(command.CommandList
  children: [
    (C {<set>} {<-o>} {<errexit>})
    (C {<set>} {<-o>} {<nounset>})
    (C {<set>} {<-o>} {<pipefail>})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:KUBE_ROOT)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: (C {<dirname>} {(DQ (${ Id.VSub_Name BASH_SOURCE))})
              ) <'/../..'>
            }
          spids: [91]
        )
      ]
    )
    (C {<source>} {(DQ (${ Id.VSub_Name KUBE_ROOT) <'/cluster/kube-util.sh'>)})
    (C {<source>} {(DQ (${ Id.VSub_Name KUBE_ROOT) <'/cluster/lib/logging.sh'>)})
    (C {<readonly>} 
      {<Id.Lit_VarLike 'KUBE_ANYWHERE_FEDERATION_IMAGE='> 
        (DQ <'gcr.io/madhusudancs-containers/kubernetes-anywhere-federation'>)
      }
    )
    (C {<readonly>} {<Id.Lit_VarLike 'KUBE_ANYWHERE_FEDERATION_VERSION='> (DQ <v0.9.0>)})
    (C {<readonly>} 
      {<Id.Lit_VarLike 'KUBE_ANYWHERE_FEDERATION_CHARTS_IMAGE='> 
        (DQ <'gcr.io/madhusudancs-containers/federation-charts'>)
      }
    )
    (C {<readonly>} {<Id.Lit_VarLike 'KUBE_ANYWHERE_FEDERATION_CHARTS_VERSION='> (DQ <v0.9.1>)})
    (C {<readonly>} 
      {<Id.Lit_VarLike 'GOOGLE_APPLICATION_CREDENTIALS='> 
        (DQ 
          (braced_var_sub
            token: <Id.VSub_Name GOOGLE_APPLICATION_CREDENTIALS>
            suffix_op: 
              (suffix_op.Unary
                tok: <Id.VTest_ColonHyphen ':-'>
                arg_word: 
                  {(${ Id.VSub_Name HOME) <Id.Lit_Slash '/'> <.config> <Id.Lit_Slash '/'> <gcloud> 
                    <Id.Lit_Slash '/'> <application_default_credentials.json>
                  }
              )
          )
        )
      }
    )
    (C {<readonly>} 
      {<Id.Lit_VarLike 'KUBE_CONFIG_DIR='> 
        (DQ 
          (braced_var_sub
            token: <Id.VSub_Name KUBE_CONFIG_DIR>
            suffix_op: 
              (suffix_op.Unary
                tok: <Id.VTest_ColonHyphen ':-'>
                arg_word: {(${ Id.VSub_Name HOME) <Id.Lit_Slash '/'> <.kube>}
              )
          )
        )
      }
    )
    (C {<readonly>} 
      {<Id.Lit_VarLike 'KUBE_CONFIG='> 
        (DQ 
          (braced_var_sub
            token: <Id.VSub_Name KUBE_CONFIG>
            suffix_op: 
              (suffix_op.Unary
                tok: <Id.VTest_ColonHyphen ':-'>
                arg_word: 
                  {(${ Id.VSub_Name HOME) <Id.Lit_Slash '/'> <.kube> <Id.Lit_Slash '/'> <config>}
              )
          )
        )
      }
    )
    (command.ShFunction
      name: pull_installer
      body: 
        (BraceGroup
          children: [
            (C 
              {<kube> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <log> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> 
                <status>
              } {(DQ <'Pulling installer images'>)}
            )
            (C {<docker>} {<pull>} 
              {
                (DQ (${ Id.VSub_Name KUBE_ANYWHERE_FEDERATION_IMAGE) <':'> 
                  (${ Id.VSub_Name KUBE_ANYWHERE_FEDERATION_VERSION)
                )
              }
            )
            (C {<docker>} {<pull>} 
              {
                (DQ (${ Id.VSub_Name KUBE_ANYWHERE_FEDERATION_CHARTS_IMAGE) <':'> 
                  (${ Id.VSub_Name KUBE_ANYWHERE_FEDERATION_CHARTS_VERSION)
                )
              }
            )
          ]
        )
    )
    (command.ShFunction
      name: ensure_files
      body: 
        (BraceGroup
          children: [
            (C 
              {<kube> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <log> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> 
                <status>
              } {(DQ <'Ensure provider is supported'>)}
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.DBracket
                              expr: 
                                (bool_expr.LogicalAnd
                                  left: 
                                    (bool_expr.Binary
                                      op_id: Id.BoolBinary_GlobNEqual
                                      left: 
                                        {
                                          (DQ 
                                            (braced_var_sub
                                              token: <Id.VSub_Name KUBERNETES_PROVIDER>
                                              suffix_op: 
                                                (suffix_op.Unary
                                                  tok: <Id.VTest_ColonHyphen ':-'>
                                                  arg_word: (word.Empty)
                                                )
                                            )
                                          )
                                        }
                                      right: {(DQ <gce>)}
                                    )
                                  right: 
                                    (bool_expr.Binary
                                      op_id: Id.BoolBinary_GlobNEqual
                                      left: 
                                        {
                                          (DQ 
                                            (braced_var_sub
                                              token: <Id.VSub_Name KUBERNETES_PROVIDER>
                                              suffix_op: 
                                                (suffix_op.Unary
                                                  tok: <Id.VTest_ColonHyphen ':-'>
                                                  arg_word: (word.Empty)
                                                )
                                            )
                                          )
                                        }
                                      right: {(DQ <gke>)}
                                    )
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<echo>} 
                      {
                        (DQ <'Supported providers: '> 
                          (word_part.EscapedLiteral
                            token: <Id.Lit_EscapedChar '\\"'>
                          ) <gce> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <', '> 
                          (word_part.EscapedLiteral
                            token: <Id.Lit_EscapedChar '\\"'>
                          ) <gke> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>)
                        )
                      }
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [286 321]
                )
              ]
            )
            (C 
              {<kube> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <log> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> 
                <status>
              } {(DQ <'Ensure credential files exist'>)}
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.DBracket
                              expr: 
                                (bool_expr.LogicalNot
                                  child: 
                                    (bool_expr.Unary
                                      op_id: Id.BoolUnary_f
                                      child: {(DQ (${ Id.VSub_Name GOOGLE_APPLICATION_CREDENTIALS))}
                                    )
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<echo>} 
                      {
                        (DQ <'Please ensure Google credentials file '> 
                          (word_part.EscapedLiteral
                            token: <Id.Lit_EscapedChar '\\"'>
                          )
                        ) (${ Id.VSub_Name GOOGLE_APPLICATION_CREDENTIALS) 
                        (DQ (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <' exists.'>)
                      }
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [360 377]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Sentence
                          child: 
                            (command.DBracket
                              expr: 
                                (bool_expr.LogicalNot
                                  child: 
                                    (bool_expr.Unary
                                      op_id: Id.BoolUnary_f
                                      child: {(DQ (${ Id.VSub_Name KUBE_CONFIG))}
                                    )
                                )
                            )
                          terminator: <Id.Op_Semi _>
                        )
                      ]
                    )
                  action: [
                    (C {<echo>} 
                      {
                        (DQ <'Please ensure kubeconfig file '> 
                          (word_part.EscapedLiteral
                            token: <Id.Lit_EscapedChar '\\"'>
                          )
                        ) (${ Id.VSub_Name KUBE_CONFIG) 
                        (DQ (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'>) <' exists.'>)
                      }
                    )
                    (command.ControlFlow
                      token: <Id.ControlFlow_Exit exit>
                      arg_word: {<1>}
                    )
                  ]
                  spids: [404 421]
                )
              ]
            )
          ]
        )
    )
    (command.ShFunction
      name: kube_action
      body: 
        (BraceGroup
          children: [
            (C {<Id.Lit_Colon ':'>} 
              {
                (DQ 
                  (braced_var_sub
                    token: <Id.VSub_Name FEDERATION_OUTPUT_ROOT>
                    suffix_op: 
                      (suffix_op.Unary
                        tok: <Id.VTest_ColonQMark ':?'>
                        arg_word: {<'must be set'>}
                      )
                  )
                )
              }
            )
            (C {<local>} {<-r>} 
              {<Id.Lit_VarLike 'action='> 
                (DQ 
                  (braced_var_sub
                    token: <Id.VSub_Number 1>
                    suffix_op: (suffix_op.Unary tok:<Id.VTest_ColonHyphen ':-'> arg_word:(word.Empty))
                  )
                )
              }
            )
            (C 
              {<kube> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <log> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> 
                <status>
              } {(DQ <'Action: '> (${ Id.VSub_Name action) <' clusters'>)}
            )
            (C {<docker>} {<run>} 
              {<--user> <Id.Lit_Equals '='> 
                (DQ (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<id>} {<-u>})) <':'> 
                  (command_sub
                    left_token: <Id.Left_DollarParen '$('>
                    child: (C {<id>} {<-g>})
                  )
                )
              } {<-m>} {<12G>} {<-v>} 
              {
                (DQ (${ Id.VSub_Name GOOGLE_APPLICATION_CREDENTIALS) 
                  <':/.config/gcloud/application_default_credentials.json:ro'>
                )
              } {<-v>} {(DQ (${ Id.VSub_Name KUBE_CONFIG_DIR) <':/.kube'>)} {<-v>} 
              {(DQ (${ Id.VSub_Name FEDERATION_OUTPUT_ROOT) <':/_output'>)} 
              {
                (DQ (${ Id.VSub_Name KUBE_ANYWHERE_FEDERATION_IMAGE) <':'> 
                  (${ Id.VSub_Name KUBE_ANYWHERE_FEDERATION_VERSION)
                )
              } {(DQ (${ Id.VSub_Name action))}
            )
          ]
        )
    )
    (command.ShFunction
      name: federation_action
      body: 
        (BraceGroup
          children: [
            (C {<Id.Lit_Colon ':'>} 
              {
                (DQ 
                  (braced_var_sub
                    token: <Id.VSub_Name FEDERATION_OUTPUT_ROOT>
                    suffix_op: 
                      (suffix_op.Unary
                        tok: <Id.VTest_ColonQMark ':?'>
                        arg_word: {<'must be set'>}
                      )
                  )
                )
              }
            )
            (C {<local>} {<-r>} 
              {<Id.Lit_VarLike 'action='> 
                (DQ 
                  (braced_var_sub
                    token: <Id.VSub_Number 1>
                    suffix_op: (suffix_op.Unary tok:<Id.VTest_ColonHyphen ':-'> arg_word:(word.Empty))
                  )
                )
              }
            )
            (C 
              {<kube> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <log> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> 
                <status>
              } {(DQ <'Action: '> (${ Id.VSub_Name action) <' federation components'>)}
            )
            (C {<docker>} {<run>} {<-m>} {<12G>} {<-v>} 
              {
                (DQ (${ Id.VSub_Name GOOGLE_APPLICATION_CREDENTIALS) 
                  <':/root/.config/gcloud/application_default_credentials.json:ro'>
                )
              } {<-v>} {(DQ (${ Id.VSub_Name KUBE_CONFIG) <':/root/.kube/config'>)} {<-v>} 
              {(DQ (${ Id.VSub_Name FEDERATION_OUTPUT_ROOT) <':/_output'>)} 
              {
                (DQ (${ Id.VSub_Name KUBE_ANYWHERE_FEDERATION_CHARTS_IMAGE) <':'> 
                  (${ Id.VSub_Name KUBE_ANYWHERE_FEDERATION_CHARTS_VERSION)
                )
              } {(DQ (${ Id.VSub_Name action))}
            )
          ]
        )
    )
    (command.ShFunction
      name: redeploy_federation
      body: 
        (BraceGroup
          children: [
            (C {<Id.Lit_Colon ':'>} 
              {
                (DQ 
                  (braced_var_sub
                    token: <Id.VSub_Name FEDERATION_OUTPUT_ROOT>
                    suffix_op: 
                      (suffix_op.Unary
                        tok: <Id.VTest_ColonQMark ':?'>
                        arg_word: {<'must be set'>}
                      )
                  )
                )
              }
            )
            (C {<local>} {<-r>} 
              {<Id.Lit_VarLike 'action='> 
                (DQ 
                  (braced_var_sub
                    token: <Id.VSub_Number 1>
                    suffix_op: (suffix_op.Unary tok:<Id.VTest_ColonHyphen ':-'> arg_word:(word.Empty))
                  )
                )
              }
            )
            (C 
              {<kube> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> <log> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> 
                <status>
              } {(DQ (${ Id.VSub_Name action) <' federation components'>)}
            )
            (C {<docker>} {<run>} {<-m>} {<12G>} {<-v>} 
              {(DQ (${ Id.VSub_Name KUBE_CONFIG) <':/root/.kube/config:ro'>)} {<-v>} {(DQ (${ Id.VSub_Name FEDERATION_OUTPUT_ROOT) <':/_output'>)} 
              {
                (DQ (${ Id.VSub_Name KUBE_ANYWHERE_FEDERATION_CHARTS_IMAGE) <':'> 
                  (${ Id.VSub_Name KUBE_ANYWHERE_FEDERATION_CHARTS_VERSION)
                )
              } {(DQ (${ Id.VSub_Name action))}
            )
          ]
        )
    )
    (C {<readonly>} 
      {<Id.Lit_VarLike 'ACTION='> 
        (DQ 
          (braced_var_sub
            token: <Id.VSub_Number 1>
            suffix_op: (suffix_op.Unary tok:<Id.VTest_ColonHyphen ':-'> arg_word:(word.Empty))
          )
        )
      }
    )
    (command.Case
      to_match: {(DQ (${ Id.VSub_Name ACTION))}
      arms: [
        (case_arm
          pat_list: [{(DQ )}]
          action: [
            (C {<echo>} 
              {
                (SQ <'Action must be one of [init, deploy_clusters, deploy_federation, \\\n'> 
                  <'    destroy_federation, destroy_clusters, redeploy_federation], \\\n'> <'    got: '>
                ) (DQ (${ Id.VSub_Name ACTION))
              }
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>})
          ]
          spids: [839 841 863 -1]
        )
        (case_arm
          pat_list: [{(DQ <init>)}]
          action: [(C {<pull_installer>})]
          spids: [866 869 875 -1]
        )
        (case_arm
          pat_list: [{(DQ <deploy_clusters>)}]
          action: [(C {<ensure_files>}) (C {<kube_action>} {<deploy>})]
          spids: [878 881 892 -1]
        )
        (case_arm
          pat_list: [{(DQ <deploy_federation>)}]
          action: [(C {<ensure_files>}) (C {<federation_action>} {<deploy>})]
          spids: [895 898 909 -1]
        )
        (case_arm
          pat_list: [{(DQ <destroy_federation>)}]
          action: [(C {<federation_action>} {<destroy>})]
          spids: [912 915 923 -1]
        )
        (case_arm
          pat_list: [{(DQ <destroy_clusters>)}]
          action: [(C {<kube_action>} {<destroy>})]
          spids: [926 929 937 -1]
        )
        (case_arm
          pat_list: [{(DQ <redeploy_federation>)}]
          action: [(C {<redeploy_federation>})]
          spids: [940 943 949 -1]
        )
      ]
    )
  ]
)