(CommandList children: [ (C {(source)} {(DQ (${ VSub_Name KUBE_ROOT) (/cluster/gce/container-linux/helper.sh))}) (FuncDef name: create-master-instance body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:address) op:Equal rhs:{(DQ )} spids:[105])] spids: [103] ) (AndOr children: [ (DBracket expr: (BoolUnary op_id: BoolUnary_n child: { (BracedVarSub token: <VSub_Number 1> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{}) spids: [114 117] ) } ) ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:address) op: Equal rhs: {(DQ (${ VSub_Number 1))} spids: [123] ) ] spids: [123] ) ] op_id: Op_DAmp ) (C {(write-master-env)}) (C {(create-master-instance-internal)} {(DQ (${ VSub_Name MASTER_NAME))} {(DQ (${ VSub_Name address))} ) ] spids: [100] ) spids: [96 99] ) (FuncDef name: replicate-master-instance body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:existing_master_zone) op: Equal rhs: {(DQ (${ VSub_Number 1))} spids: [163] ) ] spids: [161] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:existing_master_name) op: Equal rhs: {(DQ (${ VSub_Number 2))} spids: [173] ) ] spids: [171] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:existing_master_replicas) op: Equal rhs: {(DQ (${ VSub_Number 3))} spids: [183] ) ] spids: [181] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:kube_env) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(get-metadata)} {(DQ (${ VSub_Name existing_master_zone))} {(DQ (${ VSub_Name existing_master_name))} {(kube-env)} ) ] ) left_token: <Left_CommandSub '$('> spids: [196 212] ) ) } spids: [194] ) ] spids: [192] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:kube_env) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ (${ VSub_Name kube_env))}) (C {(grep)} {(-v)} {(DQ (INITIAL_ETCD_CLUSTER))}) ] negated: False ) ] ) left_token: <Left_CommandSub '$('> spids: [222 240] ) ) } spids: [220] ) ] spids: [220] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:kube_env) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(echo)} {(-e)} { (DQ (${ VSub_Name kube_env) (Lit_Other '\\') ("nINITIAL_ETCD_CLUSTER: '") (${ VSub_Name existing_master_replicas) (',') (${ VSub_Name REPLICA_NAME) ("'") ) } ) ] ) left_token: <Left_CommandSub '$('> spids: [246 266] ) ) } spids: [244] ) ] spids: [244] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ETCD_CA_KEY) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ (${ VSub_Name kube_env))}) (C {(grep)} {(DQ (ETCD_CA_KEY))}) (C {(sed)} {(DQ ("s/^.*: '//"))}) (C {(sed)} {(DQ ("s/'") (Lit_Other '$') (//))}) ] negated: False ) ] ) left_token: <Left_CommandSub '$('> spids: [272 306] ) ) } spids: [270] ) ] spids: [270] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ETCD_CA_CERT) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ (${ VSub_Name kube_env))}) (C {(grep)} {(DQ (ETCD_CA_CERT))}) (C {(sed)} {(DQ ("s/^.*: '//"))}) (C {(sed)} {(DQ ("s/'") (Lit_Other '$') (//))}) ] negated: False ) ] ) left_token: <Left_CommandSub '$('> spids: [312 346] ) ) } spids: [310] ) ] spids: [310] ) (C {(create-etcd-certs)} {(DQ (${ VSub_Name REPLICA_NAME))} {(DQ (${ VSub_Name ETCD_CA_CERT))} {(DQ (${ VSub_Name ETCD_CA_KEY))} ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:kube_env) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ (${ VSub_Name kube_env))}) (C {(grep)} {(-v)} {(DQ (ETCD_PEER_KEY))}) ] negated: False ) ] ) left_token: <Left_CommandSub '$('> spids: [375 393] ) ) } spids: [373] ) ] spids: [373] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:kube_env) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(echo)} {(-e)} { (DQ (${ VSub_Name kube_env) (Lit_Other '\\') ("nETCD_PEER_KEY: '") (${ VSub_Name ETCD_PEER_KEY_BASE64) ("'") ) } ) ] ) left_token: <Left_CommandSub '$('> spids: [399 415] ) ) } spids: [397] ) ] spids: [397] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:kube_env) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {(DQ (${ VSub_Name kube_env))}) (C {(grep)} {(-v)} {(DQ (ETCD_PEER_CERT))}) ] negated: False ) ] ) left_token: <Left_CommandSub '$('> spids: [421 439] ) ) } spids: [419] ) ] spids: [419] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:kube_env) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(echo)} {(-e)} { (DQ (${ VSub_Name kube_env) (Lit_Other '\\') ("nETCD_PEER_CERT: '") (${ VSub_Name ETCD_PEER_CERT_BASE64) ("'") ) } ) ] ) left_token: <Left_CommandSub '$('> spids: [445 461] ) ) } spids: [443] ) ] spids: [443] ) (SimpleCommand words: [{(echo)} {(DQ (${ VSub_Name kube_env))}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(${ VSub_Name KUBE_TEMP) (/master-kube-env.yaml)} spids: [474] ) ] ) (SimpleCommand words: [ {(get-metadata)} {(DQ (${ VSub_Name existing_master_zone))} {(DQ (${ VSub_Name existing_master_name))} {(cluster-name)} ] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(DQ (${ VSub_Name KUBE_TEMP) (/cluster-name.txt))} spids: [498] ) ] ) (C {(create-master-instance-internal)} {(DQ (${ VSub_Name REPLICA_NAME))}) ] spids: [158] ) spids: [152 157] ) (FuncDef name: create-master-instance-internal body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:gcloud) op: Equal rhs: {(DQ (gcloud))} spids: [532] ) ] spids: [530] ) (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:retries) op:Equal rhs:{(5)} spids:[540])] spids: [538] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: { (DQ (BracedVarSub token: <VSub_Name ENABLE_IP_ALIASES> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [549 552] ) ) } right: {(SQ <true>)} ) ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:gcloud) op: Equal rhs: {(DQ ('gcloud beta'))} spids: [567] ) ] spids: [567] ) ] spids: [16777215 564] ) ] spids: [16777215 573] ) (Assignment keyword: Assign_Local flags: [-r] pairs: [ (assign_pair lhs: (LhsName name:master_name) op: Equal rhs: {(DQ (${ VSub_Number 1))} spids: [581] ) ] spids: [577] ) (Assignment keyword: Assign_Local flags: [-r] pairs: [ (assign_pair lhs: (LhsName name:address) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Number 2> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [595 598] ) ) } spids: [593] ) ] spids: [589] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:preemptible_master) op: Equal rhs: {(DQ )} spids: [605] ) ] spids: [603] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: { (DQ (BracedVarSub token: <VSub_Name PREEMPTIBLE_MASTER> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [615 618] ) ) } right: {(DQ (true))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:preemptible_master) op: Equal rhs: {(DQ ('--preemptible --maintenance-policy TERMINATE'))} spids: [633] ) ] spids: [633] ) ] spids: [16777215 630] ) ] spids: [16777215 639] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:network) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(make-gcloud-network-argument)} {(DQ (${ VSub_Name NETWORK_PROJECT))} {(DQ (${ VSub_Name REGION))} {(DQ (${ VSub_Name NETWORK))} { (DQ (BracedVarSub token: <VSub_Name SUBNETWORK> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [670 673] ) ) } { (DQ (BracedVarSub token: <VSub_Name address> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [679 682] ) ) } { (DQ (BracedVarSub token: <VSub_Name ENABLE_IP_ALIASES> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [686 689] ) ) } { (DQ (BracedVarSub token: <VSub_Name IP_ALIAS_SIZE> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )}) spids: [693 696] ) ) } ) ] ) left_token: <Left_CommandSub '$('> spids: [646 698] ) } spids: [645] ) ] spids: [643] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:metadata) op: Equal rhs: {(DQ ('kube-env=') (${ VSub_Name KUBE_TEMP) (/master-kube-env.yaml))} spids: [704] ) ] spids: [702] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:metadata) op: Equal rhs: { (DQ (${ VSub_Name metadata) (',user-data=') (${ VSub_Name KUBE_ROOT) (/cluster/gce/container-linux/master.yaml) ) } spids: [714] ) ] spids: [714] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:metadata) op: Equal rhs: { (DQ (${ VSub_Name metadata) (',configure-sh=') (${ VSub_Name KUBE_ROOT) (/cluster/gce/container-linux/configure.sh) ) } spids: [727] ) ] spids: [727] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:metadata) op: Equal rhs: { (DQ (${ VSub_Name metadata) (',cluster-name=') (${ VSub_Name KUBE_TEMP) (/cluster-name.txt) ) } spids: [740] ) ] spids: [740] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:disk) op: Equal rhs: {(DQ ('name=') (${ VSub_Name master_name) (-pd))} spids: [756] ) ] spids: [754] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:disk) op: Equal rhs: {(DQ (${ VSub_Name disk) (',device-name=master-pd'))} spids: [766] ) ] spids: [766] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:disk) op: Equal rhs: {(DQ (${ VSub_Name disk) (',mode=rw'))} spids: [775] ) ] spids: [775] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:disk) op: Equal rhs: {(DQ (${ VSub_Name disk) (',boot=no'))} spids: [784] ) ] spids: [784] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:disk) op: Equal rhs: {(DQ (${ VSub_Name disk) (',auto-delete=no'))} spids: [793] ) ] spids: [793] ) (ForEach iter_name: attempt iter_words: [ { (CommandSubPart command_list: (CommandList children:[(C {(seq)} {(1)} {(${ VSub_Name retries)})]) left_token: <Left_CommandSub '$('> spids: [809 817] ) } ] do_arg_iter: False body: (DoGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:result) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (SimpleCommand words: [ {(${ VSub_Name gcloud)} {(compute)} {(instances)} {(create)} {(DQ (${ VSub_Name master_name))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone)} {(DQ (${ VSub_Name ZONE))} {(--machine-type)} {(DQ (${ VSub_Name MASTER_SIZE))} {(--image-project) (Lit_Other '=') (DQ (${ VSub_Name MASTER_IMAGE_PROJECT)) } {(--image)} {(DQ (${ VSub_Name MASTER_IMAGE))} {(--tags)} {(DQ (${ VSub_Name MASTER_TAG))} {(--scopes)} { (DQ ( 'storage-ro,compute-rw,monitoring,logging-write' ) ) } {(--metadata-from-file)} {(DQ (${ VSub_Name metadata))} {(--disk)} {(DQ (${ VSub_Name disk))} {(--boot-disk-size)} {(DQ (${ VSub_Name MASTER_ROOT_DISK_SIZE))} {(${ VSub_Name preemptible_master)} {(${ VSub_Name network)} ] redirects: [ (Redir op_id: Redir_GreatAnd fd: 2 arg_word: {(1)} spids: [953] ) ] ) ] ) left_token: <Left_CommandSub '$('> spids: [826 955] ) } spids: [825] ) ] spids: [825] ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ (${ VSub_Name result))}] redirects: [ (Redir op_id: Redir_GreatAnd fd: 16777215 arg_word: {(2)} spids: [969] ) ] ) (ControlFlow token: <ControlFlow_Return return> arg_word: {(0)} ) ] spids: [16777215 958] ) ] else_action: [ (SimpleCommand words: [{(echo)} {(DQ (${ VSub_Name result))}] redirects: [ (Redir op_id: Redir_GreatAnd fd: 16777215 arg_word: {(2)} spids: [989] ) ] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (LogicalNot child: (BoolBinary op_id: BoolBinary_EqualTilde left: {(DQ (${ VSub_Name result))} right: {(DQ ('try again later'))} ) ) ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ( 'Failed to create master instance due to non-retryable error' ) ) } ] redirects: [ (Redir op_id: Redir_GreatAnd fd: 16777215 arg_word: {(2)} spids: [1023] ) ] ) (ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] spids: [16777215 1014] ) ] spids: [16777215 1032] ) (C {(sleep)} {(10)}) ] spids: [978 1040] ) ] spids: [820 1043] ) spids: [808 818] ) (SimpleCommand words: [ {(echo)} { (DQ ('Failed to create master instance despite ') (${ VSub_Name retries) (' attempts') ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[1057])] ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [527] ) spids: [521 526] ) (FuncDef name: get-metadata body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:zone) op: Equal rhs: {(DQ (${ VSub_Number 1))} spids: [1079] ) ] spids: [1077] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:name) op: Equal rhs: {(DQ (${ VSub_Number 2))} spids: [1089] ) ] spids: [1087] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:key) op: Equal rhs: {(DQ (${ VSub_Number 3))} spids: [1099] ) ] spids: [1097] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:metadata_url) op: Equal rhs: { (DQ ('http://metadata.google.internal/computeMetadata/v1/instance/attributes/') (${ VSub_Name key) ) } spids: [1110] ) ] spids: [1108] ) (SimpleCommand words: [ {(gcloud)} {(compute)} {(ssh)} {(DQ (${ VSub_Name name))} {(--project)} {(DQ (${ VSub_Name PROJECT))} {(--zone)} {(DQ (${ VSub_Name zone))} {(--command)} {(DQ ("curl '") (${ VSub_Name metadata_url) ("' -H 'Metadata-Flavor: Google'"))} ] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[1164])] ) ] spids: [1074] ) spids: [1068 1073] ) ] )