(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_ROOT) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(dirname)} {(DQ (${ VSub_Name BASH_SOURCE))})] ) left_token: <Left_CommandSub "$("> spids: [55 63] ) (/../..) } spids: [54] ) ] spids: [54] ) (C {(source)} { (DQ (${ VSub_Name KUBE_ROOT) (/cluster/gce/) (BracedVarSub token: <VSub_Name KUBE_CONFIG_FILE> suffix_op: (StringUnary op_id:VTest_Hyphen arg_word:{(DQ (config-default.sh))}) spids: [73 79] ) ) } ) (C {(source)} {(DQ (${ VSub_Name KUBE_ROOT) (/cluster/common.sh))}) (C {(source)} {(DQ (${ VSub_Name KUBE_ROOT) (/hack/lib/util.sh))}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalOr left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name NODE_OS_DISTRIBUTION))} right: {(DQ (debian))} ) right: (LogicalOr left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name NODE_OS_DISTRIBUTION))} right: {(DQ (container-linux))} ) right: (LogicalOr left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name NODE_OS_DISTRIBUTION))} right: {(DQ (trusty))} ) right: (LogicalOr left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name NODE_OS_DISTRIBUTION))} right: {(DQ (gci))} ) right: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name NODE_OS_DISTRIBUTION))} right: {(DQ (ubuntu))} ) ) ) ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(source)} { (DQ (${ VSub_Name KUBE_ROOT) (/cluster/gce/) (${ VSub_Name NODE_OS_DISTRIBUTION) (/node-helper.sh) ) } ) ] spids: [-1 176] ) ] else_action: [ (SimpleCommand words: [ {(echo)} { (DQ ("Cannot operate on cluster using node os distro: ") (${ VSub_Name NODE_OS_DISTRIBUTION) ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[204])] ) (C {(exit)} {(1)}) ] spids: [192 212] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalOr left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name MASTER_OS_DISTRIBUTION))} right: {(DQ (container-linux))} ) right: (LogicalOr left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name MASTER_OS_DISTRIBUTION))} right: {(DQ (trusty))} ) right: (LogicalOr left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name MASTER_OS_DISTRIBUTION))} right: {(DQ (gci))} ) right: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name MASTER_OS_DISTRIBUTION))} right: {(DQ (ubuntu))} ) ) ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(source)} { (DQ (${ VSub_Name KUBE_ROOT) (/cluster/gce/) (${ VSub_Name MASTER_OS_DISTRIBUTION) (/master-helper.sh) ) } ) ] spids: [-1 276] ) ] else_action: [ (SimpleCommand words: [ {(echo)} { (DQ ("Cannot operate on cluster using master os distro: ") (${ VSub_Name MASTER_OS_DISTRIBUTION) ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[304])] ) (C {(exit)} {(1)}) ] spids: [292 312] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name MASTER_OS_DISTRIBUTION))} right: {(DQ (gci))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:DEFAULT_GCI_PROJECT) op: Equal rhs: {(google-containers)} spids: [337] ) ] spids: [337] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name GCI_VERSION))} right: {(DQ (cos)) (Lit_Other "*")} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:DEFAULT_GCI_PROJECT) op: Equal rhs: {(cos-cloud)} spids: [364] ) ] spids: [364] ) ] spids: [-1 361] ) ] spids: [-1 368] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:MASTER_IMAGE_PROJECT) op: Equal rhs: { (BracedVarSub token: <VSub_Name KUBE_GCE_MASTER_PROJECT> suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: {(${ VSub_Name DEFAULT_GCI_PROJECT)} ) spids: [372 378] ) } spids: [371] ) ] spids: [371] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:MASTER_IMAGE) op: Equal rhs: { (BracedVarSub token: <VSub_Name KUBE_GCE_MASTER_IMAGE> suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: {(${ VSub_Name GCI_VERSION)} ) spids: [390 396] ) } spids: [389] ) ] spids: [389] ) ] spids: [-1 334] ) (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name MASTER_OS_DISTRIBUTION))} right: {(DQ (debian))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:MASTER_IMAGE) op: Equal rhs: { (BracedVarSub token: <VSub_Name KUBE_GCE_MASTER_IMAGE> suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: {(${ VSub_Name CVM_VERSION)} ) spids: [421 427] ) } spids: [420] ) ] spids: [420] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:MASTER_IMAGE_PROJECT) op: Equal rhs: { (BracedVarSub token: <VSub_Name KUBE_GCE_MASTER_PROJECT> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(google-containers)}) spids: [431 435] ) } spids: [430] ) ] spids: [430] ) ] spids: [398 417] ) ] spids: [-1 437] ) (FuncDef name: set-node-image body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name NODE_OS_DISTRIBUTION))} right: {(DQ (gci))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:DEFAULT_GCI_PROJECT) op: Equal rhs: {(google-containers)} spids: [477] ) ] spids: [477] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name GCI_VERSION))} right: {(DQ (cos)) (Lit_Other "*")} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:DEFAULT_GCI_PROJECT) op: Equal rhs: {(cos-cloud)} spids: [504] ) ] spids: [504] ) ] spids: [-1 501] ) ] spids: [-1 508] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:NODE_IMAGE) op: Equal rhs: { (BracedVarSub token: <VSub_Name KUBE_GCE_NODE_IMAGE> suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: {(${ VSub_Name GCI_VERSION)} ) spids: [521 527] ) } spids: [520] ) ] spids: [520] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:NODE_IMAGE_PROJECT) op: Equal rhs: { (BracedVarSub token: <VSub_Name KUBE_GCE_NODE_PROJECT> suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: {(${ VSub_Name DEFAULT_GCI_PROJECT)} ) spids: [531 537] ) } spids: [530] ) ] spids: [530] ) ] spids: [-1 474] ) (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name NODE_OS_DISTRIBUTION))} right: {(DQ (debian))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:NODE_IMAGE) op: Equal rhs: { (BracedVarSub token: <VSub_Name KUBE_GCE_NODE_IMAGE> suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: {(${ VSub_Name CVM_VERSION)} ) spids: [563 569] ) } spids: [562] ) ] spids: [562] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:NODE_IMAGE_PROJECT) op: Equal rhs: { (BracedVarSub token: <VSub_Name KUBE_GCE_NODE_PROJECT> suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: {(google-containers)} ) spids: [573 577] ) } spids: [572] ) ] spids: [572] ) ] spids: [540 559] ) ] spids: [-1 580] ) ] spids: [452] ) spids: [446 451] ) (C {(set-node-image)}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name ENABLE_CLUSTER_AUTOSCALER))} right: {(DQ (true))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_z child: {($ VSub_Name "$AUTOSCALER_MIN_NODES")} ) ) terminator: <Op_Semi ";"> ) ] action: [(C {(echo)} {(DQ ("AUTOSCALER_MIN_NODES not set."))}) (C {(exit)} {(1)})] spids: [-1 624] ) ] spids: [-1 639] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_z child: {($ VSub_Name "$AUTOSCALER_MAX_NODES")} ) ) terminator: <Op_Semi ";"> ) ] action: [(C {(echo)} {(DQ ("AUTOSCALER_MAX_NODES not set."))}) (C {(exit)} {(1)})] spids: [-1 653] ) ] spids: [-1 668] ) ] spids: [-1 610] ) ] spids: [-1 670] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:NODE_INSTANCE_PREFIX) op: Equal rhs: {(DQ (${ VSub_Name INSTANCE_PREFIX) (-minion))} spids: [673] ) ] spids: [673] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:NODE_TAGS) op: Equal rhs: {(DQ (${ VSub_Name NODE_TAG))} spids: [681] ) ] spids: [681] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:ALLOCATE_NODE_CIDRS) op:Equal rhs:{(true)} spids:[689])] spids: [689] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:PREEXISTING_NETWORK) op:Equal rhs:{(false)} spids:[692])] spids: [692] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:PREEXISTING_NETWORK_MODE) op: Equal rhs: {(DQ )} spids: [695] ) ] spids: [695] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_PROMPT_FOR_UPDATE) op: Equal rhs: { (BracedVarSub token: <VSub_Name KUBE_PROMPT_FOR_UPDATE> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(DQ (n))}) spids: [701 707] ) } spids: [700] ) ] spids: [700] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_CLUSTER_INITIALIZATION_TIMEOUT) op: Equal rhs: { (BracedVarSub token: <VSub_Name KUBE_CLUSTER_INITIALIZATION_TIMEOUT> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(300)}) spids: [713 717] ) } spids: [712] ) ] spids: [712] ) (FuncDef name: join_csv body: (BraceGroup children: [ (Sentence child: (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:IFS) op:Equal rhs:{(SQ <",">)} spids:[731])] spids: [729] ) terminator: <Op_Semi ";"> ) (Sentence child: (C {(echo)} {(DQ ($ VSub_Star "$*"))}) terminator: <Op_Semi ";"> ) ] spids: [726] ) spids: [720 725] ) (FuncDef name: split_csv body: (BraceGroup children: [ (Pipeline children: [(C {(echo)} {(DQ ($ VSub_Star "$*"))}) (C {(cut)} {(-d) (SQ <",">)} {(-f1)})] negated: False ) ] spids: [756] ) spids: [750 755] ) (FuncDef name: verify-prereqs body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:cmd) op:Equal spids:[793])] spids: [791] ) (ForEach iter_name: cmd iter_words: [{(gcloud)} {(gsutil)}] do_arg_iter: False body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (SimpleCommand words: [{(which)} {(DQ (${ VSub_Name cmd))}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [822] ) ] ) ] negated: True ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:resp) op: Equal rhs: {(DQ (n))} spids: [831] ) ] spids: [829] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name KUBE_PROMPT_FOR_UPDATE))} right: {(DQ (y))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} { (DQ ("Can't find ") (${ VSub_Name cmd) ( " in PATH. Do you wish to install the Google Cloud SDK? [Y/n]" ) ) } ) (C {(read)} {(resp)}) ] spids: [-1 856] ) ] spids: [-1 875] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalAnd left: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ (${ VSub_Name resp))} right: {(DQ (n))} ) right: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ (${ VSub_Name resp))} right: {(DQ (N))} ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (Pipeline children: [ (C {(curl)} {(https) (Lit_Other ":") (//sdk.cloud.google.com)}) (C {(bash)}) ] negated: False ) ] spids: [-1 911] ) ] spids: [-1 925] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (SimpleCommand words: [{(which)} {(DQ (${ VSub_Name cmd))}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [940] ) ] ) ] negated: True ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ("Can't find ") (${ VSub_Name cmd) (" in PATH, please fix and retry. The Google Cloud ") ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [957] ) ] ) (SimpleCommand words: [ {(echo)} { (DQ ( "SDK can be downloaded from https://cloud.google.com/sdk/." ) ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [967] ) ] ) (C {(exit)} {(1)}) ] spids: [-1 944] ) ] spids: [-1 976] ) ] spids: [-1 826] ) ] spids: [-1 979] ) ] spids: [807 982] ) spids: [801 805] ) (C {(update-or-verify-gcloud)}) ] spids: [788] ) spids: [782 787] ) (FuncDef name: detect-project body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_z child: { (DQ (BracedVarSub token: <VSub_Name PROJECT> suffix_op: (StringUnary op_id:VTest_Hyphen arg_word:{(SQ )}) spids: [1027 1030] ) ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:PROJECT) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(gcloud)} {(config)} {(list)} {(project)} {(--format)} {(SQ <"value(core.project)">)} ) ] ) left_token: <Left_CommandSub "$("> spids: [1040 1054] ) } spids: [1039] ) ] spids: [1039] ) ] spids: [-1 1036] ) ] spids: [-1 1057] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:NETWORK_PROJECT) op: Equal rhs: { (BracedVarSub token: <VSub_Name NETWORK_PROJECT> suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: {(${ VSub_Name PROJECT)} ) spids: [1062 1068] ) } spids: [1061] ) ] spids: [1061] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_z child: { (DQ (BracedVarSub token: <VSub_Name PROJECT> suffix_op: (StringUnary op_id:VTest_Hyphen arg_word:{(SQ )}) spids: [1079 1082] ) ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ( "Could not detect Google Cloud Platform project. Set the default project using " ) ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[1097])] ) (SimpleCommand words: [{(echo)} {(DQ ("'gcloud config set project <PROJECT>'"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[1107])] ) (C {(exit)} {(1)}) ] spids: [-1 1088] ) ] spids: [-1 1116] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_z child: { (DQ (BracedVarSub token: <VSub_Name PROJECT_REPORTED> suffix_op: (StringUnary op_id:VTest_Hyphen arg_word:{(SQ )}) spids: [1126 1129] ) ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ ("Project: ") (${ VSub_Name PROJECT))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[1147])] ) (SimpleCommand words: [{(echo)} {(DQ ("Network Project: ") (${ VSub_Name NETWORK_PROJECT))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[1160])] ) (SimpleCommand words: [{(echo)} {(DQ ("Zone: ") (${ VSub_Name ZONE))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[1173])] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:PROJECT_REPORTED) op: Equal rhs: {(true)} spids: [1177] ) ] spids: [1177] ) ] spids: [-1 1135] ) ] spids: [-1 1181] ) ] spids: [1017] ) spids: [1011 1016] ) (FuncDef name: gsutil_get_tar_md5 body: (BraceGroup children: [ (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:tar_location) op: Equal rhs: {($ VSub_Number "$1")} spids: [1214] ) ] spids: [1210] ) (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:tar_md5) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (SimpleCommand words: [ {(gsutil)} {(hash)} {(-h)} {(-m)} {(${ VSub_Name tar_location)} ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [1244] ) ] ) (C {(grep)} {(DQ ("Hash (md5):"))}) (C {(awk)} {(-F)} {(SQ <":">)} {(SQ <"{print $2}">)}) (C {(sed)} {(SQ <"s/^[[:space:]]*//g">)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [1231 1276] ) } spids: [1230] ) ] spids: [1226] ) (C {(echo)} {(DQ (${ VSub_Name tar_md5))}) ] spids: [1195] ) spids: [1189 1194] ) (FuncDef name: copy-to-staging body: (BraceGroup children: [ (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:staging_path) op: Equal rhs: {($ VSub_Number "$1")} spids: [1306] ) ] spids: [1302] ) (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:gs_url) op: Equal rhs: {($ VSub_Number "$2")} spids: [1314] ) ] spids: [1310] ) (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:tar) op: Equal rhs: {($ VSub_Number "$3")} spids: [1322] ) ] spids: [1318] ) (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:hash) op: Equal rhs: {($ VSub_Number "$4")} spids: [1330] ) ] spids: [1326] ) (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:basename_tar) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(basename)} {(${ VSub_Name tar)})]) left_token: <Left_CommandSub "$("> spids: [1339 1345] ) } spids: [1338] ) ] spids: [1334] ) (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:remote_tar_md5) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(gsutil_get_tar_md5)} {(DQ (${ VSub_Name staging_path) (/) (${ VSub_Name basename_tar))} ) ] ) left_token: <Left_CommandSub "$("> spids: [1375 1387] ) } spids: [1374] ) ] spids: [1370] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id:BoolUnary_n child:{(${ VSub_Name remote_tar_md5)}) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:local_tar_md5) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(gsutil_get_tar_md5)} {(DQ (${ VSub_Name tar))})] ) left_token: <Left_CommandSub "$("> spids: [1419 1427] ) } spids: [1418] ) ] spids: [1414] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name remote_tar_md5))} right: {(DQ (${ VSub_Name local_tar_md5))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} { (DQ ("+++ ") (${ VSub_Name basename_tar) (" uploaded earlier, cloud and local file md5 match (md5 = ") (${ VSub_Name local_tar_md5) (")") ) } ) (ControlFlow token: <ControlFlow_Return return> arg_word: {(0)} ) ] spids: [-1 1451] ) ] spids: [-1 1474] ) ] spids: [-1 1403] ) ] spids: [-1 1477] ) (SimpleCommand words: [{(echo)} {(DQ (${ VSub_Name hash))}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(DQ (${ VSub_Name tar) (.sha1))} spids: [1489] ) ] ) (C {(gsutil)} {(-m)} {(-q)} {(-h)} {(DQ ("Cache-Control:private, max-age=0"))} {(cp)} {(DQ (${ VSub_Name tar))} {(DQ (${ VSub_Name tar) (.sha1))} {(DQ (${ VSub_Name staging_path))} ) (SimpleCommand words: [ {(gsutil)} {(-m)} {(acl)} {(ch)} {(-g)} {(all) (Lit_Other ":") (R)} {(DQ (${ VSub_Name gs_url))} {(DQ (${ VSub_Name gs_url) (.sha1))} ] redirects: [ (Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[1560]) (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[1563]) ] ) (C {(echo)} { (DQ ("+++ ") (${ VSub_Name basename_tar) (" uploaded (sha1 = ") (${ VSub_Name hash) (")")) } ) ] spids: [1299] ) spids: [1293 1298] ) (FuncDef name: set-preferred-region body: (BraceGroup children: [ (Case to_match: {(${ VSub_Name ZONE)} arms: [ (case_arm pat_list: [{(asia-) (Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:PREFERRED_REGION) op: Equal rhs: {(ArrayLiteralPart words:[{(DQ (asia))}{(DQ (us))}{(DQ (eu))}])} spids: [1641] ) ] spids: [1641] ) ] spids: [1636 1638 1657 -1] ) (case_arm pat_list: [{(europe-) (Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:PREFERRED_REGION) op: Equal rhs: {(ArrayLiteralPart words:[{(DQ (eu))}{(DQ (us))}{(DQ (asia))}])} spids: [1665] ) ] spids: [1665] ) ] spids: [1660 1662 1681 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:PREFERRED_REGION) op: Equal rhs: {(ArrayLiteralPart words:[{(DQ (us))}{(DQ (eu))}{(DQ (asia))}])} spids: [1688] ) ] spids: [1688] ) ] spids: [1684 1685 1704 -1] ) ] spids: [1627 1633 1707] ) (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:preferred) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name PREFERRED_REGION> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [1716 1721] ) ) } spids: [1714] ) ] spids: [1710] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ (${ VSub_Name RELEASE_REGION_FALLBACK))} right: {(DQ (true))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:PREFERRED_REGION) op: Equal rhs: {(ArrayLiteralPart words:[{(DQ (${ VSub_Name preferred))}])} spids: [1748] ) ] spids: [1748] ) ] spids: [-1 1745] ) ] spids: [-1 1760] ) (If arms: [ (if_arm cond: [ (Sentence child: (AndOr children: [ (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name REGIONAL_KUBE_ADDONS))} right: {(DQ (true))} ) ) (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ (${ VSub_Name preferred))} right: {(DQ (us))} ) ) ] op_id: Op_DAmp ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_ADDON_REGISTRY) op: Equal rhs: {(DQ (${ VSub_Name preferred) (.gcr.io/google_containers))} spids: [1816] ) ] spids: [1816] ) ] spids: [-1 1813] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_ADDON_REGISTRY) op: Equal rhs: {(DQ (gcr.io/google_containers))} spids: [1828] ) ] spids: [1828] ) ] spids: [1825 1834] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: { (DQ (BracedVarSub token: <VSub_Name ENABLE_DOCKER_REGISTRY_CACHE> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [1843 1846] ) ) } right: {(DQ (true))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:DOCKER_REGISTRY_MIRROR_URL) op: Equal rhs: {(DQ ("https://") (${ VSub_Name preferred) (-mirror.gcr.io))} spids: [1861] ) ] spids: [1861] ) ] spids: [-1 1858] ) ] spids: [-1 1871] ) ] spids: [1624] ) spids: [1618 1623] ) (FuncDef name: upload-server-tars body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:SERVER_BINARY_TAR_URL) op: Equal rhs: {(SQ )} spids: [1933] ) ] spids: [1933] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:SERVER_BINARY_TAR_HASH) op: Equal rhs: {(SQ )} spids: [1936] ) ] spids: [1936] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:SALT_TAR_URL) op:Equal rhs:{(SQ )} spids:[1939])] spids: [1939] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:SALT_TAR_HASH) op: Equal rhs: {(SQ )} spids: [1942] ) ] spids: [1942] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_MANIFESTS_TAR_URL) op: Equal rhs: {(SQ )} spids: [1945] ) ] spids: [1945] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_MANIFESTS_TAR_HASH) op: Equal rhs: {(SQ )} spids: [1948] ) ] spids: [1948] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:project_hash) op:Equal spids:[1954])] spids: [1952] ) (If arms: [ (if_arm cond: [ (Sentence child: (SimpleCommand words: [{(which)} {(md5)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [1963] ) (Redir op_id: Redir_GreatAnd fd: 2 arg_word: {(1)} spids: [1967] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:project_hash) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(md5)} {(-q)} {(-s)} {(DQ ($ VSub_Name "$PROJECT"))})] ) left_token: <Left_CommandSub "$("> spids: [1975 1985] ) } spids: [1974] ) ] spids: [1974] ) ] spids: [-1 1971] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:project_hash) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(-n)} {(DQ ($ VSub_Name "$PROJECT"))}) (C {(md5sum)}) (C {(awk)} {(SQ <"{ print $1 }">)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [1992 2012] ) } spids: [1991] ) ] spids: [1991] ) ] spids: [1988 2015] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:project_hash) op: Equal rhs: { (BracedVarSub token: <VSub_Name project_hash> suffix_op: (Slice begin: (ArithWord w:{(Lit_Digits 0)}) length: (ArithWord w:{(Lit_Digits 10)}) ) spids: [2028 2034] ) } spids: [2027] ) ] spids: [2027] ) (C {(set-preferred-region)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:SERVER_BINARY_TAR_HASH) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(sha1sum-file)} {(DQ (${ VSub_Name SERVER_BINARY_TAR))})] ) left_token: <Left_CommandSub "$("> spids: [2043 2051] ) } spids: [2042] ) ] spids: [2042] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:SALT_TAR_HASH) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(sha1sum-file)} {(DQ (${ VSub_Name SALT_TAR))})] ) left_token: <Left_CommandSub "$("> spids: [2055 2063] ) } spids: [2054] ) ] spids: [2054] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_n child: { (DQ (BracedVarSub token: <VSub_Name KUBE_MANIFESTS_TAR> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [2073 2076] ) ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_MANIFESTS_TAR_HASH) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(sha1sum-file)} {(DQ (${ VSub_Name KUBE_MANIFESTS_TAR))}) ] ) left_token: <Left_CommandSub "$("> spids: [2086 2094] ) } spids: [2085] ) ] spids: [2085] ) ] spids: [-1 2082] ) ] spids: [-1 2097] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:server_binary_tar_urls) op: Equal rhs: {(ArrayLiteralPart)} spids: [2103] ) ] spids: [2101] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:salt_tar_urls) op: Equal rhs: {(ArrayLiteralPart)} spids: [2110] ) ] spids: [2108] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:kube_manifest_tar_urls) op: Equal rhs: {(ArrayLiteralPart)} spids: [2117] ) ] spids: [2115] ) (ForEach iter_name: region iter_words: [ { (DQ (BracedVarSub token: <VSub_Name PREFERRED_REGION> bracket_op: (WholeArray op_id:Lit_At) spids: [2130 2135] ) ) } ] do_arg_iter: False body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:suffix) op: Equal rhs: {(DQ (-) (${ VSub_Name region))} spids: [2142] ) ] spids: [2142] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name suffix))} right: {(DQ (-us))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:suffix) op: Equal rhs: {(DQ )} spids: [2173] ) ] spids: [2173] ) ] spids: [-1 2170] ) ] spids: [-1 2178] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:staging_bucket) op: Equal rhs: { (DQ ("gs://kubernetes-staging-") (${ VSub_Name project_hash) (${ VSub_Name suffix) ) } spids: [2183] ) ] spids: [2181] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (SimpleCommand words: [{(gsutil)} {(ls)} {(DQ (${ VSub_Name staging_bucket))}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [2214] ) ] ) ] negated: True ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} {(DQ ("Creating ") (${ VSub_Name staging_bucket))}) (C {(gsutil)} {(mb)} {(-l)} {(DQ (${ VSub_Name region))} {(DQ (${ VSub_Name staging_bucket))} ) ] spids: [-1 2218] ) ] spids: [-1 2250] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:staging_path) op: Equal rhs: { (DQ (${ VSub_Name staging_bucket) (/) (${ VSub_Name INSTANCE_PREFIX) (-devel) ) } spids: [2256] ) ] spids: [2254] ) (C {(echo)} { (DQ ("+++ Staging server tars to Google Storage: ") (${ VSub_Name staging_path) ) } ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:server_binary_gs_url) op: Equal rhs: { (DQ (${ VSub_Name staging_path) (/) (BracedVarSub token: <VSub_Name SERVER_BINARY_TAR> suffix_op: (StringUnary op_id: VOp1_DPound arg_word: {("*") (Lit_Slash /)} ) spids: [2288 2293] ) ) } spids: [2282] ) ] spids: [2280] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:salt_gs_url) op: Equal rhs: { (DQ (${ VSub_Name staging_path) (/) (BracedVarSub token: <VSub_Name SALT_TAR> suffix_op: (StringUnary op_id: VOp1_DPound arg_word: {("*") (Lit_Slash /)} ) spids: [2305 2310] ) ) } spids: [2299] ) ] spids: [2297] ) (C {(copy-to-staging)} {(DQ (${ VSub_Name staging_path))} {(DQ (${ VSub_Name server_binary_gs_url))} {(DQ (${ VSub_Name SERVER_BINARY_TAR))} {(DQ (${ VSub_Name SERVER_BINARY_TAR_HASH))} ) (C {(copy-to-staging)} {(DQ (${ VSub_Name staging_path))} {(DQ (${ VSub_Name salt_gs_url))} {(DQ (${ VSub_Name SALT_TAR))} {(DQ (${ VSub_Name SALT_TAR_HASH))} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:server_binary_tar_urls) op: PlusEqual rhs: { (ArrayLiteralPart words: [ { (DQ (BracedVarSub token: <VSub_Name server_binary_gs_url> suffix_op: (PatSub pat: {("gs:") (EscapedLiteralPart token: <Lit_EscapedChar "\\/"> ) (EscapedLiteralPart token:<Lit_EscapedChar "\\/">) } replace: {("https:") (Lit_Slash /) (Lit_Slash /) (storage.googleapis.com) (Lit_Slash /) } do_all: False do_prefix: False do_suffix: False ) spids: [2376 2388] ) ) } ] ) } spids: [2373] ) ] spids: [2373] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:salt_tar_urls) op: PlusEqual rhs: { (ArrayLiteralPart words: [ { (DQ (BracedVarSub token: <VSub_Name salt_gs_url> suffix_op: (PatSub pat: {("gs:") (EscapedLiteralPart token: <Lit_EscapedChar "\\/"> ) (EscapedLiteralPart token:<Lit_EscapedChar "\\/">) } replace: {("https:") (Lit_Slash /) (Lit_Slash /) (storage.googleapis.com) (Lit_Slash /) } do_all: False do_prefix: False do_suffix: False ) spids: [2396 2408] ) ) } ] ) } spids: [2393] ) ] spids: [2393] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_n child: { (DQ (BracedVarSub token: <VSub_Name KUBE_MANIFESTS_TAR> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [2420 2423] ) ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:kube_manifests_gs_url) op: Equal rhs: { (DQ (${ VSub_Name staging_path) (/) (BracedVarSub token: <VSub_Name KUBE_MANIFESTS_TAR> suffix_op: (StringUnary op_id: VOp1_DPound arg_word: {("*") (Lit_Slash /)} ) spids: [2440 2445] ) ) } spids: [2434] ) ] spids: [2432] ) (C {(copy-to-staging)} {(DQ (${ VSub_Name staging_path))} {(DQ (${ VSub_Name kube_manifests_gs_url))} {(DQ (${ VSub_Name KUBE_MANIFESTS_TAR))} {(DQ (${ VSub_Name KUBE_MANIFESTS_TAR_HASH))} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:kube_manifests_tar_urls) op: PlusEqual rhs: { (ArrayLiteralPart words: [ { (DQ (BracedVarSub token: <VSub_Name kube_manifests_gs_url> suffix_op: (PatSub pat: {("gs:") (EscapedLiteralPart token: <Lit_EscapedChar "\\/"> ) (EscapedLiteralPart token:<Lit_EscapedChar "\\/">) } replace: {("https:") (Lit_Slash /) (Lit_Slash /) (storage.googleapis.com) (Lit_Slash /) } do_all: False do_prefix: False do_suffix: False ) spids: [2483 2495] ) ) } ] ) } spids: [2480] ) ] spids: [2480] ) ] spids: [-1 2429] ) ] spids: [-1 2500] ) ] spids: [2139 2503] ) spids: [2128 2137] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:SERVER_BINARY_TAR_URL) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(join_csv)} { (DQ (BracedVarSub token: <VSub_Name server_binary_tar_urls> bracket_op: (WholeArray op_id:Lit_At) spids: [2512 2517] ) ) } ) ] ) left_token: <Left_CommandSub "$("> spids: [2508 2519] ) } spids: [2507] ) ] spids: [2507] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:SALT_TAR_URL) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(join_csv)} { (DQ (BracedVarSub token: <VSub_Name salt_tar_urls> bracket_op: (WholeArray op_id:Lit_At) spids: [2527 2532] ) ) } ) ] ) left_token: <Left_CommandSub "$("> spids: [2523 2534] ) } spids: [2522] ) ] spids: [2522] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_n child: { (DQ (BracedVarSub token: <VSub_Name KUBE_MANIFESTS_TAR> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [2544 2547] ) ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_MANIFESTS_TAR_URL) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(join_csv)} { (DQ (BracedVarSub token: <VSub_Name kube_manifests_tar_urls> bracket_op: (WholeArray op_id:Lit_At) spids: [2561 2566] ) ) } ) ] ) left_token: <Left_CommandSub "$("> spids: [2557 2568] ) } spids: [2556] ) ] spids: [2556] ) ] spids: [-1 2553] ) ] spids: [-1 2571] ) ] spids: [1930] ) spids: [1924 1929] ) (FuncDef name: detect-node-names body: (BraceGroup children: [ (C {(detect-project)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:INSTANCE_GROUPS) op: Equal rhs: {(ArrayLiteralPart)} spids: [2609] ) ] spids: [2609] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:INSTANCE_GROUPS) op: PlusEqual rhs: { (ArrayLiteralPart words: [ { (CommandSubPart command_list: (CommandList children: [ (AndOr children: [ (C {(gcloud)} {(compute)} {(instance-groups)} {(managed)} {(list)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--filter)} { (DQ ("name ~ '") (${ VSub_Name NODE_INSTANCE_PREFIX) ("-.+' AND zone:(") (${ VSub_Name ZONE) (")") ) } {(--format) (Lit_Other "=") (SQ <"value(name)">)} ) (C {(true)}) ] op_id: Op_DPipe ) ] ) left_token: <Left_CommandSub "$("> spids: [2616 2664] ) } ] ) } spids: [2614] ) ] spids: [2614] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:NODE_NAMES) op: Equal rhs: {(ArrayLiteralPart)} spids: [2668] ) ] spids: [2668] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_n child: { (DQ (BracedVarSub token: <VSub_Name INSTANCE_GROUPS> bracket_op: (WholeArray op_id:Lit_At) suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [2680 2686] ) ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (ForEach iter_name: group iter_words: [ { (DQ (BracedVarSub token: <VSub_Name INSTANCE_GROUPS> bracket_op: (WholeArray op_id:Lit_At) spids: [2702 2707] ) ) } ] do_arg_iter: False body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:NODE_NAMES) op: PlusEqual rhs: { (ArrayLiteralPart words: [ { (CommandSubPart command_list: (CommandList children: [ (C {(gcloud)} {(compute)} {(instance-groups)} {(managed)} {(list-instances)} {(DQ (${ VSub_Name group))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--format) (Lit_Other "=") (SQ <"value(instance)">)} ) ] ) left_token: <Left_CommandSub "$("> spids: [2716 2758] ) } ] ) } spids: [2714] ) ] spids: [2714] ) ] spids: [2711 2762] ) spids: [2700 2709] ) ] spids: [-1 2692] ) ] spids: [-1 2765] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_n child: { (DQ (BracedVarSub token: <VSub_Name HEAPSTER_MACHINE_TYPE> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [2779 2782] ) ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:NODE_NAMES) op: PlusEqual rhs: { (ArrayLiteralPart words: [{(DQ (${ VSub_Name NODE_INSTANCE_PREFIX) (-heapster))}] ) } spids: [2791] ) ] spids: [2791] ) ] spids: [-1 2788] ) ] spids: [-1 2802] ) (SimpleCommand words: [ {(echo)} { (DQ ("INSTANCE_GROUPS=") (BracedVarSub token: <VSub_Name INSTANCE_GROUPS> bracket_op: (WholeArray op_id:Arith_Star) suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [2810 2816] ) ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[2819])] ) (SimpleCommand words: [ {(echo)} { (DQ ("NODE_NAMES=") (BracedVarSub token: <VSub_Name NODE_NAMES> bracket_op: (WholeArray op_id:Arith_Star) suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [2827 2833] ) ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[2836])] ) ] spids: [2603] ) spids: [2597 2602] ) (FuncDef name: detect-nodes body: (BraceGroup children: [ (C {(detect-project)}) (C {(detect-node-names)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_NODE_IP_ADDRESSES) op: Equal rhs: {(ArrayLiteralPart)} spids: [2878] ) ] spids: [2878] ) (ForExpr init: (BinaryAssign op_id: Arith_Equal left: (LhsName name:i) right: (ArithWord w:{(Lit_Digits 0)}) ) cond: (ArithBinary op_id: Arith_Less left: (ArithVarRef name:i) right: (ArithWord w: { (BracedVarSub token: <VSub_Name NODE_NAMES> prefix_op: VSub_Pound bracket_op: (WholeArray op_id:Lit_At) spids: [2894 2900] ) } ) ) update: (UnaryAssign op_id:Node_PostDPlus child:(LhsName name:i)) body: (DoGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:node_ip) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(gcloud)} {(compute)} {(instances)} {(describe)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone)} {(DQ (${ VSub_Name ZONE))} { (DQ (BracedVarSub token: <VSub_Name NODE_NAMES> bracket_op: (ArrayIndex expr: (ArithWord w:{($ VSub_Name "$i")}) ) spids: [2943 2948] ) ) } {(--format) (Lit_Other "=") (SQ <"value(networkInterfaces[0].accessConfigs[0].natIP)">)} ) ] ) left_token: <Left_CommandSub "$("> spids: [2915 2956] ) } spids: [2914] ) ] spids: [2912] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_z child: { (DQ (BracedVarSub token: <VSub_Name node_ip> suffix_op: (StringUnary op_id:VTest_Hyphen arg_word:{(SQ )}) spids: [2966 2969] ) ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ("Did not find ") (BracedVarSub token: <VSub_Name NODE_NAMES> bracket_op: (ArrayIndex expr:(ArithWord w:{($ VSub_Name "$i")})) spids: [2983 2988] ) ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [2991] ) ] ) ] spids: [-1 2976] ) ] else_action: [ (C {(echo)} { (DQ ("Found ") (BracedVarSub token: <VSub_Name NODE_NAMES> bracket_op: (ArrayIndex expr:(ArithWord w:{($ VSub_Name "$i")})) spids: [3002 3007] ) (" at ") (${ VSub_Name node_ip) ) } ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_NODE_IP_ADDRESSES) op: PlusEqual rhs: {(ArrayLiteralPart words:[{(DQ (${ VSub_Name node_ip))}])} spids: [3015] ) ] spids: [3015] ) ] spids: [2995 3025] ) ] spids: [2909 3028] ) ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_z child: { (DQ (BracedVarSub token: <VSub_Name KUBE_NODE_IP_ADDRESSES> suffix_op: (StringUnary op_id:VTest_Hyphen arg_word:{(SQ )}) spids: [3038 3041] ) ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ( "Could not detect Kubernetes minion nodes. Make sure you've launched a cluster with 'kube-up.sh'" ) ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[3056])] ) (C {(exit)} {(1)}) ] spids: [-1 3047] ) ] spids: [-1 3065] ) ] spids: [2869] ) spids: [2863 2868] ) (FuncDef name: detect-master body: (BraceGroup children: [ (C {(detect-project)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_MASTER) op: Equal rhs: {(${ VSub_Name MASTER_NAME)} spids: [3109] ) ] spids: [3109] ) (SimpleCommand words: [{(echo)} {(DQ ("Trying to find master named '") (${ VSub_Name MASTER_NAME) ("'"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[3125])] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_z child: { (DQ (BracedVarSub token: <VSub_Name KUBE_MASTER_IP> suffix_op: (StringUnary op_id:VTest_Hyphen arg_word:{(SQ )}) spids: [3136 3139] ) ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:master_address_name) op: Equal rhs: {(DQ (${ VSub_Name MASTER_NAME) (-ip))} spids: [3150] ) ] spids: [3148] ) (SimpleCommand words: [ {(echo)} {(DQ ("Looking for address '") (${ VSub_Name master_address_name) ("'"))} ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[3169])] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_MASTER_IP) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(gcloud)} {(compute)} {(addresses)} {(describe)} {(DQ (${ VSub_Name master_address_name))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--region)} {(DQ (${ VSub_Name REGION))} {(-q)} {(--format) (Lit_Other "=") (SQ <"value(address)">)} ) ] ) left_token: <Left_CommandSub "$("> spids: [3174 3214] ) } spids: [3173] ) ] spids: [3173] ) ] spids: [-1 3145] ) ] spids: [-1 3217] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_z child: { (DQ (BracedVarSub token: <VSub_Name KUBE_MASTER_IP> suffix_op: (StringUnary op_id:VTest_Hyphen arg_word:{(SQ )}) spids: [3227 3230] ) ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ( "Could not detect Kubernetes master node. Make sure you've launched a cluster with 'kube-up.sh'" ) ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[3245])] ) (C {(exit)} {(1)}) ] spids: [-1 3236] ) ] spids: [-1 3254] ) (SimpleCommand words: [ {(echo)} { (DQ ("Using master: ") ($ VSub_Name "$KUBE_MASTER") (" (external IP: ") ($ VSub_Name "$KUBE_MASTER_IP") (")") ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[3267])] ) ] spids: [3103] ) spids: [3097 3102] ) (FuncDef name: get-master-env body: (BraceGroup children: [ (SimpleCommand words: [ {(gcloud)} {(compute)} {(--project)} {(${ VSub_Name PROJECT)} {(ssh)} {(--zone)} {(${ VSub_Name ZONE)} {(${ VSub_Name KUBE_MASTER)} {(--command)} { (DQ ("curl --fail --silent -H 'Metadata-Flavor: Google' ") (" 'http://metadata/computeMetadata/v1/instance/attributes/kube-env'") ) } ] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[3336])] ) (SimpleCommand words: [ {(gcloud)} {(compute)} {(--project)} {(${ VSub_Name PROJECT)} {(ssh)} {(--zone)} {(${ VSub_Name ZONE)} {(${ VSub_Name KUBE_MASTER)} {(--command)} { (DQ ("curl --fail --silent -H 'Metadata-Flavor: Google' ") ( " 'http://metadata/computeMetadata/v1/instance/attributes/kube-master-certs'" ) ) } ] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[3372])] ) ] spids: [3297] ) spids: [3291 3296] ) (FuncDef name: create-static-ip body: (BraceGroup children: [ (C {(detect-project)}) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:attempt) op:Equal rhs:{(0)} spids:[3401])] spids: [3399] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:REGION) op: Equal rhs: {(DQ ($ VSub_Number "$2"))} spids: [3407] ) ] spids: [3405] ) (While cond: [(Sentence child:(C {(true)}) terminator:<Op_Semi ";">)] body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (SimpleCommand words: [ {(gcloud)} {(compute)} {(addresses)} {(create)} {(DQ ($ VSub_Number "$1"))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--region)} {(DQ (${ VSub_Name REGION))} {(-q)} ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [3457] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:start) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(date)} {(Lit_Other "+") (Lit_Other "%") (s)}) ] ) left_token: <Left_CommandSub "$("> spids: [3471 3477] ) ) } spids: [3469] ) ] spids: [3469] ) (While cond: [(Sentence child:(C {(true)}) terminator:<Op_Semi ";">)] body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:now) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(date)} {(Lit_Other "+") (Lit_Other "%") (s)} ) ] ) left_token: <Left_CommandSub "$("> spids: [3491 3497] ) ) } spids: [3489] ) ] spids: [3489] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_gt left: { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithVarRef name:now) right: (ArithVarRef name:start) ) spids: [3509 3516] ) } right: {(900)} ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} { (DQ ( "Timeout while waiting for master IP visibility" ) ) } ) (C {(exit)} {(2)}) ] spids: [-1 3525] ) ] spids: [-1 3540] ) (If arms: [ (if_arm cond: [ (Sentence child: (SimpleCommand words: [ {(gcloud)} {(compute)} {(addresses)} {(describe)} {(DQ ($ VSub_Number "$1"))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--region)} {(DQ (${ VSub_Name REGION))} ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [3573] ) (Redir op_id: Redir_GreatAnd fd: 2 arg_word: {(1)} spids: [3576] ) ] ) terminator: <Op_Semi ";"> ) ] action: [(ControlFlow token:<ControlFlow_Break break>)] spids: [-1 3580] ) ] spids: [-1 3586] ) (C {(echo)} {(DQ ("Master IP not visible yet. Waiting..."))}) (C {(sleep)} {(5)}) ] spids: [3486 3601] ) ) (ControlFlow token:<ControlFlow_Break break>) ] spids: [-1 3462] ) ] spids: [-1 3607] ) (If arms: [ (if_arm cond: [ (Sentence child: (SimpleCommand words: [ {(gcloud)} {(compute)} {(addresses)} {(describe)} {(DQ ($ VSub_Number "$1"))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--region)} {(DQ (${ VSub_Name REGION))} ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [3645] ) (Redir op_id: Redir_GreatAnd fd: 2 arg_word: {(1)} spids: [3648] ) ] ) terminator: <Op_Semi ";"> ) ] action: [(ControlFlow token:<ControlFlow_Break break>)] spids: [-1 3652] ) ] spids: [-1 3662] ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_Great left: (ArithVarRef name:attempt) right: (ArithWord w:{(Lit_Digits 4)}) ) ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} {(-e)} { (DQ (${ VSub_Name color_red) ("Failed to create static ip ") ($ VSub_Number "$1") (" ") (${ VSub_Name color_norm) ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [3699] ) ] ) (C {(exit)} {(2)}) ] spids: [-1 3680] ) ] spids: [-1 3708] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:attempt) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name "$attempt")}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [3712 3717] ) } spids: [3711] ) ] spids: [3711] ) (SimpleCommand words: [ {(echo)} {(-e)} { (DQ (${ VSub_Name color_yellow) ("Attempt ") ($ VSub_Name "$attempt") (" failed to create static ip ") ($ VSub_Number "$1") (". Retrying.") (${ VSub_Name color_norm) ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[3738])] ) (C {(sleep)} { (ArithSubPart anode: (ArithBinary op_id: Arith_Star left: (ArithWord w:{($ VSub_Name "$attempt")}) right: (ArithWord w:{(Lit_Digits 5)}) ) spids: [3744 3751] ) } ) ] spids: [3418 3754] ) ) ] spids: [3393] ) spids: [3387 3392] ) (FuncDef name: create-firewall-rule body: (BraceGroup children: [ (C {(detect-project)}) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:attempt) op:Equal rhs:{(0)} spids:[3785])] spids: [3783] ) (While cond: [(Sentence child:(C {(true)}) terminator:<Op_Semi ";">)] body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (C {(gcloud)} {(compute)} {(firewall-rules)} {(create)} {(DQ ($ VSub_Number "$1"))} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--network)} {(DQ (${ VSub_Name NETWORK))} {(--source-ranges)} {(DQ ($ VSub_Number "$2"))} {(--target-tags)} {(DQ ($ VSub_Number "$3"))} {(--allow)} {(tcp) (Lit_Comma ",") (udp) (Lit_Comma ",") (icmp) (Lit_Comma ",") (esp) (Lit_Comma ",") (ah) (Lit_Comma ",") (sctp) } ) ] negated: True ) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_Great left: (ArithVarRef name:attempt) right: (ArithWord w:{(Lit_Digits 4)}) ) ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} {(-e)} { (DQ (${ VSub_Name color_red) ("Failed to create firewall rule ") ($ VSub_Number "$1") (" ") (${ VSub_Name color_norm) ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [3902] ) ] ) (C {(exit)} {(2)}) ] spids: [-1 3883] ) ] spids: [-1 3911] ) (SimpleCommand words: [ {(echo)} {(-e)} { (DQ (${ VSub_Name color_yellow) ("Attempt ") (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name "$attempt")}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [3923 3928] ) (" failed to create firewall rule ") ($ VSub_Number "$1") (". Retrying.") (${ VSub_Name color_norm) ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [3937] ) ] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:attempt) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name "$attempt")}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [3942 3947] ) } spids: [3941] ) ] spids: [3941] ) (C {(sleep)} { (ArithSubPart anode: (ArithBinary op_id: Arith_Star left: (ArithWord w:{($ VSub_Name "$attempt")}) right: (ArithWord w:{(Lit_Digits 5)}) ) spids: [3952 3959] ) } ) ] spids: [-1 3866] ) ] else_action: [(ControlFlow token:<ControlFlow_Break break>)] spids: [3962 3968] ) ] spids: [3794 3971] ) ) ] spids: [3777] ) spids: [3771 3776] ) (FuncDef name: make-gcloud-network-argument body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:network_project) op: Equal rhs: {(DQ ($ VSub_Number "$1"))} spids: [3990] ) ] spids: [3988] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:region) op: Equal rhs: {(DQ ($ VSub_Number "$2"))} spids: [3998] ) ] spids: [3996] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:network) op: Equal rhs: {(DQ ($ VSub_Number "$3"))} spids: [4006] ) ] spids: [4004] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:subnet) op: Equal rhs: {(DQ ($ VSub_Number "$4"))} spids: [4014] ) ] spids: [4012] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:address) op: Equal rhs: {(DQ ($ VSub_Number "$5"))} spids: [4022] ) ] spids: [4020] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:enable_ip_alias) op: Equal rhs: {(DQ ($ VSub_Number "$6"))} spids: [4033] ) ] spids: [4031] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:alias_size) op: Equal rhs: {(DQ ($ VSub_Number "$7"))} spids: [4044] ) ] spids: [4042] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:networkURL) op: Equal rhs: { (DQ (projects/) (${ VSub_Name network_project) (/global/networks/) (${ VSub_Name network) ) } spids: [4056] ) ] spids: [4054] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:subnetURL) op: Equal rhs: { (DQ (projects/) (${ VSub_Name network_project) (/regions/) (${ VSub_Name region) (/subnetworks/) (BracedVarSub token: <VSub_Name subnet> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [4082 4085] ) ) } spids: [4071] ) ] spids: [4069] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:ret) op:Equal rhs:{(DQ )} spids:[4092])] spids: [4090] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name enable_ip_alias))} right: {(SQ <true>)} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ret) op: Equal rhs: {(DQ (--network-interface))} spids: [4120] ) ] spids: [4120] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ret) op: Equal rhs: {(DQ (${ VSub_Name ret) (" network=") (${ VSub_Name networkURL))} spids: [4126] ) ] spids: [4126] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ret) op: Equal rhs: { (DQ (${ VSub_Name ret) (",address=") (BracedVarSub token: <VSub_Name address> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [4148 4151] ) ) } spids: [4142] ) ] spids: [4142] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ret) op: Equal rhs: {(DQ (${ VSub_Name ret) (",subnet=") (${ VSub_Name subnetURL))} spids: [4155] ) ] spids: [4155] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ret) op: Equal rhs: { (DQ (${ VSub_Name ret) (",aliases=pods-default:") (${ VSub_Name alias_size) ) } spids: [4167] ) ] spids: [4167] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ret) op: Equal rhs: {(DQ (${ VSub_Name ret) (" --no-can-ip-forward"))} spids: [4179] ) ] spids: [4179] ) ] spids: [-1 4117] ) ] else_action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_n child: { (BracedVarSub token: <VSub_Name subnet> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{}) spids: [4197 4200] ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ret) op: Equal rhs: {(DQ (${ VSub_Name ret) (" --subnet ") (${ VSub_Name subnetURL))} spids: [4208] ) ] spids: [4208] ) ] spids: [-1 4205] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ret) op: Equal rhs: {(DQ (${ VSub_Name ret) (" --network ") (${ VSub_Name networkURL))} spids: [4223] ) ] spids: [4223] ) ] spids: [4220 4235] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ret) op: Equal rhs: {(DQ (${ VSub_Name ret) (" --can-ip-forward"))} spids: [4239] ) ] spids: [4239] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_n child: { (BracedVarSub token: <VSub_Name address> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{}) spids: [4254 4257] ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ret) op: Equal rhs: {(DQ (${ VSub_Name ret) (" --address ") (${ VSub_Name address))} spids: [4265] ) ] spids: [4265] ) ] spids: [-1 4262] ) ] spids: [-1 4277] ) ] spids: [4188 4280] ) (C {(echo)} {(DQ (${ VSub_Name ret))}) ] spids: [3985] ) spids: [3979 3984] ) (FuncDef name: get-template-name-from-version body: (BraceGroup children: [ (Pipeline children: [ (C {(echo)} {(DQ (${ VSub_Name NODE_INSTANCE_PREFIX) (-template-) (${ VSub_Number 1))}) (C {(cut)} {(-c)} {(1-63)}) (C {(sed)} {(SQ <"s/[\\.\\+]/-/g;s/-*$//g">)}) ] negated: False ) ] spids: [4304] ) spids: [4298 4303] ) (FuncDef name: create-node-template body: (BraceGroup children: [ (C {(detect-project)}) (C {(detect-subnetworks)}) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:template_name) op: Equal rhs: {(DQ ($ VSub_Number "$1"))} spids: [4371] ) ] spids: [4369] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(gcloud)} {(compute)} {(instance-templates)} {(describe)} {(DQ ($ VSub_Name "$template_name"))} {(--project)} {(DQ (${ VSub_Name PROJECT))} ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [4417] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ("Instance template ") (${ VSub_Number 1) (" already exists; deleting.")) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[4434])] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (C {(gcloud)} {(compute)} {(instance-templates)} {(delete)} {(DQ ($ VSub_Name "$template_name"))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--quiet)} ) ] negated: True ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [4465] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} {(-e)} { (DQ (${ VSub_Name color_yellow) ("Failed to delete existing instance template") (${ VSub_Name color_norm) ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [4486] ) ] ) (C {(exit)} {(2)}) ] spids: [-1 4469] ) ] spids: [-1 4495] ) ] spids: [-1 4421] ) ] spids: [-1 4498] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:gcloud) op: Equal rhs: {(DQ (gcloud))} spids: [4504] ) ] spids: [4502] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:accelerator_args) op: Equal rhs: {(DQ )} spids: [4513] ) ] spids: [4511] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalNot child: (BoolUnary op_id: BoolUnary_z child: {(DQ (${ VSub_Name NODE_ACCELERATORS))} ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:accelerator_args) op: Equal rhs: { (DQ ( "--maintenance-policy TERMINATE --restart-on-failure --accelerator " ) (${ VSub_Name NODE_ACCELERATORS) ) } spids: [4546] ) ] spids: [4546] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:gcloud) op: Equal rhs: {(DQ ("gcloud beta"))} spids: [4555] ) ] spids: [4555] ) ] spids: [-1 4543] ) ] spids: [-1 4561] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: { (DQ (BracedVarSub token: <VSub_Name ENABLE_IP_ALIASES> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [4570 4573] ) ) } right: {(SQ <true>)} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:gcloud) op: Equal rhs: {(DQ ("gcloud beta"))} spids: [4588] ) ] spids: [4588] ) ] spids: [-1 4585] ) ] spids: [-1 4594] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:preemptible_minions) op: Equal rhs: {(DQ )} spids: [4600] ) ] spids: [4598] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name PREEMPTIBLE_NODE))} right: {(DQ (true))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:preemptible_minions) op: Equal rhs: {(DQ ("--preemptible --maintenance-policy TERMINATE"))} spids: [4627] ) ] spids: [4627] ) ] spids: [-1 4624] ) ] spids: [-1 4633] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:local_ssds) op:Equal rhs:{(DQ )} spids:[4639])] spids: [4637] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalNot child: (BoolUnary op_id: BoolUnary_z child: { (BracedVarSub token: <VSub_Name NODE_LOCAL_SSDS> suffix_op: (StringUnary op_id:VTest_Plus arg_word:{(x)}) spids: [4652 4656] ) } ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_ge left: {(${ VSub_Name NODE_LOCAL_SSDS)} right: {(1)} ) ) terminator: <Op_Semi ";"> ) ] action: [ (ForEach iter_name: i iter_words: [ { (CommandSubPart command_list: (CommandList children: [(C {(seq)} {(${ VSub_Name NODE_LOCAL_SSDS)})] ) left_token: <Left_CommandSub "$("> spids: [4696 4702] ) } ] do_arg_iter: False body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:local_ssds) op: Equal rhs: { (DQ ($ VSub_Name "$local_ssds") ("--local-ssd=interface=SCSI ") ) } spids: [4708] ) ] spids: [4708] ) ] spids: [4705 4715] ) spids: [4695 4703] ) ] spids: [-1 4687] ) ] spids: [-1 4718] ) ] spids: [-1 4661] ) ] spids: [-1 4721] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:network) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(make-gcloud-network-argument)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(DQ (${ VSub_Name REGION))} {(DQ (${ VSub_Name NETWORK))} { (DQ (BracedVarSub token: <VSub_Name SUBNETWORK> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [4758 4761] ) ) } {(DQ )} { (DQ (BracedVarSub token: <VSub_Name ENABLE_IP_ALIASES> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [4772 4775] ) ) } { (DQ (BracedVarSub token: <VSub_Name IP_ALIAS_SIZE> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [4781 4784] ) ) } ) ] ) left_token: <Left_CommandSub "$("> spids: [4728 4786] ) } spids: [4727] ) ] spids: [4725] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:attempt) op:Equal rhs:{(1)} spids:[4792])] spids: [4790] ) (While cond: [(Sentence child:(C {(true)}) terminator:<Op_Semi ";">)] body: (DoGroup children: [ (SimpleCommand words: [ {(echo)} {(DQ ("Attempt ") (${ VSub_Name attempt) (" to create ") (${ VSub_Number 1))} ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[4817])] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (SimpleCommand words: [ {(${ VSub_Name gcloud)} {(compute)} {(instance-templates)} {(create)} {(DQ ($ VSub_Name "$template_name"))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--machine-type)} {(DQ (${ VSub_Name NODE_SIZE))} {(--boot-disk-type)} {(DQ (${ VSub_Name NODE_DISK_TYPE))} {(--boot-disk-size)} {(DQ (${ VSub_Name NODE_DISK_SIZE))} {(--image-project) (Lit_Other "=") (DQ (${ VSub_Name NODE_IMAGE_PROJECT)) } {(--image)} {(DQ (${ VSub_Name NODE_IMAGE))} {(--tags)} {(DQ (${ VSub_Name NODE_TAG))} {(${ VSub_Name accelerator_args)} {(${ VSub_Name local_ssds)} {(--region)} {(DQ (${ VSub_Name REGION))} {(${ VSub_Name network)} {(${ VSub_Name preemptible_minions)} {($ VSub_Number "$2")} {(--metadata-from-file)} {($ VSub_Number "$3")} ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [4955] ) ] ) ] negated: True ) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_Great left: (ArithVarRef name:attempt) right: (ArithWord w:{(Lit_Digits 5)}) ) ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} {(-e)} { (DQ (${ VSub_Name color_red) ("Failed to create instance template ") ($ VSub_Name "$template_name") (" ") (${ VSub_Name color_norm) ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [4995] ) ] ) (C {(exit)} {(2)}) ] spids: [-1 4976] ) ] spids: [-1 5004] ) (SimpleCommand words: [ {(echo)} {(-e)} { (DQ (${ VSub_Name color_yellow) ("Attempt ") (${ VSub_Name attempt) (" failed to create instance template ") ($ VSub_Name "$template_name") (". Retrying.") (${ VSub_Name color_norm) ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [5027] ) ] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:attempt) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name "$attempt")}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [5032 5037] ) } spids: [5031] ) ] spids: [5031] ) (C {(sleep)} { (ArithSubPart anode: (ArithBinary op_id: Arith_Star left: (ArithWord w:{($ VSub_Name "$attempt")}) right: (ArithWord w:{(Lit_Digits 5)}) ) spids: [5042 5049] ) } ) (Sentence child: (C {(gcloud)} {(compute)} {(instance-templates)} {(delete)} {(DQ ($ VSub_Name "$template_name"))} {(--project)} {(DQ (${ VSub_Name PROJECT))} ) terminator: <Op_Amp "&"> ) (AndOr children: [ (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [5086] ) ] ) (C {(true)}) ] op_id: Op_DPipe ) ] spids: [-1 4959] ) ] else_action: [(ControlFlow token:<ControlFlow_Break break>)] spids: [5094 5100] ) ] spids: [4801 5103] ) ) ] spids: [4360] ) spids: [4354 4359] ) (FuncDef name: add-instance-metadata body: (BraceGroup children: [ (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:instance) op: Equal rhs: {($ VSub_Number "$1")} spids: [5130] ) ] spids: [5126] ) (C {(shift)} {(1)}) (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:kvs) op: Equal rhs: {(ArrayLiteralPart words:[{(DQ ($ VSub_At "$@"))}])} spids: [5143] ) ] spids: [5139] ) (C {(detect-project)}) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:attempt) op:Equal rhs:{(0)} spids:[5158])] spids: [5156] ) (While cond: [(Sentence child:(C {(true)}) terminator:<Op_Semi ";">)] body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (C {(gcloud)} {(compute)} {(instances)} {(add-metadata)} {(DQ (${ VSub_Name instance))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--metadata)} { (DQ (BracedVarSub token: <VSub_Name kvs> bracket_op: (WholeArray op_id:Lit_At) spids: [5213 5218] ) ) } ) ] negated: True ) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_Great left: (ArithVarRef name:attempt) right: (ArithWord w:{(Lit_Digits 5)}) ) ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} {(-e)} { (DQ (${ VSub_Name color_red) ("Failed to add instance metadata in ") (${ VSub_Name instance) (" ") (${ VSub_Name color_norm) ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [5260] ) ] ) (C {(exit)} {(2)}) ] spids: [-1 5239] ) ] spids: [-1 5269] ) (SimpleCommand words: [ {(echo)} {(-e)} { (DQ (${ VSub_Name color_yellow) ("Attempt ") (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name "$attempt")}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [5281 5286] ) (" failed to add metadata in ") (${ VSub_Name instance) (". Retrying.") (${ VSub_Name color_norm) ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [5297] ) ] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:attempt) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name "$attempt")}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [5302 5307] ) } spids: [5301] ) ] spids: [5301] ) (C {(sleep)} { (ArithSubPart anode: (ArithBinary op_id: Arith_Star left: (ArithWord w:{(Lit_Digits 5)}) right: (ArithWord w:{($ VSub_Name "$attempt")}) ) spids: [5312 5319] ) } ) ] spids: [-1 5222] ) ] else_action: [(ControlFlow token:<ControlFlow_Break break>)] spids: [5322 5328] ) ] spids: [5167 5331] ) ) ] spids: [5123] ) spids: [5117 5122] ) (FuncDef name: add-instance-metadata-from-file body: (BraceGroup children: [ (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:instance) op: Equal rhs: {($ VSub_Number "$1")} spids: [5358] ) ] spids: [5354] ) (C {(shift)} {(1)}) (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:kvs) op: Equal rhs: {(ArrayLiteralPart words:[{(DQ ($ VSub_At "$@"))}])} spids: [5371] ) ] spids: [5367] ) (C {(detect-project)}) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:attempt) op:Equal rhs:{(0)} spids:[5386])] spids: [5384] ) (While cond: [(Sentence child:(C {(true)}) terminator:<Op_Semi ";">)] body: (DoGroup children: [ (C {(echo)} { (DQ (BracedVarSub token: <VSub_Name kvs> bracket_op: (WholeArray op_id:Lit_At) spids: [5401 5406] ) ) } ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (C {(gcloud)} {(compute)} {(instances)} {(add-metadata)} {(DQ (${ VSub_Name instance))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--metadata-from-file)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(join_csv)} { (BracedVarSub token: <VSub_Name kvs> bracket_op: (WholeArray op_id:Lit_At) spids: [5456 5461] ) } ) ] ) left_token: <Left_CommandSub "$("> spids: [5453 5462] ) ) } ) ] negated: True ) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_Great left: (ArithVarRef name:attempt) right: (ArithWord w:{(Lit_Digits 5)}) ) ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} {(-e)} { (DQ (${ VSub_Name color_red) ("Failed to add instance metadata in ") (${ VSub_Name instance) (" ") (${ VSub_Name color_norm) ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [5504] ) ] ) (C {(exit)} {(2)}) ] spids: [-1 5483] ) ] spids: [-1 5513] ) (SimpleCommand words: [ {(echo)} {(-e)} { (DQ (${ VSub_Name color_yellow) ("Attempt ") (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name "$attempt")}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [5525 5530] ) (" failed to add metadata in ") (${ VSub_Name instance) (". Retrying.") (${ VSub_Name color_norm) ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [5541] ) ] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:attempt) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name "$attempt")}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [5546 5551] ) } spids: [5545] ) ] spids: [5545] ) (C {(sleep)} { (ArithSubPart anode: (ArithBinary op_id: Arith_Star left: (ArithWord w:{($ VSub_Name "$attempt")}) right: (ArithWord w:{(Lit_Digits 5)}) ) spids: [5556 5563] ) } ) ] spids: [-1 5466] ) ] else_action: [(ControlFlow token:<ControlFlow_Break break>)] spids: [5566 5572] ) ] spids: [5395 5575] ) ) ] spids: [5351] ) spids: [5345 5350] ) (FuncDef name: kube-up body: (BraceGroup children: [ (C {(kube) (Lit_Other ":") (Lit_Other ":") (util) (Lit_Other ":") (Lit_Other ":") (ensure-temp-dir) } ) (C {(detect-project)}) (C {(load-or-gen-kube-basicauth)}) (C {(load-or-gen-kube-bearertoken)}) (C {(find-release-tars)}) (C {(upload-server-tars)}) (C {(set_num_migs)}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: { (BracedVarSub token: <VSub_Name KUBE_USE_EXISTING_MASTER> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{}) spids: [5647 5650] ) } right: {(DQ (true))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(detect-master)}) (C {(parse-master-env)}) (C {(create-subnetworks)}) (C {(detect-subnetworks)}) (C {(create-nodes)}) ] spids: [-1 5661] ) (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: { (BracedVarSub token: <VSub_Name KUBE_REPLICATE_EXISTING_MASTER> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{}) spids: [5683 5686] ) } right: {(DQ (true))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalAnd left: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ (${ VSub_Name MASTER_OS_DISTRIBUTION))} right: {(DQ (gci))} ) right: (LogicalAnd left: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ (${ VSub_Name MASTER_OS_DISTRIBUTION))} right: {(DQ (debian))} ) right: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ (${ VSub_Name MASTER_OS_DISTRIBUTION))} right: {(DQ (ubuntu))} ) ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} { (DQ ("Master replication supported only for gci, debian, and ubuntu")) } ) (ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] spids: [-1 5747] ) ] spids: [-1 5762] ) (C {(create-loadbalancer)}) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children:[(C {(replicate-master)})] negated:True) terminator: <Op_Semi ";"> ) ] action: [ (AndOr children: [(C {(remove-replica-from-etcd)} {(2379)}) (C {(true)})] op_id: Op_DPipe ) (AndOr children: [(C {(remove-replica-from-etcd)} {(4002)}) (C {(true)})] op_id: Op_DPipe ) ] spids: [-1 5779] ) ] spids: [-1 5800] ) ] spids: [5679 5697] ) ] else_action: [ (C {(check-existing)}) (C {(create-network)}) (C {(create-subnetworks)}) (C {(detect-subnetworks)}) (C {(write-cluster-name)}) (C {(create-autoscaler-config)}) (C {(create-master)}) (C {(create-nodes-firewall)}) (C {(create-nodes-template)}) (C {(create-nodes)}) (C {(check-cluster)}) ] spids: [5803 5839] ) ] spids: [5601] ) spids: [5595 5600] ) (FuncDef name: check-existing body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:running_in_terminal) op: Equal rhs: {(false)} spids: [5855] ) ] spids: [5853] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr:(BoolUnary op_id:BoolUnary_t child:{(1)})) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:running_in_terminal) op: Equal rhs: {(true)} spids: [5877] ) ] spids: [5877] ) ] spids: [-1 5874] ) ] spids: [-1 5881] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalOr left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(${ VSub_Name running_in_terminal)} right: {(DQ (true))} ) right: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(${ VSub_Name KUBE_UP_AUTOMATIC_CLEANUP)} right: {(DQ (true))} ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children:[(C {(check-resources)})] negated:True) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:run_kube_down) op: Equal rhs: {(DQ (n))} spids: [5929] ) ] spids: [5927] ) (SimpleCommand words: [{(echo)} {(DQ (${ VSub_Name KUBE_RESOURCE_FOUND) (" found."))}] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [5944] ) ] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalAnd left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(${ VSub_Name running_in_terminal)} right: {(DQ (true))} ) right: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(${ VSub_Name KUBE_UP_AUTOMATIC_CLEANUP)} right: {(DQ (false))} ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(read)} {(-p)} { (DQ ( "Would you like to shut down the old cluster (call kube-down)? [y/N] " ) ) } {(run_kube_down)} ) ] spids: [-1 5981] ) ] spids: [-1 5995] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalOr left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(${ VSub_Name run_kube_down)} right: {(DQ (y))} ) right: (LogicalOr left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(${ VSub_Name run_kube_down)} right: {(DQ (Y))} ) right: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(${ VSub_Name KUBE_UP_AUTOMATIC_CLEANUP)} right: {(DQ (true))} ) ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ ("... calling kube-down"))}] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [6048] ) ] ) (C {(kube-down)}) ] spids: [-1 6039] ) ] spids: [-1 6055] ) ] spids: [-1 5924] ) ] spids: [-1 6058] ) ] spids: [-1 5914] ) ] spids: [-1 6061] ) ] spids: [5850] ) spids: [5844 5849] ) (FuncDef name: create-network body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (C {(gcloud)} {(compute)} {(networks)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(describe)} {(DQ (${ VSub_Name NETWORK))} ) ] negated: True ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [6102] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:network_mode) op: Equal rhs: {(DQ (auto))} spids: [6119] ) ] spids: [6117] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: { (DQ (BracedVarSub token: <VSub_Name CREATE_CUSTOM_NETWORK> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [6130 6133] ) ) } right: {(DQ (true))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:network_mode) op: Equal rhs: {(DQ (custom))} spids: [6148] ) ] spids: [6148] ) ] spids: [-1 6145] ) ] spids: [-1 6154] ) (C {(echo)} { (DQ ("Creating new ") (${ VSub_Name network_mode) (" network: ") (${ VSub_Name NETWORK) ) } ) (C {(gcloud)} {(compute)} {(networks)} {(create)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(DQ (${ VSub_Name NETWORK))} {(--mode) (Lit_Other "=") (DQ (${ VSub_Name network_mode))} ) ] spids: [-1 6106] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:PREEXISTING_NETWORK) op: Equal rhs: {(true)} spids: [6205] ) ] spids: [6205] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:PREEXISTING_NETWORK_MODE) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (AndOr children: [ (C {(gcloud)} {(compute)} {(networks)} {(list)} {(--filter) (Lit_Other "=") (DQ ("name=('") (${ VSub_Name NETWORK) ("')")) } {(--project)} {(${ VSub_Name NETWORK_PROJECT)} {(--format) (Lit_Other "=") (SQ <"value(x_gcloud_subnet_mode)">) } ) (C {(true)}) ] op_id: Op_DPipe ) ] ) left_token: <Left_CommandSub "$("> spids: [6211 6245] ) ) } spids: [6209] ) ] spids: [6209] ) (C {(echo)} { (DQ ("Found existing network ") (${ VSub_Name NETWORK) (" in ") (${ VSub_Name PREEXISTING_NETWORK_MODE) (" mode.") ) } ) ] spids: [6202 6264] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (C {(gcloud)} {(compute)} {(firewall-rules)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(describe)} {(DQ (${ VSub_Name CLUSTER_NAME) (-default-internal-master))} ) ] negated: True ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [6296] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (Sentence child: (C {(gcloud)} {(compute)} {(firewall-rules)} {(create)} {(DQ (${ VSub_Name CLUSTER_NAME) (-default-internal-master))} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--network)} {(DQ (${ VSub_Name NETWORK))} {(--source-ranges)} {(DQ (10.0.0.0/8))} {(--allow)} {(DQ ("tcp:1-2379,tcp:2382-65535,udp:1-65535,icmp"))} {(--target-tags)} {(DQ (${ VSub_Name MASTER_TAG))} ) terminator: <Op_Amp "&"> ) ] spids: [-1 6300] ) ] spids: [-1 6366] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (C {(gcloud)} {(compute)} {(firewall-rules)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(describe)} {(DQ (${ VSub_Name CLUSTER_NAME) (-default-internal-node))} ) ] negated: True ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [6398] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (Sentence child: (C {(gcloud)} {(compute)} {(firewall-rules)} {(create)} {(DQ (${ VSub_Name CLUSTER_NAME) (-default-internal-node))} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--network)} {(DQ (${ VSub_Name NETWORK))} {(--source-ranges)} {(DQ (10.0.0.0/8))} {(--allow)} {(DQ ("tcp:1-65535,udp:1-65535,icmp"))} {(--target-tags)} {(DQ (${ VSub_Name NODE_TAG))} ) terminator: <Op_Amp "&"> ) ] spids: [-1 6402] ) ] spids: [-1 6468] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (C {(gcloud)} {(compute)} {(firewall-rules)} {(describe)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(DQ (${ VSub_Name NETWORK) (-default-ssh))} ) ] negated: True ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [6500] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (Sentence child: (C {(gcloud)} {(compute)} {(firewall-rules)} {(create)} {(DQ (${ VSub_Name NETWORK) (-default-ssh))} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--network)} {(DQ (${ VSub_Name NETWORK))} {(--source-ranges)} {(DQ (0.0.0.0/0))} {(--allow)} {(DQ ("tcp:22"))} ) terminator: <Op_Amp "&"> ) ] spids: [-1 6504] ) ] spids: [-1 6561] ) ] spids: [6072] ) spids: [6066 6071] ) (FuncDef name: expand-default-subnetwork body: (BraceGroup children: [ (AndOr children: [ (C {(gcloud)} {(compute)} {(networks)} {(switch-mode)} {(DQ (${ VSub_Name NETWORK))} {(--mode)} {(custom)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--quiet)} ) (C {(true)}) ] op_id: Op_DPipe ) (C {(gcloud)} {(compute)} {(networks)} {(subnets)} {(expand-ip-range)} {(DQ (${ VSub_Name NETWORK))} {(--region) (Lit_Other "=") (DQ (${ VSub_Name REGION))} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--prefix-length) (Lit_Other "=") (19)} {(--quiet)} ) ] spids: [6572] ) spids: [6566 6571] ) (FuncDef name: create-subnetworks body: (BraceGroup children: [ (Case to_match: {(${ VSub_Name ENABLE_IP_ALIASES)} arms: [ (case_arm pat_list: [{(true)}] action: [(C {(echo)} {(DQ ("IP aliases are enabled. Creating subnetworks."))})] spids: [6681 6682 6689 -1] ) (case_arm pat_list: [{(false)}] action: [ (C {(echo)} {(DQ ("IP aliases are disabled."))}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobEqual left: {(DQ (${ VSub_Name ENABLE_BIG_CLUSTER_SUBNETS))} right: {(DQ (true))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ (${ VSub_Name PREEXISTING_NETWORK))} right: {(DQ (true))} ) ) terminator: <Op_Semi ";"> ) ] action: [(C {(expand-default-subnetwork)})] spids: [-1 6744] ) ] else_action: [ (C {(echo)} { (DQ (${ VSub_Name color_yellow) ("Using pre-existing network ") (${ VSub_Name NETWORK) (", subnets won't be expanded to /19!") (${ VSub_Name color_norm) ) } ) ] spids: [6750 6770] ) ] spids: [-1 6722] ) (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalAnd left: (BoolBinary op_id: BoolBinary_GlobDEqual left: { (DQ (BracedVarSub token: <VSub_Name CREATE_CUSTOM_NETWORK> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [6778 6781] ) ) } right: {(DQ (true))} ) right: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ (${ VSub_Name PREEXISTING_NETWORK))} right: {(DQ (true))} ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(gcloud)} {(compute)} {(networks)} {(subnets)} {(create)} {(DQ (${ VSub_Name SUBNETWORK))} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--region)} {(DQ (${ VSub_Name REGION))} {(--network)} {(DQ (${ VSub_Name NETWORK))} {(--range)} {(DQ (${ VSub_Name NODE_IP_RANGE))} ) ] spids: [6773 6807] ) ] spids: [-1 6859] ) (ControlFlow token:<ControlFlow_Return return>) ] spids: [6692 6693 6863 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (C {(echo)} { (DQ (${ VSub_Name color_red) ("Invalid argument to ENABLE_IP_ALIASES") (${ VSub_Name color_norm) ) } ) (C {(exit)} {(1)}) ] spids: [6866 6867 6885 -1] ) ] spids: [6672 6678 6888] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:subnet) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (SimpleCommand words: [ {(gcloud)} {(beta)} {(compute)} {(networks)} {(subnets)} {(describe)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--region)} {(${ VSub_Name REGION)} {(${ VSub_Name IP_ALIAS_SUBNETWORK)} ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [6940] ) ] ) ] ) left_token: <Left_CommandSub "$("> spids: [6903 6942] ) } spids: [6902] ) ] spids: [6900] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr:(BoolUnary op_id:BoolUnary_z child:{(${ VSub_Name subnet)})) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(${ VSub_Name IP_ALIAS_SUBNETWORK)} right: {(${ VSub_Name INSTANCE_PREFIX) (-subnet-default)} ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} { (DQ (${ VSub_Name color_red) ("Subnetwork ") (${ VSub_Name NETWORK) (":") (${ VSub_Name IP_ALIAS_SUBNETWORK) (" does not exist") (${ VSub_Name color_norm) ) } ) (C {(exit)} {(1)}) ] spids: [-1 6983] ) ] spids: [-1 7012] ) (C {(echo)} { (DQ ("Creating subnet ") (${ VSub_Name NETWORK) (":") (${ VSub_Name IP_ALIAS_SUBNETWORK) ) } ) (C {(gcloud)} {(beta)} {(compute)} {(networks)} {(subnets)} {(create)} {(${ VSub_Name IP_ALIAS_SUBNETWORK)} {(--description)} { (DQ ("Automatically generated subnet for ") (${ VSub_Name INSTANCE_PREFIX) (" cluster. This will be removed on cluster teardown.") ) } {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--network)} {(${ VSub_Name NETWORK)} {(--region)} {(${ VSub_Name REGION)} {(--range)} {(${ VSub_Name NODE_IP_RANGE)} {(--secondary-range)} {(DQ ("pods-default=") (${ VSub_Name CLUSTER_IP_RANGE))} {(--secondary-range)} {(DQ ("services-default=") (${ VSub_Name SERVICE_CLUSTER_IP_RANGE))} ) (C {(echo)} {(DQ ("Created subnetwork ") (${ VSub_Name IP_ALIAS_SUBNETWORK))}) ] spids: [-1 6958] ) ] else_action: [ (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (C {(echo)} {(${ VSub_Name subnet)}) (C {(grep)} {(--quiet)} {(secondaryIpRanges)} {(${ VSub_Name subnet)}) ] negated: True ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} { (DQ (${ VSub_Name color_red) ("Subnet ") (${ VSub_Name IP_ALIAS_SUBNETWORK) (" does not have a secondary range") (${ VSub_Name color_norm) ) } ) (C {(exit)} {(1)}) ] spids: [-1 7153] ) ] spids: [-1 7178] ) ] spids: [7127 7181] ) ] spids: [6669] ) spids: [6663 6668] ) (FuncDef name: detect-subnetworks body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_n child: { (BracedVarSub token: <VSub_Name SUBNETWORK> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{}) spids: [7228 7231] ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} {(DQ ("Using subnet ") (${ VSub_Name SUBNETWORK))}) (ControlFlow token:<ControlFlow_Return return> arg_word:{(0)}) ] spids: [-1 7236] ) ] spids: [-1 7254] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_n child: { (BracedVarSub token: <VSub_Name IP_ALIAS_SUBNETWORK> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{}) spids: [7264 7267] ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:SUBNETWORK) op: Equal rhs: {(${ VSub_Name IP_ALIAS_SUBNETWORK)} spids: [7275] ) ] spids: [7275] ) (C {(echo)} {(DQ ("Using IP Alias subnet ") (${ VSub_Name SUBNETWORK))}) (ControlFlow token:<ControlFlow_Return return> arg_word:{(0)}) ] spids: [-1 7272] ) ] spids: [-1 7296] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:SUBNETWORK) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (SimpleCommand words: [ {(gcloud)} {(beta)} {(compute)} {(networks)} {(subnets)} {(list)} {(--network) (Lit_Other "=") (${ VSub_Name NETWORK)} {(--regions) (Lit_Other "=") (${ VSub_Name REGION)} {(--project) (Lit_Other "=") (${ VSub_Name NETWORK_PROJECT)} {(--limit) (Lit_Other "=") (1)} {(--format) (Lit_Other "=") (SQ <"value(name)">)} ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [7352] ) ] ) ] ) left_token: <Left_CommandSub "$("> spids: [7301 7354] ) } spids: [7300] ) ] spids: [7300] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_n child: { (BracedVarSub token: <VSub_Name SUBNETWORK> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{}) spids: [7364 7367] ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} { (DQ ("Found subnet for region ") (${ VSub_Name REGION) (" in network ") (${ VSub_Name NETWORK) (": ") (${ VSub_Name SUBNETWORK) ) } ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(0)}) ] spids: [-1 7372] ) ] spids: [-1 7398] ) (C {(echo)} { (DQ (${ VSub_Name color_red) ("Could not find subnetwork with region ") (${ VSub_Name REGION) (", network ") (${ VSub_Name NETWORK) (", and project ") (${ VSub_Name NETWORK_PROJECT) ) } ) ] spids: [7219] ) spids: [7213 7218] ) (FuncDef name: delete-all-firewall-rules body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:fws) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(gcloud)} {(compute)} {(firewall-rules)} {(list)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--filter) (Lit_Other "=") (DQ ("network=") (${ VSub_Name NETWORK)) } {(--format) (Lit_Other "=") (DQ ("value(name)"))} ) ] ) left_token: <Left_CommandSub "$("> spids: [7437 7468] ) } spids: [7436] ) ] spids: [7436] ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} { (DQ ("Deleting firewall rules remaining in network ") (${ VSub_Name NETWORK) (": ") (${ VSub_Name fws) ) } ) (C {(delete-firewall-rules)} {(DQ ($ VSub_Name "$fws"))}) ] spids: [-1 7471] ) ] else_action: [ (C {(echo)} {(DQ ("Failed to list firewall rules from the network ") (${ VSub_Name NETWORK))} ) ] spids: [7495 7508] ) ] spids: [7431] ) spids: [7425 7430] ) (FuncDef name: delete-firewall-rules body: (BraceGroup children: [ (ForEach iter_name: fw iter_words: [{($ VSub_At "$@")}] do_arg_iter: False body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_n child: { (CommandSubPart command_list: (CommandList children: [ (AndOr children: [ (SimpleCommand words: [ {(gcloud)} {(compute)} {(firewall-rules)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(describe)} {(DQ (${ VSub_Name fw))} {(--format) (Lit_Other "=") (SQ <"value(name)">) } ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [7569] ) ] ) (C {(true)}) ] op_id: Op_DPipe ) ] ) left_token: <Left_CommandSub "$("> spids: [7540 7575] ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (Sentence child: (C {(gcloud)} {(compute)} {(firewall-rules)} {(delete)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--quiet)} {(DQ (${ VSub_Name fw))} ) terminator: <Op_Amp "&"> ) ] spids: [-1 7580] ) ] spids: [-1 7610] ) ] spids: [7531 7613] ) spids: [7527 7529] ) (AndOr children: [ (C {(kube) (Lit_Other ":") (Lit_Other ":") (util) (Lit_Other ":") (Lit_Other ":") (wait-for-jobs) } ) (BraceGroup children: [ (SimpleCommand words: [ {(echo)} {(-e)} { (DQ (${ VSub_Name color_red) ("Failed to delete firewall rules.") (${ VSub_Name color_norm) ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[7643])] ) ] spids: [7626] ) ] op_id: Op_DPipe ) ] spids: [7519] ) spids: [7513 7518] ) (FuncDef name: delete-network body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_n child: { (CommandSubPart command_list: (CommandList children: [ (AndOr children: [ (SimpleCommand words: [ {(gcloud)} {(compute)} {(networks)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(describe)} {(DQ (${ VSub_Name NETWORK))} {(--format) (Lit_Other "=") (SQ <"value(name)">)} ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [7696] ) ] ) (C {(true)}) ] op_id: Op_DPipe ) ] ) left_token: <Left_CommandSub "$("> spids: [7667 7702] ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (C {(gcloud)} {(compute)} {(networks)} {(delete)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--quiet)} {(DQ (${ VSub_Name NETWORK))} ) ] negated: True ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} { (DQ ("Failed to delete network '") (${ VSub_Name NETWORK) ("'. Listing firewall-rules:") ) } ) (C {(gcloud)} {(compute)} {(firewall-rules)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(list)} {(--filter) (Lit_Other "=") (DQ ("network=") (${ VSub_Name NETWORK))} ) (ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] spids: [-1 7739] ) ] spids: [-1 7784] ) ] spids: [-1 7707] ) ] spids: [-1 7787] ) ] spids: [7658] ) spids: [7652 7657] ) (FuncDef name: delete-subnetworks body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: { (BracedVarSub token: <VSub_Name ENABLE_IP_ALIASES> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{}) spids: [7805 7808] ) } right: {(DQ (true))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:mode) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (AndOr children: [ (C {(gcloud)} {(compute)} {(networks)} {(list)} {(--filter) (Lit_Other "=") (DQ ("name=('") (${ VSub_Name NETWORK) ("')")) } {(--project)} {(${ VSub_Name NETWORK_PROJECT)} {(--format) (Lit_Other "=") (SQ <"value(x_gcloud_subnet_mode)">) } ) (C {(true)}) ] op_id: Op_DPipe ) ] ) left_token: <Left_CommandSub "$("> spids: [7828 7862] ) ) } spids: [7826] ) ] spids: [7826] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name mode))} right: {(DQ (CUSTOM))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobEqual left: {(DQ (${ VSub_Name ENABLE_BIG_CLUSTER_SUBNETS))} right: {(DQ (true))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} {(DQ ("Deleting default subnets..."))}) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:parallelism) op: Equal rhs: {(9)} spids: [7923] ) ] spids: [7921] ) (AndOr children: [ (Pipeline children: [ (C {(gcloud)} {(compute)} {(networks)} {(subnets)} {(list)} {(--network) (Lit_Other "=") (DQ (${ VSub_Name NETWORK))} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--format) (Lit_Other "=") (SQ <"value(region.basename())">) } ) (C {(xargs)} {(-i)} {(-P)} {(${ VSub_Name parallelism)} {(gcloud)} {(--quiet)} {(compute)} {(networks)} {(subnets)} {(delete)} {(DQ (${ VSub_Name NETWORK))} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--region) (Lit_Other "=") (DQ ("{}"))} ) ] negated: False ) (C {(true)}) ] op_id: Op_DPipe ) ] spids: [-1 7907] ) (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: { (DQ (BracedVarSub token: <VSub_Name CREATE_CUSTOM_NETWORK> suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: {(SQ )} ) spids: [8015 8018] ) ) } right: {(DQ (true))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} {(DQ ("Deleting custom subnet..."))}) (AndOr children: [ (C {(gcloud)} {(--quiet)} {(compute)} {(networks)} {(subnets)} {(delete)} {(DQ (${ VSub_Name SUBNETWORK))} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--region) (Lit_Other "=") (DQ (${ VSub_Name REGION))} ) (C {(true)}) ] op_id: Op_DPipe ) ] spids: [8010 8030] ) ] spids: [-1 8079] ) ] spids: [-1 7885] ) ] spids: [-1 8082] ) (ControlFlow token:<ControlFlow_Return return>) ] spids: [-1 7819] ) ] spids: [-1 8088] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(${ VSub_Name IP_ALIAS_SUBNETWORK)} right: {(${ VSub_Name INSTANCE_PREFIX) (-subnet-default)} ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} { (DQ ("Removing auto-created subnet ") (${ VSub_Name NETWORK) (":") (${ VSub_Name IP_ALIAS_SUBNETWORK) ) } ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_n child: { (CommandSubPart command_list: (CommandList children: [ (SimpleCommand words: [ {(gcloud)} {(beta)} {(compute)} {(networks)} {(subnets)} {(describe)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--region)} {(${ VSub_Name REGION)} {(${ VSub_Name IP_ALIAS_SUBNETWORK)} ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [8174] ) ] ) ] ) left_token: <Left_CommandSub "$("> spids: [8137 8176] ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(gcloud)} {(beta)} {(--quiet)} {(compute)} {(networks)} {(subnets)} {(delete)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--region)} {(${ VSub_Name REGION)} {(${ VSub_Name IP_ALIAS_SUBNETWORK)} ) ] spids: [-1 8181] ) ] spids: [-1 8223] ) ] spids: [-1 8114] ) ] spids: [-1 8226] ) ] spids: [7798] ) spids: [7792 7797] ) (FuncDef name: create-etcd-certs body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:host) op: Equal rhs: {(${ VSub_Number 1)} spids: [8297] ) ] spids: [8295] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:ca_cert) op: Equal rhs: { (BracedVarSub token: <VSub_Number 2> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{}) spids: [8306 8309] ) } spids: [8305] ) ] spids: [8303] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:ca_key) op: Equal rhs: { (BracedVarSub token: <VSub_Number 3> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{}) spids: [8315 8318] ) } spids: [8314] ) ] spids: [8312] ) (SimpleCommand words: [ {(generate-etcd-cert)} {(DQ (${ VSub_Name KUBE_TEMP) (/cfssl))} {(DQ (${ VSub_Name host))} {(DQ (peer))} {(DQ (peer))} ] more_env: [ (env_pair name: GEN_ETCD_CA_CERT val: {(DQ (${ VSub_Name ca_cert))} spids: [8322] ) (env_pair name: GEN_ETCD_CA_KEY val: {(DQ (${ VSub_Name ca_key))} spids: [8329] ) ] ) (C {(pushd)} {(DQ (${ VSub_Name KUBE_TEMP) (/cfssl))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ETCD_CA_KEY_BASE64) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} {(DQ (ca-key.pem))}) (C {(base64)}) (C {(tr)} {(-d)} {(SQ <"\\r\\n">)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [8374 8394] ) } spids: [8373] ) ] spids: [8373] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ETCD_CA_CERT_BASE64) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} {(DQ (ca.pem))}) (C {(gzip)}) (C {(base64)}) (C {(tr)} {(-d)} {(SQ <"\\r\\n">)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [8398 8422] ) } spids: [8397] ) ] spids: [8397] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ETCD_PEER_KEY_BASE64) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} {(DQ (peer-key.pem))}) (C {(base64)}) (C {(tr)} {(-d)} {(SQ <"\\r\\n">)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [8426 8446] ) } spids: [8425] ) ] spids: [8425] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ETCD_PEER_CERT_BASE64) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} {(DQ (peer.pem))}) (C {(gzip)}) (C {(base64)}) (C {(tr)} {(-d)} {(SQ <"\\r\\n">)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [8450 8474] ) } spids: [8449] ) ] spids: [8449] ) (C {(popd)}) ] spids: [8292] ) spids: [8288 8291] ) (FuncDef name: create-master body: (BraceGroup children: [ (C {(echo)} {(DQ ("Starting master and configuring firewalls"))}) (Sentence child: (C {(gcloud)} {(compute)} {(firewall-rules)} {(create)} {(DQ (${ VSub_Name MASTER_NAME) (-https))} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--network)} {(DQ (${ VSub_Name NETWORK))} {(--target-tags)} {(DQ (${ VSub_Name MASTER_TAG))} {(--allow)} {(tcp) (Lit_Other ":") (443)} ) terminator: <Op_Amp "&"> ) (C {(gcloud)} {(compute)} {(disks)} {(create)} {(DQ (${ VSub_Name MASTER_NAME) (-pd))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--type)} {(DQ (${ VSub_Name MASTER_DISK_TYPE))} {(--size)} {(DQ (${ VSub_Name MASTER_DISK_SIZE))} ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalAnd left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name ENABLE_CLUSTER_REGISTRY))} right: {(true)} ) right: (BoolUnary op_id: BoolUnary_n child: {(DQ (${ VSub_Name CLUSTER_REGISTRY_DISK))} ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (Sentence child: (C {(gcloud)} {(compute)} {(disks)} {(create)} {(DQ (${ VSub_Name CLUSTER_REGISTRY_DISK))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--type)} {(DQ (${ VSub_Name CLUSTER_REGISTRY_DISK_TYPE_GCE))} {(--size)} {(DQ (${ VSub_Name CLUSTER_REGISTRY_DISK_SIZE))} ) terminator: <Op_Amp "&"> ) ] spids: [-1 8651] ) ] spids: [-1 8711] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (C {(gcloud)} {(compute)} {(firewall-rules)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(describe)} {(DQ (${ VSub_Name MASTER_NAME) (-etcd))} ) ] negated: True ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [8747] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (Sentence child: (C {(gcloud)} {(compute)} {(firewall-rules)} {(create)} {(DQ (${ VSub_Name MASTER_NAME) (-etcd))} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--network)} {(DQ (${ VSub_Name NETWORK))} {(--source-tags)} {(DQ (${ VSub_Name MASTER_TAG))} {(--allow)} {(DQ ("tcp:2380,tcp:2381"))} {(--target-tags)} {(DQ (${ VSub_Name MASTER_TAG))} ) terminator: <Op_Amp "&"> ) ] spids: [-1 8751] ) ] spids: [-1 8820] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBELET_TOKEN) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (SimpleCommand words: [ {(dd)} {(Lit_VarLike "if=") (/dev/urandom)} {(Lit_VarLike "bs=") (128)} {(Lit_VarLike "count=") (1)} ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [8853] ) ] ) (C {(base64)}) (C {(tr)} {(-d)} {(DQ ("=+/"))}) (SimpleCommand words: [ {(dd)} {(Lit_VarLike "bs=") (32)} {(Lit_VarLike "count=") (1)} ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [8880] ) ] ) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [8841 8882] ) } spids: [8840] ) ] spids: [8840] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_PROXY_TOKEN) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (SimpleCommand words: [ {(dd)} {(Lit_VarLike "if=") (/dev/urandom)} {(Lit_VarLike "bs=") (128)} {(Lit_VarLike "count=") (1)} ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [8898] ) ] ) (C {(base64)}) (C {(tr)} {(-d)} {(DQ ("=+/"))}) (SimpleCommand words: [ {(dd)} {(Lit_VarLike "bs=") (32)} {(Lit_VarLike "count=") (1)} ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [8925] ) ] ) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [8886 8927] ) } spids: [8885] ) ] spids: [8885] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: { (DQ (BracedVarSub token: <VSub_Name ENABLE_NODE_PROBLEM_DETECTOR> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [8935 8938] ) ) } right: {(DQ (standalone))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:NODE_PROBLEM_DETECTOR_TOKEN) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (SimpleCommand words: [ {(dd)} {(Lit_VarLike "if=") (/dev/urandom)} {(Lit_VarLike "bs=") (128)} {(Lit_VarLike "count=") (1)} ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [8966] ) ] ) (C {(base64)}) (C {(tr)} {(-d)} {(DQ ("=+/"))}) (SimpleCommand words: [ {(dd)} {(Lit_VarLike "bs=") (32)} {(Lit_VarLike "count=") (1)} ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [8993] ) ] ) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [8954 8995] ) } spids: [8953] ) ] spids: [8953] ) ] spids: [-1 8950] ) ] spids: [-1 8998] ) (C {(create-static-ip)} {(DQ (${ VSub_Name MASTER_NAME) (-ip))} {(DQ (${ VSub_Name REGION))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:MASTER_RESERVED_IP) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(gcloud)} {(compute)} {(addresses)} {(describe)} {(DQ (${ VSub_Name MASTER_NAME) (-ip))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--region)} {(DQ (${ VSub_Name REGION))} {(-q)} {(--format) (Lit_Other "=") (SQ <"value(address)">)} ) ] ) left_token: <Left_CommandSub "$("> spids: [9027 9068] ) } spids: [9026] ) ] spids: [9026] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: { (DQ (BracedVarSub token: <VSub_Name REGISTER_MASTER_KUBELET> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [9077 9080] ) ) } right: {(DQ (true))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBELET_APISERVER) op: Equal rhs: {(DQ (${ VSub_Name MASTER_RESERVED_IP))} spids: [9095] ) ] spids: [9095] ) ] spids: [-1 9092] ) ] spids: [-1 9103] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBERNETES_MASTER_NAME) op: Equal rhs: {(DQ (${ VSub_Name MASTER_RESERVED_IP))} spids: [9107] ) ] spids: [9107] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:MASTER_ADVERTISE_ADDRESS) op: Equal rhs: {(DQ (${ VSub_Name MASTER_RESERVED_IP))} spids: [9115] ) ] spids: [9115] ) (C {(create-certs)} {(DQ (${ VSub_Name MASTER_RESERVED_IP))}) (C {(create-etcd-certs)} {(${ VSub_Name MASTER_NAME)}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_ge left: {(DQ (${ VSub_Name NUM_NODES))} right: {(DQ (50))} ) ) terminator: <Op_Semi ";"> ) ] action: [(C {(create-master-instance)} {(DQ (${ VSub_Name MASTER_RESERVED_IP))})] spids: [-1 9160] ) ] else_action: [ (Sentence child: (C {(create-master-instance)} {(DQ (${ VSub_Name MASTER_RESERVED_IP))}) terminator: <Op_Amp "&"> ) ] spids: [9180 9194] ) ] spids: [8488] ) spids: [8482 8487] ) (FuncDef name: add-replica-to-etcd body: (BraceGroup children: [ (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:client_port) op: Equal rhs: {(DQ (${ VSub_Number 1))} spids: [9245] ) ] spids: [9241] ) (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:internal_port) op: Equal rhs: {(DQ (${ VSub_Number 2))} spids: [9257] ) ] spids: [9253] ) (C {(gcloud)} {(compute)} {(ssh)} {(DQ (${ VSub_Name EXISTING_MASTER_NAME))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone)} {(DQ (${ VSub_Name EXISTING_MASTER_ZONE))} {(--command)} { (DQ ("curl localhost:") (${ VSub_Name client_port) ("/v2/members -XPOST -H ") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ("Content-Type: application/json") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (" -d '{") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (peerURLs) (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (":[") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ("https://") (${ VSub_Name REPLICA_NAME) (":") (${ VSub_Name internal_port) (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) ("]}' -s") ) } ) (ControlFlow token:<ControlFlow_Return return> arg_word:{($ VSub_QMark "$?")}) ] spids: [9238] ) spids: [9232 9237] ) (FuncDef name: set-existing-master body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:existing_master) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(gcloud)} {(compute)} {(instances)} {(list)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--filter)} { (DQ ("name ~ '") (CommandSubPart command_list: (CommandList children: [(C {(get-replica-name-regexp)})] ) left_token: <Left_CommandSub "$("> spids: [9393 9395] ) ("'") ) } {(--format)} {(DQ ("value(name,zone)"))} ) (C {(head)} {(-n1)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [9368 9412] ) } spids: [9367] ) ] spids: [9365] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:EXISTING_MASTER_NAME) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ (${ VSub_Name existing_master))}) (C {(cut)} {(-f1)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [9417 9431] ) ) } spids: [9415] ) ] spids: [9415] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:EXISTING_MASTER_ZONE) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ (${ VSub_Name existing_master))}) (C {(cut)} {(-f2)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [9437 9451] ) ) } spids: [9435] ) ] spids: [9435] ) ] spids: [9362] ) spids: [9356 9361] ) (FuncDef name: replicate-master body: (BraceGroup children: [ (C {(set-replica-name)}) (C {(set-existing-master)}) (C {(echo)} { (DQ ("Experimental: replicating existing master ") (${ VSub_Name EXISTING_MASTER_ZONE) (/) (${ VSub_Name EXISTING_MASTER_NAME) (" as ") (${ VSub_Name ZONE) (/) (${ VSub_Name REPLICA_NAME) ) } ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [(C {(add-replica-to-etcd)} {(2379)} {(2380)})] negated: True ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} {(DQ ("Failed to add master replica to etcd cluster."))}) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [-1 9511] ) ] spids: [-1 9526] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [(C {(add-replica-to-etcd)} {(4002)} {(2381)})] negated: True ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} {(DQ ("Failed to add master replica to etcd events cluster."))}) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [-1 9540] ) ] spids: [-1 9555] ) (C {(gcloud)} {(compute)} {(disks)} {(create)} {(DQ (${ VSub_Name REPLICA_NAME) (-pd))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--type)} {(DQ (${ VSub_Name MASTER_DISK_TYPE))} {(--size)} {(DQ (${ VSub_Name MASTER_DISK_SIZE))} ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:existing_master_replicas) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children:[(C {(get-all-replica-names)})]) left_token: <Left_CommandSub "$("> spids: [9628 9630] ) ) } spids: [9626] ) ] spids: [9624] ) (C {(replicate-master-instance)} {(DQ (${ VSub_Name EXISTING_MASTER_ZONE))} {(DQ (${ VSub_Name EXISTING_MASTER_NAME))} {(DQ (${ VSub_Name existing_master_replicas))} ) (C {(gcloud)} {(compute)} {(target-pools)} {(add-instances)} {(DQ (${ VSub_Name MASTER_NAME))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--instances)} {(DQ (${ VSub_Name REPLICA_NAME))} ) ] spids: [9463] ) spids: [9457 9462] ) (FuncDef name: attach-external-ip body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:NAME) op: Equal rhs: {(${ VSub_Number 1)} spids: [9736] ) ] spids: [9734] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:ZONE) op: Equal rhs: {(${ VSub_Number 2)} spids: [9744] ) ] spids: [9742] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:IP_ADDR) op: Equal rhs: { (BracedVarSub token: <VSub_Number 3> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{}) spids: [9753 9756] ) } spids: [9752] ) ] spids: [9750] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:ACCESS_CONFIG_NAME) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(gcloud)} {(compute)} {(instances)} {(describe)} {(DQ (${ VSub_Name NAME))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--format) (Lit_Other "=") (DQ ("value(networkInterfaces[0].accessConfigs[0].name)")) } ) ] ) left_token: <Left_CommandSub "$("> spids: [9762 9802] ) } spids: [9761] ) ] spids: [9759] ) (C {(gcloud)} {(compute)} {(instances)} {(delete-access-config)} {(DQ (${ VSub_Name NAME))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--access-config-name)} {(DQ (${ VSub_Name ACCESS_CONFIG_NAME))} ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id:BoolUnary_z child:{(${ VSub_Name IP_ADDR)}) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(gcloud)} {(compute)} {(instances)} {(add-access-config)} {(DQ (${ VSub_Name NAME))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--access-config-name)} {(DQ (${ VSub_Name ACCESS_CONFIG_NAME))} ) ] spids: [-1 9861] ) ] else_action: [ (C {(gcloud)} {(compute)} {(instances)} {(add-access-config)} {(DQ (${ VSub_Name NAME))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--access-config-name)} {(DQ (${ VSub_Name ACCESS_CONFIG_NAME))} {(--address)} {(DQ (${ VSub_Name IP_ADDR))} ) ] spids: [9907 9963] ) ] spids: [9731] ) spids: [9725 9730] ) (FuncDef name: create-loadbalancer body: (BraceGroup children: [ (C {(detect-master)}) (If arms: [ (if_arm cond: [ (Sentence child: (SimpleCommand words: [ {(gcloud)} {(compute)} {(forwarding-rules)} {(describe)} {(${ VSub_Name MASTER_NAME)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--region)} {(${ VSub_Name REGION)} ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [10039] ) (Redir op_id: Redir_GreatAnd fd: 2 arg_word: {(1)} spids: [10043] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} {(DQ ("Load balancer already exists"))}) (ControlFlow token:<ControlFlow_Return return>) ] spids: [-1 10047] ) ] spids: [-1 10060] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:EXISTING_MASTER_NAME) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children:[(C {(get-all-replica-names)})]) left_token: <Left_CommandSub "$("> spids: [10068 10070] ) ) } spids: [10066] ) ] spids: [10064] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:EXISTING_MASTER_ZONE) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(gcloud)} {(compute)} {(instances)} {(list)} {(DQ (${ VSub_Name EXISTING_MASTER_NAME))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--format) (Lit_Other "=") (DQ ("value(zone)"))} ) ] ) left_token: <Left_CommandSub "$("> spids: [10077 10107] ) } spids: [10076] ) ] spids: [10074] ) (C {(echo)} { (DQ ("Creating load balancer in front of an already existing master in ") (${ VSub_Name EXISTING_MASTER_ZONE) ) } ) (C {(attach-external-ip)} {(DQ (${ VSub_Name EXISTING_MASTER_NAME))} {(DQ (${ VSub_Name EXISTING_MASTER_ZONE))} ) (C {(gcloud)} {(compute)} {(target-pools)} {(create)} {(DQ (${ VSub_Name MASTER_NAME))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--region)} {(DQ (${ VSub_Name REGION))} ) (C {(gcloud)} {(compute)} {(target-pools)} {(add-instances)} {(DQ (${ VSub_Name MASTER_NAME))} {(--instances)} {(DQ (${ VSub_Name EXISTING_MASTER_NAME))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone)} {(DQ (${ VSub_Name EXISTING_MASTER_ZONE))} ) (C {(gcloud)} {(compute)} {(forwarding-rules)} {(create)} {(${ VSub_Name MASTER_NAME)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--region)} {(${ VSub_Name REGION)} {(--target-pool)} {(${ VSub_Name MASTER_NAME)} {(--address) (Lit_Other "=") (${ VSub_Name KUBE_MASTER_IP)} {(--ports) (Lit_Other "=") (443)} ) (C {(echo)} {(-n)} {(DQ ("Waiting for the load balancer configuration to propagate..."))}) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:counter) op:Equal rhs:{(0)} spids:[10288])] spids: [10286] ) (Until cond: [ (Sentence child: (C { (CommandSubPart command_list: (CommandList children: [ (Sentence child: (C {(curl)} {(-k)} {(-m1)} {(https) (Lit_Other ":") (//) (${ VSub_Name KUBE_MASTER_IP)} ) terminator: <Op_Amp "&"> ) (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [10309] ) ] ) ] ) left_token: <Left_CommandSub "$("> spids: [10294 10312] ) } ) terminator: <Op_Semi ";"> ) ] body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:counter) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithVarRef name:counter) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [10319 10324] ) } spids: [10318] ) ] spids: [10318] ) (C {(echo)} {(-n)} {(.)}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_ge left: {(${ VSub_Name counter)} right: {(1800)} ) ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} {(-e)} {(DQ (${ VSub_Name color_red) (TIMEOUT) (${ VSub_Name color_norm))} ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [10366] ) ] ) (SimpleCommand words: [ {(echo)} {(-e)} { (DQ (${ VSub_Name color_red) ("Load balancer failed to initialize within ") (${ VSub_Name counter) (" seconds.") (${ VSub_Name color_norm) ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [10388] ) ] ) (C {(exit)} {(2)}) ] spids: [-1 10349] ) ] spids: [-1 10397] ) ] spids: [10315 10400] ) ) (C {(echo)} {(DQ (DONE))}) ] spids: [9998] ) spids: [9992 9997] ) (FuncDef name: create-nodes-firewall body: (BraceGroup children: [ (Sentence child: (C {(create-firewall-rule)} {(DQ (${ VSub_Name NODE_TAG) (-all))} {(DQ (${ VSub_Name CLUSTER_IP_RANGE))} {(DQ (${ VSub_Name NODE_TAG))} ) terminator: <Op_Amp "&"> ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: { (DQ (BracedVarSub token: <VSub_Name ENABLE_NODE_LOGGING> suffix_op: (StringUnary op_id:VTest_Hyphen arg_word:{(SQ )}) spids: [10459 10462] ) ) } right: {(DQ (true))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} { (DQ ("+++ Logging using Fluentd to ") (BracedVarSub token: <VSub_Name LOGGING_DESTINATION> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(unknown)}) spids: [10481 10485] ) ) } ) ] spids: [-1 10474] ) ] spids: [-1 10489] ) (AndOr children: [ (C {(kube) (Lit_Other ":") (Lit_Other ":") (util) (Lit_Other ":") (Lit_Other ":") (wait-for-jobs) } ) (BraceGroup children: [ (SimpleCommand words: [ {(echo)} {(-e)} { (DQ (${ VSub_Name color_red) ("Some commands failed.") (${ VSub_Name color_norm) ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[10524])] ) ] spids: [10507] ) ] op_id: Op_DPipe ) ] spids: [10418] ) spids: [10412 10417] ) (FuncDef name: get-scope-flags body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:scope_flags) op:Equal rhs:{(SQ )} spids:[10544])] spids: [10542] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id:BoolUnary_n child:{(DQ (${ VSub_Name NODE_SCOPES))}) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:scope_flags) op: Equal rhs: {(DQ ("--scopes ") (${ VSub_Name NODE_SCOPES))} spids: [10565] ) ] spids: [10565] ) ] spids: [-1 10562] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:scope_flags) op: Equal rhs: {(DQ (--no-scopes))} spids: [10577] ) ] spids: [10577] ) ] spids: [10574 10583] ) (C {(echo)} {(DQ (${ VSub_Name scope_flags))}) ] spids: [10539] ) spids: [10533 10538] ) (FuncDef name: create-nodes-template body: (BraceGroup children: [ (C {(echo)} {(DQ ("Creating nodes."))}) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:scope_flags) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(get-scope-flags)})]) left_token: <Left_CommandSub "$("> spids: [10617 10619] ) } spids: [10616] ) ] spids: [10614] ) (C {(write-node-env)}) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:template_name) op: Equal rhs: {(DQ (${ VSub_Name NODE_INSTANCE_PREFIX) (-template))} spids: [10629] ) ] spids: [10627] ) (C {(create-node-instance-template)} {($ VSub_Name "$template_name")}) ] spids: [10603] ) spids: [10597 10602] ) (FuncDef name: set_num_migs body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:defaulted_max_instances_per_mig) op: Equal rhs: { (BracedVarSub token: <VSub_Name MAX_INSTANCES_PER_MIG> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(1000)}) spids: [10672 10676] ) } spids: [10671] ) ] spids: [10669] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_le left: {(${ VSub_Name defaulted_max_instances_per_mig)} right: {(DQ (0))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} {(DQ ("MAX_INSTANCES_PER_MIG cannot be negative. Assuming default 1000"))} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:defaulted_max_instances_per_mig) op: Equal rhs: {(1000)} spids: [10707] ) ] spids: [10707] ) ] spids: [-1 10697] ) ] spids: [-1 10711] ) (C {(export)} {(Lit_VarLike "NUM_MIGS=") (ArithSubPart anode: (ArithBinary op_id: Arith_Slash left: (ArithBinary op_id: Arith_Minus left: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{(${ VSub_Name NUM_NODES)}) right: (ArithWord w:{(${ VSub_Name defaulted_max_instances_per_mig)}) ) right: (ArithWord w:{(Lit_Digits 1)}) ) right: (ArithWord w:{(${ VSub_Name defaulted_max_instances_per_mig)}) ) spids: [10717 10740] ) } ) ] spids: [10666] ) spids: [10660 10665] ) (FuncDef name: create-nodes body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:template_name) op: Equal rhs: {(DQ (${ VSub_Name NODE_INSTANCE_PREFIX) (-template))} spids: [10774] ) ] spids: [10772] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_z child: { (DQ (BracedVarSub token: <VSub_Name HEAPSTER_MACHINE_TYPE> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [10791 10794] ) ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:nodes) op: Equal rhs: {(DQ (${ VSub_Name NUM_NODES))} spids: [10807] ) ] spids: [10803] ) ] spids: [-1 10800] ) ] else_action: [ (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:nodes) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithVarRef name:NUM_NODES) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [10823 10832] ) } spids: [10822] ) ] spids: [10818] ) ] spids: [10815 10835] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:instances_left) op: Equal rhs: {(${ VSub_Name nodes)} spids: [10841] ) ] spids: [10839] ) (ForExpr init: (BinaryAssign op_id: Arith_Equal left: (LhsName name:i) right: (ArithWord w:{(Lit_Digits 1)}) ) cond: (ArithBinary op_id: Arith_LessEqual left: (ArithVarRef name:i) right: (ArithWord w:{(${ VSub_Name NUM_MIGS)}) ) update: (UnaryAssign op_id:Node_PostDPlus child:(LhsName name:i)) body: (DoGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:group_name) op: Equal rhs: {(DQ (${ VSub_Name NODE_INSTANCE_PREFIX) (-group-) ($ VSub_Name "$i"))} spids: [10878] ) ] spids: [10876] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name "$i")} right: {(${ VSub_Name NUM_MIGS)} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:group_name) op: Equal rhs: {(DQ (${ VSub_Name NODE_INSTANCE_PREFIX) (-group))} spids: [10914] ) ] spids: [10914] ) ] spids: [-1 10903] ) ] spids: [-1 10923] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:this_mig_size) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Slash left: (ArithWord w:{(${ VSub_Name instances_left)}) right: (ArithBinary op_id: Arith_Plus left: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{(${ VSub_Name NUM_MIGS)}) right: (ArithWord w:{(${ VSub_Name i)}) ) right: (ArithWord w:{(Lit_Digits 1)}) ) ) spids: [10931 10950] ) } spids: [10930] ) ] spids: [10930] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:instances_left) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithVarRef name:instances_left) right: (ArithWord w:{(${ VSub_Name this_mig_size)}) ) spids: [10954 10961] ) } spids: [10953] ) ] spids: [10953] ) (Sentence child: (AndOr children: [ (C {(gcloud)} {(compute)} {(instance-groups)} {(managed)} {(create)} {(DQ (${ VSub_Name group_name))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--base-instance-name)} {(DQ (${ VSub_Name group_name))} {(--size)} {(DQ (${ VSub_Name this_mig_size))} {(--template)} {(DQ ($ VSub_Name "$template_name"))} ) (C {(true)}) ] op_id: Op_DPipe ) terminator: <Op_Semi ";"> ) (Sentence child: (AndOr children: [ (C {(gcloud)} {(compute)} {(instance-groups)} {(managed)} {(wait-until-stable)} {(DQ (${ VSub_Name group_name))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--project)} {(DQ (${ VSub_Name PROJECT))} ) (C {(true)}) ] op_id: Op_DPipe ) terminator: <Op_Semi ";"> ) ] spids: [10873 11081] ) ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_n child: { (DQ (BracedVarSub token: <VSub_Name HEAPSTER_MACHINE_TYPE> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [11092 11095] ) ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} { (DQ ("Creating a special node for heapster with machine-type ") (${ VSub_Name HEAPSTER_MACHINE_TYPE) ) } ) (C {(create-heapster-node)}) ] spids: [-1 11101] ) ] spids: [-1 11117] ) ] spids: [10769] ) spids: [10763 10768] ) (FuncDef name: create-heapster-node body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:gcloud) op: Equal rhs: {(DQ (gcloud))} spids: [11181] ) ] spids: [11179] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: { (DQ (BracedVarSub token: <VSub_Name ENABLE_IP_ALIASES> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [11193 11196] ) ) } right: {(SQ <true>)} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:gcloud) op: Equal rhs: {(DQ ("gcloud beta"))} spids: [11211] ) ] spids: [11211] ) ] spids: [-1 11208] ) ] spids: [-1 11217] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:network) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(make-gcloud-network-argument)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(DQ (${ VSub_Name REGION))} {(DQ (${ VSub_Name NETWORK))} { (DQ (BracedVarSub token: <VSub_Name SUBNETWORK> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [11254 11257] ) ) } {(DQ )} { (DQ (BracedVarSub token: <VSub_Name ENABLE_IP_ALIASES> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [11268 11271] ) ) } { (DQ (BracedVarSub token: <VSub_Name IP_ALIAS_SIZE> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [11277 11280] ) ) } ) ] ) left_token: <Left_CommandSub "$("> spids: [11224 11282] ) } spids: [11223] ) ] spids: [11221] ) (C {(${ VSub_Name gcloud)} {(compute)} {(instances)} {(create)} {(DQ (${ VSub_Name NODE_INSTANCE_PREFIX) (-heapster))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--machine-type) (Lit_Other "=") (DQ (${ VSub_Name HEAPSTER_MACHINE_TYPE))} {(--boot-disk-type)} {(DQ (${ VSub_Name NODE_DISK_TYPE))} {(--boot-disk-size)} {(DQ (${ VSub_Name NODE_DISK_SIZE))} {(--image-project) (Lit_Other "=") (DQ (${ VSub_Name NODE_IMAGE_PROJECT))} {(--image)} {(DQ (${ VSub_Name NODE_IMAGE))} {(--tags)} {(DQ (${ VSub_Name NODE_TAG))} {(${ VSub_Name network)} { (CommandSubPart command_list: (CommandList children:[(C {(get-scope-flags)})]) left_token: <Left_CommandSub "$("> spids: [11393 11395] ) } {(--metadata-from-file)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(get-node-instance-metadata)})]) left_token: <Left_CommandSub "$("> spids: [11402 11404] ) ) } ) ] spids: [11176] ) spids: [11170 11175] ) (FuncDef name: create-cluster-autoscaler-mig-config body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_lt left: {(${ VSub_Name AUTOSCALER_MIN_NODES)} right: {(0)} ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} {(DQ ("AUTOSCALER_MIN_NODES must be greater or equal 0"))}) (C {(exit)} {(2)}) ] spids: [-1 11470] ) ] spids: [-1 11485] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_lt left: {(${ VSub_Name AUTOSCALER_MAX_NODES)} right: {(${ VSub_Name NUM_MIGS)} ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} { (DQ ("AUTOSCALER_MAX_NODES must be greater or equal ") (${ VSub_Name NUM_MIGS)) } ) (C {(exit)} {(2)}) ] spids: [-1 11514] ) ] spids: [-1 11532] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:AUTOSCALER_MIG_CONFIG) op: Equal rhs: {(DQ )} spids: [11544] ) ] spids: [11544] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:left_min) op: Equal rhs: {(${ VSub_Name AUTOSCALER_MIN_NODES)} spids: [11552] ) ] spids: [11550] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:left_max) op: Equal rhs: {(${ VSub_Name AUTOSCALER_MAX_NODES)} spids: [11560] ) ] spids: [11558] ) (ForExpr init: (BinaryAssign op_id: Arith_Equal left: (LhsName name:i) right: (ArithWord w:{(Lit_Digits 1)}) ) cond: (ArithBinary op_id: Arith_LessEqual left: (ArithVarRef name:i) right: (ArithWord w:{(${ VSub_Name NUM_MIGS)}) ) update: (UnaryAssign op_id:Node_PostDPlus child:(LhsName name:i)) body: (DoGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:group_name) op: Equal rhs: {(DQ (${ VSub_Name NODE_INSTANCE_PREFIX) (-group-) ($ VSub_Name "$i"))} spids: [11593] ) ] spids: [11591] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name "$i")} right: {(${ VSub_Name NUM_MIGS)} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:group_name) op: Equal rhs: {(DQ (${ VSub_Name NODE_INSTANCE_PREFIX) (-group))} spids: [11629] ) ] spids: [11629] ) ] spids: [-1 11618] ) ] spids: [-1 11638] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:this_mig_min) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Slash left: (ArithWord w:{(${ VSub_Name left_min)}) right: (ArithBinary op_id: Arith_Plus left: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{(${ VSub_Name NUM_MIGS)}) right: (ArithWord w:{(${ VSub_Name i)}) ) right: (ArithWord w:{(Lit_Digits 1)}) ) ) spids: [11643 11660] ) } spids: [11642] ) ] spids: [11642] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:this_mig_max) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Slash left: (ArithWord w:{(${ VSub_Name left_max)}) right: (ArithBinary op_id: Arith_Plus left: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{(${ VSub_Name NUM_MIGS)}) right: (ArithWord w:{(${ VSub_Name i)}) ) right: (ArithWord w:{(Lit_Digits 1)}) ) ) spids: [11664 11681] ) } spids: [11663] ) ] spids: [11663] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:left_min) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithVarRef name:left_min) right: (ArithWord w:{($ VSub_Name "$this_mig_min")}) ) spids: [11685 11690] ) } spids: [11684] ) ] spids: [11684] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:left_max) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithVarRef name:left_max) right: (ArithWord w:{($ VSub_Name "$this_mig_max")}) ) spids: [11694 11699] ) } spids: [11693] ) ] spids: [11693] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:mig_url) op: Equal rhs: { (DQ ("https://www.googleapis.com/compute/v1/projects/") (${ VSub_Name PROJECT) (/zones/) (${ VSub_Name ZONE) (/instanceGroups/) (${ VSub_Name group_name) ) } spids: [11705] ) ] spids: [11703] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:AUTOSCALER_MIG_CONFIG) op: Equal rhs: { (DQ (${ VSub_Name AUTOSCALER_MIG_CONFIG) (" --nodes=") (${ VSub_Name this_mig_min) (":") (${ VSub_Name this_mig_max) (":") (${ VSub_Name mig_url) ) } spids: [11722] ) ] spids: [11722] ) ] spids: [11588 11742] ) ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:AUTOSCALER_MIG_CONFIG) op: Equal rhs: { (DQ (${ VSub_Name AUTOSCALER_MIG_CONFIG) (" --scale-down-enabled=") (${ VSub_Name AUTOSCALER_ENABLE_SCALE_DOWN) ) } spids: [11746] ) ] spids: [11746] ) ] spids: [11443] ) spids: [11437 11442] ) (FuncDef name: create-autoscaler-config body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name ENABLE_CLUSTER_AUTOSCALER))} right: {(DQ (true))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(create-cluster-autoscaler-mig-config)}) (C {(echo)} { (DQ ("Using autoscaler config: ") (${ VSub_Name AUTOSCALER_MIG_CONFIG) (" ") (${ VSub_Name AUTOSCALER_EXPANDER_CONFIG) ) } ) ] spids: [-1 11816] ) ] spids: [-1 11836] ) ] spids: [11790] ) spids: [11784 11789] ) (FuncDef name: check-cluster body: (BraceGroup children: [ (C {(detect-node-names)}) (C {(detect-master)}) (C {(echo)} { (DQ ("Waiting up to ") (${ VSub_Name KUBE_CLUSTER_INITIALIZATION_TIMEOUT) (" seconds for cluster initialization.") ) } ) (C {(echo)}) (C {(echo)} {(DQ (" This will continually check to see if the API for kubernetes is reachable."))} ) (C {(echo)} {(DQ (" This may time out if there was some uncaught error during start up."))}) (C {(echo)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:secure) op:Equal rhs:{(DQ )} spids:[11893])] spids: [11893] ) (If arms: [ (if_arm cond: [ (Sentence child: (SimpleCommand words: [{(which)} {(sw_vers)}] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(/dev/null)} spids: [11904] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobEqual left: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(sw_vers)}) (C {(grep)} {(ProductVersion)}) (C {(awk)} {(SQ <"{print $2}">)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [11916 11932] ) } right: {(DQ (10.9.)) (Lit_Other "*")} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:secure) op: Equal rhs: {(DQ (--insecure))} spids: [11947] ) ] spids: [11947] ) ] spids: [-1 11944] ) ] spids: [-1 11953] ) ] spids: [-1 11909] ) ] spids: [-1 11956] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:start_time) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(date)} {(Lit_Other "+") (Lit_Other "%") (s)})] ) left_token: <Left_CommandSub "$("> spids: [11963 11969] ) } spids: [11962] ) ] spids: [11960] ) (Until cond: [ (Sentence child: (C {(curl)} {(--cacert)} {(DQ (${ VSub_Name CERT_DIR) (/pki/ca.crt))} {(-H)} {(DQ ("Authorization: Bearer ") (${ VSub_Name KUBE_BEARER_TOKEN))} {(${ VSub_Name secure)} {(--max-time)} {(5)} {(--fail)} {(--output)} {(/dev/null)} {(--silent)} {(DQ ("https://") (${ VSub_Name KUBE_MASTER_IP) (/api/v1/pods))} ) terminator: <Op_Semi ";"> ) ] body: (DoGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:elapsed) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithWord w: { (CommandSubPart command_list: (CommandList children: [ (C {(date)} {(Lit_Other "+") (Lit_Other "%") (s)}) ] ) left_token: <Left_CommandSub "$("> spids: [12034 12040] ) } ) right: (ArithWord w:{(${ VSub_Name start_time)}) ) spids: [12033 12048] ) } spids: [12032] ) ] spids: [12030] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_gt left: {(${ VSub_Name elapsed)} right: {(${ VSub_Name KUBE_CLUSTER_INITIALIZATION_TIMEOUT)} ) ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} {(-e)} { (DQ (${ VSub_Name color_red) ("Cluster failed to initialize within ") (${ VSub_Name KUBE_CLUSTER_INITIALIZATION_TIMEOUT) (" seconds.") (${ VSub_Name color_norm) ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [12089] ) ] ) (C {(exit)} {(2)}) ] spids: [-1 12068] ) ] spids: [-1 12098] ) (C {(printf)} {(DQ (.))}) (C {(sleep)} {(2)}) ] spids: [12027 12113] ) ) (C {(echo)} {(DQ ("Kubernetes cluster created."))}) (C {(export)} {(Lit_VarLike "KUBE_CERT=") (DQ (${ VSub_Name CERT_DIR) (/pki/issued/kubecfg.crt))} ) (C {(export)} {(Lit_VarLike "KUBE_KEY=") (DQ (${ VSub_Name CERT_DIR) (/pki/private/kubecfg.key))} ) (C {(export)} {(Lit_VarLike "CA_CERT=") (DQ (${ VSub_Name CERT_DIR) (/pki/ca.crt))}) (C {(export)} {(Lit_VarLike "CONTEXT=") (DQ (${ VSub_Name PROJECT) (_) (${ VSub_Name INSTANCE_PREFIX)) } ) (Subshell child: (CommandList children: [ (C {(umask)} {(077)}) (C {(create-kubeconfig)}) (C {(create-kubeconfig-for-federation)}) ] ) spids: [12172 12192] ) (C {(get-kubeconfig-basicauth)}) (C {(echo)}) (C {(echo)} {(-e)} { (DQ (${ VSub_Name color_green) ("Kubernetes cluster is running. The master is running at:") ) } ) (C {(echo)}) (C {(echo)} {(-e)} {(DQ (${ VSub_Name color_yellow) (" https://") (${ VSub_Name KUBE_MASTER_IP))} ) (C {(echo)}) (C {(echo)} {(-e)} { (DQ (${ VSub_Name color_green) ("The user name and password to use is located in ") (${ VSub_Name KUBECONFIG) (.) (${ VSub_Name color_norm) ) } ) (C {(echo)}) ] spids: [11847] ) spids: [11841 11846] ) (FuncDef name: remove-replica-from-etcd body: (BraceGroup children: [ (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:port) op: Equal rhs: {(DQ (${ VSub_Number 1))} spids: [12307] ) ] spids: [12303] ) (AndOr children: [ (DBracket expr: (BoolUnary op_id:BoolUnary_n child:{(DQ (${ VSub_Name EXISTING_MASTER_NAME))}) ) (ControlFlow token:<ControlFlow_Return return>) ] op_id: Op_DPipe ) (C {(gcloud)} {(compute)} {(ssh)} {(DQ (${ VSub_Name EXISTING_MASTER_NAME))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone)} {(DQ (${ VSub_Name EXISTING_MASTER_ZONE))} {(--command)} { (DQ ("curl -s localhost:") (${ VSub_Name port) (/v2/members/) (EscapedLiteralPart token:<Lit_EscapedChar "\\$">) ("(curl -s localhost:") (${ VSub_Name port) ("/v2/members -XGET | sed 's/{") (EscapedLiteralPart token:<Lit_EscapedChar "\\\\">) (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (id/) (EscapedLiteralPart token:<Lit_EscapedChar "\\n">) ("/g' | grep ") (${ VSub_Name REPLICA_NAME) (EscapedLiteralPart token:<Lit_EscapedChar "\\\\">) (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (" | cut -f 3 -d ") (EscapedLiteralPart token:<Lit_EscapedChar "\\\\">) (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (") -XDELETE -L 2>/dev/null") ) } ) (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:res) op: Equal rhs: {($ VSub_QMark "$?")} spids: [12403] ) ] spids: [12399] ) (C {(echo)} { (DQ ("Removing etcd replica, name: ") (${ VSub_Name REPLICA_NAME) (", port: ") (${ VSub_Name port) (", result: ") (${ VSub_Name res) ) } ) (ControlFlow token: <ControlFlow_Return return> arg_word: {(DQ (${ VSub_Name res))} ) ] spids: [12300] ) spids: [12294 12299] ) (FuncDef name: kube-down body: (BraceGroup children: [ (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [(assign_pair lhs:(LhsName name:batch) op:Equal rhs:{(200)} spids:[12476])] spids: [12472] ) (C {(detect-project)}) (C {(detect-node-names)}) (C {(echo)} {(DQ ("Bringing down cluster"))}) (C {(set)} {(Lit_Other "+") (e)}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: { (DQ (BracedVarSub token: <VSub_Name KUBE_DELETE_NODES> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [12513 12516] ) ) } right: {(DQ (false))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:templates) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(get-template)} {(DQ (${ VSub_Name PROJECT))})] ) left_token: <Left_CommandSub "$("> spids: [12546 12554] ) } spids: [12545] ) ] spids: [12543] ) (ForEach iter_name: group iter_words: [ { (BracedVarSub token: <VSub_Name INSTANCE_GROUPS> bracket_op: (WholeArray op_id:Lit_At) suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{}) spids: [12564 12570] ) } ] do_arg_iter: False body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(gcloud)} {(compute)} {(instance-groups)} {(managed)} {(describe)} {(DQ (${ VSub_Name group))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone)} {(DQ (${ VSub_Name ZONE))} ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [12611] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (Sentence child: (C {(gcloud)} {(compute)} {(instance-groups)} {(managed)} {(delete)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--quiet)} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(DQ (${ VSub_Name group))} ) terminator: <Op_Amp "&"> ) ] spids: [-1 12615] ) ] spids: [-1 12663] ) ] spids: [12573 12666] ) spids: [12563 12571] ) (AndOr children: [ (C {(kube) (Lit_Other ":") (Lit_Other ":") (util) (Lit_Other ":") (Lit_Other ":") (wait-for-jobs) } ) (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(-e)} {(DQ ("Failed to delete instance group(s)."))}] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [12695] ) ] ) ] spids: [12684] ) ] op_id: Op_DPipe ) (ForEach iter_name: template iter_words: [ { (BracedVarSub token: <VSub_Name templates> bracket_op: (WholeArray op_id:Lit_At) suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{}) spids: [12709 12715] ) } ] do_arg_iter: False body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(gcloud)} {(compute)} {(instance-templates)} {(describe)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(DQ (${ VSub_Name template))} ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [12746] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (C {(gcloud)} {(compute)} {(instance-templates)} {(delete)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--quiet)} {(DQ (${ VSub_Name template))} ) ] spids: [-1 12750] ) ] spids: [-1 12784] ) ] spids: [12718 12787] ) spids: [12708 12716] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_n child: { (DQ (BracedVarSub token: <VSub_Name HEAPSTER_MACHINE_TYPE> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [12802 12805] ) ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:heapster_machine_name) op: Equal rhs: {(DQ (${ VSub_Name NODE_INSTANCE_PREFIX) (-heapster))} spids: [12818] ) ] spids: [12814] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(gcloud)} {(compute)} {(instances)} {(describe)} {(DQ (${ VSub_Name heapster_machine_name))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--project)} {(DQ (${ VSub_Name PROJECT))} ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [12860] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (C {(gcloud)} {(compute)} {(instances)} {(delete)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--quiet)} {(--delete-disks)} {(all)} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(DQ (${ VSub_Name heapster_machine_name))} ) ] spids: [-1 12864] ) ] spids: [-1 12918] ) ] spids: [-1 12811] ) ] spids: [-1 12921] ) ] spids: [-1 12528] ) ] spids: [-1 12924] ) (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:REPLICA_NAME) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name KUBE_REPLICA_NAME> suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: { (CommandSubPart command_list: (CommandList children:[(C {(get-replica-name)})]) left_token: <Left_CommandSub "$("> spids: [12937 12939] ) } ) spids: [12934 12940] ) ) } spids: [12932] ) ] spids: [12928] ) (C {(set-existing-master)}) (C {(remove-replica-from-etcd)} {(2379)}) (C {(remove-replica-from-etcd)} {(4002)}) (If arms: [ (if_arm cond: [ (Sentence child: (C {(gcloud)} {(compute)} {(instances)} {(describe)} {(DQ (${ VSub_Name REPLICA_NAME))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--project)} {(DQ (${ VSub_Name PROJECT))} ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [13001] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(gcloud)} {(compute)} {(target-pools)} {(describe)} {(DQ (${ VSub_Name MASTER_NAME))} {(--region)} {(DQ (${ VSub_Name REGION))} {(--project)} {(DQ (${ VSub_Name PROJECT))} ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [13045] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (C {(gcloud)} {(compute)} {(target-pools)} {(remove-instances)} {(DQ (${ VSub_Name MASTER_NAME))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--instances)} {(DQ (${ VSub_Name REPLICA_NAME))} ) ] spids: [-1 13049] ) ] spids: [-1 13097] ) (C {(gcloud)} {(compute)} {(instances)} {(delete)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--quiet)} {(--delete-disks)} {(all)} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(DQ (${ VSub_Name REPLICA_NAME))} ) ] spids: [-1 13005] ) ] spids: [-1 13151] ) (Assignment keyword: Assign_Local flags: ["'-r'"] pairs: [ (assign_pair lhs: (LhsName name:replica_pd) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name REPLICA_NAME> suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: {(${ VSub_Name MASTER_NAME)} ) spids: [13169 13175] ) (-pd) ) } spids: [13167] ) ] spids: [13163] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(gcloud)} {(compute)} {(disks)} {(describe)} {(DQ (${ VSub_Name replica_pd))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--project)} {(DQ (${ VSub_Name PROJECT))} ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [13213] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (C {(gcloud)} {(compute)} {(disks)} {(delete)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--quiet)} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(DQ (${ VSub_Name replica_pd))} ) ] spids: [-1 13217] ) ] spids: [-1 13261] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalAnd left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name ENABLE_CLUSTER_REGISTRY))} right: {(true)} ) right: (BoolUnary op_id: BoolUnary_n child: {(DQ (${ VSub_Name CLUSTER_REGISTRY_DISK))} ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(gcloud)} {(compute)} {(disks)} {(describe)} {(DQ (${ VSub_Name CLUSTER_REGISTRY_DISK))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--project)} {(DQ (${ VSub_Name PROJECT))} ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [13332] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (C {(gcloud)} {(compute)} {(disks)} {(delete)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--quiet)} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(DQ (${ VSub_Name CLUSTER_REGISTRY_DISK))} ) ] spids: [-1 13336] ) ] spids: [-1 13380] ) ] spids: [-1 13296] ) ] spids: [-1 13383] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:REMAINING_MASTER_COUNT) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(gcloud)} {(compute)} {(instances)} {(list)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--filter) (Lit_Other "=") (DQ ("name ~ '") (CommandSubPart command_list: (CommandList children: [(C {(get-replica-name-regexp)})] ) left_token: <Left_CommandSub "$("> spids: [13419 13421] ) ("'") ) } {(--format)} {(DQ ("value(zone)"))} ) (C {(wc)} {(-l)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [13394 13438] ) } spids: [13393] ) ] spids: [13391] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_eq left: {(DQ (${ VSub_Name REMAINING_MASTER_COUNT))} right: {(1)} ) ) terminator: <Op_Semi ";"> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(gcloud)} {(compute)} {(forwarding-rules)} {(describe)} {(DQ (${ VSub_Name MASTER_NAME))} {(--region)} {(DQ (${ VSub_Name REGION))} {(--project)} {(DQ (${ VSub_Name PROJECT))} ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [13499] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (C {(detect-master)}) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:REMAINING_REPLICA_NAME) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [(C {(get-all-replica-names)})] ) left_token: <Left_CommandSub "$("> spids: [13513 13515] ) ) } spids: [13511] ) ] spids: [13509] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:REMAINING_REPLICA_ZONE) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(gcloud)} {(compute)} {(instances)} {(list)} {(DQ (${ VSub_Name REMAINING_REPLICA_NAME))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--format) (Lit_Other "=") (DQ ("value(zone)"))} ) ] ) left_token: <Left_CommandSub "$("> spids: [13522 13552] ) } spids: [13521] ) ] spids: [13519] ) (C {(gcloud)} {(compute)} {(forwarding-rules)} {(delete)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--region)} {(DQ (${ VSub_Name REGION))} {(--quiet)} {(DQ (${ VSub_Name MASTER_NAME))} ) (C {(attach-external-ip)} {(DQ (${ VSub_Name REMAINING_REPLICA_NAME))} {(DQ (${ VSub_Name REMAINING_REPLICA_ZONE))} {(DQ (${ VSub_Name KUBE_MASTER_IP))} ) (C {(gcloud)} {(compute)} {(target-pools)} {(delete)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--region)} {(DQ (${ VSub_Name REGION))} {(--quiet)} {(DQ (${ VSub_Name MASTER_NAME))} ) ] spids: [-1 13503] ) ] spids: [-1 13658] ) ] spids: [-1 13463] ) ] spids: [-1 13661] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_eq left: {(DQ (${ VSub_Name REMAINING_MASTER_COUNT))} right: {(0)} ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(delete-firewall-rules)} {(DQ (${ VSub_Name MASTER_NAME) (-https))} {(DQ (${ VSub_Name MASTER_NAME) (-etcd))} {(DQ (${ VSub_Name NODE_TAG) (-all))} ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(gcloud)} {(compute)} {(addresses)} {(describe)} {(DQ (${ VSub_Name MASTER_NAME) (-ip))} {(--region)} {(DQ (${ VSub_Name REGION))} {(--project)} {(DQ (${ VSub_Name PROJECT))} ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [13755] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (C {(gcloud)} {(compute)} {(addresses)} {(delete)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--region)} {(DQ (${ VSub_Name REGION))} {(--quiet)} {(DQ (${ VSub_Name MASTER_NAME) (-ip))} ) ] spids: [-1 13759] ) ] spids: [-1 13804] ) ] spids: [-1 13686] ) ] spids: [-1 13807] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: { (DQ (BracedVarSub token: <VSub_Name KUBE_DELETE_NODES> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [13816 13819] ) ) } right: {(DQ (false))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_Local flags: ["'-a'"] pairs: [(assign_pair lhs:(LhsName name:minions) op:Equal spids:[13842])] spids: [13838] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:minions) op: Equal rhs: { (ArrayLiteralPart words: [ { (CommandSubPart command_list: (CommandList children: [ (C {(gcloud)} {(compute)} {(instances)} {(list)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--filter) (Lit_Other "=") (DQ ("name ~ '") (${ VSub_Name NODE_INSTANCE_PREFIX) ("-.+' AND zone:(") (${ VSub_Name ZONE) (")") ) } {(--format) (Lit_Other "=") (SQ <"value(name)">)} ) ] ) left_token: <Left_CommandSub "$("> spids: [13848 13890] ) } ] ) } spids: [13845] ) ] spids: [13845] ) (While cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_Great left: (ArithWord w: { (DQ (BracedVarSub token: <VSub_Name minions> prefix_op: VSub_Pound bracket_op: (WholeArray op_id:Lit_At) spids: [13904 13910] ) ) } ) right: (ArithWord w:{(Lit_Digits 0)}) ) ) terminator: <Op_Semi ";"> ) ] body: (DoGroup children: [ (C {(echo)} {(Deleting)} {(nodes)} { (DQ (BracedVarSub token: <VSub_Name minions> bracket_op: (WholeArray op_id:Arith_Star) suffix_op: (Slice length:(ArithWord w:{(${ VSub_Name batch)})) spids: [13931 13941] ) ) } ) (C {(gcloud)} {(compute)} {(instances)} {(delete)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--quiet)} {(--delete-disks)} {(boot)} {(--zone)} {(DQ (${ VSub_Name ZONE))} { (DQ (BracedVarSub token: <VSub_Name minions> bracket_op: (WholeArray op_id:Lit_At) suffix_op: (Slice length:(ArithWord w:{(${ VSub_Name batch)})) spids: [13986 13996] ) ) } ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:minions) op: Equal rhs: { (ArrayLiteralPart words: [ { (DQ (BracedVarSub token: <VSub_Name minions> bracket_op: (WholeArray op_id:Lit_At) suffix_op: (Slice begin: (ArithWord w:{(${ VSub_Name batch)}) ) spids: [14004 14013] ) ) } ] ) } spids: [14000] ) ] spids: [14000] ) ] spids: [13921 14019] ) ) ] spids: [-1 13831] ) ] spids: [-1 14022] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_eq left: {(DQ (${ VSub_Name REMAINING_MASTER_COUNT))} right: {(0)} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_Local flags: ["'-a'"] pairs: [(assign_pair lhs:(LhsName name:routes) op:Equal spids:[14058])] spids: [14054] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:TRUNCATED_PREFIX) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name INSTANCE_PREFIX> suffix_op: (Slice begin: (ArithWord w:{(Lit_Digits 0)}) length: (ArithWord w:{(Lit_Digits 26)}) ) spids: [14085 14091] ) ) } spids: [14083] ) ] spids: [14081] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:routes) op: Equal rhs: { (ArrayLiteralPart words: [ { (CommandSubPart command_list: (CommandList children: [ (C {(gcloud)} {(compute)} {(routes)} {(list)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--filter) (Lit_Other "=") (DQ ("name ~ '") (${ VSub_Name TRUNCATED_PREFIX) ("-.{8}-.{4}-.{4}-.{4}-.{12}'") ) } {(--format) (Lit_Other "=") (SQ <"value(name)">)} ) ] ) left_token: <Left_CommandSub "$("> spids: [14098 14134] ) } ] ) } spids: [14095] ) ] spids: [14095] ) (While cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_Great left: (ArithWord w: { (DQ (BracedVarSub token: <VSub_Name routes> prefix_op: VSub_Pound bracket_op: (WholeArray op_id:Lit_At) spids: [14144 14150] ) ) } ) right: (ArithWord w:{(Lit_Digits 0)}) ) ) terminator: <Op_Semi ";"> ) ] body: (DoGroup children: [ (C {(echo)} {(Deleting)} {(routes)} { (DQ (BracedVarSub token: <VSub_Name routes> bracket_op: (WholeArray op_id:Arith_Star) suffix_op: (Slice length:(ArithWord w:{(${ VSub_Name batch)})) spids: [14171 14181] ) ) } ) (C {(gcloud)} {(compute)} {(routes)} {(delete)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--quiet)} { (DQ (BracedVarSub token: <VSub_Name routes> bracket_op: (WholeArray op_id:Lit_At) suffix_op: (Slice length:(ArithWord w:{(${ VSub_Name batch)})) spids: [14210 14220] ) ) } ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:routes) op: Equal rhs: { (ArrayLiteralPart words: [ { (DQ (BracedVarSub token: <VSub_Name routes> bracket_op: (WholeArray op_id:Lit_At) suffix_op: (Slice begin: (ArithWord w:{(${ VSub_Name batch)}) ) spids: [14228 14237] ) ) } ] ) } spids: [14224] ) ] spids: [14224] ) ] spids: [14161 14243] ) ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(gcloud)} {(compute)} {(disks)} {(describe)} {(DQ (${ VSub_Name INSTANCE_PREFIX)) (-influxdb-pd)} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--project)} {(DQ (${ VSub_Name PROJECT))} ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [14285] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (C {(gcloud)} {(compute)} {(disks)} {(delete)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--quiet)} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(DQ (${ VSub_Name INSTANCE_PREFIX)) (-influxdb-pd)} ) ] spids: [-1 14289] ) ] spids: [-1 14334] ) (C {(delete-firewall-rules)} {(DQ (${ VSub_Name CLUSTER_NAME) (-default-internal-master))} {(DQ (${ VSub_Name CLUSTER_NAME) (-default-internal-node))} {(DQ (${ VSub_Name NETWORK) (-default-ssh))} {(DQ (${ VSub_Name NETWORK) (-default-internal))} ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name KUBE_DELETE_NETWORK))} right: {(DQ (true))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (AndOr children: [(C {(delete-all-firewall-rules)}) (C {(true)})] op_id: Op_DPipe ) (AndOr children: [(C {(delete-subnetworks)}) (C {(true)})] op_id: Op_DPipe ) (AndOr children: [(C {(delete-network)}) (C {(true)})] op_id: Op_DPipe ) ] spids: [-1 14404] ) ] spids: [-1 14435] ) (C {(export)} {(Lit_VarLike "CONTEXT=") (DQ (${ VSub_Name PROJECT) (_) (${ VSub_Name INSTANCE_PREFIX)) } ) (C {(clear-kubeconfig)}) ] spids: [-1 14047] ) ] else_action: [ (SimpleCommand words: [{(echo)} {(DQ ("... calling validate-cluster"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[14473])] ) (AndOr children: [ (Subshell child:(C {(validate-cluster)}) spids:[1448114483]) (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:validate_result) op: Equal rhs: {(DQ ($ VSub_QMark "$?"))} spids: [14487] ) ] spids: [14487] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:validate_result) op: Equal rhs: {(DQ ($ VSub_QMark "$?"))} spids: [14494] ) ] spids: [14494] ) ] op_id: Op_DPipe ) ] op_id: Op_DAmp ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_eq left: {(DQ (${ VSub_Name validate_result))} right: {(1)} ) ) terminator: <Op_Semi ";"> ) ] action: [(C {(exit)} {(1)})] spids: [-1 14534] ) (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_eq left: {(DQ (${ VSub_Name validate_result))} right: {(2)} ) ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ ("...ignoring non-fatal errors in validate-cluster"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[14568])] ) ] spids: [14542 14559] ) ] spids: [-1 14572] ) ] spids: [14460 14575] ) (C {(set)} {(-e)}) ] spids: [12469] ) spids: [12463 12468] ) (FuncDef name: get-replica-name body: (BraceGroup children: [ (C {(echo)} { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(gcloud)} {(compute)} {(instances)} {(list)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--filter) (Lit_Other "=") (DQ ("name ~ '") (CommandSubPart command_list: (CommandList children: [(C {(get-replica-name-regexp)})] ) left_token: <Left_CommandSub "$("> spids: [14648 14650] ) ("' AND zone:(") (${ VSub_Name ZONE) (")") ) } {(--format)} {(DQ ("value(name)"))} ) (C {(head)} {(-n1)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [14623 14671] ) } ) ] spids: [14618] ) spids: [14612 14617] ) (FuncDef name: get-all-replica-names body: (BraceGroup children: [ (C {(echo)} { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(gcloud)} {(compute)} {(instances)} {(list)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--filter) (Lit_Other "=") (DQ ("name ~ '") (CommandSubPart command_list: (CommandList children: [(C {(get-replica-name-regexp)})] ) left_token: <Left_CommandSub "$("> spids: [14733 14735] ) ("'") ) } {(--format)} {(DQ ("value(name)"))} ) (C {(tr)} {(DQ (EscapedLiteralPart token:<Lit_EscapedChar "\\n">))} {(DQ (","))} ) (C {(sed)} {(SQ <"s/,$//">)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [14708 14766] ) } ) ] spids: [14703] ) spids: [14697 14702] ) (FuncDef name: get-master-replicas-count body: (BraceGroup children: [ (C {(detect-project)}) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:num_masters) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(gcloud)} {(compute)} {(instances)} {(list)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--filter) (Lit_Other "=") (DQ ("name ~ '") (CommandSubPart command_list: (CommandList children: [(C {(get-replica-name-regexp)})] ) left_token: <Left_CommandSub "$("> spids: [14823 14825] ) ("'") ) } {(--format)} {(DQ ("value(zone)"))} ) (C {(wc)} {(-l)}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [14798 14842] ) } spids: [14797] ) ] spids: [14795] ) (C {(echo)} {(-n)} {(DQ (${ VSub_Name num_masters))}) ] spids: [14789] ) spids: [14783 14788] ) (FuncDef name: get-replica-name-regexp body: (BraceGroup children: [(C {(echo)} {(DQ (${ VSub_Name MASTER_NAME) ("(-...)?"))})] spids: [14870] ) spids: [14864 14869] ) (FuncDef name: set-replica-name body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:instances) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(gcloud)} {(compute)} {(instances)} {(list)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--filter) (Lit_Other "=") (DQ ("name ~ '") (CommandSubPart command_list: (CommandList children: [(C {(get-replica-name-regexp)})] ) left_token: <Left_CommandSub "$("> spids: [14952 14954] ) ("'") ) } {(--format)} {(DQ ("value(name)"))} ) ] ) left_token: <Left_CommandSub "$("> spids: [14927 14965] ) } spids: [14926] ) ] spids: [14924] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:suffix) op:Equal rhs:{(DQ )} spids:[14969])] spids: [14969] ) (While cond: [ (Sentence child: (Pipeline children: [ (C {(echo)} {(DQ (${ VSub_Name instances))}) (C {(grep)} {(DQ (${ VSub_Name suffix))}) ] negated: False ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [14995] ) ] ) terminator: <Op_Semi ";"> ) ] body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:suffix) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [(C {(date)}) (C {(md5sum)}) (C {(head)} {(-c3)})] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [15004 15016] ) ) } spids: [15002] ) ] spids: [15002] ) ] spids: [14999 15020] ) ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:REPLICA_NAME) op: Equal rhs: {(DQ (${ VSub_Name MASTER_NAME) (-) (${ VSub_Name suffix))} spids: [15023] ) ] spids: [15023] ) ] spids: [14921] ) spids: [14915 14920] ) (FuncDef name: get-template body: (BraceGroup children: [ (C {(gcloud)} {(compute)} {(instance-templates)} {(list)} {(--filter) (Lit_Other "=") (DQ ("name ~ '") (${ VSub_Name NODE_INSTANCE_PREFIX) ("-template(-(") (${ VSub_Name KUBE_RELEASE_VERSION_DASHED_REGEX) ("|") (${ VSub_Name KUBE_CI_VERSION_DASHED_REGEX) ("))?'") ) } {(--project) (Lit_Other "=") (DQ (${ VSub_Number 1))} {(--format) (Lit_Other "=") (SQ <"value(name)">)} ) ] spids: [15061] ) spids: [15055 15060] ) (FuncDef name: check-resources body: (BraceGroup children: [ (C {(detect-project)}) (C {(detect-node-names)}) (C {(echo)} {(DQ ("Looking for already existing resources"))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_RESOURCE_FOUND) op: Equal rhs: {(DQ )} spids: [15161] ) ] spids: [15161] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_n child: { (DQ (BracedVarSub token: <VSub_Name INSTANCE_GROUPS> bracket_op: (WholeArray op_id:Lit_At) suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [15174 15180] ) ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_RESOURCE_FOUND) op: Equal rhs: { (DQ ("Managed instance groups ") (BracedVarSub token: <VSub_Name INSTANCE_GROUPS> bracket_op: (WholeArray op_id:Lit_At) spids: [15192 15197] ) ) } spids: [15189] ) ] spids: [15189] ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [-1 15186] ) ] spids: [-1 15206] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(gcloud)} {(compute)} {(instance-templates)} {(describe)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(DQ (${ VSub_Name NODE_INSTANCE_PREFIX) (-template))} ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [15236] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_RESOURCE_FOUND) op: Equal rhs: { (DQ ("Instance template ") (${ VSub_Name NODE_INSTANCE_PREFIX) (-template) ) } spids: [15243] ) ] spids: [15243] ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [-1 15240] ) ] spids: [-1 15258] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(gcloud)} {(compute)} {(instances)} {(describe)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(DQ (${ VSub_Name MASTER_NAME))} {(--zone)} {(DQ (${ VSub_Name ZONE))} ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [15295] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_RESOURCE_FOUND) op: Equal rhs: {(DQ ("Kubernetes master ") (${ VSub_Name MASTER_NAME))} spids: [15302] ) ] spids: [15302] ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [-1 15299] ) ] spids: [-1 15316] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(gcloud)} {(compute)} {(disks)} {(describe)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(DQ (${ VSub_Name MASTER_NAME)) (-pd)} {(--zone)} {(DQ (${ VSub_Name ZONE))} ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [15354] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_RESOURCE_FOUND) op: Equal rhs: {(DQ ("Persistent disk ") (${ VSub_Name MASTER_NAME) (-pd))} spids: [15361] ) ] spids: [15361] ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [-1 15358] ) ] spids: [-1 15376] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(gcloud)} {(compute)} {(disks)} {(describe)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(DQ (${ VSub_Name CLUSTER_REGISTRY_DISK))} {(--zone)} {(DQ (${ VSub_Name ZONE))} ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [15413] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_RESOURCE_FOUND) op: Equal rhs: {(DQ ("Persistent disk ") (${ VSub_Name CLUSTER_REGISTRY_DISK))} spids: [15420] ) ] spids: [15420] ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [-1 15417] ) ] spids: [-1 15434] ) (Assignment keyword: Assign_Local flags: ["'-a'"] pairs: [(assign_pair lhs:(LhsName name:minions) op:Equal spids:[15446])] spids: [15442] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:minions) op: Equal rhs: { (ArrayLiteralPart words: [ { (CommandSubPart command_list: (CommandList children: [ (C {(gcloud)} {(compute)} {(instances)} {(list)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--filter) (Lit_Other "=") (DQ ("name ~ '") (${ VSub_Name NODE_INSTANCE_PREFIX) ("-.+' AND zone:(") (${ VSub_Name ZONE) (")") ) } {(--format) (Lit_Other "=") (SQ <"value(name)">)} ) ] ) left_token: <Left_CommandSub "$("> spids: [15452 15494] ) } ] ) } spids: [15449] ) ] spids: [15449] ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_Great left: (ArithWord w: { (DQ (BracedVarSub token: <VSub_Name minions> prefix_op: VSub_Pound bracket_op: (WholeArray op_id:Lit_At) spids: [15504 15510] ) ) } ) right: (ArithWord w:{(Lit_Digits 0)}) ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_RESOURCE_FOUND) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name minions> prefix_op: VSub_Pound bracket_op: (WholeArray op_id:Lit_At) spids: [15526 15532] ) (" matching matching ") (${ VSub_Name NODE_INSTANCE_PREFIX) ("-.+") ) } spids: [15524] ) ] spids: [15524] ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [-1 15521] ) ] spids: [-1 15546] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(gcloud)} {(compute)} {(firewall-rules)} {(describe)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(DQ (${ VSub_Name MASTER_NAME) (-https))} ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [15576] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_RESOURCE_FOUND) op: Equal rhs: {(DQ ("Firewall rules for ") (${ VSub_Name MASTER_NAME) (-https))} spids: [15583] ) ] spids: [15583] ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [-1 15580] ) ] spids: [-1 15598] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(gcloud)} {(compute)} {(firewall-rules)} {(describe)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(DQ (${ VSub_Name NODE_TAG) (-all))} ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [15628] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_RESOURCE_FOUND) op: Equal rhs: {(DQ ("Firewall rules for ") (${ VSub_Name MASTER_NAME) (-all))} spids: [15635] ) ] spids: [15635] ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [-1 15632] ) ] spids: [-1 15650] ) (Assignment keyword: Assign_Local flags: ["'-a'"] pairs: [(assign_pair lhs:(LhsName name:routes) op:Equal spids:[15658])] spids: [15654] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:routes) op: Equal rhs: { (ArrayLiteralPart words: [ { (CommandSubPart command_list: (CommandList children: [ (C {(gcloud)} {(compute)} {(routes)} {(list)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--filter) (Lit_Other "=") (DQ ("name ~ '") (${ VSub_Name INSTANCE_PREFIX) ("-minion-.{4}'"))} {(--format) (Lit_Other "=") (SQ <"value(name)">)} ) ] ) left_token: <Left_CommandSub "$("> spids: [15664 15698] ) } ] ) } spids: [15661] ) ] spids: [15661] ) (If arms: [ (if_arm cond: [ (Sentence child: (DParen child: (ArithBinary op_id: Arith_Great left: (ArithWord w: { (DQ (BracedVarSub token: <VSub_Name routes> prefix_op: VSub_Pound bracket_op: (WholeArray op_id:Lit_At) spids: [15708 15714] ) ) } ) right: (ArithWord w:{(Lit_Digits 0)}) ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_RESOURCE_FOUND) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name routes> prefix_op: VSub_Pound bracket_op: (WholeArray op_id:Lit_At) spids: [15730 15736] ) (" routes matching ") (${ VSub_Name INSTANCE_PREFIX) ("-minion-.{4}") ) } spids: [15728] ) ] spids: [15728] ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [-1 15725] ) ] spids: [-1 15750] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(gcloud)} {(compute)} {(addresses)} {(describe)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(DQ (${ VSub_Name MASTER_NAME) (-ip))} {(--region)} {(DQ (${ VSub_Name REGION))} ) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [15788] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_RESOURCE_FOUND) op: Equal rhs: {(DQ ("Master's reserved IP"))} spids: [15795] ) ] spids: [15795] ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [-1 15792] ) ] spids: [-1 15806] ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(0)}) ] spids: [15144] ) spids: [15138 15143] ) (FuncDef name: prepare-push body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:node) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Number 1> suffix_op: (StringUnary op_id:VTest_Hyphen arg_word:{(SQ )}) spids: [15840 15843] ) ) } spids: [15838] ) ] spids: [15836] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalAnd left: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name node))} right: {(DQ (true))} ) right: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ (${ VSub_Name NODE_OS_DISTRIBUTION))} right: {(DQ (debian))} ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ("Updating nodes in a kubernetes cluster with ") (${ VSub_Name NODE_OS_DISTRIBUTION) (" is not supported yet.") ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[15897])] ) (C {(exit)} {(1)}) ] spids: [-1 15884] ) ] spids: [-1 15906] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalAnd left: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ (${ VSub_Name node))} right: {(DQ (true))} ) right: (BoolBinary op_id: BoolBinary_GlobNEqual left: {(DQ (${ VSub_Name MASTER_OS_DISTRIBUTION))} right: {(DQ (debian))} ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ("Updating the master in a kubernetes cluster with ") (${ VSub_Name MASTER_OS_DISTRIBUTION) (" is not supported yet.") ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[15955])] ) (C {(exit)} {(1)}) ] spids: [-1 15942] ) ] spids: [-1 15964] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:OUTPUT) op: Equal rhs: {(${ VSub_Name KUBE_ROOT) (/_output/logs)} spids: [15968] ) ] spids: [15968] ) (C {(mkdir)} {(-p)} {(${ VSub_Name OUTPUT)}) (C {(kube) (Lit_Other ":") (Lit_Other ":") (util) (Lit_Other ":") (Lit_Other ":") (ensure-temp-dir) } ) (C {(detect-project)}) (C {(detect-master)}) (C {(detect-node-names)}) (C {(get-kubeconfig-basicauth)}) (C {(get-kubeconfig-bearertoken)}) (C {(tars_from_version)}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(DQ (${ VSub_Name node))} right: {(DQ (true))} ) ) terminator: <Op_Semi ";"> ) ] action: [ (C {(write-node-env)}) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:scope_flags) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(get-scope-flags)})]) left_token: <Left_CommandSub "$("> spids: [16051 16053] ) } spids: [16050] ) ] spids: [16048] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:tmp_template_name) op: Equal rhs: {(DQ (${ VSub_Name NODE_INSTANCE_PREFIX) (-template-tmp))} spids: [16067] ) ] spids: [16065] ) (C {(create-node-instance-template)} {($ VSub_Name "$tmp_template_name")}) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:template_name) op: Equal rhs: {(DQ (${ VSub_Name NODE_INSTANCE_PREFIX) (-template))} spids: [16084] ) ] spids: [16082] ) (ForEach iter_name: group iter_words: [ { (BracedVarSub token: <VSub_Name INSTANCE_GROUPS> bracket_op: (WholeArray op_id:Lit_At) suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{}) spids: [16099 16105] ) } ] do_arg_iter: False body: (DoGroup children: [ (Sentence child: (AndOr children: [ (C {(gcloud)} {(compute)} {(instance-groups)} {(managed)} {(set-instance-template)} {(DQ (${ VSub_Name group))} {(--template)} {(DQ ($ VSub_Name "$tmp_template_name"))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--project)} {(DQ (${ VSub_Name PROJECT))} ) (C {(true)}) ] op_id: Op_DPipe ) terminator: <Op_Semi ";"> ) ] spids: [16108 16163] ) spids: [16098 16106] ) (AndOr children: [ (C {(gcloud)} {(compute)} {(instance-templates)} {(delete)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--quiet)} {(DQ ($ VSub_Name "$template_name"))} ) (C {(true)}) ] op_id: Op_DPipe ) (C {(create-node-instance-template)} {(DQ ($ VSub_Name "$template_name"))}) (ForEach iter_name: group iter_words: [ { (BracedVarSub token: <VSub_Name INSTANCE_GROUPS> bracket_op: (WholeArray op_id:Lit_At) suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{}) spids: [16215 16221] ) } ] do_arg_iter: False body: (DoGroup children: [ (Sentence child: (AndOr children: [ (C {(gcloud)} {(compute)} {(instance-groups)} {(managed)} {(set-instance-template)} {(DQ (${ VSub_Name group))} {(--template)} {(DQ ($ VSub_Name "$template_name"))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--project)} {(DQ (${ VSub_Name PROJECT))} ) (C {(true)}) ] op_id: Op_DPipe ) terminator: <Op_Semi ";"> ) ] spids: [16224 16279] ) spids: [16214 16222] ) (AndOr children: [ (C {(gcloud)} {(compute)} {(instance-templates)} {(delete)} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--quiet)} {(DQ ($ VSub_Name "$tmp_template_name"))} ) (C {(true)}) ] op_id: Op_DPipe ) ] spids: [-1 16041] ) ] spids: [-1 16316] ) ] spids: [15833] ) spids: [15827 15832] ) (FuncDef name: push-master body: (BraceGroup children: [ (C {(echo)} {(DQ ("Updating master metadata ..."))}) (C {(write-master-env)}) (C {(prepare-startup-script)}) (C {(add-instance-metadata-from-file)} {(DQ (${ VSub_Name KUBE_MASTER))} {(DQ ("kube-env=") (${ VSub_Name KUBE_TEMP) (/master-kube-env.yaml))} {(DQ ("startup-script=") (${ VSub_Name KUBE_TEMP) (/configure-vm.sh))} ) (C {(echo)} { (DQ ("Pushing to master (log at ") (${ VSub_Name OUTPUT) (/push-) (${ VSub_Name KUBE_MASTER) (".log) ...") ) } ) (Sentence child: (Pipeline children: [ (C {(cat)} {(${ VSub_Name KUBE_TEMP) (/configure-vm.sh)}) (C {(gcloud)} {(compute)} {(ssh)} {(--ssh-flag) (Lit_Other "=") (DQ ("-o LogLevel=quiet"))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(DQ (${ VSub_Name KUBE_MASTER))} {(--command)} {(DQ ("sudo bash -s -- --push"))} ) ] negated: False ) terminator: <Op_Amp "&"> ) (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(${ VSub_Name OUTPUT) (/push-) (DQ (${ VSub_Name KUBE_MASTER)) (.log)} spids: [16437] ) ] ) ] spids: [16330] ) spids: [16324 16329] ) (FuncDef name: push-node body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:node) op: Equal rhs: {(${ VSub_Number 1)} spids: [16465] ) ] spids: [16465] ) (C {(echo)} {(DQ ("Updating node ") (${ VSub_Name node) (" metadata... "))}) (C {(prepare-startup-script)}) (C {(add-instance-metadata-from-file)} {(DQ (${ VSub_Name node))} {(DQ ("kube-env=") (${ VSub_Name KUBE_TEMP) (/node-kube-env.yaml))} {(DQ ("startup-script=") (${ VSub_Name KUBE_TEMP) (/configure-vm.sh))} ) (C {(echo)} { (DQ ("Start upgrading node ") (${ VSub_Name node) (" (log at ") (${ VSub_Name OUTPUT) (/push-) (${ VSub_Name node) (".log) ...") ) } ) (Sentence child: (Pipeline children: [ (C {(cat)} {(${ VSub_Name KUBE_TEMP) (/configure-vm.sh)}) (C {(gcloud)} {(compute)} {(ssh)} {(--ssh-flag) (Lit_Other "=") (DQ ("-o LogLevel=quiet"))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(DQ (${ VSub_Name node))} {(--command)} {(DQ ("sudo bash -s -- --push"))} ) ] negated: False ) terminator: <Op_Amp "&"> ) (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(${ VSub_Name OUTPUT) (/push-) (DQ (${ VSub_Name node)) (.log)} spids: [16581] ) ] ) ] spids: [16462] ) spids: [16456 16461] ) (FuncDef name: kube-push body: (BraceGroup children: [ (C {(echo)} {(DQ ("./cluster/kube-push.sh is currently not supported in GCE."))}) (C {(echo)} {(DQ ("Please use ./cluster/gce/upgrade.sh."))}) (C {(exit)} {(1)}) (C {(prepare-push)} {(true)}) (C {(push-master)}) (ForExpr init: (BinaryAssign op_id: Arith_Equal left: (LhsName name:i) right: (ArithWord w:{(Lit_Digits 0)}) ) cond: (ArithBinary op_id: Arith_Less left: (ArithVarRef name:i) right: (ArithWord w: { (BracedVarSub token: <VSub_Name NODE_NAMES> prefix_op: VSub_Pound bracket_op: (WholeArray op_id:Lit_At) spids: [16658 16664] ) } ) ) update: (UnaryAssign op_id:Node_PostDPlus child:(LhsName name:i)) body: (DoGroup children: [ (Sentence child: (C {(push-node)} { (DQ (BracedVarSub token: <VSub_Name NODE_NAMES> bracket_op: (ArrayIndex expr:(ArithWord w:{($ VSub_Name "$i")})) spids: [16679 16684] ) ) } ) terminator: <Op_Amp "&"> ) ] spids: [16673 16690] ) ) (AndOr children: [ (C {(kube) (Lit_Other ":") (Lit_Other ":") (util) (Lit_Other ":") (Lit_Other ":") (wait-for-jobs) } ) (BraceGroup children: [ (SimpleCommand words: [ {(echo)} {(-e)} { (DQ (${ VSub_Name color_red) ("Some commands failed.") (${ VSub_Name color_norm) ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[16721])] ) ] spids: [16704] ) ] op_id: Op_DPipe ) (C {(echo)}) (C {(echo)} {(DQ ("Kubernetes cluster is running. The master is running at:"))}) (C {(echo)}) (C {(echo)} {(DQ (" https://") (${ VSub_Name KUBE_MASTER_IP))}) (C {(echo)}) (C {(echo)} {(DQ ("The user name and password to use is located in ~/.kube/config"))}) (C {(echo)}) ] spids: [16606] ) spids: [16600 16605] ) (FuncDef name: test-build-release body: (BraceGroup children: [(C {(DQ (${ VSub_Name KUBE_ROOT) (/build/release.sh))})] spids: [16821] ) spids: [16815 16820] ) (FuncDef name: test-setup body: (BraceGroup children: [ (C {(detect-project)}) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalAnd left: (BoolBinary op_id: BoolBinary_GlobDEqual left: { (BracedVarSub token: <VSub_Name MULTIZONE> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{}) spids: [16874 16877] ) } right: {(DQ (true))} ) right: (BoolUnary op_id: BoolUnary_n child: { (BracedVarSub token: <VSub_Name E2E_ZONES> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{}) spids: [16889 16892] ) } ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (ForEach iter_name: KUBE_GCE_ZONE iter_words: [{(${ VSub_Name E2E_ZONES)}] do_arg_iter: False body: (DoGroup children: [ (SimpleCommand words: [{(DQ (${ VSub_Name KUBE_ROOT) (/cluster/kube-up.sh))}] more_env: [ (env_pair name: KUBE_GCE_ZONE val: {(DQ (${ VSub_Name KUBE_GCE_ZONE))} spids: [16914] ) (env_pair name: KUBE_USE_EXISTING_MASTER val: { (DQ (BracedVarSub token: <VSub_Name KUBE_USE_EXISTING_MASTER> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [16923 16926] ) ) } spids: [16921] ) ] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:KUBE_USE_EXISTING_MASTER) op: Equal rhs: {(DQ (true))} spids: [16937] ) ] spids: [16937] ) ] spids: [16911 16946] ) spids: [16905 16909] ) ] spids: [-1 16897] ) ] else_action: [(C {(DQ (${ VSub_Name KUBE_ROOT) (/cluster/kube-up.sh))})] spids: [16949 16960] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:start) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(date)} {(Lit_Other "+") (Lit_Other "%") (s)})] ) left_token: <Left_Backtick "`"> spids: [16975 16981] ) } spids: [16974] ) ] spids: [16972] ) (AndOr children: [ (SimpleCommand words: [ {(gcloud)} {(compute)} {(firewall-rules)} {(create)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--target-tags)} {(DQ (${ VSub_Name NODE_TAG))} {(--allow)} {(tcp) (Lit_Other ":") (80) (Lit_Comma ",") (tcp) (Lit_Other ":") (8080)} {(--network)} {(DQ (${ VSub_Name NETWORK))} {(DQ (${ VSub_Name NODE_TAG) (-) (${ VSub_Name INSTANCE_PREFIX) (-http-alt))} ] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[17047])] ) (C {(true)}) ] op_id: Op_DPipe ) (While cond: [ (Sentence child: (Pipeline children: [ (SimpleCommand words: [ {(gcloud)} {(compute)} {(firewall-rules)} {(describe)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} { (DQ (${ VSub_Name NODE_TAG) (-) (${ VSub_Name INSTANCE_PREFIX) (-http-alt)) } ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [17095] ) ] ) ] negated: True ) terminator: <Op_Semi ";"> ) ] body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_lt left: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name "$start")}) right: (ArithWord w:{(Lit_Digits 1200)}) ) spids: [17107 17114] ) } right: { (CommandSubPart command_list: (CommandList children: [ (C {(date)} {(Lit_Other "+") (Lit_Other "%") (s)}) ] ) left_token: <Left_Backtick "`"> spids: [17118 17124] ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} {(-e)} { (DQ (${ VSub_Name color_red) ("Failed to create firewall ") (${ VSub_Name NODE_TAG) (-) (${ VSub_Name INSTANCE_PREFIX) ("-http-alt in ") (${ VSub_Name NETWORK_PROJECT) ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [17154] ) ] ) (C {(exit)} {(1)}) ] spids: [-1 17129] ) ] spids: [-1 17163] ) (C {(sleep)} {(5)}) ] spids: [17100 17171] ) ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:start) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(date)} {(Lit_Other "+") (Lit_Other "%") (s)})] ) left_token: <Left_Backtick "`"> spids: [17184 17190] ) } spids: [17183] ) ] spids: [17183] ) (AndOr children: [ (SimpleCommand words: [ {(gcloud)} {(compute)} {(firewall-rules)} {(create)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(--target-tags)} {(DQ (${ VSub_Name NODE_TAG))} {(--allow)} {(tcp) (Lit_Other ":") (30000-32767) (Lit_Comma ",") (udp) (Lit_Other ":") (30000-32767) } {(--network)} {(DQ (${ VSub_Name NETWORK))} {(DQ (${ VSub_Name NODE_TAG) (-) (${ VSub_Name INSTANCE_PREFIX) (-nodeports))} ] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[17256])] ) (C {(true)}) ] op_id: Op_DPipe ) (While cond: [ (Sentence child: (Pipeline children: [ (SimpleCommand words: [ {(gcloud)} {(compute)} {(firewall-rules)} {(describe)} {(--project)} {(DQ (${ VSub_Name NETWORK_PROJECT))} { (DQ (${ VSub_Name NODE_TAG) (-) (${ VSub_Name INSTANCE_PREFIX) (-nodeports) ) } ] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [17304] ) ] ) ] negated: True ) terminator: <Op_Semi ";"> ) ] body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_lt left: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name "$start")}) right: (ArithWord w:{(Lit_Digits 1200)}) ) spids: [17316 17323] ) } right: { (CommandSubPart command_list: (CommandList children: [ (C {(date)} {(Lit_Other "+") (Lit_Other "%") (s)}) ] ) left_token: <Left_Backtick "`"> spids: [17327 17333] ) } ) ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} {(-e)} { (DQ (${ VSub_Name color_red) ("Failed to create firewall ") (${ VSub_Name NODE_TAG) (-) (${ VSub_Name INSTANCE_PREFIX) ("-nodeports in ") (${ VSub_Name PROJECT) ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: -1 arg_word: {(2)} spids: [17363] ) ] ) (C {(exit)} {(1)}) ] spids: [-1 17338] ) ] spids: [-1 17372] ) (C {(sleep)} {(5)}) ] spids: [17309 17380] ) ) ] spids: [16859] ) spids: [16853 16858] ) (FuncDef name: test-teardown body: (BraceGroup children: [ (C {(detect-project)}) (C {(echo)} {(DQ ("Shutting down test cluster in background."))}) (C {(delete-firewall-rules)} {(DQ (${ VSub_Name NODE_TAG) (-) (${ VSub_Name INSTANCE_PREFIX) (-http-alt))} {(DQ (${ VSub_Name NODE_TAG) (-) (${ VSub_Name INSTANCE_PREFIX) (-nodeports))} ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalAnd left: (BoolBinary op_id: BoolBinary_GlobDEqual left: { (BracedVarSub token: <VSub_Name MULTIZONE> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{}) spids: [17443 17446] ) } right: {(DQ (true))} ) right: (BoolUnary op_id: BoolUnary_n child: { (BracedVarSub token: <VSub_Name E2E_ZONES> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{}) spids: [17458 17461] ) } ) ) ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:zones) op: Equal rhs: {(ArrayLiteralPart words:[{(${ VSub_Name E2E_ZONES)}])} spids: [17471] ) ] spids: [17469] ) (ForExpr init: (BinaryAssign op_id: Arith_Equal left: (LhsName name:zone_num) right: (ArithBinary op_id: Arith_Minus left: (ArithWord w: { (BracedVarSub token: <VSub_Name zones> prefix_op: VSub_Pound bracket_op: (WholeArray op_id:Lit_At) spids: [17490 17496] ) } ) right: (ArithWord w:{(Lit_Digits 1)}) ) ) cond: (ArithBinary op_id: Arith_Great left: (ArithVarRef name:zone_num) right: (ArithWord w:{(Lit_Digits 0)}) ) update: (UnaryAssign op_id:Node_PostDMinus child:(LhsName name:zone_num)) body: (DoGroup children: [ (SimpleCommand words: [{(DQ (${ VSub_Name KUBE_ROOT) (/cluster/kube-down.sh))}] more_env: [ (env_pair name: KUBE_GCE_ZONE val: { (DQ (BracedVarSub token: <VSub_Name zones> bracket_op: (ArrayIndex expr:(ArithVarRef name:zone_num)) spids: [17517 17522] ) ) } spids: [17515] ) (env_pair name: KUBE_USE_EXISTING_MASTER val: {(DQ (true))} spids: [17525] ) ] ) ] spids: [17512 17538] ) ) (SimpleCommand words: [{(DQ (${ VSub_Name KUBE_ROOT) (/cluster/kube-down.sh))}] more_env: [ (env_pair name: KUBE_GCE_ZONE val: { (DQ (BracedVarSub token: <VSub_Name zones> bracket_op: (ArrayIndex expr:(ArithWord w:{(Lit_Digits 0)})) spids: [17543 17548] ) ) } spids: [17541] ) (env_pair name: KUBE_USE_EXISTING_MASTER val: {(DQ (false))} spids: [17551] ) ] ) ] spids: [-1 17466] ) ] else_action: [(C {(DQ (${ VSub_Name KUBE_ROOT) (/cluster/kube-down.sh))})] spids: [17564 17575] ) ] spids: [17397] ) spids: [17391 17396] ) (FuncDef name: ssh-to-node body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:node) op: Equal rhs: {(DQ ($ VSub_Number "$1"))} spids: [17594] ) ] spids: [17592] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:cmd) op: Equal rhs: {(DQ ($ VSub_Number "$2"))} spids: [17602] ) ] spids: [17600] ) (ForEach iter_name: try iter_words: [{(Lit_LBrace "{") (1..5) (Lit_RBrace "}")}] do_arg_iter: False body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(gcloud)} {(compute)} {(ssh)} {(--ssh-flag) (Lit_Other "=") (DQ ("-o LogLevel=quiet"))} {(--ssh-flag) (Lit_Other "=") (DQ ("-o ConnectTimeout=30"))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone) (Lit_Other "=") (DQ (${ VSub_Name ZONE))} {(DQ (${ VSub_Name node))} {(--command)} {(DQ ("echo test > /dev/null"))} ) terminator: <Op_Semi ";"> ) ] action: [(ControlFlow token:<ControlFlow_Break break>)] spids: [-1 17675] ) ] spids: [-1 17681] ) (C {(sleep)} {(5)}) ] spids: [17623 17689] ) spids: [17617 17621] ) (C {(gcloud)} {(compute)} {(ssh)} {(--ssh-flag) (Lit_Other "=") (DQ ("-o LogLevel=quiet"))} {(--ssh-flag) (Lit_Other "=") (DQ ("-o ConnectTimeout=30"))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone) (Lit_Other "=") (DQ (${ VSub_Name ZONE))} {(DQ (${ VSub_Name node))} {(--command)} {(DQ (${ VSub_Name cmd))} ) ] spids: [17589] ) spids: [17583 17588] ) (FuncDef name: prepare-e2e body: (BraceGroup children:[(C {(detect-project)})] spids:[17756]) spids: [17750 17755] ) (FuncDef name: prepare-startup-script body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:SED) op:Equal rhs:{(sed)} spids:[17786])] spids: [17786] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(which)} {(gsed)}) terminator: <Op_Amp "&"> ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [17797] ) ] ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:SED) op: Equal rhs: {(gsed)} spids: [17804] ) ] spids: [17804] ) ] spids: [-1 17801] ) ] spids: [-1 17808] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (Subshell child: (Pipeline children: [ (SimpleCommand words: [{($ VSub_Name "$SED")} {(--version)}] redirects: [ (Redir op_id: Redir_GreatAnd fd: 2 arg_word: {(1)} spids: [17820] ) ] ) (C {(grep)} {(-q)} {(GNU)}) ] negated: False ) spids: [17815 17830] ) ] negated: True ) terminator: <Op_Semi ";"> ) ] action: [ (C {(echo)} {(DQ ("!!! GNU sed is required. If on OS X, use 'brew install gnu-sed'."))} ) (C {(exit)} {(1)}) ] spids: [-1 17833] ) ] spids: [-1 17848] ) (SimpleCommand words: [ {($ VSub_Name "$SED")} {(SQ <"/^\\s*#\\([^!].*\\)*$/ d">)} {(${ VSub_Name KUBE_ROOT) (/cluster/gce/configure-vm.sh)} ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(${ VSub_Name KUBE_TEMP) (/configure-vm.sh)} spids: [17862] ) ] ) ] spids: [17779] ) spids: [17773 17778] ) ] )