(List (= scope= flags=0 words=[] bindings=[('KUBECTL', {[VarSub KUBECTL_BIN test_op=VS_TEST_COLON_HYPHEN {[LIT_SLASH /] [LIT_CHARS usr] [LIT_SLASH /] [LIT_CHARS local] [LIT_SLASH /] [LIT_CHARS bin] [LIT_SLASH /] [LIT_CHARS kubectl]}]})]) (= scope= flags=0 words=[] bindings=[('KUBECTL_OPTS', {[VarSub KUBECTL_OPTS test_op=VS_TEST_COLON_HYPHEN {}]})]) (= scope= flags=0 words=[] bindings=[('ADDON_CHECK_INTERVAL_SEC', {[VarSub TEST_ADDON_CHECK_INTERVAL_SEC test_op=VS_TEST_COLON_HYPHEN {[LIT_CHARS 60]}]})]) (= scope= flags=0 words=[] bindings=[('ADDON_PATH', {[VarSub ADDON_PATH test_op=VS_TEST_COLON_HYPHEN {[LIT_SLASH /] [LIT_CHARS etc] [LIT_SLASH /] [LIT_CHARS kubernetes] [LIT_SLASH /] [LIT_CHARS addons]}]})]) (= scope= flags=0 words=[] bindings=[('SYSTEM_NAMESPACE', {[LIT_CHARS kube-system]})]) (= scope= flags=0 words=[] bindings=[('trusty_master', {[VarSub TRUSTY_MASTER test_op=VS_TEST_COLON_HYPHEN {[LIT_CHARS false]}]})]) (FunctionDef log [] (Case to_match={[VarSub 1]}, pat_word_list=[[{[LIT_CHARS DB3]}], [{[LIT_CHARS DB2]}], [{[LIT_CHARS DBG]}], [{[LIT_CHARS INFO]}], [{[LIT_CHARS WRN]}], [{[LIT_CHARS ERR]}], [{[LIT_OTHER "*"]}]] (ElseTrue) (ElseTrue) (ElseTrue) (Com {[LIT_CHARS echo]} {[DQ [VarSub 1][LIT_CHARS ": "][VarSub 2]]} ) (Com {[LIT_CHARS echo]} {[DQ [VarSub 1][LIT_CHARS ": "][VarSub 2]]} ) (Com {[LIT_CHARS echo]} {[DQ [VarSub 1][LIT_CHARS ": "][VarSub 2]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "INVALID_LOG_LEVEL "][VarSub 1][LIT_CHARS ": "][VarSub 2]]} ) ) ) (FunctionDef run_until_success [] (List (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('command', {[VarSub 1]})]) (= scope= flags=0 words=[] bindings=[('tries', {[VarSub 2]})]) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('delay', {[VarSub 3]})]) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('command_name', {[VarSub 1]})]) (While (Com {[LIT_DBRACKET_LIKE "["]} {[VarSub tries]} {[LIT_CHARS -gt]} {[LIT_CHARS 0]} {[LIT_DBRACKET_LIKE "]"]} ) (List (Com {[LIT_CHARS log]} {[LIT_CHARS DBG]} {[DQ [LIT_CHARS "executing: '"][VarSub command][LIT_CHARS "'"]]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS /bin/bash]} {[LIT_CHARS -c]} {[DQ [VarSub command]]} ) (AndOr OP_AND_IF (Com {[LIT_CHARS log]} {[LIT_CHARS DB3]} {[DQ [LIT_CHARS "== Successfully executed "][VarSub command_name][LIT_CHARS " at "][ComSub (Com {[LIT_CHARS date]} {[LIT_CHARS -Is]})][LIT_CHARS " =="]]} ) (Com {[LIT_CHARS return]} {[LIT_CHARS 0]} ) ) ) (Com {[LIT_CHARS let]} {[LIT_VAR_LIKE "tries="] [LIT_CHARS tries-1] =} ) (Com {[LIT_CHARS log]} {[LIT_CHARS WRN]} {[DQ [LIT_CHARS "== Failed to execute "][VarSub command_name][LIT_CHARS " at "][ComSub (Com {[LIT_CHARS date]} {[LIT_CHARS -Is]})][LIT_CHARS ". "][VarSub tries][LIT_CHARS " tries remaining. =="]]} ) (Com {[LIT_CHARS sleep]} {[VarSub delay]} ) ) ) (Com {[LIT_CHARS return]} {[LIT_CHARS 1]} ) ) ) (FunctionDef start_addon [] (List (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('addon_filename', {[VarSub 1]})]) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('tries', {[VarSub 2]})]) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('delay', {[VarSub 3]})]) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('namespace', {[VarSub 4]})]) (Com {[LIT_CHARS create_resource_from_string]} {[DQ [ComSub (Com {[LIT_CHARS cat]} {[VarSub addon_filename]})]]} {[DQ [VarSub tries]]} {[DQ [VarSub delay]]} {[DQ [VarSub addon_filename]]} {[DQ [VarSub namespace]]} ) ) ) (FunctionDef create_resource_from_string [] (List (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('config_string', {[VarSub 1]})]) (= scope= flags=0 words=[] bindings=[('tries', {[VarSub 2]})]) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('delay', {[VarSub 3]})]) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('config_name', {[VarSub 4]})]) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('namespace', {[VarSub 5]})]) (While (Com {[LIT_DBRACKET_LIKE "["]} {[VarSub tries]} {[LIT_CHARS -gt]} {[LIT_CHARS 0]} {[LIT_DBRACKET_LIKE "]"]} ) (List (AndOr OP_AND_IF (Pipeline (Com {[LIT_CHARS echo]} {[DQ [VarSub config_string]]} ) (Com {[VarSub KUBECTL]} {[VarSub KUBECTL_OPTS]} {[LIT_CHARS --namespace] [LIT_DBRACKET_LIKE "="] [DQ [VarSub namespace]]} {[LIT_CHARS apply]} {[LIT_CHARS -f]} {[LIT_CHARS -]} ) ) (AndOr OP_AND_IF (Com {[LIT_CHARS log]} {[LIT_CHARS INFO]} {[DQ [LIT_CHARS "== Successfully started "][VarSub config_name][LIT_CHARS " in namespace "][VarSub namespace][LIT_CHARS " at "][ComSub (Com {[LIT_CHARS date]} {[LIT_CHARS -Is]})]]} ) (Com {[LIT_CHARS return]} {[LIT_CHARS 0]} ) ) ) (Com {[LIT_CHARS let]} {[LIT_VAR_LIKE "tries="] [LIT_CHARS tries-1] =} ) (Com {[LIT_CHARS log]} {[LIT_CHARS WRN]} {[DQ [LIT_CHARS "== Failed to start "][VarSub config_name][LIT_CHARS " in namespace "][VarSub namespace][LIT_CHARS " at "][ComSub (Com {[LIT_CHARS date]} {[LIT_CHARS -Is]})][LIT_CHARS ". "][VarSub tries][LIT_CHARS " tries remaining. =="]]} ) (Com {[LIT_CHARS sleep]} {[VarSub delay]} ) ) ) (Com {[LIT_CHARS return]} {[LIT_CHARS 1]} ) ) ) (FunctionDef annotate_addons [] (List (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('obj_type', {[VarSub 1]})]) (Com {[VarSub KUBECTL]} {[VarSub KUBECTL_OPTS]} {[LIT_CHARS annotate]} {[VarSub obj_type]} {[LIT_CHARS --namespace] [LIT_DBRACKET_LIKE "="] [VarSub SYSTEM_NAMESPACE]} {[LIT_CHARS -l]} {[LIT_CHARS kubernetes.io/cluster-service] [LIT_DBRACKET_LIKE "="] [LIT_CHARS true]} {[LIT_CHARS kubectl.kubernetes.io/last-applied-configuration] [LIT_DBRACKET_LIKE "="] [SQ ]} {[LIT_CHARS --overwrite] [LIT_DBRACKET_LIKE "="] [LIT_CHARS false]} ) (If (DBracket {B2 BINARY_INT_EQ {[VarSub ?]} {[LIT_CHARS 0]}}) (Com {[LIT_CHARS log]} {[LIT_CHARS INFO]} {[DQ [LIT_CHARS "== Annotate resources completed successfully at "][ComSub (Com {[LIT_CHARS date]} {[LIT_CHARS -Is]})][LIT_CHARS " =="]]} ) (ElseTrue) (Com {[LIT_CHARS log]} {[LIT_CHARS WRN]} {[DQ [LIT_CHARS "== Annotate resources completed with errors at "][ComSub (Com {[LIT_CHARS date]} {[LIT_CHARS -Is]})][LIT_CHARS " =="]]} ) ) ) ) (FunctionDef update_addons [] (List (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('enable_prune', {[VarSub 1]})]) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('additional_opt', {[VarSub 2]})]) (Com {[LIT_CHARS run_until_success]} {[DQ [VarSub KUBECTL][LIT_CHARS " "][VarSub KUBECTL_OPTS][LIT_CHARS " apply --namespace="][VarSub SYSTEM_NAMESPACE][LIT_CHARS " -f "][VarSub ADDON_PATH][LIT_CHARS " "][LIT_CHARS " --prune="][VarSub enable_prune][LIT_CHARS " -l kubernetes.io/cluster-service=true --recursive "][VarSub additional_opt]]} {[LIT_CHARS 3]} {[LIT_CHARS 5]} ) (If (DBracket {B2 BINARY_INT_EQ {[VarSub ?]} {[LIT_CHARS 0]}}) (Com {[LIT_CHARS log]} {[LIT_CHARS INFO]} {[DQ [LIT_CHARS "== Kubernetes addon update completed successfully at "][ComSub (Com {[LIT_CHARS date]} {[LIT_CHARS -Is]})][LIT_CHARS " =="]]} ) (ElseTrue) (Com {[LIT_CHARS log]} {[LIT_CHARS WRN]} {[DQ [LIT_CHARS "== Kubernetes addon update completed with errors at "][ComSub (Com {[LIT_CHARS date]} {[LIT_CHARS -Is]})][LIT_CHARS " =="]]} ) ) ) ) (Com {[LIT_CHARS log]} {[LIT_CHARS INFO]} {[DQ [LIT_CHARS "== Kubernetes addon manager started at "][ComSub (Com {[LIT_CHARS date]} {[LIT_CHARS -Is]})][LIT_CHARS " with ADDON_CHECK_INTERVAL_SEC="][VarSub ADDON_CHECK_INTERVAL_SEC][LIT_CHARS " =="]]} ) (Fork (Com {[LIT_CHARS start_addon]} {[LIT_CHARS /opt/namespace.yaml]} {[LIT_CHARS 100]} {[LIT_CHARS 10]} {[DQ ]} ) ) (= scope= flags=0 words=[] bindings=[('token_found', {[DQ ]})]) (While (Com {[LIT_DBRACKET_LIKE "["]} {[LIT_CHARS -z]} {[DQ [VarSub token_found]]} {[LIT_DBRACKET_LIKE "]"]} ) (List (Com {[LIT_CHARS sleep]} {[LIT_CHARS .5]} ) (= scope= flags=0 words=[] bindings=[('token_found', {[ComSub (AndOr OP_OR_IF (Com {[VarSub KUBECTL]} {[VarSub KUBECTL_OPTS]} {[LIT_CHARS get]} {[LIT_CHARS --namespace] [LIT_DBRACKET_LIKE "="] [DQ [VarSub SYSTEM_NAMESPACE]]} {[LIT_CHARS serviceaccount]} {[LIT_CHARS default]} {[LIT_CHARS -o]} {[LIT_CHARS go-template] [LIT_DBRACKET_LIKE "="] [DQ [LIT_CHARS "{{with index .secrets 0}}{{.name}}{{end}}"]]}) (Com {[LIT_CHARS true]}) )]})]) ) ) (Com {[LIT_CHARS log]} {[LIT_CHARS INFO]} {[DQ [LIT_CHARS "== Default service account in the "][VarSub SYSTEM_NAMESPACE][LIT_CHARS " namespace has token "][VarSub token_found][LIT_CHARS " =="]]} ) (For obj [{[ComSub (Com {[LIT_CHARS find]} {[LIT_CHARS /etc/kubernetes/admission-controls]} {[\ LIT_ESCAPED_CHAR "\\("]} {[LIT_CHARS -name]} {[\ LIT_ESCAPED_CHAR "\\*"] [LIT_CHARS .yaml]} {[LIT_CHARS -o]} {[LIT_CHARS -name]} {[\ LIT_ESCAPED_CHAR "\\*"] [LIT_CHARS .json]} {[\ LIT_ESCAPED_CHAR "\\)"]})]}]) (List (Fork (Com {[LIT_CHARS start_addon]} {[DQ [VarSub obj]]} {[LIT_CHARS 100]} {[LIT_CHARS 10]} {[LIT_CHARS default]} ) ) (Com {[LIT_CHARS log]} {[LIT_CHARS INFO]} {[DQ [LIT_CHARS "++ obj "][VarSub obj][LIT_CHARS " is created ++"]]} ) ) ) (Com {[LIT_CHARS log]} {[LIT_CHARS INFO]} {[DQ [LIT_CHARS "== Annotating the old addon resources at "][ComSub (Com {[LIT_CHARS date]} {[LIT_CHARS -Is]})][LIT_CHARS " =="]]} ) (Com {[LIT_CHARS annotate_addons]} {[LIT_CHARS ReplicationController]} ) (Com {[LIT_CHARS log]} {[LIT_CHARS INFO]} {[DQ [LIT_CHARS "== Executing apply to spin up new addon resources at "][ComSub (Com {[LIT_CHARS date]} {[LIT_CHARS -Is]})][LIT_CHARS " =="]]} ) (Com {[LIT_CHARS update_addons]} {[LIT_CHARS false]} ) (Com {[LIT_CHARS log]} {[LIT_CHARS INFO]} {[DQ [LIT_CHARS "== Wait for addons to be spinned up at "][ComSub (Com {[LIT_CHARS date]} {[LIT_CHARS -Is]})][LIT_CHARS " =="]]} ) (Com {[LIT_CHARS sleep]} {[VarSub ADDON_CHECK_INTERVAL_SEC]} ) (Com {[LIT_CHARS log]} {[LIT_CHARS INFO]} {[DQ [LIT_CHARS "== Entering periodical apply loop at "][ComSub (Com {[LIT_CHARS date]} {[LIT_CHARS -Is]})][LIT_CHARS " =="]]} ) (While (Com {[LIT_CHARS true]} ) (List (= scope= flags=0 words=[] bindings=[('start_sec', {[ComSub (Com {[LIT_CHARS date]} {[LIT_OTHER "+"] [DQ [LIT_CHARS "%s"]]})]})]) (Com {[LIT_CHARS update_addons]} {[LIT_CHARS true]} {[DQ [LIT_CHARS ">/dev/null"]]} ) (= scope= flags=0 words=[] bindings=[('end_sec', {[ComSub (Com {[LIT_CHARS date]} {[LIT_OTHER "+"] [DQ [LIT_CHARS "%s"]]})]})]) (= scope= flags=0 words=[] bindings=[('len_sec', {[ArithSub {A2 AS_OP_MINUS {A Atom NODE_ARITH_WORD {[VarSub end_sec]}} {A Atom NODE_ARITH_WORD {[VarSub start_sec]}}}]})]) (If (DBracket {B2 BINARY_INT_LT {[VarSub len_sec]} {[VarSub ADDON_CHECK_INTERVAL_SEC]}}) (List (= scope= flags=0 words=[] bindings=[('sleep_time', {[ArithSub {A2 AS_OP_MINUS {A Atom NODE_ARITH_WORD {[VarSub ADDON_CHECK_INTERVAL_SEC]}} {A Atom NODE_ARITH_WORD {[VarSub len_sec]}}}]})]) (Com {[LIT_CHARS sleep]} {[VarSub sleep_time]} ) ) ) ) ) )