Skip to content

Commit 92c368c

Browse files
author
Jonathan Chang
committed
delete unused
1 parent d4c90a8 commit 92c368c

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

dev-infrastructure/scripts/istio.sh

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -72,37 +72,6 @@ echo "********** Istio Upgrade Started with version ${NEWVERSION} **************
7272

7373
istioctl tag set "$TAG" --revision "${NEWVERSION}" --istioNamespace ${ISTIO_NAMESPACE} --overwrite
7474

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
10675
for namespace in $(kubectl get namespaces --selector=istio.io/rev="$TAG" -o jsonpath='{.items[*].metadata.name}'); do
10776
pods="$(kubectl get pods --namespace "${namespace}" -o json)"
10877
for pod in $(jq <<<"${pods}" --raw-output --arg NEWVERSION "${NEWVERSION}" '.items[] | select(.metadata.annotations["sidecar.istio.io/status"] | fromjson.revision != $NEWVERSION) | .metadata.name'); do

0 commit comments

Comments
 (0)