Skip to content

Commit

Permalink
Merge pull request #3960 from LiilyZhang/zhangl/jsonPath
Browse files Browse the repository at this point in the history
Issue #3944 (part2) - Bug: agent-install.sh breaks on som…
  • Loading branch information
LiilyZhang authored Nov 22, 2023
2 parents 8d34202 + 549eb2d commit 9dcdcd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions agent-install/agent-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3595,15 +3595,15 @@ 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%:*}
if [[ "$agent_image_on_edge_cluster_registry" != "$IMAGE_ON_EDGE_CLUSTER_REGISTRY" ]]; then
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"
Expand Down

0 comments on commit 9dcdcd7

Please sign in to comment.