(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: [81 89]
              ) (/../..)
            }
          spids: [80]
        )
      ]
      spids: [80]
    )
    (C {(source)} {(DQ (${ VSub_Name KUBE_ROOT) (/federation/cluster/common.sh))})
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:DNS_ZONE_NAME)
          op: Equal
          rhs: 
            {
              (DQ 
                (BracedVarSub
                  token: <VSub_Name FEDERATION_DNS_ZONE_NAME>
                  suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )})
                  spids: [110 113]
                )
              )
            }
          spids: [108]
        )
      ]
      spids: [108]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:DNS_PROVIDER)
          op: Equal
          rhs: 
            {
              (DQ 
                (BracedVarSub
                  token: <VSub_Name FEDERATION_DNS_PROVIDER>
                  suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(google-clouddns)})
                  spids: [118 122]
                )
              )
            }
          spids: [116]
        )
      ]
      spids: [116]
    )
    (FuncDef
      name: get_version
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:versions_file)
                  op: Equal
                  rhs: {(DQ (${ VSub_Name KUBE_ROOT) (/_output/federation/versions))}
                  spids: [166]
                )
              ]
              spids: [162]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolUnary
                              op_id: BoolUnary_n
                              child: 
                                {
                                  (DQ 
                                    (BracedVarSub
                                      token: <VSub_Name KUBERNETES_RELEASE>
                                      suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(SQ )})
                                      spids: [183 186]
                                    )
                                  )
                                }
                            )
                        )
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ 
                          (BracedVarSub
                            token: <VSub_Name KUBERNETES_RELEASE>
                            suffix_op: 
                              (PatSub
                                pat: {("+")}
                                replace: {(_)}
                                do_all: True
                                do_prefix: False
                                do_suffix: False
                              )
                            spids: [198 205]
                          )
                        )
                      }
                    )
                    (ControlFlow token:<ControlFlow_Return return>)
                  ]
                  spids: [-1 192]
                )
              ]
              spids: [-1 212]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (LogicalNot
                              child: 
                                (BoolUnary
                                  op_id: BoolUnary_f
                                  child: {(DQ (${ VSub_Name versions_file))}
                                )
                            )
                        )
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ ("Couldn't determine the release version: neither the "))} 
                      {(DQ ("KUBERNETES_RELEASE environment variable is set, nor does "))} {(DQ ("the versions file exist at ") (${ VSub_Name versions_file))}
                    )
                    (C {(exit)} {(1)})
                  ]
                  spids: [-1 233]
                )
              ]
              spids: [-1 263]
            )
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:kube_version)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (CommandSubPart
                          command_list: 
                            (CommandList
                              children: [
                                (Pipeline
                                  children: [
                                    (C {(cat)} {(DQ (${ VSub_Name versions_file))})
                                    (C {(python)} {(-c)} 
                                      {
                                        (SQ <"\\\n"> <"import json, sys;\\\n"> 
                                          <"print json.load(sys.stdin)[\"KUBE_VERSION\"]">
                                        )
                                      }
                                    )
                                  ]
                                  negated: False
                                )
                              ]
                            )
                          left_token: <Left_CommandSub "$(">
                          spids: [277 297]
                        )
                      )
                    }
                  spids: [275]
                )
              ]
              spids: [271]
            )
            (C {(echo)} 
              {
                (DQ 
                  (BracedVarSub
                    token: <VSub_Name kube_version>
                    suffix_op: 
                      (PatSub
                        pat: {("+")}
                        replace: {(_)}
                        do_all: True
                        do_prefix: False
                        do_suffix: False
                      )
                    spids: [305 312]
                  )
                )
              }
            )
          ]
          spids: [159]
        )
      spids: [153 158]
    )
    (FuncDef
      name: wait_for_rbac
      body: 
        (BraceGroup
          children: [
            (C {(${ VSub_Name KUBE_ROOT) (/cluster/kubectl.sh)} {(get)} {(role)})
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:i) op:Equal rhs:{(1)} spids:[351])]
              spids: [349]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:timeout) op:Equal rhs:{(60)} spids:[357])]
              spids: [355]
            )
            (While
              cond: [
                (Sentence
                  child: 
                    (DBracket
                      expr: 
                        (BoolBinary
                          op_id: BoolBinary_le
                          left: {(${ VSub_Name i)}
                          right: {(${ VSub_Name timeout)}
                        )
                    )
                  terminator: <Op_Semi ";">
                )
              ]
              body: 
                (DoGroup
                  children: [
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (DBracket
                                  expr: 
                                    (BoolBinary
                                      op_id: BoolBinary_EqualTilde
                                      left: 
                                        {
                                          (DQ 
                                            (CommandSubPart
                                              command_list: 
                                                (CommandList
                                                  children: [
                                                    (C 
                                                      {(${ VSub_Name KUBE_ROOT) 
                                                        (/cluster/kubectl.sh)
                                                      } {(api-versions)}
                                                    )
                                                  ]
                                                )
                                              left_token: <Left_CommandSub "$(">
                                              spids: [386 393]
                                            )
                                          )
                                        }
                                      right: {(DQ (rbac.authorization.k8s.io/))}
                                    )
                                )
                              terminator: <Op_Semi ";">
                            )
                          ]
                          action: [(ControlFlow token:<ControlFlow_Break break>)]
                          spids: [-1 405]
                        )
                      ]
                      spids: [-1 411]
                    )
                    (C {(${ VSub_Name KUBE_ROOT) (/cluster/kubectl.sh)} {(get)} {(role)})
                    (C {(sleep)} {(1)})
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:i)
                          op: Equal
                          rhs: 
                            {
                              (ArithSubPart
                                anode: 
                                  (ArithBinary
                                    op_id: Arith_Plus
                                    left: (ArithVarRef name:i)
                                    right: (ArithWord w:{(Lit_Digits 1)})
                                  )
                                spids: [430 435]
                              )
                            }
                          spids: [429]
                        )
                      ]
                      spids: [429]
                    )
                  ]
                  spids: [378 438]
                )
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_gt
                              left: {(${ VSub_Name i)}
                              right: {(${ VSub_Name timeout)}
                            )
                        )
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [
                    (C 
                      {(kube) (Lit_Other ":") (Lit_Other ":") (log) (Lit_Other ":") (Lit_Other ":") 
                        (status)
                      } 
                      {
                        (DQ ("rbac.authorization.k8s.io API group not available after at least ") 
                          (${ VSub_Name timeout) (" seconds:")
                        )
                      }
                    )
                    (C 
                      {(kube) (Lit_Other ":") (Lit_Other ":") (log) (Lit_Other ":") (Lit_Other ":") 
                        (status)
                      } 
                      {
                        (DQ 
                          (CommandSubPart
                            command_list: 
                              (CommandList
                                children: [
                                  (C {(${ VSub_Name KUBE_ROOT) (/cluster/kubectl.sh)} {(api-versions)})
                                ]
                              )
                            left_token: <Left_CommandSub "$(">
                            spids: [487 494]
                          )
                        )
                      }
                    )
                    (C {(exit)} {(123)})
                  ]
                  spids: [-1 458]
                )
              ]
              spids: [-1 503]
            )
            (C {(kube) (Lit_Other ":") (Lit_Other ":") (log) (Lit_Other ":") (Lit_Other ":") (status)} 
              {(DQ ("rbac.authorization.k8s.io API group is available"))}
            )
          ]
          spids: [324]
        )
      spids: [318 323]
    )
    (FuncDef
      name: init
      body: 
        (BraceGroup
          children: [
            (C {(kube) (Lit_Other ":") (Lit_Other ":") (log) (Lit_Other ":") (Lit_Other ":") (status)} 
              {
                (DQ ("Deploying federation control plane for ") (${ VSub_Name FEDERATION_NAME) 
                  (" in cluster ") (${ VSub_Name HOST_CLUSTER_CONTEXT)
                )
              }
            )
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:project)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name KUBE_PROJECT>
                          suffix_op: 
                            (StringUnary
                              op_id: VTest_ColonHyphen
                              arg_word: 
                                {
                                  (BracedVarSub
                                    token: <VSub_Name PROJECT>
                                    suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{})
                                    spids: [566 569]
                                  )
                                }
                            )
                          spids: [563 570]
                        )
                      )
                    }
                  spids: [561]
                )
              ]
              spids: [557]
            )
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:kube_registry)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (BracedVarSub
                          token: <VSub_Name KUBE_REGISTRY>
                          suffix_op: 
                            (StringUnary
                              op_id: VTest_ColonHyphen
                              arg_word: {(gcr.io) (Lit_Slash /) (${ VSub_Name project)}
                            )
                          spids: [580 588]
                        )
                      )
                    }
                  spids: [578]
                )
              ]
              spids: [574]
            )
            (Assignment
              keyword: Assign_Local
              flags: ["'-r'"]
              pairs: [
                (assign_pair
                  lhs: (LhsName name:kube_version)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (CommandSubPart
                          command_list: (CommandList children:[(C {(get_version)})])
                          left_token: <Left_CommandSub "$(">
                          spids: [598 600]
                        )
                      )
                    }
                  spids: [596]
                )
              ]
              spids: [592]
            )
            (C {(kube) (Lit_Other ":") (Lit_Other ":") (log) (Lit_Other ":") (Lit_Other ":") (status)} 
              {
                (DQ ("DNS_ZONE_NAME: ") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) 
                  (${ VSub_Name DNS_ZONE_NAME) (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (", DNS_PROVIDER: ") 
                  (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) (${ VSub_Name DNS_PROVIDER) (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">)
                )
              }
            )
            (C {(kube) (Lit_Other ":") (Lit_Other ":") (log) (Lit_Other ":") (Lit_Other ":") (status)} 
              {
                (DQ ("Image: ") (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">) 
                  (${ VSub_Name kube_registry) ("/hyperkube-amd64:") (${ VSub_Name kube_version) (EscapedLiteralPart token:<Lit_EscapedChar "\\\"">)
                )
              }
            )
            (C {(wait_for_rbac)})
            (C {(timeout)} {(--signal) (Lit_Other "=") (INT)} {(--kill-after) (Lit_Other "=") (1m)} 
              {(20m)} {(DQ (${ VSub_Name KUBE_ROOT) (/federation/develop/kubefed.sh))} {(init)} 
              {(DQ (${ VSub_Name FEDERATION_NAME))} {(--federation-system-namespace) (Lit_Other "=") (${ VSub_Name FEDERATION_NAMESPACE)} 
              {(--host-cluster-context) (Lit_Other "=") (DQ (${ VSub_Name HOST_CLUSTER_CONTEXT))} {(--dns-zone-name) (Lit_Other "=") (DQ (${ VSub_Name DNS_ZONE_NAME))} 
              {(--dns-provider) (Lit_Other "=") (DQ (${ VSub_Name DNS_PROVIDER))} 
              {(--image) (Lit_Other "=") 
                (DQ (${ VSub_Name kube_registry) ("/hyperkube-amd64:") (${ VSub_Name kube_version))
              } {(--apiserver-enable-basic-auth) (Lit_Other "=") (true)} 
              {(--apiserver-enable-token-auth) (Lit_Other "=") (true)} {(--apiserver-arg-overrides) (Lit_Other "=") (DQ ("--runtime-config=api/all=true,--v=4"))} 
              {(--controllermanager-arg-overrides) (Lit_Other "=") (DQ ("--v=4"))} {(--etcd-persistent-storage) (Lit_Other "=") (${ VSub_Name FEDERATION_USE_PV_FOR_ETCD)} 
              {(--v) (Lit_Other "=") (4)}
            )
          ]
          spids: [533]
        )
      spids: [527 532]
    )
    (FuncDef
      name: join_clusters
      body: 
        (BraceGroup
          children: [
            (ForEach
              iter_name: context
              iter_words: [
                {
                  (CommandSubPart
                    command_list: (CommandList children:[(C {(federation_cluster_contexts)})])
                    left_token: <Left_CommandSub "$(">
                    spids: [809 811]
                  )
                }
              ]
              do_arg_iter: False
              body: 
                (DoGroup
                  children: [
                    (C 
                      {(kube) (Lit_Other ":") (Lit_Other ":") (log) (Lit_Other ":") (Lit_Other ":") 
                        (status)
                      } 
                      {
                        (DQ ("Joining cluster with name '") (${ VSub_Name context) 
                          ("' to federation with name '") (${ VSub_Name FEDERATION_NAME) ("'")
                        )
                      }
                    )
                    (C {(DQ (${ VSub_Name KUBE_ROOT) (/federation/develop/kubefed.sh))} {(join)} 
                      {(DQ (${ VSub_Name context))} {(--federation-system-namespace) (Lit_Other "=") (${ VSub_Name FEDERATION_NAMESPACE)} 
                      {(--host-cluster-context) (Lit_Other "=") 
                        (DQ (${ VSub_Name HOST_CLUSTER_CONTEXT))
                      } {(--context) (Lit_Other "=") (DQ (${ VSub_Name FEDERATION_KUBE_CONTEXT))} {(--v) (Lit_Other "=") (4)}
                    )
                  ]
                  spids: [814 891]
                )
              spids: [808 812]
            )
          ]
          spids: [800]
        )
      spids: [794 799]
    )
    (C {(init)})
    (C {(join_clusters)})
  ]
)