(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_ROOT) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:55) command_list: (command.CommandList children: [(C {(dirname)} {(DQ (${ Id.VSub_Name BASH_SOURCE))})] ) ) (/../..) } spids: [54] ) ] ) (C {(source)} { (DQ (${ Id.VSub_Name KUBE_ROOT) (/cluster/gce/) (braced_var_sub token: (Token id:Id.VSub_Name val:KUBE_CONFIG_FILE span_id:74) suffix_op: (suffix_op.Unary op_id:Id.VTest_Hyphen arg_word:{(DQ (config-default.sh))}) ) ) } ) (C {(source)} {(DQ (${ Id.VSub_Name KUBE_ROOT) (/cluster/common.sh))}) (C {(source)} {(DQ (${ Id.VSub_Name KUBE_ROOT) (/hack/lib/util.sh))}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalOr left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name NODE_OS_DISTRIBUTION))} right: {(DQ (debian))} ) right: (bool_expr.LogicalOr left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name NODE_OS_DISTRIBUTION))} right: {(DQ (container-linux))} ) right: (bool_expr.LogicalOr left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name NODE_OS_DISTRIBUTION))} right: {(DQ (trusty))} ) right: (bool_expr.LogicalOr left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name NODE_OS_DISTRIBUTION))} right: {(DQ (gci))} ) right: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name NODE_OS_DISTRIBUTION))} right: {(DQ (ubuntu))} ) ) ) ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:174) ) ] action: [ (C {(source)} { (DQ (${ Id.VSub_Name KUBE_ROOT) (/cluster/gce/) (${ Id.VSub_Name NODE_OS_DISTRIBUTION) (/node-helper.sh) ) } ) ] spids: [101 176] ) ] else_action: [ (command.Simple words: [ {(echo)} { (DQ ('Cannot operate on cluster using node os distro: ') (${ Id.VSub_Name NODE_OS_DISTRIBUTION) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:204) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:208) arg_word: {(1)} ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalOr left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name MASTER_OS_DISTRIBUTION))} right: {(DQ (container-linux))} ) right: (bool_expr.LogicalOr left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name MASTER_OS_DISTRIBUTION))} right: {(DQ (trusty))} ) right: (bool_expr.LogicalOr left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name MASTER_OS_DISTRIBUTION))} right: {(DQ (gci))} ) right: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name MASTER_OS_DISTRIBUTION))} right: {(DQ (ubuntu))} ) ) ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:274) ) ] action: [ (C {(source)} { (DQ (${ Id.VSub_Name KUBE_ROOT) (/cluster/gce/) (${ Id.VSub_Name MASTER_OS_DISTRIBUTION) (/master-helper.sh) ) } ) ] spids: [215 276] ) ] else_action: [ (command.Simple words: [ {(echo)} { (DQ ('Cannot operate on cluster using master os distro: ') (${ Id.VSub_Name MASTER_OS_DISTRIBUTION) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:304) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:308) arg_word: {(1)} ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name MASTER_OS_DISTRIBUTION))} right: {(DQ (gci))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:332) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:DEFAULT_GCI_PROJECT) op: assign_op.Equal rhs: {(google-containers)} spids: [337] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name GCI_VERSION))} right: {(DQ (cos)) (Id.Lit_Other '*')} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:359) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:DEFAULT_GCI_PROJECT) op: assign_op.Equal rhs: {(cos-cloud)} spids: [364] ) ] ) ] spids: [341 361] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:MASTER_IMAGE_PROJECT) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:KUBE_GCE_MASTER_PROJECT span_id:373) suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonHyphen arg_word: {(${ Id.VSub_Name DEFAULT_GCI_PROJECT)} ) ) } spids: [371] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:MASTER_IMAGE) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:KUBE_GCE_MASTER_IMAGE span_id:391) suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonHyphen arg_word: {(${ Id.VSub_Name GCI_VERSION)} ) ) } spids: [389] ) ] ) ] spids: [315 334] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name MASTER_OS_DISTRIBUTION))} right: {(DQ (debian))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:415) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:MASTER_IMAGE) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:KUBE_GCE_MASTER_IMAGE span_id:422) suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonHyphen arg_word: {(${ Id.VSub_Name CVM_VERSION)} ) ) } spids: [420] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:MASTER_IMAGE_PROJECT) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:KUBE_GCE_MASTER_PROJECT span_id:432) suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonHyphen arg_word: {(google-containers)} ) ) } spids: [430] ) ] ) ] spids: [398 417] ) ] ) (command.ShFunction name: set-node-image body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name NODE_OS_DISTRIBUTION))} right: {(DQ (gci))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:472) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:DEFAULT_GCI_PROJECT) op: assign_op.Equal rhs: {(google-containers)} spids: [477] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name GCI_VERSION))} right: {(DQ (cos)) (Id.Lit_Other '*')} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:499) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:DEFAULT_GCI_PROJECT) op: assign_op.Equal rhs: {(cos-cloud)} spids: [504] ) ] ) ] spids: [481 501] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:NODE_IMAGE) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:KUBE_GCE_NODE_IMAGE span_id:522) suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonHyphen arg_word: {(${ Id.VSub_Name GCI_VERSION)} ) ) } spids: [520] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:NODE_IMAGE_PROJECT) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:KUBE_GCE_NODE_PROJECT span_id:532) suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonHyphen arg_word: {(${ Id.VSub_Name DEFAULT_GCI_PROJECT)} ) ) } spids: [530] ) ] ) ] spids: [455 474] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name NODE_OS_DISTRIBUTION))} right: {(DQ (debian))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:557) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:NODE_IMAGE) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:KUBE_GCE_NODE_IMAGE span_id:564) suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonHyphen arg_word: {(${ Id.VSub_Name CVM_VERSION)} ) ) } spids: [562] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:NODE_IMAGE_PROJECT) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:KUBE_GCE_NODE_PROJECT span_id:574) suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonHyphen arg_word: {(google-containers)} ) ) } spids: [572] ) ] ) ] spids: [540 559] ) ] ) ] ) ) (C {(set-node-image)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name ENABLE_CLUSTER_AUTOSCALER))} right: {(DQ (true))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:608) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_z child: {($ Id.VSub_DollarName '$AUTOSCALER_MIN_NODES')} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:622) ) ] action: [ (C {(echo)} {(DQ ('AUTOSCALER_MIN_NODES not set.'))}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:634) arg_word: {(1)} ) ] spids: [613 624] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_z child: {($ Id.VSub_DollarName '$AUTOSCALER_MAX_NODES')} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:651) ) ] action: [ (C {(echo)} {(DQ ('AUTOSCALER_MAX_NODES not set.'))}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:663) arg_word: {(1)} ) ] spids: [642 653] ) ] ) ] spids: [591 610] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:NODE_INSTANCE_PREFIX) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name INSTANCE_PREFIX) (-minion))} spids: [673] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:NODE_TAGS) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name NODE_TAG))} spids: [681] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ALLOCATE_NODE_CIDRS) op: assign_op.Equal rhs: {(true)} spids: [689] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:PREEXISTING_NETWORK) op: assign_op.Equal rhs: {(false)} spids: [692] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:PREEXISTING_NETWORK_MODE) op: assign_op.Equal rhs: {(DQ )} spids: [695] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_PROMPT_FOR_UPDATE) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:KUBE_PROMPT_FOR_UPDATE span_id:702) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{(DQ (n))}) ) } spids: [700] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_CLUSTER_INITIALIZATION_TIMEOUT) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:KUBE_CLUSTER_INITIALIZATION_TIMEOUT span_id:714) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{(300)}) ) } spids: [712] ) ] ) (command.ShFunction name: join_csv body: (command.BraceGroup children: [ (command.Sentence child: (C {(local)} {(Id.Lit_VarLike 'IFS=') (SQ (Token id:Id.Lit_Chars val:',' span_id:733))}) terminator: (Token id:Id.Op_Semi val:';' span_id:735) ) (command.Sentence child: (C {(echo)} {(DQ ($ Id.VSub_Star '$*'))}) terminator: (Token id:Id.Op_Semi val:';' span_id:742) ) ] ) ) (command.ShFunction name: split_csv body: (command.BraceGroup children: [ (command.Pipeline children: [ (C {(echo)} {(DQ ($ Id.VSub_Star '$*'))}) (C {(cut)} {(-d) (SQ (Token id:Id.Lit_Chars val:',' span_id:771))} {(-f1)}) ] negated: F ) ] ) ) (command.ShFunction name: verify-prereqs body: (command.BraceGroup children: [ (C {(local)} {(cmd)}) (command.ForEach iter_name: cmd iter_words: [{(gcloud)} {(gsutil)}] do_arg_iter: F body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [{(which)} {(DQ (${ Id.VSub_Name cmd))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:822) fd: -1 arg_word: {(/dev/null)} ) ] ) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:824) ) ] action: [ (C {(local)} {(Id.Lit_VarLike 'resp=') (DQ (n))}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name KUBE_PROMPT_FOR_UPDATE))} right: {(DQ (y))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:854) ) ] action: [ (C {(echo)} { (DQ ("Can't find ") (${ Id.VSub_Name cmd) ( ' in PATH. Do you wish to install the Google Cloud SDK? [Y/n]' ) ) } ) (C {(read)} {(resp)}) ] spids: [837 856] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalAnd left: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {(DQ (${ Id.VSub_Name resp))} right: {(DQ (n))} ) right: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {(DQ (${ Id.VSub_Name resp))} right: {(DQ (N))} ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:909) ) ] action: [ (command.Pipeline children: [ (C {(curl)} {(https) (Id.Lit_Other ':') (//sdk.cloud.google.com)} ) (C {(bash)}) ] negated: F ) ] spids: [878 911] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [{(which)} {(DQ (${ Id.VSub_Name cmd))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:940) fd: -1 arg_word: {(/dev/null)} ) ] ) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:942) ) ] action: [ (command.Simple words: [ {(echo)} { (DQ ("Can't find ") (${ Id.VSub_Name cmd) (' in PATH, please fix and retry. The Google Cloud ') ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:957) fd: -1 arg_word: {(2)} ) ] ) (command.Simple words: [ {(echo)} { (DQ ( 'SDK can be downloaded from https://cloud.google.com/sdk/.' ) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:967) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:971) arg_word: {(1)} ) ] spids: [928 944] ) ] ) ] spids: [810 826] ) ] ) ] ) ) (C {(update-or-verify-gcloud)}) ] ) ) (command.ShFunction name: detect-project body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_z child: { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:PROJECT span_id:1028) suffix_op: (suffix_op.Unary op_id:Id.VTest_Hyphen arg_word:(word.Empty)) ) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:1034) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:PROJECT) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:1040) command_list: (command.CommandList children: [ (C {(gcloud)} {(config)} {(list)} {(project)} {(--format)} { (SQ (Token id: Id.Lit_Chars val: 'value(core.project)' span_id: 1052 ) ) } ) ] ) ) } spids: [1039] ) ] ) ] spids: [1020 1036] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:NETWORK_PROJECT) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:NETWORK_PROJECT span_id:1063) suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonHyphen arg_word: {(${ Id.VSub_Name PROJECT)} ) ) } spids: [1061] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_z child: { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:PROJECT span_id:1080) suffix_op: (suffix_op.Unary op_id:Id.VTest_Hyphen arg_word:(word.Empty)) ) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:1086) ) ] action: [ (command.Simple words: [ {(echo)} { (DQ ( 'Could not detect Google Cloud Platform project. Set the default project using ' ) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1097) fd: -1 arg_word: {(2)} ) ] ) (command.Simple words: [{(echo)} {(DQ ("'gcloud config set project <PROJECT>'"))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1107) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:1111) arg_word: {(1)} ) ] spids: [1072 1088] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_z child: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: PROJECT_REPORTED span_id: 1127 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_Hyphen arg_word:(word.Empty)) ) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:1133) ) ] action: [ (command.Simple words: [{(echo)} {(DQ ('Project: ') (${ Id.VSub_Name PROJECT))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1147) fd: -1 arg_word: {(2)} ) ] ) (command.Simple words: [{(echo)} {(DQ ('Network Project: ') (${ Id.VSub_Name NETWORK_PROJECT))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1160) fd: -1 arg_word: {(2)} ) ] ) (command.Simple words: [{(echo)} {(DQ ('Zone: ') (${ Id.VSub_Name ZONE))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:1173) fd: -1 arg_word: {(2)} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:PROJECT_REPORTED) op: assign_op.Equal rhs: {(true)} spids: [1177] ) ] ) ] spids: [1119 1135] ) ] ) ] ) ) (command.ShFunction name: gsutil_get_tar_md5 body: (command.BraceGroup children: [ (C {(local)} {(-r)} {(Id.Lit_VarLike 'tar_location=') ($ Id.VSub_Number '$1')}) (C {(local)} {(-r)} {(Id.Lit_VarLike 'tar_md5=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:1231) command_list: (command.CommandList children: [ (command.Pipeline children: [ (command.Simple words: [{(gsutil)} {(hash)} {(-h)} {(-m)} {(${ Id.VSub_Name tar_location)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:1244) fd: 2 arg_word: {(/dev/null)} ) ] ) (C {(grep)} {(DQ ('Hash (md5):'))}) (C {(awk)} {(-F)} {(SQ (Token id:Id.Lit_Chars val:':' span_id:1262))} {(SQ (Token id:Id.Lit_Chars val:'{print $2}' span_id:1266))} ) (C {(sed)} {(SQ (Token id:Id.Lit_Chars val:'s/^[[:space:]]*//g' span_id:1274))} ) ] negated: F ) ] ) ) } ) (C {(echo)} {(DQ (${ Id.VSub_Name tar_md5))}) ] ) ) (command.ShFunction name: copy-to-staging body: (command.BraceGroup children: [ (C {(local)} {(-r)} {(Id.Lit_VarLike 'staging_path=') ($ Id.VSub_Number '$1')}) (C {(local)} {(-r)} {(Id.Lit_VarLike 'gs_url=') ($ Id.VSub_Number '$2')}) (C {(local)} {(-r)} {(Id.Lit_VarLike 'tar=') ($ Id.VSub_Number '$3')}) (C {(local)} {(-r)} {(Id.Lit_VarLike 'hash=') ($ Id.VSub_Number '$4')}) (C {(local)} {(-r)} {(Id.Lit_VarLike 'basename_tar=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:1339) command_list: (command.CommandList children: [(C {(basename)} {(${ Id.VSub_Name tar)})] ) ) } ) (C {(local)} {(-r)} {(Id.Lit_VarLike 'remote_tar_md5=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:1375) command_list: (command.CommandList children: [ (C {(gsutil_get_tar_md5)} {(DQ (${ Id.VSub_Name staging_path) (/) (${ Id.VSub_Name basename_tar))} ) ] ) ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: {(${ Id.VSub_Name remote_tar_md5)} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:1401) ) ] action: [ (C {(local)} {(-r)} {(Id.Lit_VarLike 'local_tar_md5=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:1419) command_list: (command.CommandList children: [(C {(gsutil_get_tar_md5)} {(DQ (${ Id.VSub_Name tar))})] ) ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name remote_tar_md5))} right: {(DQ (${ Id.VSub_Name local_tar_md5))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:1449) ) ] action: [ (C {(echo)} { (DQ ('+++ ') (${ Id.VSub_Name basename_tar) (' uploaded earlier, cloud and local file md5 match (md5 = ') (${ Id.VSub_Name local_tar_md5) (')') ) } ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:1469) arg_word: {(0)} ) ] spids: [1430 1451] ) ] ) ] spids: [1390 1403] ) ] ) (command.Simple words: [{(echo)} {(DQ (${ Id.VSub_Name hash))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:1489) fd: -1 arg_word: {(DQ (${ Id.VSub_Name tar) (.sha1))} ) ] ) (C {(gsutil)} {(-m)} {(-q)} {(-h)} {(DQ ('Cache-Control:private, max-age=0'))} {(cp)} {(DQ (${ Id.VSub_Name tar))} {(DQ (${ Id.VSub_Name tar) (.sha1))} {(DQ (${ Id.VSub_Name staging_path))} ) (command.Simple words: [ {(gsutil)} {(-m)} {(acl)} {(ch)} {(-g)} {(all) (Id.Lit_Other ':') (R)} {(DQ (${ Id.VSub_Name gs_url))} {(DQ (${ Id.VSub_Name gs_url) (.sha1))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:1560) fd: -1 arg_word: {(/dev/null)} ) (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:1563) fd: 2 arg_word: {(1)} ) ] ) (C {(echo)} { (DQ ('+++ ') (${ Id.VSub_Name basename_tar) (' uploaded (sha1 = ') (${ Id.VSub_Name hash) (')') ) } ) ] ) ) (command.ShFunction name: set-preferred-region body: (command.BraceGroup children: [ (command.Case to_match: {(${ Id.VSub_Name ZONE)} arms: [ (case_arm pat_list: [{(asia-) (Id.Lit_Star '*')}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:PREFERRED_REGION) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:1642) words: [{(DQ (asia))} {(DQ (us))} {(DQ (eu))}] ) } spids: [1641] ) ] ) ] spids: [1636 1638 1657 -1] ) (case_arm pat_list: [{(europe-) (Id.Lit_Star '*')}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:PREFERRED_REGION) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:1666) words: [{(DQ (eu))} {(DQ (us))} {(DQ (asia))}] ) } spids: [1665] ) ] ) ] spids: [1660 1662 1681 -1] ) (case_arm pat_list: [{(Id.Lit_Star '*')}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:PREFERRED_REGION) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:1689) words: [{(DQ (us))} {(DQ (eu))} {(DQ (asia))}] ) } spids: [1688] ) ] ) ] spids: [1684 1685 1704 -1] ) ] ) (C {(local)} {(-r)} {(Id.Lit_VarLike 'preferred=') (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:PREFERRED_REGION span_id:1717) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) ) ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {(DQ (${ Id.VSub_Name RELEASE_REGION_FALLBACK))} right: {(DQ (true))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:1743) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:PREFERRED_REGION) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:1749) words: [{(DQ (${ Id.VSub_Name preferred))}] ) } spids: [1748] ) ] ) ] spids: [1726 1745] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name REGIONAL_KUBE_ADDONS))} right: {(DQ (true))} ) ) (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {(DQ (${ Id.VSub_Name preferred))} right: {(DQ (us))} ) ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:1811) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_ADDON_REGISTRY) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name preferred) (.gcr.io/google_containers))} spids: [1816] ) ] ) ] spids: [1776 1813] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_ADDON_REGISTRY) op: assign_op.Equal rhs: {(DQ (gcr.io/google_containers))} spids: [1828] ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: ENABLE_DOCKER_REGISTRY_CACHE span_id: 1844 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } right: {(DQ (true))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:1856) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:DOCKER_REGISTRY_MIRROR_URL) op: assign_op.Equal rhs: {(DQ ('https://') (${ Id.VSub_Name preferred) (-mirror.gcr.io))} spids: [1861] ) ] ) ] spids: [1838 1858] ) ] ) ] ) ) (command.ShFunction name: upload-server-tars body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:SERVER_BINARY_TAR_URL) op: assign_op.Equal rhs: (word.Empty) spids: [1933] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:SERVER_BINARY_TAR_HASH) op: assign_op.Equal rhs: (word.Empty) spids: [1936] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:SALT_TAR_URL) op: assign_op.Equal rhs: (word.Empty) spids: [1939] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:SALT_TAR_HASH) op: assign_op.Equal rhs: (word.Empty) spids: [1942] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_MANIFESTS_TAR_URL) op: assign_op.Equal rhs: (word.Empty) spids: [1945] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_MANIFESTS_TAR_HASH) op: assign_op.Equal rhs: (word.Empty) spids: [1948] ) ] ) (C {(local)} {(project_hash)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [{(which)} {(md5)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:1963) fd: -1 arg_word: {(/dev/null)} ) (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:1967) fd: 2 arg_word: {(1)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:1969) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:project_hash) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:1975) command_list: (command.CommandList children: [ (C {(md5)} {(-q)} {(-s)} {(DQ ($ Id.VSub_DollarName '$PROJECT'))}) ] ) ) } spids: [1974] ) ] ) ] spids: [1957 1971] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:project_hash) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:1992) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {(-n)} {(DQ ($ Id.VSub_DollarName '$PROJECT'))}) (C {(md5sum)}) (C {(awk)} {(SQ (Token id:Id.Lit_Chars val:'{ print $1 }' span_id:2010))} ) ] negated: F ) ] ) ) } spids: [1991] ) ] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:project_hash) op: assign_op.Equal rhs: { (braced_var_sub token: (Token id:Id.VSub_Name val:project_hash span_id:2029) suffix_op: (suffix_op.Slice begin: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) length: (arith_expr.ArithWord w:{(Id.Lit_Digits 10)}) ) ) } spids: [2027] ) ] ) (C {(set-preferred-region)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:SERVER_BINARY_TAR_HASH) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2043) command_list: (command.CommandList children: [(C {(sha1sum-file)} {(DQ (${ Id.VSub_Name SERVER_BINARY_TAR))})] ) ) } spids: [2042] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:SALT_TAR_HASH) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2055) command_list: (command.CommandList children: [(C {(sha1sum-file)} {(DQ (${ Id.VSub_Name SALT_TAR))})] ) ) } spids: [2054] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: KUBE_MANIFESTS_TAR span_id: 2074 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:2080) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_MANIFESTS_TAR_HASH) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2086) command_list: (command.CommandList children: [ (C {(sha1sum-file)} {(DQ (${ Id.VSub_Name KUBE_MANIFESTS_TAR))}) ] ) ) } spids: [2085] ) ] ) ] spids: [2066 2082] ) ] ) (C {(local)} {(Id.Lit_VarLike 'server_binary_tar_urls=') (sh_array_literal left:(Token id:Id.Op_LParen val:'(' span_id:2104)) } ) (C {(local)} {(Id.Lit_VarLike 'salt_tar_urls=') (sh_array_literal left:(Token id:Id.Op_LParen val:'(' span_id:2111)) } ) (C {(local)} {(Id.Lit_VarLike 'kube_manifest_tar_urls=') (sh_array_literal left:(Token id:Id.Op_LParen val:'(' span_id:2118)) } ) (command.ForEach iter_name: region iter_words: [ { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:PREFERRED_REGION span_id:2131) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:suffix) op: assign_op.Equal rhs: {(DQ (-) (${ Id.VSub_Name region))} spids: [2142] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name suffix))} right: {(DQ (-us))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:2168) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:suffix) op: assign_op.Equal rhs: {(DQ )} spids: [2173] ) ] ) ] spids: [2151 2170] ) ] ) (C {(local)} {(Id.Lit_VarLike 'staging_bucket=') (DQ ('gs://kubernetes-staging-') (${ Id.VSub_Name project_hash) (${ Id.VSub_Name suffix) ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [{(gsutil)} {(ls)} {(DQ (${ Id.VSub_Name staging_bucket))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:2214) fd: -1 arg_word: {(/dev/null)} ) ] ) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:2216) ) ] action: [ (C {(echo)} {(DQ ('Creating ') (${ Id.VSub_Name staging_bucket))}) (C {(gsutil)} {(mb)} {(-l)} {(DQ (${ Id.VSub_Name region))} {(DQ (${ Id.VSub_Name staging_bucket))} ) ] spids: [2200 2218] ) ] ) (C {(local)} {(Id.Lit_VarLike 'staging_path=') (DQ (${ Id.VSub_Name staging_bucket) (/) (${ Id.VSub_Name INSTANCE_PREFIX) (-devel) ) } ) (C {(echo)} { (DQ ('+++ Staging server tars to Google Storage: ') (${ Id.VSub_Name staging_path) ) } ) (C {(local)} {(Id.Lit_VarLike 'server_binary_gs_url=') (DQ (${ Id.VSub_Name staging_path) (/) (braced_var_sub token: (Token id:Id.VSub_Name val:SERVER_BINARY_TAR span_id:2289) suffix_op: (suffix_op.Unary op_id: Id.VOp1_DPound arg_word: {('*') (Id.Lit_Slash /)} ) ) ) } ) (C {(local)} {(Id.Lit_VarLike 'salt_gs_url=') (DQ (${ Id.VSub_Name staging_path) (/) (braced_var_sub token: (Token id:Id.VSub_Name val:SALT_TAR span_id:2306) suffix_op: (suffix_op.Unary op_id: Id.VOp1_DPound arg_word: {('*') (Id.Lit_Slash /)} ) ) ) } ) (C {(copy-to-staging)} {(DQ (${ Id.VSub_Name staging_path))} {(DQ (${ Id.VSub_Name server_binary_gs_url))} {(DQ (${ Id.VSub_Name SERVER_BINARY_TAR))} {(DQ (${ Id.VSub_Name SERVER_BINARY_TAR_HASH))} ) (C {(copy-to-staging)} {(DQ (${ Id.VSub_Name staging_path))} {(DQ (${ Id.VSub_Name salt_gs_url))} {(DQ (${ Id.VSub_Name SALT_TAR))} {(DQ (${ Id.VSub_Name SALT_TAR_HASH))} ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:server_binary_tar_urls) op: assign_op.PlusEqual rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:2374) words: [ { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: server_binary_gs_url span_id: 2377 ) suffix_op: (suffix_op.PatSub pat: {('gs:') (word_part.EscapedLiteral token: (Token id: Id.Lit_EscapedChar val: '\\/' span_id: 2380 ) ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\/' span_id:2381)) } replace: {('https:') (Id.Lit_Slash /) (Id.Lit_Slash /) (storage.googleapis.com) (Id.Lit_Slash /) } replace_mode: Id.Undefined_Tok ) ) ) } ] ) } spids: [2373] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:salt_tar_urls) op: assign_op.PlusEqual rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:2394) words: [ { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:salt_gs_url span_id:2397) suffix_op: (suffix_op.PatSub pat: {('gs:') (word_part.EscapedLiteral token: (Token id: Id.Lit_EscapedChar val: '\\/' span_id: 2400 ) ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\/' span_id:2401)) } replace: {('https:') (Id.Lit_Slash /) (Id.Lit_Slash /) (storage.googleapis.com) (Id.Lit_Slash /) } replace_mode: Id.Undefined_Tok ) ) ) } ] ) } spids: [2393] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: KUBE_MANIFESTS_TAR span_id: 2421 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:2427) ) ] action: [ (C {(local)} {(Id.Lit_VarLike 'kube_manifests_gs_url=') (DQ (${ Id.VSub_Name staging_path) (/) (braced_var_sub token: (Token id: Id.VSub_Name val: KUBE_MANIFESTS_TAR span_id: 2441 ) suffix_op: (suffix_op.Unary op_id: Id.VOp1_DPound arg_word: {('*') (Id.Lit_Slash /)} ) ) ) } ) (C {(copy-to-staging)} {(DQ (${ Id.VSub_Name staging_path))} {(DQ (${ Id.VSub_Name kube_manifests_gs_url))} {(DQ (${ Id.VSub_Name KUBE_MANIFESTS_TAR))} {(DQ (${ Id.VSub_Name KUBE_MANIFESTS_TAR_HASH))} ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:kube_manifests_tar_urls) op: assign_op.PlusEqual rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:2481) words: [ { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: kube_manifests_gs_url span_id: 2484 ) suffix_op: (suffix_op.PatSub pat: {('gs:') (word_part.EscapedLiteral token: (Token id: Id.Lit_EscapedChar val: '\\/' span_id: 2487 ) ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\/' span_id:2488)) } replace: {('https:') (Id.Lit_Slash /) (Id.Lit_Slash /) (storage.googleapis.com) (Id.Lit_Slash /) } replace_mode: Id.Undefined_Tok ) ) ) } ] ) } spids: [2480] ) ] ) ] spids: [2413 2429] ) ] ) ] ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:SERVER_BINARY_TAR_URL) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2508) command_list: (command.CommandList children: [ (C {(join_csv)} { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: server_binary_tar_urls span_id: 2513 ) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } ) ] ) ) } spids: [2507] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:SALT_TAR_URL) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2523) command_list: (command.CommandList children: [ (C {(join_csv)} { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:salt_tar_urls span_id:2528) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } ) ] ) ) } spids: [2522] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: KUBE_MANIFESTS_TAR span_id: 2545 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:2551) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_MANIFESTS_TAR_URL) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2557) command_list: (command.CommandList children: [ (C {(join_csv)} { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: kube_manifests_tar_urls span_id: 2562 ) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } ) ] ) ) } spids: [2556] ) ] ) ] spids: [2537 2553] ) ] ) ] ) ) (command.ShFunction name: detect-node-names body: (command.BraceGroup children: [ (C {(detect-project)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:INSTANCE_GROUPS) op: assign_op.Equal rhs: {(sh_array_literal left:(Token id:Id.Op_LParen val:'(' span_id:2610))} spids: [2609] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:INSTANCE_GROUPS) op: assign_op.PlusEqual rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:2615) words: [ { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2616) command_list: (command.CommandList children: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(gcloud)} {(compute)} {(instance-groups)} {(managed)} {(list)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--filter)} { (DQ ("name ~ '") (${ Id.VSub_Name NODE_INSTANCE_PREFIX) ("-.+' AND zone:(") (${ Id.VSub_Name ZONE) (')') ) } {(--format) (Id.Lit_Equals '=') (SQ (Token id:Id.Lit_Chars val:'value(name)' span_id:2658))} ) (C {(true)}) ] ) ] ) ) } ] ) } spids: [2614] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:NODE_NAMES) op: assign_op.Equal rhs: {(sh_array_literal left:(Token id:Id.Op_LParen val:'(' span_id:2669))} spids: [2668] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:INSTANCE_GROUPS span_id:2681) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:2690) ) ] action: [ (command.ForEach iter_name: group iter_words: [ { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:INSTANCE_GROUPS span_id:2703) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:NODE_NAMES) op: assign_op.PlusEqual rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:2715) words: [ { (command_sub left_token: (Token id: Id.Left_DollarParen val: '$(' span_id: 2716 ) command_list: (command.CommandList children: [ (C {(gcloud)} {(compute)} {(instance-groups)} {(managed)} {(list-instances)} {(DQ (${ Id.VSub_Name group))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--format) (Id.Lit_Equals '=') (SQ (Token id:Id.Lit_Chars val:'value(instance)' span_id:2756))} ) ] ) ) } ] ) } spids: [2714] ) ] ) ] ) ) ] spids: [2673 2692] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: HEAPSTER_MACHINE_TYPE span_id: 2780 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:2786) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:NODE_NAMES) op: assign_op.PlusEqual rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:2792) words: [{(DQ (${ Id.VSub_Name NODE_INSTANCE_PREFIX) (-heapster))}] ) } spids: [2791] ) ] ) ] spids: [2772 2788] ) ] ) (command.Simple words: [ {(echo)} { (DQ ('INSTANCE_GROUPS=') (braced_var_sub token: (Token id:Id.VSub_Name val:INSTANCE_GROUPS span_id:2811) bracket_op: (bracket_op.WholeArray op_id:Id.Arith_Star) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:2819) fd: -1 arg_word: {(2)} ) ] ) (command.Simple words: [ {(echo)} { (DQ ('NODE_NAMES=') (braced_var_sub token: (Token id:Id.VSub_Name val:NODE_NAMES span_id:2828) bracket_op: (bracket_op.WholeArray op_id:Id.Arith_Star) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:2836) fd: -1 arg_word: {(2)} ) ] ) ] ) ) (command.ShFunction name: detect-nodes body: (command.BraceGroup children: [ (C {(detect-project)}) (C {(detect-node-names)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_NODE_IP_ADDRESSES) op: assign_op.Equal rhs: {(sh_array_literal left:(Token id:Id.Op_LParen val:'(' span_id:2879))} spids: [2878] ) ] ) (command.ForExpr init: (arith_expr.BinaryAssign op_id: Id.Arith_Equal left: (sh_lhs_expr.Name name:i) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) cond: (arith_expr.Binary op_id: Id.Arith_Less left: (arith_expr.VarRef token:(Token id:Id.Lit_ArithVarLike val:i span_id:2892)) right: (arith_expr.ArithWord w: { (braced_var_sub token: (Token id:Id.VSub_Name val:NODE_NAMES span_id:2896) prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) } ) ) update: (arith_expr.UnaryAssign op_id:Id.Node_PostDPlus child:(sh_lhs_expr.Name name:i)) body: (command.DoGroup children: [ (C {(local)} {(Id.Lit_VarLike 'node_ip=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:2915) command_list: (command.CommandList children: [ (C {(gcloud)} {(compute)} {(instances)} {(describe)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:NODE_NAMES span_id:2944) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$i')} ) ) ) ) } {(--format) (Id.Lit_Equals '=') (SQ (Token id: Id.Lit_Chars val: 'value(networkInterfaces[0].accessConfigs[0].natIP)' span_id: 2954 ) ) } ) ] ) ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_z child: { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:node_ip span_id:2967) suffix_op: (suffix_op.Unary op_id:Id.VTest_Hyphen arg_word:(word.Empty)) ) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:2974) ) ] action: [ (command.Simple words: [ {(echo)} { (DQ ('Did not find ') (braced_var_sub token: (Token id:Id.VSub_Name val:NODE_NAMES span_id:2984) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$i')}) ) ) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:2991) fd: -1 arg_word: {(2)} ) ] ) ] spids: [2959 2976] ) ] else_action: [ (C {(echo)} { (DQ ('Found ') (braced_var_sub token: (Token id:Id.VSub_Name val:NODE_NAMES span_id:3003) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$i')}) ) ) (' at ') (${ Id.VSub_Name node_ip) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_NODE_IP_ADDRESSES) op: assign_op.PlusEqual rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:3016) words: [{(DQ (${ Id.VSub_Name node_ip))}] ) } spids: [3015] ) ] ) ] ) ] ) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_z child: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: KUBE_NODE_IP_ADDRESSES span_id: 3039 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_Hyphen arg_word:(word.Empty)) ) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:3045) ) ] action: [ (command.Simple words: [ {(echo)} { (DQ ( "Could not detect Kubernetes minion nodes. Make sure you've launched a cluster with 'kube-up.sh'" ) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3056) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:3060) arg_word: {(1)} ) ] spids: [3031 3047] ) ] ) ] ) ) (command.ShFunction name: detect-master body: (command.BraceGroup children: [ (C {(detect-project)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_MASTER) op: assign_op.Equal rhs: {(${ Id.VSub_Name MASTER_NAME)} spids: [3109] ) ] ) (command.Simple words: [ {(echo)} {(DQ ("Trying to find master named '") (${ Id.VSub_Name MASTER_NAME) ("'"))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3125) fd: -1 arg_word: {(2)} ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_z child: { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:KUBE_MASTER_IP span_id:3137) suffix_op: (suffix_op.Unary op_id:Id.VTest_Hyphen arg_word:(word.Empty)) ) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:3143) ) ] action: [ (C {(local)} {(Id.Lit_VarLike 'master_address_name=') (DQ (${ Id.VSub_Name MASTER_NAME) (-ip)) } ) (command.Simple words: [ {(echo)} {(DQ ("Looking for address '") (${ Id.VSub_Name master_address_name) ("'"))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3169) fd: -1 arg_word: {(2)} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_MASTER_IP) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:3174) command_list: (command.CommandList children: [ (C {(gcloud)} {(compute)} {(addresses)} {(describe)} {(DQ (${ Id.VSub_Name master_address_name))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--region)} {(DQ (${ Id.VSub_Name REGION))} {(-q)} {(--format) (Id.Lit_Equals '=') (SQ (Token id: Id.Lit_Chars val: 'value(address)' span_id: 3212 ) ) } ) ] ) ) } spids: [3173] ) ] ) ] spids: [3129 3145] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_z child: { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:KUBE_MASTER_IP span_id:3228) suffix_op: (suffix_op.Unary op_id:Id.VTest_Hyphen arg_word:(word.Empty)) ) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:3234) ) ] action: [ (command.Simple words: [ {(echo)} { (DQ ( "Could not detect Kubernetes master node. Make sure you've launched a cluster with 'kube-up.sh'" ) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3245) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:3249) arg_word: {(1)} ) ] spids: [3220 3236] ) ] ) (command.Simple words: [ {(echo)} { (DQ ('Using master: ') ($ Id.VSub_DollarName '$KUBE_MASTER') (' (external IP: ') ($ Id.VSub_DollarName '$KUBE_MASTER_IP') (')') ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3267) fd: -1 arg_word: {(2)} ) ] ) ] ) ) (command.ShFunction name: get-master-env body: (command.BraceGroup children: [ (command.Simple words: [ {(gcloud)} {(compute)} {(--project)} {(${ Id.VSub_Name PROJECT)} {(ssh)} {(--zone)} {(${ Id.VSub_Name ZONE)} {(${ Id.VSub_Name KUBE_MASTER)} {(--command)} { (DQ ("curl --fail --silent -H 'Metadata-Flavor: Google' ") (" 'http://metadata/computeMetadata/v1/instance/attributes/kube-env'") ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:3336) fd: 2 arg_word: {(/dev/null)} ) ] ) (command.Simple words: [ {(gcloud)} {(compute)} {(--project)} {(${ Id.VSub_Name PROJECT)} {(ssh)} {(--zone)} {(${ Id.VSub_Name ZONE)} {(${ Id.VSub_Name KUBE_MASTER)} {(--command)} { (DQ ("curl --fail --silent -H 'Metadata-Flavor: Google' ") ( " 'http://metadata/computeMetadata/v1/instance/attributes/kube-master-certs'" ) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:3372) fd: 2 arg_word: {(/dev/null)} ) ] ) ] ) ) (command.ShFunction name: create-static-ip body: (command.BraceGroup children: [ (C {(detect-project)}) (C {(local)} {(Id.Lit_VarLike 'attempt=') (0)}) (C {(local)} {(Id.Lit_VarLike 'REGION=') (DQ ($ Id.VSub_Number '$2'))}) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:3413) cond: [ (command.Sentence child: (C {(true)}) terminator: (Token id:Id.Op_Semi val:';' span_id:3416) ) ] body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [ {(gcloud)} {(compute)} {(addresses)} {(create)} {(DQ ($ Id.VSub_Number '$1'))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--region)} {(DQ (${ Id.VSub_Name REGION))} {(-q)} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:3457) fd: -1 arg_word: {(/dev/null)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:3460) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:start) op: assign_op.Equal rhs: { (DQ (command_sub left_token: (Token id: Id.Left_DollarParen val: '$(' span_id: 3471 ) command_list: (command.CommandList children: [ (C {(date)} {(Id.Lit_Other '+') (Id.Lit_Other '%') (s)}) ] ) ) ) } spids: [3469] ) ] ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:3481) cond: [ (command.Sentence child: (C {(true)}) terminator: (Token id:Id.Op_Semi val:';' span_id:3484) ) ] body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:now) op: assign_op.Equal rhs: { (DQ (command_sub left_token: (Token id: Id.Left_DollarParen val: '$(' span_id: 3491 ) command_list: (command.CommandList children: [ (C {(date)} {(Id.Lit_Other '+') (Id.Lit_Other '%') (s)} ) ] ) ) ) } spids: [3489] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_gt left: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.VarRef token: (Token id: Id.Lit_ArithVarLike val: now span_id: 3510 ) ) right: (arith_expr.VarRef token: (Token id: Id.Lit_ArithVarLike val: start span_id: 3514 ) ) ) ) } right: {(900)} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:3523) ) ] action: [ (C {(echo)} { (DQ ('Timeout while waiting for master IP visibility') ) } ) (command.ControlFlow token: (Token id: Id.ControlFlow_Exit val: exit span_id: 3535 ) arg_word: {(2)} ) ] spids: [3505 3525] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [ {(gcloud)} {(compute)} {(addresses)} {(describe)} {(DQ ($ Id.VSub_Number '$1'))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--region)} {(DQ (${ Id.VSub_Name REGION))} ] redirects: [ (redir.Redir op: (Token id: Id.Redir_Great val: '>' span_id: 3573 ) fd: -1 arg_word: {(/dev/null)} ) (redir.Redir op: (Token id: Id.Redir_GreatAnd val: '2>&' span_id: 3576 ) fd: 2 arg_word: {(1)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:3578) ) ] action: [ (command.ControlFlow token: (Token id: Id.ControlFlow_Break val: break span_id: 3583 ) ) ] spids: [3543 3580] ) ] ) (C {(echo)} {(DQ ('Master IP not visible yet. Waiting...'))}) (C {(sleep)} {(5)}) ] ) ) (command.ControlFlow token: (Token id:Id.ControlFlow_Break val:break span_id:3604) ) ] spids: [3421 3462] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [ {(gcloud)} {(compute)} {(addresses)} {(describe)} {(DQ ($ Id.VSub_Number '$1'))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--region)} {(DQ (${ Id.VSub_Name REGION))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:3645) fd: -1 arg_word: {(/dev/null)} ) (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:3648) fd: 2 arg_word: {(1)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:3650) ) ] action: [ (command.ControlFlow token: (Token id:Id.ControlFlow_Break val:break span_id:3659) ) ] spids: [3611 3652] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_Great left: (arith_expr.VarRef token: (Token id: Id.Lit_ArithVarLike val: attempt span_id: 3670 ) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 4)}) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:3678) ) ] action: [ (command.Simple words: [ {(echo)} {(-e)} { (DQ (${ Id.VSub_Name color_red) ('Failed to create static ip ') ($ Id.VSub_Number '$1') (' ') (${ Id.VSub_Name color_norm) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3699) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:3703) arg_word: {(2)} ) ] spids: [3666 3680] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:attempt) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$attempt')}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) } spids: [3711] ) ] ) (command.Simple words: [ {(echo)} {(-e)} { (DQ (${ Id.VSub_Name color_yellow) ('Attempt ') ($ Id.VSub_DollarName '$attempt') (' failed to create static ip ') ($ Id.VSub_Number '$1') ('. Retrying.') (${ Id.VSub_Name color_norm) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3738) fd: -1 arg_word: {(2)} ) ] ) (C {(sleep)} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Star left: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$attempt')}) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 5)}) ) ) } ) ] ) ) ] ) ) (command.ShFunction name: create-firewall-rule body: (command.BraceGroup children: [ (C {(detect-project)}) (C {(local)} {(Id.Lit_VarLike 'attempt=') (0)}) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:3789) cond: [ (command.Sentence child: (C {(true)}) terminator: (Token id:Id.Op_Semi val:';' span_id:3792) ) ] body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (C {(gcloud)} {(compute)} {(firewall-rules)} {(create)} {(DQ ($ Id.VSub_Number '$1'))} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--network)} {(DQ (${ Id.VSub_Name NETWORK))} {(--source-ranges)} {(DQ ($ Id.VSub_Number '$2'))} {(--target-tags)} {(DQ ($ Id.VSub_Number '$3'))} {(--allow)} {(tcp) (Id.Lit_Comma ',') (udp) (Id.Lit_Comma ',') (icmp) (Id.Lit_Comma ',') (esp) (Id.Lit_Comma ',') (ah) (Id.Lit_Comma ',') (sctp) } ) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:3864) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_Great left: (arith_expr.VarRef token: (Token id: Id.Lit_ArithVarLike val: attempt span_id: 3873 ) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 4)}) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:3881) ) ] action: [ (command.Simple words: [ {(echo)} {(-e)} { (DQ (${ Id.VSub_Name color_red) ('Failed to create firewall rule ') ($ Id.VSub_Number '$1') (' ') (${ Id.VSub_Name color_norm) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3902) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:3906) arg_word: {(2)} ) ] spids: [3869 3883] ) ] ) (command.Simple words: [ {(echo)} {(-e)} { (DQ (${ Id.VSub_Name color_yellow) ('Attempt ') (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$attempt')} ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) (' failed to create firewall rule ') ($ Id.VSub_Number '$1') ('. Retrying.') (${ Id.VSub_Name color_norm) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:3937) fd: -1 arg_word: {(2)} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:attempt) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$attempt')} ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) } spids: [3941] ) ] ) (C {(sleep)} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Star left: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$attempt')} ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 5)}) ) ) } ) ] spids: [3797 3866] ) ] else_action: [ (command.ControlFlow token: (Token id:Id.ControlFlow_Break val:break span_id:3965) ) ] ) ] ) ) ] ) ) (command.ShFunction name: make-gcloud-network-argument body: (command.BraceGroup children: [ (C {(local)} {(Id.Lit_VarLike 'network_project=') (DQ ($ Id.VSub_Number '$1'))}) (C {(local)} {(Id.Lit_VarLike 'region=') (DQ ($ Id.VSub_Number '$2'))}) (C {(local)} {(Id.Lit_VarLike 'network=') (DQ ($ Id.VSub_Number '$3'))}) (C {(local)} {(Id.Lit_VarLike 'subnet=') (DQ ($ Id.VSub_Number '$4'))}) (C {(local)} {(Id.Lit_VarLike 'address=') (DQ ($ Id.VSub_Number '$5'))}) (C {(local)} {(Id.Lit_VarLike 'enable_ip_alias=') (DQ ($ Id.VSub_Number '$6'))}) (C {(local)} {(Id.Lit_VarLike 'alias_size=') (DQ ($ Id.VSub_Number '$7'))}) (C {(local)} {(Id.Lit_VarLike 'networkURL=') (DQ (projects/) (${ Id.VSub_Name network_project) (/global/networks/) (${ Id.VSub_Name network) ) } ) (C {(local)} {(Id.Lit_VarLike 'subnetURL=') (DQ (projects/) (${ Id.VSub_Name network_project) (/regions/) (${ Id.VSub_Name region) (/subnetworks/) (braced_var_sub token: (Token id:Id.VSub_Name val:subnet span_id:4083) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } ) (C {(local)} {(Id.Lit_VarLike 'ret=') (DQ )}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name enable_ip_alias))} right: {(SQ (Token id:Id.Lit_Chars val:true span_id:4111))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:4115) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ret) op: assign_op.Equal rhs: {(DQ (--network-interface))} spids: [4120] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ret) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name ret) (' network=') (${ Id.VSub_Name networkURL))} spids: [4126] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ret) op: assign_op.Equal rhs: { (DQ (${ Id.VSub_Name ret) (',address=') (braced_var_sub token: (Token id:Id.VSub_Name val:address span_id:4149) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } spids: [4142] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ret) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name ret) (',subnet=') (${ Id.VSub_Name subnetURL))} spids: [4155] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ret) op: assign_op.Equal rhs: { (DQ (${ Id.VSub_Name ret) (',aliases=pods-default:') (${ Id.VSub_Name alias_size) ) } spids: [4167] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ret) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name ret) (' --no-can-ip-forward'))} spids: [4179] ) ] ) ] spids: [4098 4117] ) ] else_action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: { (braced_var_sub token: (Token id:Id.VSub_Name val:subnet span_id:4198) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{}) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:4203) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ret) op: assign_op.Equal rhs: { (DQ (${ Id.VSub_Name ret) (' --subnet ') (${ Id.VSub_Name subnetURL)) } spids: [4208] ) ] ) ] spids: [4191 4205] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ret) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name ret) (' --network ') (${ Id.VSub_Name networkURL))} spids: [4223] ) ] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ret) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name ret) (' --can-ip-forward'))} spids: [4239] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: { (braced_var_sub token: (Token id:Id.VSub_Name val:address span_id:4255) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{}) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:4260) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ret) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name ret) (' --address ') (${ Id.VSub_Name address))} spids: [4265] ) ] ) ] spids: [4248 4262] ) ] ) ] ) (C {(echo)} {(DQ (${ Id.VSub_Name ret))}) ] ) ) (command.ShFunction name: get-template-name-from-version body: (command.BraceGroup children: [ (command.Pipeline children: [ (C {(echo)} {(DQ (${ Id.VSub_Name NODE_INSTANCE_PREFIX) (-template-) (${ Id.VSub_Number 1))} ) (C {(cut)} {(-c)} {(1-63)}) (C {(sed)} {(SQ (Token id:Id.Lit_Chars val:'s/[\\.\\+]/-/g;s/-*$//g' span_id:4336))}) ] negated: F ) ] ) ) (command.ShFunction name: create-node-template body: (command.BraceGroup children: [ (C {(detect-project)}) (C {(detect-subnetworks)}) (C {(local)} {(Id.Lit_VarLike 'template_name=') (DQ ($ Id.VSub_Number '$1'))}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [ {(gcloud)} {(compute)} {(instance-templates)} {(describe)} {(DQ ($ Id.VSub_DollarName '$template_name'))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:4416) fd: -1 arg_word: {(/dev/null)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:4418) ) ] action: [ (command.Simple words: [ {(echo)} { (DQ ('Instance template ') (${ Id.VSub_Number 1) (' already exists; deleting.') ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:4433) fd: -1 arg_word: {(2)} ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [ {(gcloud)} {(compute)} {(instance-templates)} {(delete)} {(DQ ($ Id.VSub_DollarName '$template_name'))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--quiet)} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:4463) fd: -1 arg_word: {(/dev/null)} ) ] ) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:4465) ) ] action: [ (command.Simple words: [ {(echo)} {(-e)} { (DQ (${ Id.VSub_Name color_yellow) ('Failed to delete existing instance template') (${ Id.VSub_Name color_norm) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:4484) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:4488) arg_word: {(2)} ) ] spids: [4437 4467] ) ] ) ] spids: [4394 4420] ) ] ) (C {(local)} {(Id.Lit_VarLike 'gcloud=') (DQ (gcloud))}) (C {(local)} {(Id.Lit_VarLike 'accelerator_args=') (DQ )}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalNot child: (bool_expr.Unary op_id: Id.BoolUnary_z child: {(DQ (${ Id.VSub_Name NODE_ACCELERATORS))} ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:4539) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:accelerator_args) op: assign_op.Equal rhs: { (DQ ( '--maintenance-policy TERMINATE --restart-on-failure --accelerator ' ) (${ Id.VSub_Name NODE_ACCELERATORS) ) } spids: [4544] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:gcloud) op: assign_op.Equal rhs: {(DQ ('gcloud beta'))} spids: [4553] ) ] ) ] spids: [4524 4541] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: ENABLE_IP_ALIASES span_id: 4569 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } right: {(SQ (Token id:Id.Lit_Chars val:true span_id:4577))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:4581) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:gcloud) op: assign_op.Equal rhs: {(DQ ('gcloud beta'))} spids: [4586] ) ] ) ] spids: [4563 4583] ) ] ) (C {(local)} {(Id.Lit_VarLike 'preemptible_minions=') (DQ )}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name PREEMPTIBLE_NODE))} right: {(DQ (true))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:4620) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:preemptible_minions) op: assign_op.Equal rhs: {(DQ ('--preemptible --maintenance-policy TERMINATE'))} spids: [4625] ) ] ) ] spids: [4603 4622] ) ] ) (C {(local)} {(Id.Lit_VarLike 'local_ssds=') (DQ )}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalNot child: (bool_expr.Unary op_id: Id.BoolUnary_z child: { (braced_var_sub token: (Token id: Id.VSub_Name val: NODE_LOCAL_SSDS span_id: 4651 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_Plus arg_word:{(x)}) ) } ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:4657) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_ge left: {(${ Id.VSub_Name NODE_LOCAL_SSDS)} right: {(1)} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:4683) ) ] action: [ (command.ForEach iter_name: i iter_words: [ { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:4694) command_list: (command.CommandList children: [(C {(seq)} {(${ Id.VSub_Name NODE_LOCAL_SSDS)})] ) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:local_ssds) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName '$local_ssds') ('--local-ssd=interface=SCSI ') ) } spids: [4706] ) ] ) ] ) ) ] spids: [4670 4685] ) ] ) ] spids: [4642 4659] ) ] ) (C {(local)} {(Id.Lit_VarLike 'network=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:4726) command_list: (command.CommandList children: [ (C {(make-gcloud-network-argument)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(DQ (${ Id.VSub_Name REGION))} {(DQ (${ Id.VSub_Name NETWORK))} { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:SUBNETWORK span_id:4757) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } {(DQ )} { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:ENABLE_IP_ALIASES span_id:4771) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:IP_ALIAS_SIZE span_id:4780) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } ) ] ) ) } ) (C {(local)} {(Id.Lit_VarLike 'attempt=') (1)}) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:4794) cond: [ (command.Sentence child: (C {(true)}) terminator: (Token id:Id.Op_Semi val:';' span_id:4797) ) ] body: (command.DoGroup children: [ (command.Simple words: [ {(echo)} { (DQ ('Attempt ') (${ Id.VSub_Name attempt) (' to create ') (${ Id.VSub_Number 1) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:4815) fd: -1 arg_word: {(2)} ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [ {(${ Id.VSub_Name gcloud)} {(compute)} {(instance-templates)} {(create)} {(DQ ($ Id.VSub_DollarName '$template_name'))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--machine-type)} {(DQ (${ Id.VSub_Name NODE_SIZE))} {(--boot-disk-type)} {(DQ (${ Id.VSub_Name NODE_DISK_TYPE))} {(--boot-disk-size)} {(DQ (${ Id.VSub_Name NODE_DISK_SIZE))} {(--image-project) (Id.Lit_Equals '=') (DQ (${ Id.VSub_Name NODE_IMAGE_PROJECT)) } {(--image)} {(DQ (${ Id.VSub_Name NODE_IMAGE))} {(--tags)} {(DQ (${ Id.VSub_Name NODE_TAG))} {(${ Id.VSub_Name accelerator_args)} {(${ Id.VSub_Name local_ssds)} {(--region)} {(DQ (${ Id.VSub_Name REGION))} {(${ Id.VSub_Name network)} {(${ Id.VSub_Name preemptible_minions)} {($ Id.VSub_Number '$2')} {(--metadata-from-file)} {($ Id.VSub_Number '$3')} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:4953) fd: -1 arg_word: {(2)} ) ] ) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:4955) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_Great left: (arith_expr.VarRef token: (Token id: Id.Lit_ArithVarLike val: attempt span_id: 4964 ) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 5)}) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:4972) ) ] action: [ (command.Simple words: [ {(echo)} {(-e)} { (DQ (${ Id.VSub_Name color_red) ('Failed to create instance template ') ($ Id.VSub_DollarName '$template_name') (' ') (${ Id.VSub_Name color_norm) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:4993) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:4997) arg_word: {(2)} ) ] spids: [4960 4974] ) ] ) (command.Simple words: [ {(echo)} {(-e)} { (DQ (${ Id.VSub_Name color_yellow) ('Attempt ') (${ Id.VSub_Name attempt) (' failed to create instance template ') ($ Id.VSub_DollarName '$template_name') ('. Retrying.') (${ Id.VSub_Name color_norm) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:5025) fd: -1 arg_word: {(2)} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:attempt) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$attempt')} ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) } spids: [5029] ) ] ) (C {(sleep)} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Star left: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$attempt')} ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 5)}) ) ) } ) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Simple words: [ {(gcloud)} {(compute)} {(instance-templates)} {(delete)} {(DQ ($ Id.VSub_DollarName '$template_name'))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:5083) fd: -1 arg_word: {(/dev/null)} ) ] ) (C {(true)}) ] ) ] spids: [4819 4957] ) ] else_action: [ (command.ControlFlow token: (Token id:Id.ControlFlow_Break val:break span_id:5094) ) ] ) ] ) ) ] ) ) (command.ShFunction name: add-instance-metadata body: (command.BraceGroup children: [ (C {(local)} {(-r)} {(Id.Lit_VarLike 'instance=') ($ Id.VSub_Number '$1')}) (C {(shift)} {(1)}) (C {(local)} {(-r)} {(Id.Lit_VarLike 'kvs=') (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:5141) words: [{(DQ ($ Id.VSub_At '$@'))}] ) } ) (C {(detect-project)}) (C {(local)} {(Id.Lit_VarLike 'attempt=') (0)}) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:5159) cond: [ (command.Sentence child: (C {(true)}) terminator: (Token id:Id.Op_Semi val:';' span_id:5162) ) ] body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (C {(gcloud)} {(compute)} {(instances)} {(add-metadata)} {(DQ (${ Id.VSub_Name instance))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(--metadata)} { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:kvs span_id:5211) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } ) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:5217) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_Great left: (arith_expr.VarRef token: (Token id: Id.Lit_ArithVarLike val: attempt span_id: 5226 ) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 5)}) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:5234) ) ] action: [ (command.Simple words: [ {(echo)} {(-e)} { (DQ (${ Id.VSub_Name color_red) ('Failed to add instance metadata in ') (${ Id.VSub_Name instance) (' ') (${ Id.VSub_Name color_norm) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:5257) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:5261) arg_word: {(2)} ) ] spids: [5222 5236] ) ] ) (command.Simple words: [ {(echo)} {(-e)} { (DQ (${ Id.VSub_Name color_yellow) ('Attempt ') (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$attempt')} ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) (' failed to add metadata in ') (${ Id.VSub_Name instance) ('. Retrying.') (${ Id.VSub_Name color_norm) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:5294) fd: -1 arg_word: {(2)} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:attempt) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$attempt')} ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) } spids: [5298] ) ] ) (C {(sleep)} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Star left: (arith_expr.ArithWord w:{(Id.Lit_Digits 5)}) right: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$attempt')} ) ) ) } ) ] spids: [5167 5219] ) ] else_action: [ (command.ControlFlow token: (Token id:Id.ControlFlow_Break val:break span_id:5322) ) ] ) ] ) ) ] ) ) (command.ShFunction name: add-instance-metadata-from-file body: (command.BraceGroup children: [ (C {(local)} {(-r)} {(Id.Lit_VarLike 'instance=') ($ Id.VSub_Number '$1')}) (C {(shift)} {(1)}) (C {(local)} {(-r)} {(Id.Lit_VarLike 'kvs=') (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:5369) words: [{(DQ ($ Id.VSub_At '$@'))}] ) } ) (C {(detect-project)}) (C {(local)} {(Id.Lit_VarLike 'attempt=') (0)}) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:5387) cond: [ (command.Sentence child: (C {(true)}) terminator: (Token id:Id.Op_Semi val:';' span_id:5390) ) ] body: (command.DoGroup children: [ (C {(echo)} { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:kvs span_id:5399) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (C {(gcloud)} {(compute)} {(instances)} {(add-metadata)} {(DQ (${ Id.VSub_Name instance))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(--metadata-from-file)} { (DQ (command_sub left_token: (Token id: Id.Left_DollarParen val: '$(' span_id: 5450 ) command_list: (command.CommandList children: [ (C {(join_csv)} { (braced_var_sub token: (Token id: Id.VSub_Name val: kvs span_id: 5454 ) bracket_op: (bracket_op.WholeArray op_id: Id.Lit_At ) ) } ) ] ) ) ) } ) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:5461) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_Great left: (arith_expr.VarRef token: (Token id: Id.Lit_ArithVarLike val: attempt span_id: 5470 ) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 5)}) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:5478) ) ] action: [ (command.Simple words: [ {(echo)} {(-e)} { (DQ (${ Id.VSub_Name color_red) ('Failed to add instance metadata in ') (${ Id.VSub_Name instance) (' ') (${ Id.VSub_Name color_norm) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:5501) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:5505) arg_word: {(2)} ) ] spids: [5466 5480] ) ] ) (command.Simple words: [ {(echo)} {(-e)} { (DQ (${ Id.VSub_Name color_yellow) ('Attempt ') (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$attempt')} ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) (' failed to add metadata in ') (${ Id.VSub_Name instance) ('. Retrying.') (${ Id.VSub_Name color_norm) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:5538) fd: -1 arg_word: {(2)} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:attempt) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$attempt')} ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) } spids: [5542] ) ] ) (C {(sleep)} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Star left: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$attempt')} ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 5)}) ) ) } ) ] spids: [5407 5463] ) ] else_action: [ (command.ControlFlow token: (Token id:Id.ControlFlow_Break val:break span_id:5566) ) ] ) ] ) ) ] ) ) (command.ShFunction name: kube-up body: (command.BraceGroup children: [ (C {(kube) (Id.Lit_Other ':') (Id.Lit_Other ':') (util) (Id.Lit_Other ':') (Id.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)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (braced_var_sub token: (Token id: Id.VSub_Name val: KUBE_USE_EXISTING_MASTER span_id: 5645 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{}) ) } right: {(DQ (true))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:5656) ) ] action: [ (C {(detect-master)}) (C {(parse-master-env)}) (C {(create-subnetworks)}) (C {(detect-subnetworks)}) (C {(create-nodes)}) ] spids: [5640 5658] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (braced_var_sub token: (Token id: Id.VSub_Name val: KUBE_REPLICATE_EXISTING_MASTER span_id: 5681 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{}) ) } right: {(DQ (true))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:5692) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalAnd left: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {(DQ (${ Id.VSub_Name MASTER_OS_DISTRIBUTION))} right: {(DQ (gci))} ) right: (bool_expr.LogicalAnd left: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {(DQ (${ Id.VSub_Name MASTER_OS_DISTRIBUTION))} right: {(DQ (debian))} ) right: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {(DQ (${ Id.VSub_Name MASTER_OS_DISTRIBUTION))} right: {(DQ (ubuntu))} ) ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:5742) ) ] action: [ (C {(echo)} {(DQ ('Master replication supported only for gci, debian, and ubuntu'))} ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:5754) arg_word: {(1)} ) ] spids: [5697 5744] ) ] ) (C {(create-loadbalancer)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children:[(C {(replicate-master)})] negated:T) terminator: (Token id:Id.Op_Semi val:';' span_id:5774) ) ] action: [ (command.AndOr ops: [Id.Op_DPipe] children: [(C {(remove-replica-from-etcd)} {(2379)}) (C {(true)})] ) (command.AndOr ops: [Id.Op_DPipe] children: [(C {(remove-replica-from-etcd)} {(4002)}) (C {(true)})] ) ] spids: [5769 5776] ) ] ) ] spids: [5676 5694] ) ] 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)}) ] ) ] ) ) (command.ShFunction name: check-existing body: (command.BraceGroup children: [ (C {(local)} {(Id.Lit_VarLike 'running_in_terminal=') (false)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr:(bool_expr.Unary op_id:Id.BoolUnary_t child:{(1)})) terminator: (Token id:Id.Op_Semi val:';' span_id:5869) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:running_in_terminal) op: assign_op.Equal rhs: {(true)} spids: [5874] ) ] ) ] spids: [5860 5871] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalOr left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(${ Id.VSub_Name running_in_terminal)} right: {(DQ (true))} ) right: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(${ Id.VSub_Name KUBE_UP_AUTOMATIC_CLEANUP)} right: {(DQ (true))} ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:5909) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children:[(C {(check-resources)})] negated:T) terminator: (Token id:Id.Op_Semi val:';' span_id:5919) ) ] action: [ (C {(local)} {(Id.Lit_VarLike 'run_kube_down=') (DQ (n))}) (command.Simple words: [{(echo)} {(DQ (${ Id.VSub_Name KUBE_RESOURCE_FOUND) (' found.'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:5941) fd: -1 arg_word: {(2)} ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalAnd left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(${ Id.VSub_Name running_in_terminal)} right: {(DQ (true))} ) right: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(${ Id.VSub_Name KUBE_UP_AUTOMATIC_CLEANUP)} right: {(DQ (false))} ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:5976) ) ] action: [ (C {(read)} {(-p)} { (DQ ( 'Would you like to shut down the old cluster (call kube-down)? [y/N] ' ) ) } {(run_kube_down)} ) ] spids: [5949 5978] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalOr left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(${ Id.VSub_Name run_kube_down)} right: {(DQ (y))} ) right: (bool_expr.LogicalOr left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(${ Id.VSub_Name run_kube_down)} right: {(DQ (Y))} ) right: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(${ Id.VSub_Name KUBE_UP_AUTOMATIC_CLEANUP)} right: {(DQ (true))} ) ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:6034) ) ] action: [ (command.Simple words: [{(echo)} {(DQ ('... calling kube-down'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:6045) fd: -1 arg_word: {(2)} ) ] ) (C {(kube-down)}) ] spids: [5995 6036] ) ] ) ] spids: [5914 5921] ) ] ) ] spids: [5882 5911] ) ] ) ] ) ) (command.ShFunction name: create-network body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [ {(gcloud)} {(compute)} {(networks)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(describe)} {(DQ (${ Id.VSub_Name NETWORK))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:6098) fd: -1 arg_word: {(/dev/null)} ) ] ) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:6100) ) ] action: [ (C {(local)} {(Id.Lit_VarLike 'network_mode=') (DQ (auto))}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: CREATE_CUSTOM_NETWORK span_id: 6127 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } right: {(DQ (true))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:6139) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:network_mode) op: assign_op.Equal rhs: {(DQ (custom))} spids: [6144] ) ] ) ] spids: [6121 6141] ) ] ) (C {(echo)} { (DQ ('Creating new ') (${ Id.VSub_Name network_mode) (' network: ') (${ Id.VSub_Name NETWORK) ) } ) (C {(gcloud)} {(compute)} {(networks)} {(create)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(DQ (${ Id.VSub_Name NETWORK))} {(--mode) (Id.Lit_Equals '=') (DQ (${ Id.VSub_Name network_mode))} ) ] spids: [6072 6102] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:PREEXISTING_NETWORK) op: assign_op.Equal rhs: {(true)} spids: [6201] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:PREEXISTING_NETWORK_MODE) op: assign_op.Equal rhs: { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:6207) command_list: (command.CommandList children: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(gcloud)} {(compute)} {(networks)} {(list)} {(--filter) (Id.Lit_Equals '=') (DQ ("name=('") (${ Id.VSub_Name NETWORK) ("')")) } {(--project)} {(${ Id.VSub_Name NETWORK_PROJECT)} {(--format) (Id.Lit_Equals '=') (SQ (Token id: Id.Lit_Chars val: 'value(x_gcloud_subnet_mode)' span_id: 6235 ) ) } ) (C {(true)}) ] ) ] ) ) ) } spids: [6205] ) ] ) (C {(echo)} { (DQ ('Found existing network ') (${ Id.VSub_Name NETWORK) (' in ') (${ Id.VSub_Name PREEXISTING_NETWORK_MODE) (' mode.') ) } ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [ {(gcloud)} {(compute)} {(firewall-rules)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(describe)} {(DQ (${ Id.VSub_Name CLUSTER_NAME) (-default-internal-master))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:6291) fd: -1 arg_word: {(/dev/null)} ) ] ) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:6293) ) ] action: [ (command.Sentence child: (C {(gcloud)} {(compute)} {(firewall-rules)} {(create)} {(DQ (${ Id.VSub_Name CLUSTER_NAME) (-default-internal-master))} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--network)} {(DQ (${ Id.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 (${ Id.VSub_Name MASTER_TAG))} ) terminator: (Token id:Id.Op_Amp val:'&' span_id:6358) ) ] spids: [6264 6295] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [ {(gcloud)} {(compute)} {(firewall-rules)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(describe)} {(DQ (${ Id.VSub_Name CLUSTER_NAME) (-default-internal-node))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:6392) fd: -1 arg_word: {(/dev/null)} ) ] ) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:6394) ) ] action: [ (command.Sentence child: (C {(gcloud)} {(compute)} {(firewall-rules)} {(create)} {(DQ (${ Id.VSub_Name CLUSTER_NAME) (-default-internal-node))} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--network)} {(DQ (${ Id.VSub_Name NETWORK))} {(--source-ranges)} {(DQ (10.0.0.0/8))} {(--allow)} {(DQ ('tcp:1-65535,udp:1-65535,icmp'))} {(--target-tags)} {(DQ (${ Id.VSub_Name NODE_TAG))} ) terminator: (Token id:Id.Op_Amp val:'&' span_id:6459) ) ] spids: [6365 6396] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [ {(gcloud)} {(compute)} {(firewall-rules)} {(describe)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(DQ (${ Id.VSub_Name NETWORK) (-default-ssh))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:6493) fd: -1 arg_word: {(/dev/null)} ) ] ) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:6495) ) ] action: [ (command.Sentence child: (C {(gcloud)} {(compute)} {(firewall-rules)} {(create)} {(DQ (${ Id.VSub_Name NETWORK) (-default-ssh))} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--network)} {(DQ (${ Id.VSub_Name NETWORK))} {(--source-ranges)} {(DQ (0.0.0.0/0))} {(--allow)} {(DQ ('tcp:22'))} ) terminator: (Token id:Id.Op_Amp val:'&' span_id:6551) ) ] spids: [6466 6497] ) ] ) ] ) ) (command.ShFunction name: expand-default-subnetwork body: (command.BraceGroup children: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(gcloud)} {(compute)} {(networks)} {(switch-mode)} {(DQ (${ Id.VSub_Name NETWORK))} {(--mode)} {(custom)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--quiet)} ) (C {(true)}) ] ) (C {(gcloud)} {(compute)} {(networks)} {(subnets)} {(expand-ip-range)} {(DQ (${ Id.VSub_Name NETWORK))} {(--region) (Id.Lit_Equals '=') (DQ (${ Id.VSub_Name REGION))} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--prefix-length) (Id.Lit_Equals '=') (19)} {(--quiet)} ) ] ) ) (command.ShFunction name: create-subnetworks body: (command.BraceGroup children: [ (command.Case to_match: {(${ Id.VSub_Name ENABLE_IP_ALIASES)} arms: [ (case_arm pat_list: [{(true)}] action: [(C {(echo)} {(DQ ('IP aliases are enabled. Creating subnetworks.'))})] spids: [6674 6675 6682 -1] ) (case_arm pat_list: [{(false)}] action: [ (C {(echo)} {(DQ ('IP aliases are disabled.'))}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobEqual left: {(DQ (${ Id.VSub_Name ENABLE_BIG_CLUSTER_SUBNETS))} right: {(DQ (true))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:6713) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {(DQ (${ Id.VSub_Name PREEXISTING_NETWORK))} right: {(DQ (true))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:6735) ) ] action: [(C {(expand-default-subnetwork)})] spids: [6718 6737] ) ] else_action: [ (C {(echo)} { (DQ (${ Id.VSub_Name color_yellow) ('Using pre-existing network ') (${ Id.VSub_Name NETWORK) (", subnets won't be expanded to /19!") (${ Id.VSub_Name color_norm) ) } ) ] ) ] spids: [6696 6715] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalAnd left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: CREATE_CUSTOM_NETWORK span_id: 6772 ) suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonHyphen arg_word: (word.Empty) ) ) ) } right: {(DQ (true))} ) right: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {(DQ (${ Id.VSub_Name PREEXISTING_NETWORK))} right: {(DQ (true))} ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:6798) ) ] action: [ (C {(gcloud)} {(compute)} {(networks)} {(subnets)} {(create)} {(DQ (${ Id.VSub_Name SUBNETWORK))} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--region)} {(DQ (${ Id.VSub_Name REGION))} {(--network)} {(DQ (${ Id.VSub_Name NETWORK))} {(--range)} {(DQ (${ Id.VSub_Name NODE_IP_RANGE))} ) ] spids: [6766 6800] ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:6855) ) ] spids: [6685 6686 6856 -1] ) (case_arm pat_list: [{(Id.Lit_Star '*')}] action: [ (C {(echo)} { (DQ (${ Id.VSub_Name color_red) ('Invalid argument to ENABLE_IP_ALIASES') (${ Id.VSub_Name color_norm) ) } ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:6875) arg_word: {(1)} ) ] spids: [6859 6860 6878 -1] ) ] ) (C {(local)} {(Id.Lit_VarLike 'subnet=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:6896) command_list: (command.CommandList children: [ (command.Simple words: [ {(gcloud)} {(beta)} {(compute)} {(networks)} {(subnets)} {(describe)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--region)} {(${ Id.VSub_Name REGION)} {(${ Id.VSub_Name IP_ALIAS_SUBNETWORK)} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:6933) fd: 2 arg_word: {(/dev/null)} ) ] ) ] ) ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id:Id.BoolUnary_z child:{(${ Id.VSub_Name subnet)}) ) terminator: (Token id:Id.Op_Semi val:';' span_id:6949) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {(${ Id.VSub_Name IP_ALIAS_SUBNETWORK)} right: {(${ Id.VSub_Name INSTANCE_PREFIX) (-subnet-default)} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:6974) ) ] action: [ (C {(echo)} { (DQ (${ Id.VSub_Name color_red) ('Subnetwork ') (${ Id.VSub_Name NETWORK) (':') (${ Id.VSub_Name IP_ALIAS_SUBNETWORK) (' does not exist') (${ Id.VSub_Name color_norm) ) } ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:7000) arg_word: {(1)} ) ] spids: [6958 6976] ) ] ) (C {(echo)} { (DQ ('Creating subnet ') (${ Id.VSub_Name NETWORK) (':') (${ Id.VSub_Name IP_ALIAS_SUBNETWORK) ) } ) (C {(gcloud)} {(beta)} {(compute)} {(networks)} {(subnets)} {(create)} {(${ Id.VSub_Name IP_ALIAS_SUBNETWORK)} {(--description)} { (DQ ('Automatically generated subnet for ') (${ Id.VSub_Name INSTANCE_PREFIX) (' cluster. This will be removed on cluster teardown.') ) } {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--network)} {(${ Id.VSub_Name NETWORK)} {(--region)} {(${ Id.VSub_Name REGION)} {(--range)} {(${ Id.VSub_Name NODE_IP_RANGE)} {(--secondary-range)} {(DQ ('pods-default=') (${ Id.VSub_Name CLUSTER_IP_RANGE))} {(--secondary-range)} {(DQ ('services-default=') (${ Id.VSub_Name SERVICE_CLUSTER_IP_RANGE))} ) (C {(echo)} {(DQ ('Created subnetwork ') (${ Id.VSub_Name IP_ALIAS_SUBNETWORK))}) ] spids: [6938 6951] ) ] else_action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (C {(echo)} {(${ Id.VSub_Name subnet)}) (C {(grep)} {(--quiet)} {(secondaryIpRanges)} {(${ Id.VSub_Name subnet)}) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:7144) ) ] action: [ (C {(echo)} { (DQ (${ Id.VSub_Name color_red) ('Subnet ') (${ Id.VSub_Name IP_ALIAS_SUBNETWORK) (' does not have a secondary range') (${ Id.VSub_Name color_norm) ) } ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:7166) arg_word: {(1)} ) ] spids: [7123 7146] ) ] ) ] ) ] ) ) (command.ShFunction name: detect-subnetworks body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: { (braced_var_sub token: (Token id:Id.VSub_Name val:SUBNETWORK span_id:7222) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{}) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:7227) ) ] action: [ (C {(echo)} {(DQ ('Using subnet ') (${ Id.VSub_Name SUBNETWORK))}) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:7242) arg_word: {(0)} ) ] spids: [7215 7229] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: { (braced_var_sub token: (Token id: Id.VSub_Name val: IP_ALIAS_SUBNETWORK span_id: 7258 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{}) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:7263) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:SUBNETWORK) op: assign_op.Equal rhs: {(${ Id.VSub_Name IP_ALIAS_SUBNETWORK)} spids: [7268] ) ] ) (C {(echo)} {(DQ ('Using IP Alias subnet ') (${ Id.VSub_Name SUBNETWORK))}) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:7284) arg_word: {(0)} ) ] spids: [7251 7265] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:SUBNETWORK) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:7294) command_list: (command.CommandList children: [ (command.Simple words: [ {(gcloud)} {(beta)} {(compute)} {(networks)} {(subnets)} {(list)} {(--network) (Id.Lit_Equals '=') (${ Id.VSub_Name NETWORK)} {(--regions) (Id.Lit_Equals '=') (${ Id.VSub_Name REGION)} {(--project) (Id.Lit_Equals '=') (${ Id.VSub_Name NETWORK_PROJECT)} {(--limit) (Id.Lit_Equals '=') (1)} {(--format) (Id.Lit_Equals '=') (SQ (Token id:Id.Lit_Chars val:'value(name)' span_id:7342)) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:7345) fd: 2 arg_word: {(/dev/null)} ) ] ) ] ) ) } spids: [7293] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: { (braced_var_sub token: (Token id:Id.VSub_Name val:SUBNETWORK span_id:7358) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{}) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:7363) ) ] action: [ (C {(echo)} { (DQ ('Found subnet for region ') (${ Id.VSub_Name REGION) (' in network ') (${ Id.VSub_Name NETWORK) (': ') (${ Id.VSub_Name SUBNETWORK) ) } ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:7386) arg_word: {(0)} ) ] spids: [7351 7365] ) ] ) (C {(echo)} { (DQ (${ Id.VSub_Name color_red) ('Could not find subnetwork with region ') (${ Id.VSub_Name REGION) (', network ') (${ Id.VSub_Name NETWORK) (', and project ') (${ Id.VSub_Name NETWORK_PROJECT) ) } ) ] ) ) (command.ShFunction name: delete-all-firewall-rules body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:fws) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:7430) command_list: (command.CommandList children: [ (C {(gcloud)} {(compute)} {(firewall-rules)} {(list)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--filter) (Id.Lit_Equals '=') (DQ ('network=') (${ Id.VSub_Name NETWORK)) } {(--format) (Id.Lit_Equals '=') (DQ ('value(name)'))} ) ] ) ) } spids: [7429] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:7462) ) ] action: [ (C {(echo)} { (DQ ('Deleting firewall rules remaining in network ') (${ Id.VSub_Name NETWORK) (': ') (${ Id.VSub_Name fws) ) } ) (C {(delete-firewall-rules)} {(DQ ($ Id.VSub_DollarName '$fws'))}) ] spids: [7427 7464] ) ] else_action: [ (C {(echo)} {(DQ ('Failed to list firewall rules from the network ') (${ Id.VSub_Name NETWORK))} ) ] ) ] ) ) (command.ShFunction name: delete-firewall-rules body: (command.BraceGroup children: [ (command.ForEach iter_name: fw iter_words: [{($ Id.VSub_At '$@')}] do_arg_iter: F body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: { (command_sub left_token: (Token id: Id.Left_DollarParen val: '$(' span_id: 7533 ) command_list: (command.CommandList children: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Simple words: [ {(gcloud)} {(compute)} {(firewall-rules)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(describe)} {(DQ (${ Id.VSub_Name fw))} {(--format) (Id.Lit_Equals '=') (SQ (Token id: Id.Lit_Chars val: 'value(name)' span_id: 7559 ) ) } ] redirects: [ (redir.Redir op: (Token id: Id.Redir_Great val: '2>' span_id: 7562 ) fd: 2 arg_word: {(/dev/null)} ) ] ) (C {(true)}) ] ) ] ) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:7571) ) ] action: [ (command.Sentence child: (C {(gcloud)} {(compute)} {(firewall-rules)} {(delete)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--quiet)} {(DQ (${ Id.VSub_Name fw))} ) terminator: (Token id:Id.Op_Amp val:'&' span_id:7600) ) ] spids: [7527 7573] ) ] ) ] ) ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(kube) (Id.Lit_Other ':') (Id.Lit_Other ':') (util) (Id.Lit_Other ':') (Id.Lit_Other ':') (wait-for-jobs) } ) (command.BraceGroup children: [ (command.Simple words: [ {(echo)} {(-e)} { (DQ (${ Id.VSub_Name color_red) ('Failed to delete firewall rules.') (${ Id.VSub_Name color_norm) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:7636) fd: -1 arg_word: {(2)} ) ] ) ] ) ] ) ] ) ) (command.ShFunction name: delete-network body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:7660) command_list: (command.CommandList children: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Simple words: [ {(gcloud)} {(compute)} {(networks)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(describe)} {(DQ (${ Id.VSub_Name NETWORK))} {(--format) (Id.Lit_Equals '=') (SQ (Token id: Id.Lit_Chars val: 'value(name)' span_id: 7686 ) ) } ] redirects: [ (redir.Redir op: (Token id: Id.Redir_Great val: '2>' span_id: 7689 ) fd: 2 arg_word: {(/dev/null)} ) ] ) (C {(true)}) ] ) ] ) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:7698) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (C {(gcloud)} {(compute)} {(networks)} {(delete)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--quiet)} {(DQ (${ Id.VSub_Name NETWORK))} ) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:7730) ) ] action: [ (C {(echo)} { (DQ ("Failed to delete network '") (${ Id.VSub_Name NETWORK) ("'. Listing firewall-rules:") ) } ) (C {(gcloud)} {(compute)} {(firewall-rules)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(list)} {(--filter) (Id.Lit_Equals '=') (DQ ('network=') (${ Id.VSub_Name NETWORK))} ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:7772) arg_word: {(1)} ) ] spids: [7703 7732] ) ] ) ] spids: [7654 7700] ) ] ) ] ) ) (command.ShFunction name: delete-subnetworks body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: { (braced_var_sub token: (Token id:Id.VSub_Name val:ENABLE_IP_ALIASES span_id:7799) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{}) ) } right: {(DQ (true))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:7810) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:mode) op: assign_op.Equal rhs: { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:7821) command_list: (command.CommandList children: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(gcloud)} {(compute)} {(networks)} {(list)} {(--filter) (Id.Lit_Equals '=') (DQ ("name=('") (${ Id.VSub_Name NETWORK) ("')")) } {(--project)} {(${ Id.VSub_Name NETWORK_PROJECT)} {(--format) (Id.Lit_Equals '=') (SQ (Token id: Id.Lit_Chars val: 'value(x_gcloud_subnet_mode)' span_id: 7849 ) ) } ) (C {(true)}) ] ) ] ) ) ) } spids: [7819] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name mode))} right: {(DQ (CUSTOM))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:7876) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobEqual left: {(DQ (${ Id.VSub_Name ENABLE_BIG_CLUSTER_SUBNETS))} right: {(DQ (true))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:7898) ) ] action: [ (C {(echo)} {(DQ ('Deleting default subnets...'))}) (C {(local)} {(Id.Lit_VarLike 'parallelism=') (9)}) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Pipeline children: [ (C {(gcloud)} {(compute)} {(networks)} {(subnets)} {(list)} {(--network) (Id.Lit_Equals '=') (DQ (${ Id.VSub_Name NETWORK)) } {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--format) (Id.Lit_Equals '=') (SQ (Token id: Id.Lit_Chars val: 'value(region.basename())' span_id: 7949 ) ) } ) (C {(xargs)} {(-i)} {(-P)} {(${ Id.VSub_Name parallelism)} {(gcloud)} {(--quiet)} {(compute)} {(networks)} {(subnets)} {(delete)} {(DQ (${ Id.VSub_Name NETWORK))} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--region) (Id.Lit_Equals '=') (DQ ('{}'))} ) ] negated: F ) (C {(true)}) ] ) ] spids: [7881 7900] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: CREATE_CUSTOM_NETWORK span_id: 8009 ) suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonHyphen arg_word: (word.Empty) ) ) ) } right: {(DQ (true))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:8021) ) ] action: [ (C {(echo)} {(DQ ('Deleting custom subnet...'))}) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(gcloud)} {(--quiet)} {(compute)} {(networks)} {(subnets)} {(delete)} {(DQ (${ Id.VSub_Name SUBNETWORK))} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--region) (Id.Lit_Equals '=') (DQ (${ Id.VSub_Name REGION))} ) (C {(true)}) ] ) ] spids: [8003 8023] ) ] ) ] spids: [7859 7878] ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:8078) ) ] spids: [7794 7812] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(${ Id.VSub_Name IP_ALIAS_SUBNETWORK)} right: {(${ Id.VSub_Name INSTANCE_PREFIX) (-subnet-default)} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:8105) ) ] action: [ (C {(echo)} { (DQ ('Removing auto-created subnet ') (${ Id.VSub_Name NETWORK) (':') (${ Id.VSub_Name IP_ALIAS_SUBNETWORK) ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: { (command_sub left_token: (Token id: Id.Left_DollarParen val: '$(' span_id: 8130 ) command_list: (command.CommandList children: [ (command.Simple words: [ {(gcloud)} {(beta)} {(compute)} {(networks)} {(subnets)} {(describe)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--region)} {(${ Id.VSub_Name REGION)} {(${ Id.VSub_Name IP_ALIAS_SUBNETWORK)} ] redirects: [ (redir.Redir op: (Token id: Id.Redir_Great val: '2>' span_id: 8167 ) fd: 2 arg_word: {(/dev/null)} ) ] ) ] ) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:8172) ) ] action: [ (C {(gcloud)} {(beta)} {(--quiet)} {(compute)} {(networks)} {(subnets)} {(delete)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--region)} {(${ Id.VSub_Name REGION)} {(${ Id.VSub_Name IP_ALIAS_SUBNETWORK)} ) ] spids: [8124 8174] ) ] ) ] spids: [8089 8107] ) ] ) ] ) ) (command.ShFunction name: create-etcd-certs body: (command.BraceGroup children: [ (C {(local)} {(Id.Lit_VarLike 'host=') (${ Id.VSub_Number 1)}) (C {(local)} {(Id.Lit_VarLike 'ca_cert=') (braced_var_sub token: (Token id:Id.VSub_Number val:2 span_id:8300) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{}) ) } ) (C {(local)} {(Id.Lit_VarLike 'ca_key=') (braced_var_sub token: (Token id:Id.VSub_Number val:3 span_id:8309) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{}) ) } ) (command.Simple words: [ {(generate-etcd-cert)} {(DQ (${ Id.VSub_Name KUBE_TEMP) (/cfssl))} {(DQ (${ Id.VSub_Name host))} {(DQ (peer))} {(DQ (peer))} ] more_env: [ (env_pair name: GEN_ETCD_CA_CERT val: {(DQ (${ Id.VSub_Name ca_cert))} spids: [8315] ) (env_pair name: GEN_ETCD_CA_KEY val: {(DQ (${ Id.VSub_Name ca_key))} spids: [8322] ) ] ) (C {(pushd)} {(DQ (${ Id.VSub_Name KUBE_TEMP) (/cfssl))}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ETCD_CA_KEY_BASE64) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:8367) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(cat)} {(DQ (ca-key.pem))}) (C {(base64)}) (C {(tr)} {(-d)} {(SQ (Token id:Id.Lit_Chars val:'\\r\\n' span_id:8385))} ) ] negated: F ) ] ) ) } spids: [8366] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ETCD_CA_CERT_BASE64) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:8391) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(cat)} {(DQ (ca.pem))}) (C {(gzip)}) (C {(base64)}) (C {(tr)} {(-d)} {(SQ (Token id:Id.Lit_Chars val:'\\r\\n' span_id:8413))} ) ] negated: F ) ] ) ) } spids: [8390] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ETCD_PEER_KEY_BASE64) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:8419) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(cat)} {(DQ (peer-key.pem))}) (C {(base64)}) (C {(tr)} {(-d)} {(SQ (Token id:Id.Lit_Chars val:'\\r\\n' span_id:8437))} ) ] negated: F ) ] ) ) } spids: [8418] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ETCD_PEER_CERT_BASE64) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:8443) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(cat)} {(DQ (peer.pem))}) (C {(gzip)}) (C {(base64)}) (C {(tr)} {(-d)} {(SQ (Token id:Id.Lit_Chars val:'\\r\\n' span_id:8465))} ) ] negated: F ) ] ) ) } spids: [8442] ) ] ) (C {(popd)}) ] ) ) (command.ShFunction name: create-master body: (command.BraceGroup children: [ (C {(echo)} {(DQ ('Starting master and configuring firewalls'))}) (command.Sentence child: (C {(gcloud)} {(compute)} {(firewall-rules)} {(create)} {(DQ (${ Id.VSub_Name MASTER_NAME) (-https))} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--network)} {(DQ (${ Id.VSub_Name NETWORK))} {(--target-tags)} {(DQ (${ Id.VSub_Name MASTER_TAG))} {(--allow)} {(tcp) (Id.Lit_Other ':') (443)} ) terminator: (Token id:Id.Op_Amp val:'&' span_id:8544) ) (C {(gcloud)} {(compute)} {(disks)} {(create)} {(DQ (${ Id.VSub_Name MASTER_NAME) (-pd))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(--type)} {(DQ (${ Id.VSub_Name MASTER_DISK_TYPE))} {(--size)} {(DQ (${ Id.VSub_Name MASTER_DISK_SIZE))} ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalAnd left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name ENABLE_CLUSTER_REGISTRY))} right: {(true)} ) right: (bool_expr.Unary op_id: Id.BoolUnary_n child: {(DQ (${ Id.VSub_Name CLUSTER_REGISTRY_DISK))} ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:8642) ) ] action: [ (command.Sentence child: (C {(gcloud)} {(compute)} {(disks)} {(create)} {(DQ (${ Id.VSub_Name CLUSTER_REGISTRY_DISK))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(--type)} {(DQ (${ Id.VSub_Name CLUSTER_REGISTRY_DISK_TYPE_GCE))} {(--size)} {(DQ (${ Id.VSub_Name CLUSTER_REGISTRY_DISK_SIZE))} ) terminator: (Token id:Id.Op_Amp val:'&' span_id:8701) ) ] spids: [8617 8644] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [ {(gcloud)} {(compute)} {(firewall-rules)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(describe)} {(DQ (${ Id.VSub_Name MASTER_NAME) (-etcd))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:8739) fd: -1 arg_word: {(/dev/null)} ) ] ) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:8741) ) ] action: [ (command.Sentence child: (C {(gcloud)} {(compute)} {(firewall-rules)} {(create)} {(DQ (${ Id.VSub_Name MASTER_NAME) (-etcd))} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--network)} {(DQ (${ Id.VSub_Name NETWORK))} {(--source-tags)} {(DQ (${ Id.VSub_Name MASTER_TAG))} {(--allow)} {(DQ ('tcp:2380,tcp:2381'))} {(--target-tags)} {(DQ (${ Id.VSub_Name MASTER_TAG))} ) terminator: (Token id:Id.Op_Amp val:'&' span_id:8809) ) ] spids: [8712 8743] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBELET_TOKEN) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:8833) command_list: (command.CommandList children: [ (command.Pipeline children: [ (command.Simple words: [ {(dd)} {(Id.Lit_VarLike 'if=') (/dev/urandom)} {(Id.Lit_VarLike 'bs=') (128)} {(Id.Lit_VarLike 'count=') (1)} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:8845) fd: 2 arg_word: {(/dev/null)} ) ] ) (C {(base64)}) (C {(tr)} {(-d)} {(DQ ('=+/'))}) (command.Simple words: [ {(dd)} {(Id.Lit_VarLike 'bs=') (32)} {(Id.Lit_VarLike 'count=') (1)} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:8872) fd: 2 arg_word: {(/dev/null)} ) ] ) ] negated: F ) ] ) ) } spids: [8832] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_PROXY_TOKEN) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:8878) command_list: (command.CommandList children: [ (command.Pipeline children: [ (command.Simple words: [ {(dd)} {(Id.Lit_VarLike 'if=') (/dev/urandom)} {(Id.Lit_VarLike 'bs=') (128)} {(Id.Lit_VarLike 'count=') (1)} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:8890) fd: 2 arg_word: {(/dev/null)} ) ] ) (C {(base64)}) (C {(tr)} {(-d)} {(DQ ('=+/'))}) (command.Simple words: [ {(dd)} {(Id.Lit_VarLike 'bs=') (32)} {(Id.Lit_VarLike 'count=') (1)} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:8917) fd: 2 arg_word: {(/dev/null)} ) ] ) ] negated: F ) ] ) ) } spids: [8877] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: ENABLE_NODE_PROBLEM_DETECTOR span_id: 8928 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } right: {(DQ (standalone))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:8940) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:NODE_PROBLEM_DETECTOR_TOKEN) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:8946) command_list: (command.CommandList children: [ (command.Pipeline children: [ (command.Simple words: [ {(dd)} {(Id.Lit_VarLike 'if=') (/dev/urandom)} {(Id.Lit_VarLike 'bs=') (128)} {(Id.Lit_VarLike 'count=') (1)} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:8958) fd: 2 arg_word: {(/dev/null)} ) ] ) (C {(base64)}) (C {(tr)} {(-d)} {(DQ ('=+/'))}) (command.Simple words: [ {(dd)} {(Id.Lit_VarLike 'bs=') (32)} {(Id.Lit_VarLike 'count=') (1)} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:8985) fd: 2 arg_word: {(/dev/null)} ) ] ) ] negated: F ) ] ) ) } spids: [8945] ) ] ) ] spids: [8922 8942] ) ] ) (C {(create-static-ip)} {(DQ (${ Id.VSub_Name MASTER_NAME) (-ip))} {(DQ (${ Id.VSub_Name REGION))} ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:MASTER_RESERVED_IP) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:9019) command_list: (command.CommandList children: [ (C {(gcloud)} {(compute)} {(addresses)} {(describe)} {(DQ (${ Id.VSub_Name MASTER_NAME) (-ip))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--region)} {(DQ (${ Id.VSub_Name REGION))} {(-q)} {(--format) (Id.Lit_Equals '=') (SQ (Token id:Id.Lit_Chars val:'value(address)' span_id:9058)) } ) ] ) ) } spids: [9018] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: REGISTER_MASTER_KUBELET span_id: 9070 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } right: {(DQ (true))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:9082) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBELET_APISERVER) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name MASTER_RESERVED_IP))} spids: [9087] ) ] ) ] spids: [9064 9084] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBERNETES_MASTER_NAME) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name MASTER_RESERVED_IP))} spids: [9099] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:MASTER_ADVERTISE_ADDRESS) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name MASTER_RESERVED_IP))} spids: [9107] ) ] ) (C {(create-certs)} {(DQ (${ Id.VSub_Name MASTER_RESERVED_IP))}) (C {(create-etcd-certs)} {(${ Id.VSub_Name MASTER_NAME)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_ge left: {(DQ (${ Id.VSub_Name NUM_NODES))} right: {(DQ (50))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:9150) ) ] action: [(C {(create-master-instance)} {(DQ (${ Id.VSub_Name MASTER_RESERVED_IP))})] spids: [9133 9152] ) ] else_action: [ (command.Sentence child: (C {(create-master-instance)} {(DQ (${ Id.VSub_Name MASTER_RESERVED_IP))}) terminator: (Token id:Id.Op_Amp val:'&' span_id:9183) ) ] ) ] ) ) (command.ShFunction name: add-replica-to-etcd body: (command.BraceGroup children: [ (C {(local)} {(-r)} {(Id.Lit_VarLike 'client_port=') (DQ (${ Id.VSub_Number 1))}) (C {(local)} {(-r)} {(Id.Lit_VarLike 'internal_port=') (DQ (${ Id.VSub_Number 2))}) (C {(gcloud)} {(compute)} {(ssh)} {(DQ (${ Id.VSub_Name EXISTING_MASTER_NAME))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--zone)} {(DQ (${ Id.VSub_Name EXISTING_MASTER_ZONE))} {(--command)} { (DQ ('curl localhost:') (${ Id.VSub_Name client_port) ('/v2/members -XPOST -H ') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:9301) ) ('Content-Type: application/json') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:9303) ) (" -d '{") (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:9305)) (peerURLs) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:9307)) (':[') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:9309) ) ('https://') (${ Id.VSub_Name REPLICA_NAME) (':') (${ Id.VSub_Name internal_port) (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:9318) ) ("]}' -s") ) } ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:9323) arg_word: {($ Id.VSub_QMark '$?')} ) ] ) ) (command.ShFunction name: set-existing-master body: (command.BraceGroup children: [ (C {(local)} {(Id.Lit_VarLike 'existing_master=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:9360) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(gcloud)} {(compute)} {(instances)} {(list)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--filter)} { (DQ ("name ~ '") (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:9385) command_list: (command.CommandList children: [(C {(get-replica-name-regexp)})] ) ) ("'") ) } {(--format)} {(DQ ('value(name,zone)'))} ) (C {(head)} {(-n1)}) ] negated: F ) ] ) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:EXISTING_MASTER_NAME) op: assign_op.Equal rhs: { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:9409) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {(DQ (${ Id.VSub_Name existing_master))}) (C {(cut)} {(-f1)}) ] negated: F ) ] ) ) ) } spids: [9407] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:EXISTING_MASTER_ZONE) op: assign_op.Equal rhs: { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:9429) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {(DQ (${ Id.VSub_Name existing_master))}) (C {(cut)} {(-f2)}) ] negated: F ) ] ) ) ) } spids: [9427] ) ] ) ] ) ) (command.ShFunction name: replicate-master body: (command.BraceGroup children: [ (C {(set-replica-name)}) (C {(set-existing-master)}) (C {(echo)} { (DQ ('Experimental: replicating existing master ') (${ Id.VSub_Name EXISTING_MASTER_ZONE) (/) (${ Id.VSub_Name EXISTING_MASTER_NAME) (' as ') (${ Id.VSub_Name ZONE) (/) (${ Id.VSub_Name REPLICA_NAME) ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [(C {(add-replica-to-etcd)} {(2379)} {(2380)})] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:9501) ) ] action: [ (C {(echo)} {(DQ ('Failed to add master replica to etcd cluster.'))}) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:9513) arg_word: {(1)} ) ] spids: [9492 9503] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [(C {(add-replica-to-etcd)} {(4002)} {(2381)})] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:9530) ) ] action: [ (C {(echo)} {(DQ ('Failed to add master replica to etcd events cluster.'))}) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:9542) arg_word: {(1)} ) ] spids: [9521 9532] ) ] ) (C {(gcloud)} {(compute)} {(disks)} {(create)} {(DQ (${ Id.VSub_Name REPLICA_NAME) (-pd))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(--type)} {(DQ (${ Id.VSub_Name MASTER_DISK_TYPE))} {(--size)} {(DQ (${ Id.VSub_Name MASTER_DISK_SIZE))} ) (C {(local)} {(Id.Lit_VarLike 'existing_master_replicas=') (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:9620) command_list: (command.CommandList children:[(C {(get-all-replica-names)})]) ) ) } ) (C {(replicate-master-instance)} {(DQ (${ Id.VSub_Name EXISTING_MASTER_ZONE))} {(DQ (${ Id.VSub_Name EXISTING_MASTER_NAME))} {(DQ (${ Id.VSub_Name existing_master_replicas))} ) (C {(gcloud)} {(compute)} {(target-pools)} {(add-instances)} {(DQ (${ Id.VSub_Name MASTER_NAME))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(--instances)} {(DQ (${ Id.VSub_Name REPLICA_NAME))} ) ] ) ) (command.ShFunction name: attach-external-ip body: (command.BraceGroup children: [ (C {(local)} {(Id.Lit_VarLike 'NAME=') (${ Id.VSub_Number 1)}) (C {(local)} {(Id.Lit_VarLike 'ZONE=') (${ Id.VSub_Number 2)}) (C {(local)} {(Id.Lit_VarLike 'IP_ADDR=') (braced_var_sub token: (Token id:Id.VSub_Number val:3 span_id:9746) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{}) ) } ) (C {(local)} {(Id.Lit_VarLike 'ACCESS_CONFIG_NAME=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:9754) command_list: (command.CommandList children: [ (C {(gcloud)} {(compute)} {(instances)} {(describe)} {(DQ (${ Id.VSub_Name NAME))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(--format) (Id.Lit_Equals '=') (DQ ('value(networkInterfaces[0].accessConfigs[0].name)')) } ) ] ) ) } ) (C {(gcloud)} {(compute)} {(instances)} {(delete-access-config)} {(DQ (${ Id.VSub_Name NAME))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(--access-config-name)} {(DQ (${ Id.VSub_Name ACCESS_CONFIG_NAME))} ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_z child: {(${ Id.VSub_Name IP_ADDR)} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:9851) ) ] action: [ (C {(gcloud)} {(compute)} {(instances)} {(add-access-config)} {(DQ (${ Id.VSub_Name NAME))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(--access-config-name)} {(DQ (${ Id.VSub_Name ACCESS_CONFIG_NAME))} ) ] spids: [9840 9853] ) ] else_action: [ (C {(gcloud)} {(compute)} {(instances)} {(add-access-config)} {(DQ (${ Id.VSub_Name NAME))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(--access-config-name)} {(DQ (${ Id.VSub_Name ACCESS_CONFIG_NAME))} {(--address)} {(DQ (${ Id.VSub_Name IP_ADDR))} ) ] ) ] ) ) (command.ShFunction name: create-loadbalancer body: (command.BraceGroup children: [ (C {(detect-master)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [ {(gcloud)} {(compute)} {(forwarding-rules)} {(describe)} {(${ Id.VSub_Name MASTER_NAME)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--region)} {(${ Id.VSub_Name REGION)} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:10031) fd: -1 arg_word: {(/dev/null)} ) (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:10035) fd: 2 arg_word: {(1)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:10037) ) ] action: [ (C {(echo)} {(DQ ('Load balancer already exists'))}) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:10049) ) ] spids: [10001 10039] ) ] ) (C {(local)} {(Id.Lit_VarLike 'EXISTING_MASTER_NAME=') (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:10060) command_list: (command.CommandList children:[(C {(get-all-replica-names)})]) ) ) } ) (C {(local)} {(Id.Lit_VarLike 'EXISTING_MASTER_ZONE=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:10069) command_list: (command.CommandList children: [ (C {(gcloud)} {(compute)} {(instances)} {(list)} {(DQ (${ Id.VSub_Name EXISTING_MASTER_NAME))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--format) (Id.Lit_Equals '=') (DQ ('value(zone)'))} ) ] ) ) } ) (C {(echo)} { (DQ ('Creating load balancer in front of an already existing master in ') (${ Id.VSub_Name EXISTING_MASTER_ZONE) ) } ) (C {(attach-external-ip)} {(DQ (${ Id.VSub_Name EXISTING_MASTER_NAME))} {(DQ (${ Id.VSub_Name EXISTING_MASTER_ZONE))} ) (C {(gcloud)} {(compute)} {(target-pools)} {(create)} {(DQ (${ Id.VSub_Name MASTER_NAME))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--region)} {(DQ (${ Id.VSub_Name REGION))} ) (C {(gcloud)} {(compute)} {(target-pools)} {(add-instances)} {(DQ (${ Id.VSub_Name MASTER_NAME))} {(--instances)} {(DQ (${ Id.VSub_Name EXISTING_MASTER_NAME))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--zone)} {(DQ (${ Id.VSub_Name EXISTING_MASTER_ZONE))} ) (C {(gcloud)} {(compute)} {(forwarding-rules)} {(create)} {(${ Id.VSub_Name MASTER_NAME)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--region)} {(${ Id.VSub_Name REGION)} {(--target-pool)} {(${ Id.VSub_Name MASTER_NAME)} {(--address) (Id.Lit_Equals '=') (${ Id.VSub_Name KUBE_MASTER_IP)} {(--ports) (Id.Lit_Equals '=') (443)} ) (C {(echo)} {(-n)} {(DQ ('Waiting for the load balancer configuration to propagate...'))}) (C {(local)} {(Id.Lit_VarLike 'counter=') (0)}) (command.WhileUntil keyword: (Token id:Id.KW_Until val:until span_id:10284) cond: [ (command.Sentence child: (C { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:10286) command_list: (command.CommandList children: [ (command.Simple words: [ {(curl)} {(-k)} {(-m1)} {(https) (Id.Lit_Other ':') (//) (${ Id.VSub_Name KUBE_MASTER_IP)} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:10300) fd: -1 arg_word: {(/dev/null)} ) ] ) ] ) ) } ) terminator: (Token id:Id.Op_Semi val:';' span_id:10304) ) ] body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:counter) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.VarRef token: (Token id: Id.Lit_ArithVarLike val: counter span_id: 10311 ) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) } spids: [10309] ) ] ) (C {(echo)} {(-n)} {(.)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_ge left: {(${ Id.VSub_Name counter)} right: {(1800)} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:10338) ) ] action: [ (command.Simple words: [ {(echo)} {(-e)} { (DQ (${ Id.VSub_Name color_red) (TIMEOUT) (${ Id.VSub_Name color_norm) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:10357) fd: -1 arg_word: {(2)} ) ] ) (command.Simple words: [ {(echo)} {(-e)} { (DQ (${ Id.VSub_Name color_red) ('Load balancer failed to initialize within ') (${ Id.VSub_Name counter) (' seconds.') (${ Id.VSub_Name color_norm) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:10379) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:10383) arg_word: {(2)} ) ] spids: [10325 10340] ) ] ) ] ) ) (C {(echo)} {(DQ (DONE))}) ] ) ) (command.ShFunction name: create-nodes-firewall body: (command.BraceGroup children: [ (command.Sentence child: (C {(create-firewall-rule)} {(DQ (${ Id.VSub_Name NODE_TAG) (-all))} {(DQ (${ Id.VSub_Name CLUSTER_IP_RANGE))} {(DQ (${ Id.VSub_Name NODE_TAG))} ) terminator: (Token id:Id.Op_Amp val:'&' span_id:10437) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: ENABLE_NODE_LOGGING span_id: 10451 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_Hyphen arg_word:(word.Empty)) ) ) } right: {(DQ (true))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:10463) ) ] action: [ (C {(echo)} { (DQ ('+++ Logging using Fluentd to ') (braced_var_sub token: (Token id:Id.VSub_Name val:LOGGING_DESTINATION span_id:10473) suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonHyphen arg_word: {(unknown)} ) ) ) } ) ] spids: [10445 10465] ) ] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(kube) (Id.Lit_Other ':') (Id.Lit_Other ':') (util) (Id.Lit_Other ':') (Id.Lit_Other ':') (wait-for-jobs) } ) (command.BraceGroup children: [ (command.Simple words: [ {(echo)} {(-e)} { (DQ (${ Id.VSub_Name color_red) ('Some commands failed.') (${ Id.VSub_Name color_norm) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:10515) fd: -1 arg_word: {(2)} ) ] ) ] ) ] ) ] ) ) (command.ShFunction name: get-scope-flags body: (command.BraceGroup children: [ (C {(local)} {(Id.Lit_VarLike 'scope_flags=')}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: {(DQ (${ Id.VSub_Name NODE_SCOPES))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:10551) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:scope_flags) op: assign_op.Equal rhs: {(DQ ('--scopes ') (${ Id.VSub_Name NODE_SCOPES))} spids: [10556] ) ] ) ] spids: [10538 10553] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:scope_flags) op: assign_op.Equal rhs: {(DQ (--no-scopes))} spids: [10568] ) ] ) ] ) (C {(echo)} {(DQ (${ Id.VSub_Name scope_flags))}) ] ) ) (command.ShFunction name: create-nodes-template body: (command.BraceGroup children: [ (C {(echo)} {(DQ ('Creating nodes.'))}) (C {(local)} {(Id.Lit_VarLike 'scope_flags=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:10608) command_list: (command.CommandList children:[(C {(get-scope-flags)})]) ) } ) (C {(write-node-env)}) (C {(local)} {(Id.Lit_VarLike 'template_name=') (DQ (${ Id.VSub_Name NODE_INSTANCE_PREFIX) (-template)) } ) (C {(create-node-instance-template)} {($ Id.VSub_DollarName '$template_name')}) ] ) ) (command.ShFunction name: set_num_migs body: (command.BraceGroup children: [ (C {(local)} {(Id.Lit_VarLike 'defaulted_max_instances_per_mig=') (braced_var_sub token: (Token id:Id.VSub_Name val:MAX_INSTANCES_PER_MIG span_id:10664) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{(1000)}) ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_le left: {(${ Id.VSub_Name defaulted_max_instances_per_mig)} right: {(DQ (0))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:10686) ) ] action: [ (C {(echo)} {(DQ ('MAX_INSTANCES_PER_MIG cannot be negative. Assuming default 1000'))} ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:defaulted_max_instances_per_mig) op: assign_op.Equal rhs: {(1000)} spids: [10698] ) ] ) ] spids: [10671 10688] ) ] ) (C {(export)} {(Id.Lit_VarLike 'NUM_MIGS=') (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Slash left: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w:{(${ Id.VSub_Name NUM_NODES)}) right: (arith_expr.ArithWord w: {(${ Id.VSub_Name defaulted_max_instances_per_mig)} ) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) right: (arith_expr.ArithWord w: {(${ Id.VSub_Name defaulted_max_instances_per_mig)} ) ) ) } ) ] ) ) (command.ShFunction name: create-nodes body: (command.BraceGroup children: [ (C {(local)} {(Id.Lit_VarLike 'template_name=') (DQ (${ Id.VSub_Name NODE_INSTANCE_PREFIX) (-template)) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_z child: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: HEAPSTER_MACHINE_TYPE span_id: 10783 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:10789) ) ] action: [ (C {(local)} {(-r)} {(Id.Lit_VarLike 'nodes=') (DQ (${ Id.VSub_Name NUM_NODES))}) ] spids: [10775 10791] ) ] else_action: [ (C {(local)} {(-r)} {(Id.Lit_VarLike 'nodes=') (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:NUM_NODES span_id:10816) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) } ) ] ) (C {(local)} {(Id.Lit_VarLike 'instances_left=') (${ Id.VSub_Name nodes)}) (command.ForExpr init: (arith_expr.BinaryAssign op_id: Id.Arith_Equal left: (sh_lhs_expr.Name name:i) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) cond: (arith_expr.Binary op_id: Id.Arith_LessEqual left: (arith_expr.VarRef token:(Token id:Id.Lit_ArithVarLike val:i span_id:10851)) right: (arith_expr.ArithWord w:{(${ Id.VSub_Name NUM_MIGS)}) ) update: (arith_expr.UnaryAssign op_id:Id.Node_PostDPlus child:(sh_lhs_expr.Name name:i)) body: (command.DoGroup children: [ (C {(local)} {(Id.Lit_VarLike 'group_name=') (DQ (${ Id.VSub_Name NODE_INSTANCE_PREFIX) (-group-) ($ Id.VSub_DollarName '$i') ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_DollarName '$i')} right: {(${ Id.VSub_Name NUM_MIGS)} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:10892) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:group_name) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name NODE_INSTANCE_PREFIX) (-group))} spids: [10905] ) ] ) ] spids: [10879 10894] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:this_mig_size) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Slash left: (arith_expr.ArithWord w:{(${ Id.VSub_Name instances_left)}) right: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.ArithWord w:{(${ Id.VSub_Name NUM_MIGS)}) right: (arith_expr.ArithWord w:{(${ Id.VSub_Name i)}) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) ) } spids: [10921] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:instances_left) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.VarRef token: (Token id: Id.Lit_ArithVarLike val: instances_left span_id: 10946 ) ) right: (arith_expr.ArithWord w:{(${ Id.VSub_Name this_mig_size)}) ) ) } spids: [10944] ) ] ) (command.Sentence child: (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(gcloud)} {(compute)} {(instance-groups)} {(managed)} {(create)} {(DQ (${ Id.VSub_Name group_name))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(--base-instance-name)} {(DQ (${ Id.VSub_Name group_name))} {(--size)} {(DQ (${ Id.VSub_Name this_mig_size))} {(--template)} {(DQ ($ Id.VSub_DollarName '$template_name'))} ) (C {(true)}) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:11025) ) (command.Sentence child: (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(gcloud)} {(compute)} {(instance-groups)} {(managed)} {(wait-until-stable)} {(DQ (${ Id.VSub_Name group_name))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} ) (C {(true)}) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:11069) ) ] ) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: HEAPSTER_MACHINE_TYPE span_id: 11084 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:11090) ) ] action: [ (C {(echo)} { (DQ ('Creating a special node for heapster with machine-type ') (${ Id.VSub_Name HEAPSTER_MACHINE_TYPE) ) } ) (C {(create-heapster-node)}) ] spids: [11076 11092] ) ] ) ] ) ) (command.ShFunction name: create-heapster-node body: (command.BraceGroup children: [ (C {(local)} {(Id.Lit_VarLike 'gcloud=') (DQ (gcloud))}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: ENABLE_IP_ALIASES span_id: 11185 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } right: {(SQ (Token id:Id.Lit_Chars val:true span_id:11193))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:11197) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:gcloud) op: assign_op.Equal rhs: {(DQ ('gcloud beta'))} spids: [11202] ) ] ) ] spids: [11179 11199] ) ] ) (C {(local)} {(Id.Lit_VarLike 'network=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:11215) command_list: (command.CommandList children: [ (C {(make-gcloud-network-argument)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(DQ (${ Id.VSub_Name REGION))} {(DQ (${ Id.VSub_Name NETWORK))} { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:SUBNETWORK span_id:11246) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } {(DQ )} { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:ENABLE_IP_ALIASES span_id:11260) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:IP_ALIAS_SIZE span_id:11269) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } ) ] ) ) } ) (C {(${ Id.VSub_Name gcloud)} {(compute)} {(instances)} {(create)} {(DQ (${ Id.VSub_Name NODE_INSTANCE_PREFIX) (-heapster))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(--machine-type) (Id.Lit_Equals '=') (DQ (${ Id.VSub_Name HEAPSTER_MACHINE_TYPE))} {(--boot-disk-type)} {(DQ (${ Id.VSub_Name NODE_DISK_TYPE))} {(--boot-disk-size)} {(DQ (${ Id.VSub_Name NODE_DISK_SIZE))} {(--image-project) (Id.Lit_Equals '=') (DQ (${ Id.VSub_Name NODE_IMAGE_PROJECT))} {(--image)} {(DQ (${ Id.VSub_Name NODE_IMAGE))} {(--tags)} {(DQ (${ Id.VSub_Name NODE_TAG))} {(${ Id.VSub_Name network)} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:11384) command_list: (command.CommandList children:[(C {(get-scope-flags)})]) ) } {(--metadata-from-file)} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:11393) command_list: (command.CommandList children:[(C {(get-node-instance-metadata)})]) ) ) } ) ] ) ) (command.ShFunction name: create-cluster-autoscaler-mig-config body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_lt left: {(${ Id.VSub_Name AUTOSCALER_MIN_NODES)} right: {(0)} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:11459) ) ] action: [ (C {(echo)} {(DQ ('AUTOSCALER_MIN_NODES must be greater or equal 0'))}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:11471) arg_word: {(2)} ) ] spids: [11446 11461] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_lt left: {(${ Id.VSub_Name AUTOSCALER_MAX_NODES)} right: {(${ Id.VSub_Name NUM_MIGS)} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:11503) ) ] action: [ (C {(echo)} { (DQ ('AUTOSCALER_MAX_NODES must be greater or equal ') (${ Id.VSub_Name NUM_MIGS) ) } ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:11518) arg_word: {(2)} ) ] spids: [11488 11505] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:AUTOSCALER_MIG_CONFIG) op: assign_op.Equal rhs: {(DQ )} spids: [11535] ) ] ) (C {(local)} {(Id.Lit_VarLike 'left_min=') (${ Id.VSub_Name AUTOSCALER_MIN_NODES)}) (C {(local)} {(Id.Lit_VarLike 'left_max=') (${ Id.VSub_Name AUTOSCALER_MAX_NODES)}) (command.ForExpr init: (arith_expr.BinaryAssign op_id: Id.Arith_Equal left: (sh_lhs_expr.Name name:i) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) cond: (arith_expr.Binary op_id: Id.Arith_LessEqual left: (arith_expr.VarRef token:(Token id:Id.Lit_ArithVarLike val:i span_id:11566)) right: (arith_expr.ArithWord w:{(${ Id.VSub_Name NUM_MIGS)}) ) update: (arith_expr.UnaryAssign op_id:Id.Node_PostDPlus child:(sh_lhs_expr.Name name:i)) body: (command.DoGroup children: [ (C {(local)} {(Id.Lit_VarLike 'group_name=') (DQ (${ Id.VSub_Name NODE_INSTANCE_PREFIX) (-group-) ($ Id.VSub_DollarName '$i') ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_DollarName '$i')} right: {(${ Id.VSub_Name NUM_MIGS)} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:11607) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:group_name) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name NODE_INSTANCE_PREFIX) (-group))} spids: [11620] ) ] ) ] spids: [11594 11609] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:this_mig_min) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Slash left: (arith_expr.ArithWord w:{(${ Id.VSub_Name left_min)}) right: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.ArithWord w:{(${ Id.VSub_Name NUM_MIGS)}) right: (arith_expr.ArithWord w:{(${ Id.VSub_Name i)}) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) ) } spids: [11633] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:this_mig_max) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Slash left: (arith_expr.ArithWord w:{(${ Id.VSub_Name left_max)}) right: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.ArithWord w:{(${ Id.VSub_Name NUM_MIGS)}) right: (arith_expr.ArithWord w:{(${ Id.VSub_Name i)}) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) ) } spids: [11654] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:left_min) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.VarRef token: (Token id: Id.Lit_ArithVarLike val: left_min span_id: 11677 ) ) right: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$this_mig_min')} ) ) ) } spids: [11675] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:left_max) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.VarRef token: (Token id: Id.Lit_ArithVarLike val: left_max span_id: 11686 ) ) right: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$this_mig_max')} ) ) ) } spids: [11684] ) ] ) (C {(local)} {(Id.Lit_VarLike 'mig_url=') (DQ ('https://www.googleapis.com/compute/v1/projects/') (${ Id.VSub_Name PROJECT) (/zones/) (${ Id.VSub_Name ZONE) (/instanceGroups/) (${ Id.VSub_Name group_name) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:AUTOSCALER_MIG_CONFIG) op: assign_op.Equal rhs: { (DQ (${ Id.VSub_Name AUTOSCALER_MIG_CONFIG) (' --nodes=') (${ Id.VSub_Name this_mig_min) (':') (${ Id.VSub_Name this_mig_max) (':') (${ Id.VSub_Name mig_url) ) } spids: [11713] ) ] ) ] ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:AUTOSCALER_MIG_CONFIG) op: assign_op.Equal rhs: { (DQ (${ Id.VSub_Name AUTOSCALER_MIG_CONFIG) (' --scale-down-enabled=') (${ Id.VSub_Name AUTOSCALER_ENABLE_SCALE_DOWN) ) } spids: [11737] ) ] ) ] ) ) (command.ShFunction name: create-autoscaler-config body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name ENABLE_CLUSTER_AUTOSCALER))} right: {(DQ (true))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:11805) ) ] action: [ (C {(create-cluster-autoscaler-mig-config)}) (C {(echo)} { (DQ ('Using autoscaler config: ') (${ Id.VSub_Name AUTOSCALER_MIG_CONFIG) (' ') (${ Id.VSub_Name AUTOSCALER_EXPANDER_CONFIG) ) } ) ] spids: [11788 11807] ) ] ) ] ) ) (command.ShFunction name: check-cluster body: (command.BraceGroup children: [ (C {(detect-node-names)}) (C {(detect-master)}) (C {(echo)} { (DQ ('Waiting up to ') (${ Id.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)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:secure) op: assign_op.Equal rhs: {(DQ )} spids: [11884] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [{(which)} {(sw_vers)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:11895) fd: -1 arg_word: {(/dev/null)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:11898) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobEqual left: { (command_sub left_token: (Token id: Id.Left_DollarParen val: '$(' span_id: 11907 ) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(sw_vers)}) (C {(grep)} {(ProductVersion)}) (C {(awk)} { (SQ (Token id: Id.Lit_Chars val: '{print $2}' span_id: 11921 ) ) } ) ] negated: F ) ] ) ) } right: {(DQ (10.9.)) (Id.Lit_Other '*')} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:11933) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:secure) op: assign_op.Equal rhs: {(DQ (--insecure))} spids: [11938] ) ] ) ] spids: [11903 11935] ) ] ) ] spids: [11889 11900] ) ] ) (C {(local)} {(Id.Lit_VarLike 'start_time=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:11954) command_list: (command.CommandList children: [(C {(date)} {(Id.Lit_Other '+') (Id.Lit_Other '%') (s)})] ) ) } ) (command.WhileUntil keyword: (Token id:Id.KW_Until val:until span_id:11963) cond: [ (command.Sentence child: (C {(curl)} {(--cacert)} {(DQ (${ Id.VSub_Name CERT_DIR) (/pki/ca.crt))} {(-H)} {(DQ ('Authorization: Bearer ') (${ Id.VSub_Name KUBE_BEARER_TOKEN))} {(${ Id.VSub_Name secure)} {(--max-time)} {(5)} {(--fail)} {(--output)} {(/dev/null)} {(--silent)} {(DQ ('https://') (${ Id.VSub_Name KUBE_MASTER_IP) (/api/v1/pods))} ) terminator: (Token id:Id.Op_Semi val:';' span_id:12016) ) ] body: (command.DoGroup children: [ (C {(local)} {(Id.Lit_VarLike 'elapsed=') (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.ArithWord w: { (command_sub left_token: (Token id: Id.Left_DollarParen val: '$(' span_id: 12025 ) command_list: (command.CommandList children: [ (C {(date)} {(Id.Lit_Other '+') (Id.Lit_Other '%') (s)}) ] ) ) } ) right: (arith_expr.ArithWord w:{(${ Id.VSub_Name start_time)}) ) ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_gt left: {(${ Id.VSub_Name elapsed)} right: {(${ Id.VSub_Name KUBE_CLUSTER_INITIALIZATION_TIMEOUT)} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:12057) ) ] action: [ (command.Simple words: [ {(echo)} {(-e)} { (DQ (${ Id.VSub_Name color_red) ('Cluster failed to initialize within ') (${ Id.VSub_Name KUBE_CLUSTER_INITIALIZATION_TIMEOUT) (' seconds.') (${ Id.VSub_Name color_norm) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:12080) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:12084) arg_word: {(2)} ) ] spids: [12042 12059] ) ] ) (C {(printf)} {(DQ (.))}) (C {(sleep)} {(2)}) ] ) ) (C {(echo)} {(DQ ('Kubernetes cluster created.'))}) (C {(export)} {(Id.Lit_VarLike 'KUBE_CERT=') (DQ (${ Id.VSub_Name CERT_DIR) (/pki/issued/kubecfg.crt))} ) (C {(export)} {(Id.Lit_VarLike 'KUBE_KEY=') (DQ (${ Id.VSub_Name CERT_DIR) (/pki/private/kubecfg.key))} ) (C {(export)} {(Id.Lit_VarLike 'CA_CERT=') (DQ (${ Id.VSub_Name CERT_DIR) (/pki/ca.crt))}) (C {(export)} {(Id.Lit_VarLike 'CONTEXT=') (DQ (${ Id.VSub_Name PROJECT) (_) (${ Id.VSub_Name INSTANCE_PREFIX)) } ) (command.Subshell command_list: (command.CommandList children: [ (C {(umask)} {(077)}) (C {(create-kubeconfig)}) (C {(create-kubeconfig-for-federation)}) ] ) ) (C {(get-kubeconfig-basicauth)}) (C {(echo)}) (C {(echo)} {(-e)} { (DQ (${ Id.VSub_Name color_green) ('Kubernetes cluster is running. The master is running at:') ) } ) (C {(echo)}) (C {(echo)} {(-e)} {(DQ (${ Id.VSub_Name color_yellow) (' https://') (${ Id.VSub_Name KUBE_MASTER_IP))} ) (C {(echo)}) (C {(echo)} {(-e)} { (DQ (${ Id.VSub_Name color_green) ('The user name and password to use is located in ') (${ Id.VSub_Name KUBECONFIG) (.) (${ Id.VSub_Name color_norm) ) } ) (C {(echo)}) ] ) ) (command.ShFunction name: remove-replica-from-etcd body: (command.BraceGroup children: [ (C {(local)} {(-r)} {(Id.Lit_VarLike 'port=') (DQ (${ Id.VSub_Number 1))}) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: {(DQ (${ Id.VSub_Name EXISTING_MASTER_NAME))} ) ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:12320) ) ] ) (C {(gcloud)} {(compute)} {(ssh)} {(DQ (${ Id.VSub_Name EXISTING_MASTER_NAME))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--zone)} {(DQ (${ Id.VSub_Name EXISTING_MASTER_ZONE))} {(--command)} { (DQ ('curl -s localhost:') (${ Id.VSub_Name port) (/v2/members/) (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\$' span_id:12367) ) ('(curl -s localhost:') (${ Id.VSub_Name port) ("/v2/members -XGET | sed 's/{") (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\\\' span_id:12373) ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:12374)) (id/) (Id.Lit_Other '\\') ("n/g' | grep ") (${ Id.VSub_Name REPLICA_NAME) (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\\\' span_id:12381) ) (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\"' span_id:12382)) (' | cut -f 3 -d ') (word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\\\' span_id:12384)) (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\"' span_id:12385) ) (') -XDELETE -L 2>/dev/null') ) } ) (C {(local)} {(-r)} {(Id.Lit_VarLike 'res=') ($ Id.VSub_QMark '$?')}) (C {(echo)} { (DQ ('Removing etcd replica, name: ') (${ Id.VSub_Name REPLICA_NAME) (', port: ') (${ Id.VSub_Name port) (', result: ') (${ Id.VSub_Name res) ) } ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:12416) arg_word: {(DQ (${ Id.VSub_Name res))} ) ] ) ) (command.ShFunction name: kube-down body: (command.BraceGroup children: [ (C {(local)} {(-r)} {(Id.Lit_VarLike 'batch=') (200)}) (C {(detect-project)}) (C {(detect-node-names)}) (C {(echo)} {(DQ ('Bringing down cluster'))}) (C {(Id.KW_Set set)} {(Id.Lit_Other '+') (e)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: KUBE_DELETE_NODES span_id: 12505 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } right: {(DQ (false))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:12517) ) ] action: [ (C {(local)} {(Id.Lit_VarLike 'templates=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:12537) command_list: (command.CommandList children: [(C {(get-template)} {(DQ (${ Id.VSub_Name PROJECT))})] ) ) } ) (command.ForEach iter_name: group iter_words: [ { (braced_var_sub token: (Token id:Id.VSub_Name val:INSTANCE_GROUPS span_id:12556) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{}) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [ {(gcloud)} {(compute)} {(instance-groups)} {(managed)} {(describe)} {(DQ (${ Id.VSub_Name group))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:12601) fd: -1 arg_word: {(/dev/null)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:12603) ) ] action: [ (command.Sentence child: (C {(gcloud)} {(compute)} {(instance-groups)} {(managed)} {(delete)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--quiet)} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(DQ (${ Id.VSub_Name group))} ) terminator: (Token id:Id.Op_Amp val:'&' span_id:12650) ) ] spids: [12567 12605] ) ] ) ] ) ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(kube) (Id.Lit_Other ':') (Id.Lit_Other ':') (util) (Id.Lit_Other ':') (Id.Lit_Other ':') (wait-for-jobs) } ) (command.BraceGroup children: [ (command.Simple words: [{(echo)} {(-e)} {(DQ ('Failed to delete instance group(s).'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:12685) fd: -1 arg_word: {(2)} ) ] ) ] ) ] ) (command.ForEach iter_name: template iter_words: [ { (braced_var_sub token: (Token id:Id.VSub_Name val:templates span_id:12700) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{}) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [ {(gcloud)} {(compute)} {(instance-templates)} {(describe)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(DQ (${ Id.VSub_Name template))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:12735) fd: -1 arg_word: {(/dev/null)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:12737) ) ] action: [ (C {(gcloud)} {(compute)} {(instance-templates)} {(delete)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--quiet)} {(DQ (${ Id.VSub_Name template))} ) ] spids: [12711 12739] ) ] ) ] ) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: HEAPSTER_MACHINE_TYPE span_id: 12792 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:12798) ) ] action: [ (C {(local)} {(-r)} {(Id.Lit_VarLike 'heapster_machine_name=') (DQ (${ Id.VSub_Name NODE_INSTANCE_PREFIX) (-heapster)) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [ {(gcloud)} {(compute)} {(instances)} {(describe)} {(DQ (${ Id.VSub_Name heapster_machine_name))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:12848) fd: -1 arg_word: {(/dev/null)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:12850) ) ] action: [ (C {(gcloud)} {(compute)} {(instances)} {(delete)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--quiet)} {(--delete-disks)} {(all)} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(DQ (${ Id.VSub_Name heapster_machine_name))} ) ] spids: [12816 12852] ) ] ) ] spids: [12784 12800] ) ] ) ] spids: [12499 12519] ) ] ) (C {(local)} {(-r)} {(Id.Lit_VarLike 'REPLICA_NAME=') (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:KUBE_REPLICA_NAME span_id:12923) suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonHyphen arg_word: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:12925) command_list: (command.CommandList children:[(C {(get-replica-name)})]) ) } ) ) ) } ) (C {(set-existing-master)}) (C {(remove-replica-from-etcd)} {(2379)}) (C {(remove-replica-from-etcd)} {(4002)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [ {(gcloud)} {(compute)} {(instances)} {(describe)} {(DQ (${ Id.VSub_Name REPLICA_NAME))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:12988) fd: -1 arg_word: {(/dev/null)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:12990) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [ {(gcloud)} {(compute)} {(target-pools)} {(describe)} {(DQ (${ Id.VSub_Name MASTER_NAME))} {(--region)} {(DQ (${ Id.VSub_Name REGION))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:13031) fd: -1 arg_word: {(/dev/null)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:13033) ) ] action: [ (C {(gcloud)} {(compute)} {(target-pools)} {(remove-instances)} {(DQ (${ Id.VSub_Name MASTER_NAME))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(--instances)} {(DQ (${ Id.VSub_Name REPLICA_NAME))} ) ] spids: [12999 13035] ) ] ) (C {(gcloud)} {(compute)} {(instances)} {(delete)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--quiet)} {(--delete-disks)} {(all)} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(DQ (${ Id.VSub_Name REPLICA_NAME))} ) ] spids: [12956 12992] ) ] ) (C {(local)} {(-r)} {(Id.Lit_VarLike 'replica_pd=') (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:REPLICA_NAME span_id:13156) suffix_op: (suffix_op.Unary op_id: Id.VTest_ColonHyphen arg_word: {(${ Id.VSub_Name MASTER_NAME)} ) ) (-pd) ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [ {(gcloud)} {(compute)} {(disks)} {(describe)} {(DQ (${ Id.VSub_Name replica_pd))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:13198) fd: -1 arg_word: {(/dev/null)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:13200) ) ] action: [ (C {(gcloud)} {(compute)} {(disks)} {(delete)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--quiet)} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(DQ (${ Id.VSub_Name replica_pd))} ) ] spids: [13166 13202] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalAnd left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name ENABLE_CLUSTER_REGISTRY))} right: {(true)} ) right: (bool_expr.Unary op_id: Id.BoolUnary_n child: {(DQ (${ Id.VSub_Name CLUSTER_REGISTRY_DISK))} ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:13279) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [ {(gcloud)} {(compute)} {(disks)} {(describe)} {(DQ (${ Id.VSub_Name CLUSTER_REGISTRY_DISK))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:13316) fd: -1 arg_word: {(/dev/null)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:13318) ) ] action: [ (C {(gcloud)} {(compute)} {(disks)} {(delete)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--quiet)} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(DQ (${ Id.VSub_Name CLUSTER_REGISTRY_DISK))} ) ] spids: [13284 13320] ) ] ) ] spids: [13254 13281] ) ] ) (C {(local)} {(Id.Lit_VarLike 'REMAINING_MASTER_COUNT=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:13378) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(gcloud)} {(compute)} {(instances)} {(list)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--filter) (Id.Lit_Equals '=') (DQ ("name ~ '") (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:13403) command_list: (command.CommandList children: [(C {(get-replica-name-regexp)})] ) ) ("'") ) } {(--format)} {(DQ ('value(zone)'))} ) (C {(wc)} {(-l)}) ] negated: F ) ] ) ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_eq left: {(DQ (${ Id.VSub_Name REMAINING_MASTER_COUNT))} right: {(1)} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:13445) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [ {(gcloud)} {(compute)} {(forwarding-rules)} {(describe)} {(DQ (${ Id.VSub_Name MASTER_NAME))} {(--region)} {(DQ (${ Id.VSub_Name REGION))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:13482) fd: -1 arg_word: {(/dev/null)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:13484) ) ] action: [ (C {(detect-master)}) (C {(local)} {(Id.Lit_VarLike 'REMAINING_REPLICA_NAME=') (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:13496) command_list: (command.CommandList children: [(C {(get-all-replica-names)})] ) ) ) } ) (C {(local)} {(Id.Lit_VarLike 'REMAINING_REPLICA_ZONE=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:13505) command_list: (command.CommandList children: [ (C {(gcloud)} {(compute)} {(instances)} {(list)} {(DQ (${ Id.VSub_Name REMAINING_REPLICA_NAME))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--format) (Id.Lit_Equals '=') (DQ ('value(zone)'))} ) ] ) ) } ) (C {(gcloud)} {(compute)} {(forwarding-rules)} {(delete)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--region)} {(DQ (${ Id.VSub_Name REGION))} {(--quiet)} {(DQ (${ Id.VSub_Name MASTER_NAME))} ) (C {(attach-external-ip)} {(DQ (${ Id.VSub_Name REMAINING_REPLICA_NAME))} {(DQ (${ Id.VSub_Name REMAINING_REPLICA_ZONE))} {(DQ (${ Id.VSub_Name KUBE_MASTER_IP))} ) (C {(gcloud)} {(compute)} {(target-pools)} {(delete)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--region)} {(DQ (${ Id.VSub_Name REGION))} {(--quiet)} {(DQ (${ Id.VSub_Name MASTER_NAME))} ) ] spids: [13450 13486] ) ] ) ] spids: [13430 13447] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_eq left: {(DQ (${ Id.VSub_Name REMAINING_MASTER_COUNT))} right: {(0)} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:13667) ) ] action: [ (C {(delete-firewall-rules)} {(DQ (${ Id.VSub_Name MASTER_NAME) (-https))} {(DQ (${ Id.VSub_Name MASTER_NAME) (-etcd))} {(DQ (${ Id.VSub_Name NODE_TAG) (-all))} ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [ {(gcloud)} {(compute)} {(addresses)} {(describe)} {(DQ (${ Id.VSub_Name MASTER_NAME) (-ip))} {(--region)} {(DQ (${ Id.VSub_Name REGION))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:13737) fd: -1 arg_word: {(/dev/null)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:13739) ) ] action: [ (C {(gcloud)} {(compute)} {(addresses)} {(delete)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--region)} {(DQ (${ Id.VSub_Name REGION))} {(--quiet)} {(DQ (${ Id.VSub_Name MASTER_NAME) (-ip))} ) ] spids: [13704 13741] ) ] ) ] spids: [13652 13669] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: KUBE_DELETE_NODES span_id: 13799 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } right: {(DQ (false))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:13811) ) ] action: [ (C {(local)} {(-a)} {(minions)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:minions) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:13828) words: [ { (command_sub left_token: (Token id: Id.Left_DollarParen val: '$(' span_id: 13830 ) command_list: (command.CommandList children: [ (C {(gcloud)} {(compute)} {(instances)} {(list)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--filter) (Id.Lit_Equals '=') (DQ ("name ~ '") (${ Id.VSub_Name NODE_INSTANCE_PREFIX) ("-.+' AND zone:(") (${ Id.VSub_Name ZONE) (')') ) } {(--format) (Id.Lit_Equals '=') (SQ (Token id:Id.Lit_Chars val:'value(name)' span_id:13870))} ) ] ) ) } ] ) } spids: [13827] ) ] ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:13881) cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_Great left: (arith_expr.ArithWord w: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: minions span_id: 13888 ) prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:13901) ) ] body: (command.DoGroup children: [ (C {(echo)} {(Deleting)} {(nodes)} { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:minions span_id:13914) bracket_op: (bracket_op.WholeArray op_id:Id.Arith_Star) suffix_op: (suffix_op.Slice length: (arith_expr.ArithWord w:{(${ Id.VSub_Name batch)}) ) ) ) } ) (C {(gcloud)} {(compute)} {(instances)} {(delete)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--quiet)} {(--delete-disks)} {(boot)} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:minions span_id:13969) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) suffix_op: (suffix_op.Slice length: (arith_expr.ArithWord w:{(${ Id.VSub_Name batch)}) ) ) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:minions) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:13983) words: [ { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: minions span_id: 13987 ) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) suffix_op: (suffix_op.Slice begin: (arith_expr.ArithWord w: {(${ Id.VSub_Name batch)} ) ) ) ) } ] ) } spids: [13982] ) ] ) ] ) ) ] spids: [13793 13813] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_eq left: {(DQ (${ Id.VSub_Name REMAINING_MASTER_COUNT))} right: {(0)} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:14027) ) ] action: [ (C {(local)} {(-a)} {(routes)}) (C {(local)} {(Id.Lit_VarLike 'TRUNCATED_PREFIX=') (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:INSTANCE_PREFIX span_id:14068) suffix_op: (suffix_op.Slice begin: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) length: (arith_expr.ArithWord w:{(Id.Lit_Digits 26)}) ) ) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:routes) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:14078) words: [ { (command_sub left_token: (Token id: Id.Left_DollarParen val: '$(' span_id: 14080 ) command_list: (command.CommandList children: [ (C {(gcloud)} {(compute)} {(routes)} {(list)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--filter) (Id.Lit_Equals '=') (DQ ("name ~ '") (${ Id.VSub_Name TRUNCATED_PREFIX) ("-.{8}-.{4}-.{4}-.{4}-.{12}'") ) } {(--format) (Id.Lit_Equals '=') (SQ (Token id:Id.Lit_Chars val:'value(name)' span_id:14114))} ) ] ) ) } ] ) } spids: [14077] ) ] ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:14121) cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_Great left: (arith_expr.ArithWord w: { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:routes span_id:14128) prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:14141) ) ] body: (command.DoGroup children: [ (C {(echo)} {(Deleting)} {(routes)} { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:routes span_id:14154) bracket_op: (bracket_op.WholeArray op_id:Id.Arith_Star) suffix_op: (suffix_op.Slice length: (arith_expr.ArithWord w:{(${ Id.VSub_Name batch)}) ) ) ) } ) (C {(gcloud)} {(compute)} {(routes)} {(delete)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--quiet)} { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:routes span_id:14193) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) suffix_op: (suffix_op.Slice length: (arith_expr.ArithWord w:{(${ Id.VSub_Name batch)}) ) ) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:routes) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:14207) words: [ { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: routes span_id: 14211 ) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) suffix_op: (suffix_op.Slice begin: (arith_expr.ArithWord w: {(${ Id.VSub_Name batch)} ) ) ) ) } ] ) } spids: [14206] ) ] ) ] ) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [ {(gcloud)} {(compute)} {(disks)} {(describe)} {(DQ (${ Id.VSub_Name INSTANCE_PREFIX)) (-influxdb-pd)} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:14266) fd: -1 arg_word: {(/dev/null)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:14268) ) ] action: [ (C {(gcloud)} {(compute)} {(disks)} {(delete)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--quiet)} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(DQ (${ Id.VSub_Name INSTANCE_PREFIX)) (-influxdb-pd)} ) ] spids: [14233 14270] ) ] ) (C {(delete-firewall-rules)} {(DQ (${ Id.VSub_Name CLUSTER_NAME) (-default-internal-master))} {(DQ (${ Id.VSub_Name CLUSTER_NAME) (-default-internal-node))} {(DQ (${ Id.VSub_Name NETWORK) (-default-ssh))} {(DQ (${ Id.VSub_Name NETWORK) (-default-internal))} ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name KUBE_DELETE_NETWORK))} right: {(DQ (true))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:14383) ) ] action: [ (command.AndOr ops: [Id.Op_DPipe] children: [(C {(delete-all-firewall-rules)}) (C {(true)})] ) (command.AndOr ops: [Id.Op_DPipe] children: [(C {(delete-subnetworks)}) (C {(true)})] ) (command.AndOr ops: [Id.Op_DPipe] children: [(C {(delete-network)}) (C {(true)})] ) ] spids: [14366 14385] ) ] ) (C {(export)} {(Id.Lit_VarLike 'CONTEXT=') (DQ (${ Id.VSub_Name PROJECT) (_) (${ Id.VSub_Name INSTANCE_PREFIX)) } ) (C {(clear-kubeconfig)}) ] spids: [14012 14029] ) ] else_action: [ (command.Simple words: [{(echo)} {(DQ ('... calling validate-cluster'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:14454) fd: -1 arg_word: {(2)} ) ] ) (command.AndOr ops: [Id.Op_DAmp Id.Op_DPipe] children: [ (command.Subshell command_list: (command.CommandList children:[(C {(validate-cluster)})]) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:validate_result) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_QMark '$?'))} spids: [14468] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:validate_result) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_QMark '$?'))} spids: [14475] ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_eq left: {(DQ (${ Id.VSub_Name validate_result))} right: {(1)} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:14513) ) ] action: [ (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:14518) arg_word: {(1)} ) ] spids: [14498 14515] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_eq left: {(DQ (${ Id.VSub_Name validate_result))} right: {(2)} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:14538) ) ] action: [ (command.Simple words: [{(echo)} {(DQ ('...ignoring non-fatal errors in validate-cluster'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:14549) fd: -1 arg_word: {(2)} ) ] ) ] spids: [14523 14540] ) ] ) ] ) (C {(Id.KW_Set set)} {(-e)}) ] ) ) (command.ShFunction name: get-replica-name body: (command.BraceGroup children: [ (C {(echo)} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:14604) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(gcloud)} {(compute)} {(instances)} {(list)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--filter) (Id.Lit_Equals '=') (DQ ("name ~ '") (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:14629) command_list: (command.CommandList children: [(C {(get-replica-name-regexp)})] ) ) ("' AND zone:(") (${ Id.VSub_Name ZONE) (')') ) } {(--format)} {(DQ ('value(name)'))} ) (C {(head)} {(-n1)}) ] negated: F ) ] ) ) } ) ] ) ) (command.ShFunction name: get-all-replica-names body: (command.BraceGroup children: [ (C {(echo)} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:14689) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(gcloud)} {(compute)} {(instances)} {(list)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--filter) (Id.Lit_Equals '=') (DQ ("name ~ '") (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:14714) command_list: (command.CommandList children: [(C {(get-replica-name-regexp)})] ) ) ("'") ) } {(--format)} {(DQ ('value(name)'))} ) (C {(tr)} {(DQ (Id.Lit_Other '\\') (n))} {(DQ (','))}) (C {(sed)} {(SQ (Token id:Id.Lit_Chars val:'s/,$//' span_id:14746))}) ] negated: F ) ] ) ) } ) ] ) ) (command.ShFunction name: get-master-replicas-count body: (command.BraceGroup children: [ (C {(detect-project)}) (C {(local)} {(Id.Lit_VarLike 'num_masters=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:14780) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(gcloud)} {(compute)} {(instances)} {(list)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--filter) (Id.Lit_Equals '=') (DQ ("name ~ '") (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:14805) command_list: (command.CommandList children: [(C {(get-replica-name-regexp)})] ) ) ("'") ) } {(--format)} {(DQ ('value(zone)'))} ) (C {(wc)} {(-l)}) ] negated: F ) ] ) ) } ) (C {(echo)} {(-n)} {(DQ (${ Id.VSub_Name num_masters))}) ] ) ) (command.ShFunction name: get-replica-name-regexp body: (command.BraceGroup children: [(C {(echo)} {(DQ (${ Id.VSub_Name MASTER_NAME) ('(-...)?'))})] ) ) (command.ShFunction name: set-replica-name body: (command.BraceGroup children: [ (C {(local)} {(Id.Lit_VarLike 'instances=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:14909) command_list: (command.CommandList children: [ (C {(gcloud)} {(compute)} {(instances)} {(list)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--filter) (Id.Lit_Equals '=') (DQ ("name ~ '") (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:14934) command_list: (command.CommandList children: [(C {(get-replica-name-regexp)})] ) ) ("'") ) } {(--format)} {(DQ ('value(name)'))} ) ] ) ) } ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:suffix) op: assign_op.Equal rhs: {(DQ )} spids: [14951] ) ] ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:14956) cond: [ (command.Sentence child: (command.Pipeline children: [ (C {(echo)} {(DQ (${ Id.VSub_Name instances))}) (command.Simple words: [{(grep)} {(DQ (${ Id.VSub_Name suffix))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:14976) fd: -1 arg_word: {(/dev/null)} ) ] ) ] negated: F ) terminator: (Token id:Id.Op_Semi val:';' span_id:14978) ) ] body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:suffix) op: assign_op.Equal rhs: { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:14985) command_list: (command.CommandList children: [ (command.Pipeline children: [(C {(date)}) (C {(md5sum)}) (C {(head)} {(-c3)})] negated: F ) ] ) ) ) } spids: [14983] ) ] ) ] ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:REPLICA_NAME) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Name MASTER_NAME) (-) (${ Id.VSub_Name suffix))} spids: [15004] ) ] ) ] ) ) (command.ShFunction name: get-template body: (command.BraceGroup children: [ (C {(gcloud)} {(compute)} {(instance-templates)} {(list)} {(--filter) (Id.Lit_Equals '=') (DQ ("name ~ '") (${ Id.VSub_Name NODE_INSTANCE_PREFIX) ('-template(-(') (${ Id.VSub_Name KUBE_RELEASE_VERSION_DASHED_REGEX) ('|') (${ Id.VSub_Name KUBE_CI_VERSION_DASHED_REGEX) ("))?'") ) } {(--project) (Id.Lit_Equals '=') (DQ (${ Id.VSub_Number 1))} {(--format) (Id.Lit_Equals '=') (SQ (Token id:Id.Lit_Chars val:'value(name)' span_id:15086)) } ) ] ) ) (command.ShFunction name: check-resources body: (command.BraceGroup children: [ (C {(detect-project)}) (C {(detect-node-names)}) (C {(echo)} {(DQ ('Looking for already existing resources'))}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_RESOURCE_FOUND) op: assign_op.Equal rhs: {(DQ )} spids: [15142] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_n child: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: INSTANCE_GROUPS span_id: 15156 ) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:15165) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_RESOURCE_FOUND) op: assign_op.Equal rhs: { (DQ ('Managed instance groups ') (braced_var_sub token: (Token id:Id.VSub_Name val:INSTANCE_GROUPS span_id:15174) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } spids: [15170] ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:15182) arg_word: {(1)} ) ] spids: [15148 15167] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [ {(gcloud)} {(compute)} {(instance-templates)} {(describe)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(DQ (${ Id.VSub_Name NODE_INSTANCE_PREFIX) (-template))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:15216) fd: -1 arg_word: {(/dev/null)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:15218) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_RESOURCE_FOUND) op: assign_op.Equal rhs: { (DQ ('Instance template ') (${ Id.VSub_Name NODE_INSTANCE_PREFIX) (-template) ) } spids: [15223] ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:15233) arg_word: {(1)} ) ] spids: [15191 15220] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [ {(gcloud)} {(compute)} {(instances)} {(describe)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(DQ (${ Id.VSub_Name MASTER_NAME))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:15274) fd: -1 arg_word: {(/dev/null)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:15276) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_RESOURCE_FOUND) op: assign_op.Equal rhs: {(DQ ('Kubernetes master ') (${ Id.VSub_Name MASTER_NAME))} spids: [15281] ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:15290) arg_word: {(1)} ) ] spids: [15242 15278] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [ {(gcloud)} {(compute)} {(disks)} {(describe)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(DQ (${ Id.VSub_Name MASTER_NAME)) (-pd)} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:15332) fd: -1 arg_word: {(/dev/null)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:15334) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_RESOURCE_FOUND) op: assign_op.Equal rhs: {(DQ ('Persistent disk ') (${ Id.VSub_Name MASTER_NAME) (-pd))} spids: [15339] ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:15349) arg_word: {(1)} ) ] spids: [15299 15336] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [ {(gcloud)} {(compute)} {(disks)} {(describe)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(DQ (${ Id.VSub_Name CLUSTER_REGISTRY_DISK))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:15390) fd: -1 arg_word: {(/dev/null)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:15392) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_RESOURCE_FOUND) op: assign_op.Equal rhs: {(DQ ('Persistent disk ') (${ Id.VSub_Name CLUSTER_REGISTRY_DISK))} spids: [15397] ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:15406) arg_word: {(1)} ) ] spids: [15358 15394] ) ] ) (C {(local)} {(-a)} {(minions)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:minions) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:15427) words: [ { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:15429) command_list: (command.CommandList children: [ (C {(gcloud)} {(compute)} {(instances)} {(list)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--filter) (Id.Lit_Equals '=') (DQ ("name ~ '") (${ Id.VSub_Name NODE_INSTANCE_PREFIX) ("-.+' AND zone:(") (${ Id.VSub_Name ZONE) (')') ) } {(--format) (Id.Lit_Equals '=') (SQ (Token id:Id.Lit_Chars val:'value(name)' span_id:15469))} ) ] ) ) } ] ) } spids: [15426] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_Great left: (arith_expr.ArithWord w: { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:minions span_id:15483) prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:15496) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_RESOURCE_FOUND) op: assign_op.Equal rhs: { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:minions span_id:15505) prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) (' matching matching ') (${ Id.VSub_Name NODE_INSTANCE_PREFIX) ('-.+') ) } spids: [15501] ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:15518) arg_word: {(1)} ) ] spids: [15476 15498] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [ {(gcloud)} {(compute)} {(firewall-rules)} {(describe)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(DQ (${ Id.VSub_Name MASTER_NAME) (-https))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:15552) fd: -1 arg_word: {(/dev/null)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:15554) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_RESOURCE_FOUND) op: assign_op.Equal rhs: {(DQ ('Firewall rules for ') (${ Id.VSub_Name MASTER_NAME) (-https))} spids: [15559] ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:15569) arg_word: {(1)} ) ] spids: [15527 15556] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [ {(gcloud)} {(compute)} {(firewall-rules)} {(describe)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(DQ (${ Id.VSub_Name NODE_TAG) (-all))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:15603) fd: -1 arg_word: {(/dev/null)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:15605) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_RESOURCE_FOUND) op: assign_op.Equal rhs: {(DQ ('Firewall rules for ') (${ Id.VSub_Name MASTER_NAME) (-all))} spids: [15610] ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:15620) arg_word: {(1)} ) ] spids: [15578 15607] ) ] ) (C {(local)} {(-a)} {(routes)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:routes) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:15637) words: [ { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:15639) command_list: (command.CommandList children: [ (C {(gcloud)} {(compute)} {(routes)} {(list)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--filter) (Id.Lit_Equals '=') (DQ ("name ~ '") (${ Id.VSub_Name INSTANCE_PREFIX) ("-minion-.{4}'"))} {(--format) (Id.Lit_Equals '=') (SQ (Token id:Id.Lit_Chars val:'value(name)' span_id:15671)) } ) ] ) ) } ] ) } spids: [15636] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Id.Arith_Great left: (arith_expr.ArithWord w: { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:routes span_id:15685) prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:15698) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_RESOURCE_FOUND) op: assign_op.Equal rhs: { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:routes span_id:15707) prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) (' routes matching ') (${ Id.VSub_Name INSTANCE_PREFIX) ('-minion-.{4}') ) } spids: [15703] ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:15720) arg_word: {(1)} ) ] spids: [15678 15700] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [ {(gcloud)} {(compute)} {(addresses)} {(describe)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(DQ (${ Id.VSub_Name MASTER_NAME) (-ip))} {(--region)} {(DQ (${ Id.VSub_Name REGION))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:15762) fd: -1 arg_word: {(/dev/null)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:15764) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_RESOURCE_FOUND) op: assign_op.Equal rhs: {(DQ ("Master's reserved IP"))} spids: [15769] ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:15775) arg_word: {(1)} ) ] spids: [15729 15766] ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:15788) arg_word: {(0)} ) ] ) ) (command.ShFunction name: prepare-push body: (command.BraceGroup children: [ (C {(local)} {(Id.Lit_VarLike 'node=') (DQ (braced_var_sub token: (Token id:Id.VSub_Number val:1 span_id:15815) suffix_op: (suffix_op.Unary op_id:Id.VTest_Hyphen arg_word:(word.Empty)) ) ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalAnd left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name node))} right: {(DQ (true))} ) right: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {(DQ (${ Id.VSub_Name NODE_OS_DISTRIBUTION))} right: {(DQ (debian))} ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:15856) ) ] action: [ (command.Simple words: [ {(echo)} { (DQ ('Updating nodes in a kubernetes cluster with ') (${ Id.VSub_Name NODE_OS_DISTRIBUTION) (' is not supported yet.') ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:15871) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:15875) arg_word: {(1)} ) ] spids: [15825 15858] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalAnd left: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {(DQ (${ Id.VSub_Name node))} right: {(DQ (true))} ) right: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {(DQ (${ Id.VSub_Name MASTER_OS_DISTRIBUTION))} right: {(DQ (debian))} ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:15914) ) ] action: [ (command.Simple words: [ {(echo)} { (DQ ('Updating the master in a kubernetes cluster with ') (${ Id.VSub_Name MASTER_OS_DISTRIBUTION) (' is not supported yet.') ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:15929) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:15933) arg_word: {(1)} ) ] spids: [15883 15916] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:OUTPUT) op: assign_op.Equal rhs: {(${ Id.VSub_Name KUBE_ROOT) (/_output/logs)} spids: [15942] ) ] ) (C {(mkdir)} {(-p)} {(${ Id.VSub_Name OUTPUT)}) (C {(kube) (Id.Lit_Other ':') (Id.Lit_Other ':') (util) (Id.Lit_Other ':') (Id.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)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ (${ Id.VSub_Name node))} right: {(DQ (true))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:16013) ) ] action: [ (C {(write-node-env)}) (C {(local)} {(Id.Lit_VarLike 'scope_flags=') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:16025) command_list: (command.CommandList children:[(C {(get-scope-flags)})]) ) } ) (C {(local)} {(Id.Lit_VarLike 'tmp_template_name=') (DQ (${ Id.VSub_Name NODE_INSTANCE_PREFIX) (-template-tmp)) } ) (C {(create-node-instance-template)} {($ Id.VSub_DollarName '$tmp_template_name')}) (C {(local)} {(Id.Lit_VarLike 'template_name=') (DQ (${ Id.VSub_Name NODE_INSTANCE_PREFIX) (-template)) } ) (command.ForEach iter_name: group iter_words: [ { (braced_var_sub token: (Token id:Id.VSub_Name val:INSTANCE_GROUPS span_id:16074) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{}) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (command.Sentence child: (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(gcloud)} {(compute)} {(instance-groups)} {(managed)} {(set-instance-template)} {(DQ (${ Id.VSub_Name group))} {(--template)} {(DQ ($ Id.VSub_DollarName '$tmp_template_name'))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} ) (C {(true)}) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:16134) ) ] ) ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(gcloud)} {(compute)} {(instance-templates)} {(delete)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--quiet)} {(DQ ($ Id.VSub_DollarName '$template_name'))} ) (C {(true)}) ] ) (C {(create-node-instance-template)} {(DQ ($ Id.VSub_DollarName '$template_name'))}) (command.ForEach iter_name: group iter_words: [ { (braced_var_sub token: (Token id:Id.VSub_Name val:INSTANCE_GROUPS span_id:16190) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{}) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (command.Sentence child: (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(gcloud)} {(compute)} {(instance-groups)} {(managed)} {(set-instance-template)} {(DQ (${ Id.VSub_Name group))} {(--template)} {(DQ ($ Id.VSub_DollarName '$template_name'))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} ) (C {(true)}) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:16250) ) ] ) ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(gcloud)} {(compute)} {(instance-templates)} {(delete)} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--quiet)} {(DQ ($ Id.VSub_DollarName '$tmp_template_name'))} ) (C {(true)}) ] ) ] spids: [15996 16015] ) ] ) ] ) ) (command.ShFunction name: push-master body: (command.BraceGroup children: [ (C {(echo)} {(DQ ('Updating master metadata ...'))}) (C {(write-master-env)}) (C {(prepare-startup-script)}) (C {(add-instance-metadata-from-file)} {(DQ (${ Id.VSub_Name KUBE_MASTER))} {(DQ ('kube-env=') (${ Id.VSub_Name KUBE_TEMP) (/master-kube-env.yaml))} {(DQ ('startup-script=') (${ Id.VSub_Name KUBE_TEMP) (/configure-vm.sh))} ) (C {(echo)} { (DQ ('Pushing to master (log at ') (${ Id.VSub_Name OUTPUT) (/push-) (${ Id.VSub_Name KUBE_MASTER) ('.log) ...') ) } ) (command.Pipeline children: [ (C {(cat)} {(${ Id.VSub_Name KUBE_TEMP) (/configure-vm.sh)}) (command.Simple words: [ {(gcloud)} {(compute)} {(ssh)} {(--ssh-flag) (Id.Lit_Equals '=') (DQ ('-o LogLevel=quiet'))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(DQ (${ Id.VSub_Name KUBE_MASTER))} {(--command)} {(DQ ('sudo bash -s -- --push'))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:16410) fd: -1 arg_word: {(${ Id.VSub_Name OUTPUT) (/push-) (DQ (${ Id.VSub_Name KUBE_MASTER)) (.log)} ) ] ) ] negated: F ) ] ) ) (command.ShFunction name: push-node body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:node) op: assign_op.Equal rhs: {(${ Id.VSub_Number 1)} spids: [16438] ) ] ) (C {(echo)} {(DQ ('Updating node ') (${ Id.VSub_Name node) (' metadata... '))}) (C {(prepare-startup-script)}) (C {(add-instance-metadata-from-file)} {(DQ (${ Id.VSub_Name node))} {(DQ ('kube-env=') (${ Id.VSub_Name KUBE_TEMP) (/node-kube-env.yaml))} {(DQ ('startup-script=') (${ Id.VSub_Name KUBE_TEMP) (/configure-vm.sh))} ) (C {(echo)} { (DQ ('Start upgrading node ') (${ Id.VSub_Name node) (' (log at ') (${ Id.VSub_Name OUTPUT) (/push-) (${ Id.VSub_Name node) ('.log) ...') ) } ) (command.Pipeline children: [ (C {(cat)} {(${ Id.VSub_Name KUBE_TEMP) (/configure-vm.sh)}) (command.Simple words: [ {(gcloud)} {(compute)} {(ssh)} {(--ssh-flag) (Id.Lit_Equals '=') (DQ ('-o LogLevel=quiet'))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--zone)} {(DQ (${ Id.VSub_Name ZONE))} {(DQ (${ Id.VSub_Name node))} {(--command)} {(DQ ('sudo bash -s -- --push'))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:16553) fd: -1 arg_word: {(${ Id.VSub_Name OUTPUT) (/push-) (DQ (${ Id.VSub_Name node)) (.log)} ) ] ) ] negated: F ) ] ) ) (command.ShFunction name: kube-push body: (command.BraceGroup children: [ (C {(echo)} {(DQ ('./cluster/kube-push.sh is currently not supported in GCE.'))}) (C {(echo)} {(DQ ('Please use ./cluster/gce/upgrade.sh.'))}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:16603) arg_word: {(1)} ) (C {(prepare-push)} {(true)}) (C {(push-master)}) (command.ForExpr init: (arith_expr.BinaryAssign op_id: Id.Arith_Equal left: (sh_lhs_expr.Name name:i) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) cond: (arith_expr.Binary op_id: Id.Arith_Less left: (arith_expr.VarRef token:(Token id:Id.Lit_ArithVarLike val:i span_id:16628)) right: (arith_expr.ArithWord w: { (braced_var_sub token: (Token id:Id.VSub_Name val:NODE_NAMES span_id:16632) prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) } ) ) update: (arith_expr.UnaryAssign op_id:Id.Node_PostDPlus child:(sh_lhs_expr.Name name:i)) body: (command.DoGroup children: [ (command.Sentence child: (C {(push-node)} { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:NODE_NAMES span_id:16652) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{($ Id.VSub_DollarName '$i')}) ) ) ) } ) terminator: (Token id:Id.Op_Amp val:'&' span_id:16659) ) ] ) ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(kube) (Id.Lit_Other ':') (Id.Lit_Other ':') (util) (Id.Lit_Other ':') (Id.Lit_Other ':') (wait-for-jobs) } ) (command.BraceGroup children: [ (command.Simple words: [ {(echo)} {(-e)} { (DQ (${ Id.VSub_Name color_red) ('Some commands failed.') (${ Id.VSub_Name color_norm) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:16693) fd: -1 arg_word: {(2)} ) ] ) ] ) ] ) (C {(echo)}) (C {(echo)} {(DQ ('Kubernetes cluster is running. The master is running at:'))}) (C {(echo)}) (C {(echo)} {(DQ (' https://') (${ Id.VSub_Name KUBE_MASTER_IP))}) (C {(echo)}) (C {(echo)} {(DQ ('The user name and password to use is located in ~/.kube/config'))}) (C {(echo)}) ] ) ) (command.ShFunction name: test-build-release body: (command.BraceGroup children: [(C {(DQ (${ Id.VSub_Name KUBE_ROOT) (/build/release.sh))})] ) ) (command.ShFunction name: test-setup body: (command.BraceGroup children: [ (C {(detect-project)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalAnd left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (braced_var_sub token: (Token id:Id.VSub_Name val:MULTIZONE span_id:16847) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{}) ) } right: {(DQ (true))} ) right: (bool_expr.Unary op_id: Id.BoolUnary_n child: { (braced_var_sub token: (Token id:Id.VSub_Name val:E2E_ZONES span_id:16862) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{}) ) } ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:16867) ) ] action: [ (command.ForEach iter_name: KUBE_GCE_ZONE iter_words: [{(${ Id.VSub_Name E2E_ZONES)}] do_arg_iter: F body: (command.DoGroup children: [ (command.Simple words: [{(DQ (${ Id.VSub_Name KUBE_ROOT) (/cluster/kube-up.sh))}] more_env: [ (env_pair name: KUBE_GCE_ZONE val: {(DQ (${ Id.VSub_Name KUBE_GCE_ZONE))} spids: [16886] ) (env_pair name: KUBE_USE_EXISTING_MASTER val: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: KUBE_USE_EXISTING_MASTER span_id: 16896 ) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:(word.Empty)) ) ) } spids: [16893] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:KUBE_USE_EXISTING_MASTER) op: assign_op.Equal rhs: {(DQ (true))} spids: [16909] ) ] ) ] ) ) ] spids: [16842 16869] ) ] else_action: [(C {(DQ (${ Id.VSub_Name KUBE_ROOT) (/cluster/kube-up.sh))})] ) (C {(local)} {(Id.Lit_VarLike 'start=') (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:16947) command_list: (command.CommandList children: [(C {(date)} {(Id.Lit_Other '+') (Id.Lit_Other '%') (s)})] ) ) } ) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Simple words: [ {(gcloud)} {(compute)} {(firewall-rules)} {(create)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--target-tags)} {(DQ (${ Id.VSub_Name NODE_TAG))} {(--allow)} {(tcp) (Id.Lit_Other ':') (80) (Id.Lit_Comma ',') (tcp) (Id.Lit_Other ':') (8080)} {(--network)} {(DQ (${ Id.VSub_Name NETWORK))} { (DQ (${ Id.VSub_Name NODE_TAG) (-) (${ Id.VSub_Name INSTANCE_PREFIX) (-http-alt)) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:17021) fd: 2 arg_word: {(/dev/null)} ) ] ) (C {(true)}) ] ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:17038) cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [ {(gcloud)} {(compute)} {(firewall-rules)} {(describe)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} { (DQ (${ Id.VSub_Name NODE_TAG) (-) (${ Id.VSub_Name INSTANCE_PREFIX) (-http-alt) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:17069) fd: 2 arg_word: {(/dev/null)} ) ] ) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:17072) ) ] body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_lt left: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$start')} ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1200)}) ) ) } right: { (command_sub left_token: (Token id: Id.Left_Backtick val: '`' span_id: 17092 ) command_list: (command.CommandList children: [ (C {(date)} {(Id.Lit_Other '+') (Id.Lit_Other '%') (s)} ) ] ) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:17103) ) ] action: [ (command.Simple words: [ {(echo)} {(-e)} { (DQ (${ Id.VSub_Name color_red) ('Failed to create firewall ') (${ Id.VSub_Name NODE_TAG) (-) (${ Id.VSub_Name INSTANCE_PREFIX) ('-http-alt in ') (${ Id.VSub_Name NETWORK_PROJECT) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:17130) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:17134) arg_word: {(1)} ) ] spids: [17077 17105] ) ] ) (C {(sleep)} {(5)}) ] ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:start) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:17160) command_list: (command.CommandList children: [(C {(date)} {(Id.Lit_Other '+') (Id.Lit_Other '%') (s)})] ) ) } spids: [17159] ) ] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Simple words: [ {(gcloud)} {(compute)} {(firewall-rules)} {(create)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} {(--target-tags)} {(DQ (${ Id.VSub_Name NODE_TAG))} {(--allow)} {(tcp) (Id.Lit_Other ':') (30000-32767) (Id.Lit_Comma ',') (udp) (Id.Lit_Other ':') (30000-32767) } {(--network)} {(DQ (${ Id.VSub_Name NETWORK))} { (DQ (${ Id.VSub_Name NODE_TAG) (-) (${ Id.VSub_Name INSTANCE_PREFIX) (-nodeports)) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:17234) fd: 2 arg_word: {(/dev/null)} ) ] ) (C {(true)}) ] ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:17251) cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [ {(gcloud)} {(compute)} {(firewall-rules)} {(describe)} {(--project)} {(DQ (${ Id.VSub_Name NETWORK_PROJECT))} { (DQ (${ Id.VSub_Name NODE_TAG) (-) (${ Id.VSub_Name INSTANCE_PREFIX) (-nodeports) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:17282) fd: 2 arg_word: {(/dev/null)} ) ] ) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:17285) ) ] body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_lt left: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.ArithWord w: {($ Id.VSub_DollarName '$start')} ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1200)}) ) ) } right: { (command_sub left_token: (Token id: Id.Left_Backtick val: '`' span_id: 17305 ) command_list: (command.CommandList children: [ (C {(date)} {(Id.Lit_Other '+') (Id.Lit_Other '%') (s)} ) ] ) ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:17316) ) ] action: [ (command.Simple words: [ {(echo)} {(-e)} { (DQ (${ Id.VSub_Name color_red) ('Failed to create firewall ') (${ Id.VSub_Name NODE_TAG) (-) (${ Id.VSub_Name INSTANCE_PREFIX) ('-nodeports in ') (${ Id.VSub_Name PROJECT) ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:17343) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:17347) arg_word: {(1)} ) ] spids: [17290 17318] ) ] ) (C {(sleep)} {(5)}) ] ) ) ] ) ) (command.ShFunction name: test-teardown body: (command.BraceGroup children: [ (C {(detect-project)}) (C {(echo)} {(DQ ('Shutting down test cluster in background.'))}) (C {(delete-firewall-rules)} {(DQ (${ Id.VSub_Name NODE_TAG) (-) (${ Id.VSub_Name INSTANCE_PREFIX) (-http-alt))} {(DQ (${ Id.VSub_Name NODE_TAG) (-) (${ Id.VSub_Name INSTANCE_PREFIX) (-nodeports))} ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalAnd left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (braced_var_sub token: (Token id:Id.VSub_Name val:MULTIZONE span_id:17424) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{}) ) } right: {(DQ (true))} ) right: (bool_expr.Unary op_id: Id.BoolUnary_n child: { (braced_var_sub token: (Token id:Id.VSub_Name val:E2E_ZONES span_id:17439) suffix_op: (suffix_op.Unary op_id:Id.VTest_ColonHyphen arg_word:{}) ) } ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:17444) ) ] action: [ (C {(local)} {(Id.Lit_VarLike 'zones=') (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:17452) words: [{(${ Id.VSub_Name E2E_ZONES)}] ) } ) (command.ForExpr init: (arith_expr.BinaryAssign op_id: Id.Arith_Equal left: (sh_lhs_expr.Name name:zone_num) right: (arith_expr.Binary op_id: Id.Arith_Minus left: (arith_expr.ArithWord w: { (braced_var_sub token: (Token id:Id.VSub_Name val:zones span_id:17472) prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) } ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 1)}) ) ) cond: (arith_expr.Binary op_id: Id.Arith_Great left: (arith_expr.VarRef token: (Token id:Id.Lit_ArithVarLike val:zone_num span_id:17481) ) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) update: (arith_expr.UnaryAssign op_id: Id.Node_PostDMinus child: (sh_lhs_expr.Name name:zone_num) ) body: (command.DoGroup children: [ (command.Simple words: [{(DQ (${ Id.VSub_Name KUBE_ROOT) (/cluster/kube-down.sh))}] more_env: [ (env_pair name: KUBE_GCE_ZONE val: { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:zones span_id:17498) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.VarRef token: (Token id: Id.Lit_ArithVarLike val: zone_num span_id: 17500 ) ) ) ) ) } spids: [17495] ) (env_pair name: KUBE_USE_EXISTING_MASTER val: {(DQ (true))} spids: [17505] ) ] ) ] ) ) (command.Simple words: [{(DQ (${ Id.VSub_Name KUBE_ROOT) (/cluster/kube-down.sh))}] more_env: [ (env_pair name: KUBE_GCE_ZONE val: { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:zones span_id:17524) bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) ) ) } spids: [17521] ) (env_pair name: KUBE_USE_EXISTING_MASTER val: {(DQ (false))} spids: [17531] ) ] ) ] spids: [17419 17446] ) ] else_action: [(C {(DQ (${ Id.VSub_Name KUBE_ROOT) (/cluster/kube-down.sh))})] ) ] ) ) (command.ShFunction name: ssh-to-node body: (command.BraceGroup children: [ (C {(local)} {(Id.Lit_VarLike 'node=') (DQ ($ Id.VSub_Number '$1'))}) (C {(local)} {(Id.Lit_VarLike 'cmd=') (DQ ($ Id.VSub_Number '$2'))}) (command.ForEach iter_name: try iter_words: [ (word.BracedTree parts: [(word_part.BracedRange kind:Id.Range_Int start:1 end:5 step:1)] ) ] do_arg_iter: F body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(gcloud)} {(compute)} {(ssh)} {(--ssh-flag) (Id.Lit_Equals '=') (DQ ('-o LogLevel=quiet'))} {(--ssh-flag) (Id.Lit_Equals '=') (DQ ('-o ConnectTimeout=30'))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--zone) (Id.Lit_Equals '=') (DQ (${ Id.VSub_Name ZONE))} {(DQ (${ Id.VSub_Name node))} {(--command)} {(DQ ('echo test > /dev/null'))} ) terminator: (Token id:Id.Op_Semi val:';' span_id:17653) ) ] action: [ (command.ControlFlow token: (Token id:Id.ControlFlow_Break val:break span_id:17658) ) ] spids: [17606 17655] ) ] ) (C {(sleep)} {(5)}) ] ) ) (C {(gcloud)} {(compute)} {(ssh)} {(--ssh-flag) (Id.Lit_Equals '=') (DQ ('-o LogLevel=quiet'))} {(--ssh-flag) (Id.Lit_Equals '=') (DQ ('-o ConnectTimeout=30'))} {(--project)} {(DQ (${ Id.VSub_Name PROJECT))} {(--zone) (Id.Lit_Equals '=') (DQ (${ Id.VSub_Name ZONE))} {(DQ (${ Id.VSub_Name node))} {(--command)} {(DQ (${ Id.VSub_Name cmd))} ) ] ) ) (command.ShFunction name: prepare-e2e body: (command.BraceGroup children:[(C {(detect-project)})]) ) (command.ShFunction name: prepare-startup-script body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:SED) op: assign_op.Equal rhs: {(sed)} spids: [17766] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Simple words: [{(which)} {(gsed)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_AndGreat val:'&>' span_id:17776) fd: -1 arg_word: {(/dev/null)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:17778) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:SED) op: assign_op.Equal rhs: {(gsed)} spids: [17783] ) ] ) ] spids: [17770 17780] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Subshell command_list: (command.CommandList children: [ (command.Pipeline children: [ (command.Simple words: [{($ Id.VSub_DollarName '$SED')} {(--version)}] redirects: [ (redir.Redir op: (Token id: Id.Redir_GreatAnd val: '2>&' span_id: 17799 ) fd: 2 arg_word: {(1)} ) ] ) (C {(grep)} {(-q)} {(GNU)}) ] negated: F ) ] ) ) ] negated: T ) terminator: (Token id:Id.Op_Semi val:';' span_id:17810) ) ] action: [ (C {(echo)} {(DQ ("!!! GNU sed is required. If on OS X, use 'brew install gnu-sed'."))} ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:17822) arg_word: {(1)} ) ] spids: [17790 17812] ) ] ) (command.Simple words: [ {($ Id.VSub_DollarName '$SED')} {(SQ (Token id:Id.Lit_Chars val:'/^\\s*#\\([^!].*\\)*$/ d' span_id:17833))} {(${ Id.VSub_Name KUBE_ROOT) (/cluster/gce/configure-vm.sh)} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:17841) fd: -1 arg_word: {(${ Id.VSub_Name KUBE_TEMP) (/configure-vm.sh)} ) ] ) ] ) ) ] )