(CommandList
  children: [
    (C {(set)} {(-o)} {(errexit)})
    (C {(set)} {(-o)} {(nounset)})
    (C {(set)} {(-o)} {(pipefail)})
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:KUBE_ROOT)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [(C {(dirname)} {(DQ (${ VSub_Name BASH_SOURCE))})]
                  )
                left_token: <Left_CommandSub '$('>
                spids: [80 88]
              ) (/..)
            }
          spids: [79]
        )
      ]
      spids: [79]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (C {(Lit_Other '[')} {(-f)} {(DQ (${ VSub_Name KUBE_ROOT) (/cluster/env.sh))} 
                  {(Lit_Other ']')}
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [(C {(source)} {(DQ (${ VSub_Name KUBE_ROOT) (/cluster/env.sh))})]
          spids: [16777215 108]
        )
      ]
      spids: [16777215 120]
    )
    (C {(source)} {(DQ (${ VSub_Name KUBE_ROOT) (/hack/lib/util.sh))})
    (C {(source)} {(DQ (${ VSub_Name KUBE_ROOT) (/cluster/kube-util.sh))})
    (FuncDef
      name: kubectl_retry
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [(assign_pair lhs:(LhsName name:tries) op:Equal rhs:{(3)} spids:[154])]
              spids: [154]
            )
            (While
              cond: [
                (Sentence
                  child: 
                    (Pipeline
                      children: [
                        (C {(DQ (${ VSub_Name KUBE_ROOT) (/cluster/kubectl.sh))} {(DQ ($ VSub_At '$@'))})
                      ]
                      negated: True
                    )
                  terminator: <Op_Semi ';'>
                )
              ]
              body: 
                (DoGroup
                  children: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:tries)
                          op: Equal
                          rhs: 
                            {
                              (ArithSubPart
                                anode: 
                                  (ArithBinary
                                    op_id: Arith_Minus
                                    left: (ArithVarRef name:tries)
                                    right: (ArithWord w:{(Lit_Digits 1)})
                                  )
                                spids: [178 183]
                              )
                            }
                          spids: [177]
                        )
                      ]
                      spids: [177]
                    )
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (DBracket
                                  expr: 
                                    (BoolBinary
                                      op_id: BoolBinary_le
                                      left: {(${ VSub_Name tries)}
                                      right: {(0)}
                                    )
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (SimpleCommand
                              words: [
                                {(echo)}
                                {(DQ ("('kubectl ") ($ VSub_At '$@') ("' failed, giving up)"))}
                              ]
                              redirects: [
                                (Redir
                                  op_id: Redir_GreatAnd
                                  fd: 16777215
                                  arg_word: {(2)}
                                  spids: [212]
                                )
                              ]
                            )
                            (ControlFlow
                              token: <ControlFlow_Return return>
                              arg_word: {(1)}
                            )
                          ]
                          spids: [16777215 201]
                        )
                      ]
                      spids: [16777215 221]
                    )
                    (SimpleCommand
                      words: [
                        {(echo)}
                        {(DQ ('(kubectl failed, will retry ') (${ VSub_Name tries) (' times)'))}
                      ]
                      redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[234])]
                    )
                    (C {(sleep)} {(1)})
                  ]
                  spids: [174 243]
                )
            )
          ]
          spids: [151]
        )
      spids: [145 150]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:ALLOWED_NOTREADY_NODES)
          op: Equal
          rhs: 
            {
              (DQ 
                (BracedVarSub
                  token: <VSub_Name ALLOWED_NOTREADY_NODES>
                  suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(0)})
                  spids: [250 254]
                )
              )
            }
          spids: [248]
        )
      ]
      spids: [248]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:CLUSTER_READY_ADDITIONAL_TIME_SECONDS)
          op: Equal
          rhs: 
            {
              (DQ 
                (BracedVarSub
                  token: <VSub_Name CLUSTER_READY_ADDITIONAL_TIME_SECONDS>
                  suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(30)})
                  spids: [259 263]
                )
              )
            }
          spids: [257]
        )
      ]
      spids: [257]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:EXPECTED_NUM_NODES)
          op: Equal
          rhs: {(DQ (${ VSub_Name NUM_NODES))}
          spids: [267]
        )
      ]
      spids: [267]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (DBracket
                  expr: 
                    (BoolBinary
                      op_id: BoolBinary_GlobDEqual
                      left: 
                        {
                          (DQ 
                            (BracedVarSub
                              token: <VSub_Name KUBERNETES_PROVIDER>
                              suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )})
                              spids: [280 283]
                            )
                          )
                        }
                      right: {(DQ (gce))}
                    )
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(echo)} 
              {
                (DQ ('Validating gce cluster, MULTIZONE=') 
                  (BracedVarSub
                    token: <VSub_Name MULTIZONE>
                    suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )})
                    spids: [302 305]
                  )
                )
              }
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: 
                                {
                                  (DQ 
                                    (BracedVarSub
                                      token: <VSub_Name MULTIZONE>
                                      suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )})
                                      spids: [318 321]
                                    )
                                  )
                                }
                              right: {(DQ (true))}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:EXPECTED_NUM_NODES)
                          op: Equal
                          rhs: 
                            {
                              (CommandSubPart
                                command_list: 
                                  (CommandList
                                    children: [
                                      (Pipeline
                                        children: [
                                          (C {(gcloud)} {(-q)} {(compute)} {(instances)} {(list)} 
                                            {(--project) (Lit_Other '=') (DQ (${ VSub_Name PROJECT))} {(--format) (Lit_Other '=') (Lit_Other '[') (no-heading) (Lit_Other ']')} 
                                            {(--filter) (Lit_Other '=') 
                                              (DQ ("name ~ '") (${ VSub_Name NODE_INSTANCE_PREFIX) 
                                                (".*' AND zone:(") 
                                                (CommandSubPart
                                                  command_list: 
                                                    (CommandList
                                                      children: [
                                                        (Pipeline
                                                          children: [
                                                            (C {(gcloud)} {(-q)} {(compute)} {(zones)} 
                                                              {(list)} {(--project) (Lit_Other '=') (DQ (${ VSub_Name PROJECT))} 
                                                              {(--filter) (Lit_Other '=') 
                                                                (Lit_VarLike 'region=') (${ VSub_Name REGION)
                                                              } 
                                                              {(--format) (Lit_Other '=') (csv) 
                                                                (Lit_Other '[') (no-heading) (Lit_Other ']') (EscapedLiteralPart token:<Lit_EscapedChar '\\('>) (name) 
                                                                (EscapedLiteralPart
                                                                  token: <Lit_EscapedChar '\\)'>
                                                                )
                                                              }
                                                            )
                                                            (C {(tr)} {(DQ (Lit_Other '\\') (n))} 
                                                              {(DQ (','))}
                                                            )
                                                            (C {(sed)} 
                                                              {(DQ ('s/,') (Lit_Other '$') (//))}
                                                            )
                                                          ]
                                                          negated: False
                                                        )
                                                      ]
                                                    )
                                                  left_token: <Left_CommandSub '$('>
                                                  spids: [372 430]
                                                ) (')')
                                              )
                                            }
                                          )
                                          (C {(wc)} {(-l)})
                                        ]
                                        negated: False
                                      )
                                    ]
                                  )
                                left_token: <Left_CommandSub '$('>
                                spids: [337 439]
                              )
                            }
                          spids: [336]
                        )
                      ]
                      spids: [336]
                    )
                    (C {(echo)} 
                      {
                        (DQ ('Computing number of nodes, NODE_INSTANCE_PREFIX=') 
                          (${ VSub_Name NODE_INSTANCE_PREFIX) (', REGION=') (${ VSub_Name REGION) (', EXPECTED_NUM_NODES=') (${ VSub_Name EXPECTED_NUM_NODES)
                        )
                      }
                    )
                  ]
                  spids: [16777215 333]
                )
              ]
              spids: [16777215 460]
            )
          ]
          spids: [16777215 295]
        )
      ]
      spids: [16777215 462]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (DBracket
                  expr: 
                    (BoolBinary
                      op_id: BoolBinary_GlobDEqual
                      left: 
                        {
                          (DQ 
                            (BracedVarSub
                              token: <VSub_Name REGISTER_MASTER_KUBELET>
                              suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )})
                              spids: [470 473]
                            )
                          )
                        }
                      right: {(DQ (true))}
                    )
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: 
                                {
                                  (DQ 
                                    (BracedVarSub
                                      token: <VSub_Name KUBERNETES_PROVIDER>
                                      suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )})
                                      spids: [493 496]
                                    )
                                  )
                                }
                              right: {(DQ (gce))}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:NUM_MASTERS)
                          op: Equal
                          rhs: 
                            {
                              (CommandSubPart
                                command_list: 
                                  (CommandList
                                    children: [(C {(get-master-replicas-count)})]
                                  )
                                left_token: <Left_CommandSub '$('>
                                spids: [512 514]
                              )
                            }
                          spids: [511]
                        )
                      ]
                      spids: [511]
                    )
                  ]
                  spids: [16777215 508]
                )
              ]
              else_action: [
                (Assignment
                  keyword: Assign_None
                  pairs: [(assign_pair lhs:(LhsName name:NUM_MASTERS) op:Equal rhs:{(1)} spids:[520])]
                  spids: [520]
                )
              ]
              spids: [517 524]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:EXPECTED_NUM_NODES)
                  op: Equal
                  rhs: 
                    {
                      (ArithSubPart
                        anode: 
                          (ArithBinary
                            op_id: Arith_Plus
                            left: (ArithVarRef name:EXPECTED_NUM_NODES)
                            right: (ArithVarRef name:NUM_MASTERS)
                          )
                        spids: [528 533]
                      )
                    }
                  spids: [527]
                )
              ]
              spids: [527]
            )
          ]
          spids: [16777215 485]
        )
      ]
      spids: [16777215 535]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:REQUIRED_NUM_NODES)
          op: Equal
          rhs: 
            {
              (ArithSubPart
                anode: 
                  (ArithBinary
                    op_id: Arith_Minus
                    left: (ArithVarRef name:EXPECTED_NUM_NODES)
                    right: (ArithVarRef name:ALLOWED_NOTREADY_NODES)
                  )
                spids: [539 546]
              )
            }
          spids: [538]
        )
      ]
      spids: [538]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:return_value) op:Equal rhs:{(0)} spids:[551])]
      spids: [551]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:attempt) op:Equal rhs:{(0)} spids:[554])]
      spids: [554]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:PAUSE_BETWEEN_ITERATIONS_SECONDS)
          op: Equal
          rhs: {(15)}
          spids: [560]
        )
      ]
      spids: [560]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:MAX_ATTEMPTS) op:Equal rhs:{(100)} spids:[563])]
      spids: [563]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:ADDITIONAL_ITERATIONS)
          op: Equal
          rhs: 
            {
              (ArithSubPart
                anode: 
                  (ArithBinary
                    op_id: Arith_Slash
                    left: 
                      (ArithBinary
                        op_id: Arith_Minus
                        left: 
                          (ArithBinary
                            op_id: Arith_Plus
                            left: (ArithVarRef name:CLUSTER_READY_ADDITIONAL_TIME_SECONDS)
                            right: (ArithVarRef name:PAUSE_BETWEEN_ITERATIONS_SECONDS)
                          )
                        right: (ArithWord w:{(Lit_Digits 1)})
                      )
                    right: (ArithVarRef name:PAUSE_BETWEEN_ITERATIONS_SECONDS)
                  )
                spids: [567 582]
              )
            }
          spids: [566]
        )
      ]
      spids: [566]
    )
    (While
      cond: [(Sentence child:(C {(true)}) terminator:<Op_Semi ';'>)]
      body: 
        (DoGroup
          children: [
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_gt
                              left: {(${ VSub_Name attempt)}
                              right: {(0)}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [(C {(sleep)} {(15)})]
                  spids: [16777215 611]
                )
              ]
              spids: [16777215 619]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:attempt)
                  op: Equal
                  rhs: 
                    {
                      (ArithSubPart
                        anode: 
                          (ArithBinary
                            op_id: Arith_Plus
                            left: (ArithVarRef name:attempt)
                            right: (ArithWord w:{(Lit_Digits 1)})
                          )
                        spids: [623 628]
                      )
                    }
                  spids: [622]
                )
              ]
              spids: [622]
            )
            (AndOr
              children: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:node)
                      op: Equal
                      rhs: 
                        {
                          (CommandSubPart
                            command_list: 
                              (CommandList
                                children: [(C {(kubectl_retry)} {(get)} {(nodes)})]
                              )
                            left_token: <Left_CommandSub '$('>
                            spids: [681 687]
                          )
                        }
                      spids: [680]
                    )
                  ]
                  spids: [680]
                )
                (AndOr
                  children: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:res)
                          op: Equal
                          rhs: {(DQ ($ VSub_QMark '$?'))}
                          spids: [691]
                        )
                      ]
                      spids: [691]
                    )
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:res)
                          op: Equal
                          rhs: {(DQ ($ VSub_QMark '$?'))}
                          spids: [698]
                        )
                      ]
                      spids: [698]
                    )
                  ]
                  op_id: Op_DPipe
                )
              ]
              op_id: Op_DAmp
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {(DQ (${ VSub_Name res))} {(-ne)} {(DQ (0))} 
                          {(Lit_Other ']')}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (DBracket
                                  expr: 
                                    (BoolBinary
                                      op_id: BoolBinary_gt
                                      left: {(DQ (${ VSub_Name attempt))}
                                      right: 
                                        {
                                          (DQ 
                                            (BracedVarSub
                                              token: <VSub_Name last_run>
                                              suffix_op: 
                                                (StringUnary
                                                  op_id: VTest_ColonHyphen
                                                  arg_word: {($ VSub_Name '$MAX_ATTEMPTS')}
                                                )
                                              spids: [739 743]
                                            )
                                          )
                                        }
                                    )
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (C {(echo)} {(-e)} 
                              {
                                (DQ (${ VSub_Name color_red) (' Failed to get nodes.') 
                                  (${ VSub_Name color_norm)
                                )
                              }
                            )
                            (C {(exit)} {(1)})
                          ]
                          spids: [16777215 749]
                        )
                      ]
                      else_action: [(ControlFlow token:<ControlFlow_Continue continue>)]
                      spids: [772 778]
                    )
                  ]
                  spids: [16777215 723]
                )
              ]
              spids: [16777215 781]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:found)
                  op: Equal
                  rhs: 
                    {
                      (ArithSubPart
                        anode: 
                          (ArithBinary
                            op_id: Arith_Minus
                            left: 
                              (ArithWord
                                w: 
                                  {
                                    (CommandSubPart
                                      command_list: 
                                        (CommandList
                                          children: [
                                            (Pipeline
                                              children: [
                                                (C {(echo)} {(DQ (${ VSub_Name node))})
                                                (C {(wc)} {(-l)})
                                              ]
                                              negated: False
                                            )
                                          ]
                                        )
                                      left_token: <Left_CommandSub '$('>
                                      spids: [786 800]
                                    )
                                  }
                              )
                            right: (ArithWord w:{(Lit_Digits 1)})
                          )
                        spids: [785 806]
                      )
                    }
                  spids: [784]
                )
              ]
              spids: [784]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:ready)
                  op: Equal
                  rhs: 
                    {
                      (ArithSubPart
                        anode: 
                          (ArithBinary
                            op_id: Arith_Minus
                            left: 
                              (ArithWord
                                w: 
                                  {
                                    (CommandSubPart
                                      command_list: 
                                        (CommandList
                                          children: [
                                            (Pipeline
                                              children: [
                                                (C {(echo)} {(DQ (${ VSub_Name node))})
                                                (C {(grep)} {(-v)} {(DQ (NotReady))})
                                                (C {(wc)} {(-l)})
                                              ]
                                              negated: False
                                            )
                                          ]
                                        )
                                      left_token: <Left_CommandSub '$('>
                                      spids: [811 836]
                                    )
                                  }
                              )
                            right: (ArithWord w:{(Lit_Digits 1)})
                          )
                        spids: [810 842]
                      )
                    }
                  spids: [809]
                )
              ]
              spids: [809]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (AndOr
                          children: [
                            (DParen
                              child: 
                                (ArithBinary
                                  op_id: Arith_DEqual
                                  left: (ArithWord w:{(DQ (${ VSub_Name found))})
                                  right: (ArithWord w:{(DQ (${ VSub_Name EXPECTED_NUM_NODES))})
                                )
                            )
                            (DParen
                              child: 
                                (ArithBinary
                                  op_id: Arith_DEqual
                                  left: (ArithWord w:{(DQ (${ VSub_Name ready))})
                                  right: (ArithWord w:{(DQ (${ VSub_Name EXPECTED_NUM_NODES))})
                                )
                            )
                          ]
                          op_id: Op_DAmp
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [(ControlFlow token:<ControlFlow_Break break>)]
                  spids: [16777215 888]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DParen
                          child: 
                            (ArithBinary
                              op_id: Arith_Great
                              left: (ArithWord w:{(DQ (${ VSub_Name found))})
                              right: (ArithWord w:{(DQ (${ VSub_Name EXPECTED_NUM_NODES))})
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (DBracket
                                  expr: 
                                    (BoolBinary
                                      op_id: BoolBinary_GlobNEqual
                                      left: 
                                        {
                                          (DQ 
                                            (BracedVarSub
                                              token: <VSub_Name KUBE_USE_EXISTING_MASTER>
                                              suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )})
                                              spids: [924 927]
                                            )
                                          )
                                        }
                                      right: {(DQ (true))}
                                    )
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (C {(echo)} {(-e)} 
                              {
                                (DQ (${ VSub_Name color_red) ('Found ') (${ VSub_Name found) 
                                  (' nodes, but expected ') (${ VSub_Name EXPECTED_NUM_NODES) ('. Your cluster may not behave correctly.') 
                                  (${ VSub_Name color_norm)
                                )
                              }
                            )
                          ]
                          spids: [16777215 939]
                        )
                      ]
                      spids: [16777215 965]
                    )
                    (ControlFlow token:<ControlFlow_Break break>)
                  ]
                  spids: [894 916]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DParen
                          child: 
                            (ArithBinary
                              op_id: Arith_Great
                              left: (ArithWord w:{(DQ (${ VSub_Name ready))})
                              right: (ArithWord w:{(DQ (${ VSub_Name EXPECTED_NUM_NODES))})
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(echo)} {(-e)} 
                      {
                        (DQ (${ VSub_Name color_red) ('Found ') (${ VSub_Name ready) 
                          (' ready nodes, but expected ') (${ VSub_Name EXPECTED_NUM_NODES) ('. Your cluster may not behave correctly.') 
                          (${ VSub_Name color_norm)
                        )
                      }
                    )
                    (ControlFlow token:<ControlFlow_Break break>)
                  ]
                  spids: [971 992]
                )
              ]
              else_action: [
                (If
                  arms: [
                    (if_arm
                      cond: [
                        (Sentence
                          child: 
                            (DBracket
                              expr: 
                                (BoolBinary
                                  op_id: BoolBinary_le
                                  left: {(DQ (${ VSub_Name REQUIRED_NUM_NODES))}
                                  right: {(DQ (${ VSub_Name ready))}
                                )
                            )
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [
                        (C {(echo)} {(-e)} 
                          {
                            (DQ (${ VSub_Name color_green) ('Found ') (${ VSub_Name REQUIRED_NUM_NODES) 
                              (' Nodes, allowing additional ') (${ VSub_Name ADDITIONAL_ITERATIONS) (' iterations for other Nodes to join.') (${ VSub_Name color_norm)
                            )
                          }
                        )
                        (Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (LhsName name:last_run)
                              op: Equal
                              rhs: 
                                {
                                  (DQ 
                                    (BracedVarSub
                                      token: <VSub_Name last_run>
                                      suffix_op: 
                                        (StringUnary
                                          op_id: VTest_ColonHyphen
                                          arg_word: 
                                            {
                                              (ArithSubPart
                                                anode: 
                                                  (ArithBinary
                                                    op_id: Arith_Minus
                                                    left: 
                                                      (ArithBinary
                                                        op_id: Arith_Plus
                                                        left: (ArithVarRef name:attempt)
                                                        right: 
                                                          (ArithVarRef
                                                            name: ADDITIONAL_ITERATIONS
                                                          )
                                                      )
                                                    right: (ArithWord w:{(Lit_Digits 1)})
                                                  )
                                                spids: [1076 1087]
                                              )
                                            }
                                        )
                                      spids: [1073 1088]
                                    )
                                  )
                                }
                              spids: [1071]
                            )
                          ]
                          spids: [1071]
                        )
                      ]
                      spids: [16777215 1045]
                    )
                  ]
                  spids: [16777215 1092]
                )
                (If
                  arms: [
                    (if_arm
                      cond: [
                        (Sentence
                          child: 
                            (DBracket
                              expr: 
                                (BoolBinary
                                  op_id: BoolBinary_gt
                                  left: {(DQ (${ VSub_Name attempt))}
                                  right: 
                                    {
                                      (DQ 
                                        (BracedVarSub
                                          token: <VSub_Name last_run>
                                          suffix_op: 
                                            (StringUnary
                                              op_id: VTest_ColonHyphen
                                              arg_word: {($ VSub_Name '$MAX_ATTEMPTS')}
                                            )
                                          spids: [1108 1112]
                                        )
                                      )
                                    }
                                )
                            )
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [
                        (C {(echo)} {(-e)} 
                          {
                            (DQ (${ VSub_Name color_yellow) ('Detected ') (${ VSub_Name ready) 
                              (' ready nodes, found ') (${ VSub_Name found) (' nodes out of expected ') (${ VSub_Name EXPECTED_NUM_NODES) 
                              ('. Your cluster may not be fully functional.') (${ VSub_Name color_norm)
                            )
                          }
                        )
                        (C {(kubectl_retry)} {(get)} {(nodes)})
                        (If
                          arms: [
                            (if_arm
                              cond: [
                                (Sentence
                                  child: 
                                    (DBracket
                                      expr: 
                                        (BoolBinary
                                          op_id: BoolBinary_gt
                                          left: {(DQ (${ VSub_Name REQUIRED_NUM_NODES))}
                                          right: {(DQ (${ VSub_Name ready))}
                                        )
                                    )
                                  terminator: <Op_Semi ';'>
                                )
                              ]
                              action: [(C {(exit)} {(1)})]
                              spids: [16777215 1176]
                            )
                          ]
                          else_action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:return_value)
                                  op: Equal
                                  rhs: {(2)}
                                  spids: [1187]
                                )
                              ]
                              spids: [1187]
                            )
                            (ControlFlow token:<ControlFlow_Break break>)
                          ]
                          spids: [1184 1194]
                        )
                      ]
                      spids: [16777215 1118]
                    )
                  ]
                  else_action: [
                    (C {(echo)} {(-e)} 
                      {
                        (DQ (${ VSub_Name color_yellow) ('Waiting for ') 
                          (${ VSub_Name EXPECTED_NUM_NODES) (' ready nodes. ') (${ VSub_Name ready) (' ready nodes, ') (${ VSub_Name found) 
                          (' registered. Retrying.') (${ VSub_Name color_norm)
                        )
                      }
                    )
                  ]
                  spids: [1197 1227]
                )
              ]
              spids: [1021 1230]
            )
          ]
          spids: [589 1232]
        )
    )
    (C {(echo)} {(DQ ('Found ') (${ VSub_Name found) (' node(s).'))})
    (C {(kubectl_retry)} {(get)} {(nodes)})
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:attempt) op:Equal rhs:{(0)} spids:[1251])]
      spids: [1251]
    )
    (While
      cond: [(Sentence child:(C {(true)}) terminator:<Op_Semi ';'>)]
      body: 
        (DoGroup
          children: [
            (AndOr
              children: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:cs_status)
                      op: Equal
                      rhs: 
                        {
                          (CommandSubPart
                            command_list: 
                              (CommandList
                                children: [
                                  (C {(kubectl_retry)} {(get)} {(componentstatuses)} {(-o)} {(template)} 
                                    {(--template) (Lit_Other '=') 
                                      (SQ 
                                        <
'{{range .items}}{{with index .conditions 0}}{{.type}}:{{.status}}{{end}}{{"\\n"}}{{end}}'
                                        >
                                      )
                                    }
                                  )
                                ]
                              )
                            left_token: <Left_CommandSub '$('>
                            spids: [1283 1299]
                          )
                        }
                      spids: [1282]
                    )
                  ]
                  spids: [1282]
                )
                (C {(true)})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:componentstatuses)
                      op: Equal
                      rhs: 
                        {
                          (CommandSubPart
                            command_list: 
                              (CommandList
                                children: [
                                  (Pipeline
                                    children: [
                                      (C {(echo)} {(DQ (${ VSub_Name cs_status))})
                                      (C {(grep)} {(-c)} {(SQ <'Healthy:'>)})
                                    ]
                                    negated: False
                                  )
                                ]
                              )
                            left_token: <Left_CommandSub '$('>
                            spids: [1307 1325]
                          )
                        }
                      spids: [1306]
                    )
                  ]
                  spids: [1306]
                )
                (C {(true)})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:healthy)
                      op: Equal
                      rhs: 
                        {
                          (CommandSubPart
                            command_list: 
                              (CommandList
                                children: [
                                  (Pipeline
                                    children: [
                                      (C {(echo)} {(DQ (${ VSub_Name cs_status))})
                                      (C {(grep)} {(-c)} {(SQ <'Healthy:True'>)})
                                    ]
                                    negated: False
                                  )
                                ]
                              )
                            left_token: <Left_CommandSub '$('>
                            spids: [1333 1351]
                          )
                        }
                      spids: [1332]
                    )
                  ]
                  spids: [1332]
                )
                (C {(true)})
              ]
              op_id: Op_DPipe
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (AndOr
                          children: [
                            (DParen
                              child: 
                                (ArithBinary
                                  op_id: Arith_Great
                                  left: (ArithVarRef name:componentstatuses)
                                  right: (ArithVarRef name:healthy)
                                )
                            )
                            (DParen
                              child: 
                                (ArithBinary
                                  op_id: Arith_DEqual
                                  left: (ArithVarRef name:componentstatuses)
                                  right: (ArithWord w:{(Lit_Digits 0)})
                                )
                            )
                          ]
                          op_id: Op_DPipe
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (DParen
                                  child: 
                                    (ArithBinary
                                      op_id: Arith_Less
                                      left: (ArithVarRef name:attempt)
                                      right: (ArithWord w:{(Lit_Digits 5)})
                                    )
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (C {(echo)} {(-e)} 
                              {
                                (DQ (${ VSub_Name color_yellow) ('Cluster not working yet.') 
                                  (${ VSub_Name color_norm)
                                )
                              }
                            )
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:attempt)
                                  op: Equal
                                  rhs: 
                                    {
                                      (ArithSubPart
                                        anode: 
                                          (ArithBinary
                                            op_id: Arith_Plus
                                            left: (ArithVarRef name:attempt)
                                            right: (ArithWord w:{(Lit_Digits 1)})
                                          )
                                        spids: [1416 1421]
                                      )
                                    }
                                  spids: [1415]
                                )
                              ]
                              spids: [1415]
                            )
                            (C {(sleep)} {(30)})
                          ]
                          spids: [16777215 1397]
                        )
                      ]
                      else_action: [
                        (C {(echo)} {(-e)} 
                          {
                            (DQ (' ') (${ VSub_Name color_yellow) ('Validate output:') 
                              (${ VSub_Name color_norm)
                            )
                          }
                        )
                        (C {(kubectl_retry)} {(get)} {(cs)})
                        (C {(echo)} {(-e)} 
                          {
                            (DQ (${ VSub_Name color_red) 
                              (
'Validation returned one or more failed components. Cluster is probably broken.'
                              ) (${ VSub_Name color_norm)
                            )
                          }
                        )
                        (C {(exit)} {(1)})
                      ]
                      spids: [1429 1475]
                    )
                  ]
                  spids: [16777215 1382]
                )
              ]
              else_action: [(ControlFlow token:<ControlFlow_Break break>)]
              spids: [1478 1484]
            )
          ]
          spids: [1259 1486]
        )
    )
    (C {(echo)} {(DQ ('Validate output:'))})
    (AndOr children:[(C {(kubectl_retry)} {(get)} {(cs)}) (C {(true)})] op_id:Op_DPipe)
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (C {(Lit_Other '[')} {(DQ (${ VSub_Name return_value))} 
                  {(Lit_Other '=') (Lit_Other '=')} {(DQ (0))} {(Lit_Other ']')}
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (C {(echo)} {(-e)} 
              {
                (DQ (${ VSub_Name color_green) ('Cluster validation succeeded') 
                  (${ VSub_Name color_norm)
                )
              }
            )
          ]
          spids: [16777215 1525]
        )
      ]
      else_action: [
        (C {(echo)} {(-e)} 
          {
            (DQ (${ VSub_Name color_yellow) 
              (
'Cluster validation encountered some problems, but cluster should be in working order'
              ) (${ VSub_Name color_norm)
            )
          }
        )
      ]
      spids: [1542 1559]
    )
    (C {(exit)} {(DQ (${ VSub_Name return_value))})
  ]
)