File tree Expand file tree Collapse file tree 1 file changed +0
-31
lines changed
dev-infrastructure/scripts Expand file tree Collapse file tree 1 file changed +0
-31
lines changed Original file line number Diff line number Diff line change @@ -72,37 +72,6 @@ echo "********** Istio Upgrade Started with version ${NEWVERSION} **************
72
72
73
73
istioctl tag set " $TAG " --revision " ${NEWVERSION} " --istioNamespace ${ISTIO_NAMESPACE} --overwrite
74
74
75
- # Get the namespaces with the label istio.io/rev=$TAG
76
- # for namespace in $( kubectl get namespaces --selector=istio.io/rev="$TAG" -o jsonpath='{.items[*].metadata.name}' ); do
77
- # for pod in $( kubectl get pods -n "$namespace" -o jsonpath='{.items[*].metadata.name}' ); do
78
- # istio_version=$(kubectl get pod "$pod" -n "$namespace" -o jsonpath='{.metadata.annotations.sidecar\.istio\.io/status}' | grep -oP '(?<="revision":")[^"]*')
79
- # if [[ "$istio_version" != "$NEWVERSION" ]]; then
80
- # owner_kind=$(kubectl get pod "$pod" -n "$namespace" -o jsonpath='{.metadata.ownerReferences[0].kind}')
81
- # owner_name=$(kubectl get pod "$pod" -n "$namespace" -o jsonpath='{.metadata.ownerReferences[0].name}')
82
-
83
- # case "$owner_kind" in
84
- # "ReplicaSet")
85
- # deployment=$(kubectl get replicaset "$owner_name" -n "$namespace" -o jsonpath='{.metadata.ownerReferences[0].name}')
86
- # if [[ -n "$deployment" ]]; then
87
- # kubectl rollout restart deployment "$deployment" -n "$namespace"
88
- # continue 2
89
- # else
90
- # kubectl delete pod "$pod" -n "$namespace"
91
- # fi
92
- # ;;
93
- # "StatefulSet")
94
- # deployment=$(kubectl get replicaset "$owner_name" -n "$namespace" -o jsonpath='{.metadata.ownerReferences[0].name}')
95
- # kubectl rollout restart deployment "$deployment" -n "$namespace"
96
- # continue 2
97
- # ;;
98
- # *)
99
- # # Don't do anything for (Cron)Job, or no owner pod for now.
100
- # ;;
101
- # esac
102
-
103
- # fi
104
- # done
105
- # done
106
75
for namespace in $( kubectl get namespaces --selector=istio.io/rev=" $TAG " -o jsonpath=' {.items[*].metadata.name}' ) ; do
107
76
pods=" $( kubectl get pods --namespace " ${namespace} " -o json) "
108
77
for pod in $( jq <<< " ${pods}" --raw-output --arg NEWVERSION " ${NEWVERSION} " ' .items[] | select(.metadata.annotations["sidecar.istio.io/status"] | fromjson.revision != $NEWVERSION) | .metadata.name' ) ; do
You can’t perform that action at this time.
0 commit comments