diff --git a/remote_cli/README b/remote_cli/README index db2583f..ec26ef1 100644 --- a/remote_cli/README +++ b/remote_cli/README @@ -96,6 +96,11 @@ if [ -z "$OAM_IP" ]; then # AIO-SX doesn't use oam_floating_ip, but instead uses just oam_ip OAM_IP=$(system oam-show |grep oam_ip| awk '{print $4}') fi +# If it's an IPv6 address we must enclose it in brackets +if [[ $OAM_IP =~ .*:.* ]]; then + OAM_IP="[${OAM_IP}]" +fi + kubectl config --kubeconfig ${OUTPUT_FILE} set-cluster stxcluster --server=https://${OAM_IP}:6443 --insecure-skip-tls-verify diff --git a/remote_cli/client_wrapper.sh b/remote_cli/client_wrapper.sh index 543fd1f..113ec48 100755 --- a/remote_cli/client_wrapper.sh +++ b/remote_cli/client_wrapper.sh @@ -70,11 +70,11 @@ else fi if [[ "$FORCE_SHELL" == "true" ]]; then - exec ${SHELL_COMMAND} run --rm -ti ${COMMAND_ENV} ${VOLUME_LIST} --workdir /wd ${CLIENT_IMAGE_NAME} "$@" + exec ${SHELL_COMMAND} run --rm --network host -ti ${COMMAND_ENV} ${VOLUME_LIST} --workdir /wd ${CLIENT_IMAGE_NAME} "$@" elif [[ "$FORCE_NO_SHELL" == "true" ]]; then - exec ${SHELL_COMMAND} run --rm -t ${COMMAND_ENV} ${VOLUME_LIST} --workdir /wd ${CLIENT_IMAGE_NAME} "$@" + exec ${SHELL_COMMAND} run --rm --network host -t ${COMMAND_ENV} ${VOLUME_LIST} --workdir /wd ${CLIENT_IMAGE_NAME} "$@" elif [ -z "$2" ]; then - exec ${SHELL_COMMAND} run --rm -ti ${COMMAND_ENV} ${VOLUME_LIST} --workdir /wd ${CLIENT_IMAGE_NAME} "$@" + exec ${SHELL_COMMAND} run --rm --network host -ti ${COMMAND_ENV} ${VOLUME_LIST} --workdir /wd ${CLIENT_IMAGE_NAME} "$@" else - exec ${SHELL_COMMAND} run --rm -t ${COMMAND_ENV} ${VOLUME_LIST} --workdir /wd ${CLIENT_IMAGE_NAME} "$@" + exec ${SHELL_COMMAND} run --rm --network host -t ${COMMAND_ENV} ${VOLUME_LIST} --workdir /wd ${CLIENT_IMAGE_NAME} "$@" fi diff --git a/remote_cli/configure_client.sh b/remote_cli/configure_client.sh index f844295..70b592f 100755 --- a/remote_cli/configure_client.sh +++ b/remote_cli/configure_client.sh @@ -15,6 +15,8 @@ TAG_FILE=docker_image_version.sh WORK_DIR='.' custom_conf_file=0 explicit_client_type=0 +override_platform_image=0 +override_application_image=0 # The script may be called from locations other # than its own folder, so build the full path to @@ -39,9 +41,11 @@ usage(){ echo " (default value is admin-openrc.sh)" echo "-k k8s_file kubernetis config file" echo " (default value is temp-kubeconfig)" + echo "-p override platform docker image" + echo "-a override application docker image" } -while getopts ":hr:w:o:t:k:" opt; do +while getopts ":hr:w:o:t:k:p:a:" opt; do case $opt in h) usage @@ -64,6 +68,14 @@ while getopts ":hr:w:o:t:k:" opt; do k) K8S_FILE=${OPTARG} ;; + p) + PLATFORM_IMAGE=${OPTARG} + override_platform_image=1 + ;; + a) + APPLICATION_IMAGE=${OPTARG} + override_application_image=1 + ;; *) echo "Invalid parameter provided" usage @@ -136,3 +148,11 @@ fi echo "source ${PATH_TO_SCRIPT}/$ALIAS_FILE" >> $CONF_FILE echo "source ${PATH_TO_SCRIPT}/$TAG_FILE" >> $CONF_FILE + +if [[ $override_platform_image -eq 1 ]]; then + echo "export PLATFORM_DOCKER_IMAGE=\"${PLATFORM_IMAGE}\"" >> $CONF_FILE +fi + +if [[ $override_application_image -eq 1 ]]; then + echo "export APPLICATION_DOCKER_IMAGE=\"${APPLICATION_IMAGE}\"" >> $CONF_FILE +fi