(List (Com {[LIT_CHARS set]} {[LIT_CHARS -o]} {[LIT_CHARS errexit]} ) (Com {[LIT_CHARS set]} {[LIT_CHARS -o]} {[LIT_CHARS nounset]} ) (Com {[LIT_CHARS set]} {[LIT_CHARS -o]} {[LIT_CHARS pipefail]} ) (= scope= flags=0 words=[] bindings=[('KUBE_ROOT', {[ComSub (Com {[LIT_CHARS dirname]} {[DQ [VarSub BASH_SOURCE]]})] [LIT_CHARS /..]})]) (Com {[LIT_CHARS source]} {[DQ [VarSub KUBE_ROOT][LIT_CHARS /hack/lib/init.sh]]} ) (= scope= flags=0 words=[] bindings=[('KUBECTL', {[DQ [VarSub KUBE_OUTPUT_HOSTBIN][LIT_CHARS /kubectl]]})]) (= scope= flags=0 words=[{[LIT_CHARS -a]}] bindings=[('resources', {[Array {OP_NEWLINE "\n"} {[DQ [LIT_CHARS endpoints]]} {OP_NEWLINE "\n"} {[DQ [LIT_CHARS events]]} {OP_NEWLINE "\n"} {[DQ [LIT_CHARS limitranges]]} {OP_NEWLINE "\n"} {[DQ [LIT_CHARS namespaces]]} {OP_NEWLINE "\n"} {[DQ [LIT_CHARS nodes]]} {OP_NEWLINE "\n"} {[DQ [LIT_CHARS pods]]} {OP_NEWLINE "\n"} {[DQ [LIT_CHARS persistentvolumes]]} {OP_NEWLINE "\n"} {[DQ [LIT_CHARS persistentvolumeclaims]]} {OP_NEWLINE "\n"} {[DQ [LIT_CHARS replicationcontrollers]]} {OP_NEWLINE "\n"} {[DQ [LIT_CHARS resourcequotas]]} {OP_NEWLINE "\n"} {[DQ [LIT_CHARS secrets]]} {OP_NEWLINE "\n"} {[DQ [LIT_CHARS services]]} {OP_NEWLINE "\n"} {[DQ [LIT_CHARS jobs]]} {OP_NEWLINE "\n"} {[DQ [LIT_CHARS horizontalpodautoscalers]]} {OP_NEWLINE "\n"}]})]) (= scope= flags=0 words=[] bindings=[('namespaces', {[Array {[ComSub (Com {[DQ [VarSub KUBECTL]]} {[LIT_CHARS get]} {[LIT_CHARS namespaces]} {[LIT_CHARS -o]} {[LIT_CHARS go-template] [LIT_DBRACKET_LIKE "="] [DQ [LIT_CHARS "{{range.items}}{{.metadata.name}} {{end}}"]]})]}]})]) (If (Com {[LIT_DBRACKET_LIKE "["]} {[LIT_CHARS -z]} {[DQ [VarSub namespaces test_op=VS_TEST_COLON_HYPHEN {}]]} {[LIT_DBRACKET_LIKE "]"]} ) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Unexpected: No namespace found. Nothing to do."]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) (= scope= flags=0 words=[] bindings=[('all_failed', {[LIT_CHARS 1]})]) (For resource [{[DQ [VarSub resources bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}})]]}]) (For namespace [{[DQ [VarSub namespaces bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}})]]}]) (List (Com {[LIT_CHARS set]} {[LIT_OTHER "+"] [LIT_CHARS e]} ) (= scope= flags=0 words=[] bindings=[('instances', {[Array {[ComSub (Com {[DQ [VarSub KUBECTL]]} {[LIT_CHARS get]} {[DQ [VarSub resource]]} {[LIT_CHARS --namespace] [LIT_DBRACKET_LIKE "="] [DQ [VarSub namespace]]} {[LIT_CHARS -o]} {[LIT_CHARS go-template] [LIT_DBRACKET_LIKE "="] [DQ [LIT_CHARS "{{range.items}}{{.metadata.name}} {{end}}"]]})]}]})]) (= scope= flags=0 words=[] bindings=[('result', {[VarSub ?]})]) (Com {[LIT_CHARS set]} {[LIT_CHARS -e]} ) (If (DBracket {B? LOGICAL_BINARY_AND {B2 BINARY_INT_EQ {[DQ [VarSub all_failed]]} {[LIT_CHARS 1]}} {B2 BINARY_INT_EQ {[DQ [VarSub result]]} {[LIT_CHARS 0]}}}) (= scope= flags=0 words=[] bindings=[('all_failed', {[LIT_CHARS 0]})]) ) (If (DBracket {B1 UNARY_STRING_z {[DQ [VarSub instances test_op=VS_TEST_COLON_HYPHEN {}]]}}) (Com {[LIT_CHARS continue]} ) ) (For instance [{[DQ [VarSub instances bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}})]]}]) (List (= scope= flags=0 words=[] bindings=[('success', {[LIT_CHARS 0]})]) (ForExpr {A2 AS_OP_EQUAL {A Atom NODE_ARITH_WORD {[VarSub tries]}} {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 0]}}} {A2 AS_OP_LESS {A Atom NODE_ARITH_WORD {[VarSub tries]}} {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 5]}}} {A1 AS_OP_DPLUS {A Atom NODE_ARITH_WORD {[VarSub tries]}} } (List (= scope= flags=0 words=[] bindings=[('filename', {[DQ [LIT_CHARS /tmp/k8s-][VarSub namespace][LIT_CHARS -][VarSub resource][LIT_CHARS -][VarSub instance][LIT_CHARS .json]]})]) (AndOr OP_OR_IF (Subshell (Com {[DQ [VarSub KUBECTL]]} {[LIT_CHARS get]} {[DQ [VarSub resource]]} {[DQ [VarSub instance]]} {[LIT_CHARS --namespace] [LIT_DBRACKET_LIKE "="] [DQ [VarSub namespace]]} {[LIT_CHARS -o]} {[LIT_CHARS json]} < (FilenameRedirectNode filename={[DQ [VarSub filename]]} "> 1), > ) ) (Com {[LIT_CHARS true]} ) ) (If (DBracket {B! {B1 UNARY_FILE_s {[DQ [VarSub filename]]}}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Looks like "][VarSub instance][LIT_CHARS " got deleted. Ignoring it"]]} ) (Com {[LIT_CHARS continue]} ) ) ) (AndOr OP_OR_IF (= scope= flags=0 words=[] bindings=[('output', {[ComSub (Com {[DQ [VarSub KUBECTL]]} {[LIT_CHARS replace]} {[LIT_CHARS -f]} {[DQ [VarSub filename]]} {[LIT_CHARS --namespace] [LIT_DBRACKET_LIKE "="] [DQ [VarSub namespace]]})]})]) (Com {[LIT_CHARS true]} ) ) (Com {[LIT_CHARS rm]} {[DQ [VarSub filename]]} ) (If (Com {[LIT_DBRACKET_LIKE "["]} {[LIT_CHARS -n]} {[DQ [VarSub output test_op=VS_TEST_COLON_HYPHEN {}]]} {[LIT_DBRACKET_LIKE "]"]} ) (List (= scope= flags=0 words=[] bindings=[('success', {[LIT_CHARS 1]})]) (Com {[LIT_CHARS break]} ) ) ) ) ) (If (DBracket {B2 BINARY_INT_EQ {[DQ [VarSub success]]} {[LIT_CHARS 0]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Error: failed to update "][VarSub resource][LIT_CHARS /][VarSub instance][LIT_CHARS " in "][VarSub namespace][LIT_CHARS " namespace after 5 tries"]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) ) ) (If (AndOr OP_OR_IF (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub resource]]} {[DQ [LIT_CHARS namespaces]]}}) (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub resource]]} {[DQ [LIT_CHARS nodes]]}}) ) (Com {[LIT_CHARS break]} ) ) ) ) ) (If (DBracket {B2 BINARY_INT_EQ {[DQ [VarSub all_failed]]} {[LIT_CHARS 1]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "kubectl get failed for all resources"]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "All objects updated successfully!!"]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 0]} ) )