diff --git a/agent-install/agent-install.sh b/agent-install/agent-install.sh index fc2761189..e993badeb 100755 --- a/agent-install/agent-install.sh +++ b/agent-install/agent-install.sh @@ -3595,7 +3595,7 @@ function check_agent_deployment_exist() { # check 1) agent image in deployment # eg: {image-registry}:5000/{repo}/{image-name}:{version} - local agent_image_in_use=$($KUBECTL get deployment agent -o jsonpath='{$.spec.template.spec.containers[:1].image}' -n ${AGENT_NAMESPACE}) + local agent_image_in_use=$($KUBECTL get deployment agent -n ${AGENT_NAMESPACE} -o json | jq -r '.spec.template.spec.containers[0].image') # {image-registry}:5000/{repo} local agent_image_on_edge_cluster_registry=${agent_image_in_use%:*} @@ -3603,7 +3603,7 @@ function check_agent_deployment_exist() { log_fatal 3 "Current deployment image registry cannot be updated, please run agent-uninstall.sh and re-run agent-install.sh" fi - local image_pull_secrets_length=$($KUBECTL get deployment agent -n ${AGENT_NAMESPACE} -o jsonpath='{.spec.template.spec.imagePullSecrets}' | jq length) + local image_pull_secrets_length=$($KUBECTL get deployment agent -n ${AGENT_NAMESPACE} -o json | jq '.spec.template.spec.imagePullSecrets' | jq length) local use_image_pull_secrets if [[ "$image_pull_secrets_length" == "1" ]]; then use_image_pull_secrets="true"