(List (Com {[LIT_CHARS set]} {[LIT_CHARS -o]} {[LIT_CHARS errexit]} ) (Com {[LIT_CHARS set]} {[LIT_CHARS -o]} {[LIT_CHARS nounset]} ) (Com {[LIT_CHARS set]} {[LIT_CHARS -o]} {[LIT_CHARS pipefail]} ) (FunctionDef set-broken-motd [] (Com {[LIT_CHARS cat]} < (FilenameRedirectNode filename={[LIT_CHARS /etc/motd]} "> 1), (HereDocRedirectNode here_end='EOF' do_expansion=True body_word={[DQ [LIT_CHARS "Broken (or in progress) Kubernetes node setup! Check the cluster initialization status\n"][LIT_CHARS "using the following commands.\n"][LIT_CHARS "\n"][LIT_CHARS "Master instance:\n"][LIT_CHARS " - sudo systemctl status kube-master-installation\n"][LIT_CHARS " - sudo systemctl status kube-master-configuration\n"][LIT_CHARS "\n"][LIT_CHARS "Node instance:\n"][LIT_CHARS " - sudo systemctl status kube-node-installation\n"][LIT_CHARS " - sudo systemctl status kube-node-configuration\n"]]} 0), > ) ) (FunctionDef download-kube-env [] (List (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('tmp_kube_env', {[DQ [LIT_CHARS /tmp/kube-env.yaml]]})]) (Com {[LIT_CHARS curl]} {[LIT_CHARS --fail]} {[LIT_CHARS --retry]} {[LIT_CHARS 5]} {[LIT_CHARS --retry-delay]} {[LIT_CHARS 3]} {[LIT_CHARS --silent]} {[LIT_CHARS --show-error]} {[LIT_CHARS -H]} {[DQ [LIT_CHARS "X-Google-Metadata-Request: True"]]} {[LIT_CHARS -o]} {[DQ [VarSub tmp_kube_env]]} {[LIT_CHARS http] [LIT_OTHER ":"] [LIT_CHARS //metadata.google.internal/computeMetadata/v1/instance/attributes/kube-env]} ) (Com {[LIT_CHARS eval]} {[ComSub (Com redirects=[(FilenameRedirectNode filename={[DQ [VarSub tmp_kube_env]]} 0) (FilenameRedirectNode filename={[DQ [VarSub KUBE_HOME][LIT_CHARS /kube-env]]} "> 1)]{[LIT_CHARS python]} {[LIT_CHARS -c]} {[SQ ] [SQ ] [SQ ]})]} ) (Com {[LIT_CHARS rm]} {[LIT_CHARS -f]} {[DQ [VarSub tmp_kube_env]]} ) ) ) (FunctionDef validate-hash [] (List (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('file', {[DQ [VarSub 1]]})]) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('expected', {[DQ [VarSub 2]]})]) (AndOr OP_OR_IF (= scope= flags=0 words=[] bindings=[('actual', {[ComSub (Pipeline (Com {[LIT_CHARS sha1sum]} {[VarSub file]}) (Com {[LIT_CHARS awk]} {[SQ ]}) )]})]) (Com {[LIT_CHARS true]} ) ) (If (DBracket {B2 BINARY_STRING_NOT_EQUAL {[DQ [VarSub actual]]} {[DQ [VarSub expected]]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "== "][VarSub file][LIT_CHARS " corrupted, sha1 "][VarSub actual][LIT_CHARS " doesn't match expected "][VarSub expected][LIT_CHARS " =="]]} ) (Com {[LIT_CHARS return]} {[LIT_CHARS 1]} ) ) ) ) ) (FunctionDef download-or-bust [] (List (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('hash', {[DQ [VarSub 1]]})]) (Com {[LIT_CHARS shift]} {[LIT_CHARS 1]} ) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('urls', {[Array {[VarSub *]}]})]) (While (Com {[LIT_CHARS true]} ) (For url [{[DQ [VarSub urls bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}})]]}]) (List (= scope= flags=0 words=[] bindings=[('file', {[DQ [VarSub url transform_ops=[VS_UNARY_DPOUND {[LIT_CHARS "*"] [LIT_SLASH /]}]]]})]) (Com {[LIT_CHARS rm]} {[LIT_CHARS -f]} {[DQ [VarSub file]]} ) (If (Pipeline! (Com {[LIT_CHARS curl]} {[LIT_CHARS -f]} {[LIT_CHARS --ipv4]} {[LIT_CHARS -Lo]} {[DQ [VarSub file]]} {[LIT_CHARS --connect-timeout]} {[LIT_CHARS 20]} {[LIT_CHARS --max-time]} {[LIT_CHARS 300]} {[LIT_CHARS --retry]} {[LIT_CHARS 6]} {[LIT_CHARS --retry-delay]} {[LIT_CHARS 10]} {[DQ [VarSub url]]} ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "== Failed to download "][VarSub url][LIT_CHARS ". Retrying. =="]]} ) (AndOr OP_AND_IF (DBracket {B1 UNARY_STRING_n {[DQ [VarSub hash]]}}) (Pipeline! (Com {[LIT_CHARS validate-hash]} {[DQ [VarSub file]]} {[DQ [VarSub hash]]} ) ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "== Hash validation of "][VarSub url][LIT_CHARS " failed. Retrying. =="]]} ) (ElseTrue) (List (If (DBracket {B1 UNARY_STRING_n {[DQ [VarSub hash]]}}) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "== Downloaded "][VarSub url][LIT_CHARS " (SHA1 = "][VarSub hash][LIT_CHARS ") =="]]} ) (ElseTrue) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "== Downloaded "][VarSub url][LIT_CHARS " =="]]} ) ) (Com {[LIT_CHARS return]} ) ) ) ) ) ) ) ) (FunctionDef split-commas [] (Pipeline (Com {[LIT_CHARS echo]} {[VarSub 1]} ) (Com {[LIT_CHARS tr]} {[DQ [LIT_CHARS ","]]} {[DQ [\ LIT_ESCAPED_CHAR "\\n"]]} ) ) ) (FunctionDef install-rkt [] (List (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('rkt_binary', {[DQ [LIT_CHARS rkt-v1.18.0]]})]) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('rkt_sha1', {[DQ [LIT_CHARS 75fc8f29c79bc9e505f3e7f6e8fadf2425c21967]]})]) (Com {[LIT_CHARS download-or-bust]} {[DQ [VarSub rkt_sha1]]} {[DQ [LIT_CHARS "https://storage.googleapis.com/kubernetes-release/rkt/"][VarSub rkt_binary]]} ) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('rkt_dst', {[DQ [VarSub KUBE_HOME][LIT_CHARS /bin/rkt]]})]) (Com {[LIT_CHARS mv]} {[DQ [VarSub KUBE_HOME][LIT_CHARS /][VarSub rkt_binary]]} {[DQ [VarSub rkt_dst]]} ) (Com {[LIT_CHARS chmod]} {[LIT_CHARS a] [LIT_OTHER "+"] [LIT_CHARS x]} {[DQ [VarSub rkt_dst]]} ) ) ) (FunctionDef install-kube-binary-config [] (List (Com {[LIT_CHARS cd]} {[DQ [VarSub KUBE_HOME]]} ) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('server_binary_tar_urls', {[Array {[ComSub (Com {[LIT_CHARS split-commas]} {[DQ [VarSub SERVER_BINARY_TAR_URL]]})]}]})]) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('server_binary_tar', {[DQ [VarSub server_binary_tar_urls bracket_op=(Index {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 0]}}) transform_ops=[VS_UNARY_DPOUND {[LIT_CHARS "*"] [LIT_SLASH /]}]]]})]) (If (DBracket {B1 UNARY_STRING_n {[DQ [VarSub SERVER_BINARY_TAR_HASH test_op=VS_TEST_COLON_HYPHEN {}]]}}) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('server_binary_tar_hash', {[DQ [VarSub SERVER_BINARY_TAR_HASH]]})]) (ElseTrue) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Downloading binary release sha1 (not found in env)"]]} ) (Com {[LIT_CHARS download-or-bust]} {[DQ ]} {[DQ [VarSub server_binary_tar_urls bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}}) transform_ops=[PatSub {[LIT_CHARS .tar.gz]} {[LIT_CHARS .tar.gz.sha1]}]]]} ) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('server_binary_tar_hash', {[ComSub (Com {[LIT_CHARS cat]} {[DQ [VarSub server_binary_tar][LIT_CHARS .sha1]]})]})]) ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Downloading binary release tar"]]} ) (Com {[LIT_CHARS download-or-bust]} {[DQ [VarSub server_binary_tar_hash]]} {[DQ [VarSub server_binary_tar_urls bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}})]]} ) (Com {[LIT_CHARS tar]} {[LIT_CHARS xzf]} {[DQ [VarSub KUBE_HOME][LIT_CHARS /][VarSub server_binary_tar]]} {[LIT_CHARS -C]} {[DQ [VarSub KUBE_HOME]]} {[LIT_CHARS --overwrite]} ) (= scope= flags=0 words=[] bindings=[('src_dir', {[DQ [VarSub KUBE_HOME][LIT_CHARS /kubernetes/server/bin]]})]) (= scope= flags=0 words=[] bindings=[('dst_dir', {[DQ [VarSub KUBE_HOME][LIT_CHARS /kube-docker-files]]})]) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[DQ [VarSub dst_dir]]} ) (Com {[LIT_CHARS cp]} {[DQ [VarSub src_dir][LIT_CHARS /]] [LIT_OTHER "*"] [LIT_CHARS .docker_tag]} {[DQ [VarSub dst_dir]]} ) (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub KUBERNETES_MASTER test_op=VS_TEST_COLON_HYPHEN {}]]} {[DQ [LIT_CHARS false]]}}) (Com {[LIT_CHARS cp]} {[DQ [VarSub src_dir][LIT_CHARS /kube-proxy.tar]]} {[DQ [VarSub dst_dir]]} ) (ElseTrue) (List (Com {[LIT_CHARS cp]} {[DQ [VarSub src_dir][LIT_CHARS /kube-apiserver.tar]]} {[DQ [VarSub dst_dir]]} ) (Com {[LIT_CHARS cp]} {[DQ [VarSub src_dir][LIT_CHARS /kube-controller-manager.tar]]} {[DQ [VarSub dst_dir]]} ) (Com {[LIT_CHARS cp]} {[DQ [VarSub src_dir][LIT_CHARS /kube-scheduler.tar]]} {[DQ [VarSub dst_dir]]} ) (Com {[LIT_CHARS cp]} {[LIT_CHARS -r]} {[DQ [VarSub KUBE_HOME][LIT_CHARS /kubernetes/addons]]} {[DQ [VarSub dst_dir]]} ) ) ) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('kube_bin', {[DQ [VarSub KUBE_HOME][LIT_CHARS /bin]]})]) (Com {[LIT_CHARS mv]} {[DQ [VarSub src_dir][LIT_CHARS /kubelet]]} {[DQ [VarSub kube_bin]]} ) (Com {[LIT_CHARS mv]} {[DQ [VarSub src_dir][LIT_CHARS /kubectl]]} {[DQ [VarSub kube_bin]]} ) (If (AndOr OP_OR_IF (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub NETWORK_PROVIDER test_op=VS_TEST_COLON_HYPHEN {}]]} {[DQ [LIT_CHARS kubenet]]}}) (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub NETWORK_PROVIDER test_op=VS_TEST_COLON_HYPHEN {}]]} {[DQ [LIT_CHARS cni]]}}) ) (List (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('cni_tar', {[DQ [LIT_CHARS cni-07a8a28637e97b22eb8dfe710eeae1344f69d16e.tar.gz]]})]) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('cni_sha1', {[DQ [LIT_CHARS 19d49f7b2b99cd2493d5ae0ace896c64e289ccbb]]})]) (Com {[LIT_CHARS download-or-bust]} {[DQ [VarSub cni_sha1]]} {[DQ [LIT_CHARS "https://storage.googleapis.com/kubernetes-release/network-plugins/"][VarSub cni_tar]]} ) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('cni_dir', {[DQ [VarSub KUBE_HOME][LIT_CHARS /cni]]})]) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[DQ [VarSub cni_dir]]} ) (Com {[LIT_CHARS tar]} {[LIT_CHARS xzf]} {[DQ [VarSub KUBE_HOME][LIT_CHARS /][VarSub cni_tar]]} {[LIT_CHARS -C]} {[DQ [VarSub cni_dir]]} {[LIT_CHARS --overwrite]} ) (Com {[LIT_CHARS mv]} {[DQ [VarSub cni_dir][LIT_CHARS /bin]] [LIT_CHARS /] [LIT_OTHER "*"]} {[DQ [VarSub kube_bin]]} ) (Com {[LIT_CHARS rmdir]} {[DQ [VarSub cni_dir][LIT_CHARS /bin]]} ) (Com {[LIT_CHARS rm]} {[LIT_CHARS -f]} {[DQ [VarSub KUBE_HOME][LIT_CHARS /][VarSub cni_tar]]} ) ) ) (Com {[LIT_CHARS mv]} {[DQ [VarSub KUBE_HOME][LIT_CHARS /kubernetes/LICENSES]]} {[DQ [VarSub KUBE_HOME]]} ) (Com {[LIT_CHARS mv]} {[DQ [VarSub KUBE_HOME][LIT_CHARS /kubernetes/kubernetes-src.tar.gz]]} {[DQ [VarSub KUBE_HOME]]} ) (= scope= flags=0 words=[] bindings=[('dst_dir', {[DQ [VarSub KUBE_HOME][LIT_CHARS /kube-manifests]]})]) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[DQ [VarSub dst_dir]]} ) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('manifests_tar_urls', {[Array {[ComSub (Com {[LIT_CHARS split-commas]} {[DQ [VarSub KUBE_MANIFESTS_TAR_URL]]})]}]})]) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('manifests_tar', {[DQ [VarSub manifests_tar_urls bracket_op=(Index {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 0]}}) transform_ops=[VS_UNARY_DPOUND {[LIT_CHARS "*"] [LIT_SLASH /]}]]]})]) (If (Com {[LIT_DBRACKET_LIKE "["]} {[LIT_CHARS -n]} {[DQ [VarSub KUBE_MANIFESTS_TAR_HASH test_op=VS_TEST_COLON_HYPHEN {}]]} {[LIT_DBRACKET_LIKE "]"]} ) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('manifests_tar_hash', {[DQ [VarSub KUBE_MANIFESTS_TAR_HASH]]})]) (ElseTrue) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Downloading k8s manifests sha1 (not found in env)"]]} ) (Com {[LIT_CHARS download-or-bust]} {[DQ ]} {[DQ [VarSub manifests_tar_urls bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}}) transform_ops=[PatSub {[LIT_CHARS .tar.gz]} {[LIT_CHARS .tar.gz.sha1]}]]]} ) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('manifests_tar_hash', {[ComSub (Com {[LIT_CHARS cat]} {[DQ [VarSub manifests_tar][LIT_CHARS .sha1]]})]})]) ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Downloading k8s manifests tar"]]} ) (Com {[LIT_CHARS download-or-bust]} {[DQ [VarSub manifests_tar_hash]]} {[DQ [VarSub manifests_tar_urls bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}})]]} ) (Com {[LIT_CHARS tar]} {[LIT_CHARS xzf]} {[DQ [VarSub KUBE_HOME][LIT_CHARS /][VarSub manifests_tar]]} {[LIT_CHARS -C]} {[DQ [VarSub dst_dir]]} {[LIT_CHARS --overwrite]} ) (= scope= flags=0 words=[{[LIT_CHARS -r]}] bindings=[('kube_addon_registry', {[DQ [VarSub KUBE_ADDON_REGISTRY test_op=VS_TEST_COLON_HYPHEN {[LIT_CHARS gcr.io] [LIT_SLASH /] [LIT_CHARS google_containers]}]]})]) (If (DBracket {B2 BINARY_STRING_NOT_EQUAL {[DQ [VarSub kube_addon_registry]]} {[DQ [LIT_CHARS gcr.io/google_containers]]}}) (List (Pipeline (Com {[LIT_CHARS find]} {[DQ [VarSub dst_dir]]} {[LIT_CHARS -name]} {[\ LIT_ESCAPED_CHAR "\\*"] [LIT_CHARS .yaml]} {[LIT_CHARS -or]} {[LIT_CHARS -name]} {[\ LIT_ESCAPED_CHAR "\\*"] [LIT_CHARS .yaml.in]} ) (Com {[LIT_CHARS xargs]} {[LIT_CHARS sed]} {[LIT_CHARS -ri]} {[DQ [LIT_CHARS "s@(image:"][\ LIT_ESCAPED_CHAR "\\s"][LIT_CHARS ".*)gcr.io/google_containers@"][\ LIT_ESCAPED_CHAR "\\1"][VarSub kube_addon_registry][LIT_CHARS "@"]]} ) ) (Pipeline (Com {[LIT_CHARS find]} {[DQ [VarSub dst_dir]]} {[LIT_CHARS -name]} {[\ LIT_ESCAPED_CHAR "\\*"] [LIT_CHARS .manifest]} {[LIT_CHARS -or]} {[LIT_CHARS -name]} {[\ LIT_ESCAPED_CHAR "\\*"] [LIT_CHARS .json]} ) (Com {[LIT_CHARS xargs]} {[LIT_CHARS sed]} {[LIT_CHARS -ri]} {[DQ [LIT_CHARS "s@(image"][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ":"][\ LIT_ESCAPED_CHAR "\\s"][LIT_CHARS "+"][\ LIT_ESCAPED_CHAR "\\\""][LIT_CHARS ")gcr.io/google_containers@"][\ LIT_ESCAPED_CHAR "\\1"][VarSub kube_addon_registry][LIT_CHARS "@"]]} ) ) ) ) (Com {[LIT_CHARS cp]} {[DQ [VarSub dst_dir][LIT_CHARS /kubernetes/gci-trusty/gci-configure-helper.sh]]} {[DQ [VarSub KUBE_HOME][LIT_CHARS /bin/configure-helper.sh]]} ) (Com {[LIT_CHARS cp]} {[DQ [VarSub dst_dir][LIT_CHARS /kubernetes/gci-trusty/gci-mounter]]} {[DQ [VarSub KUBE_HOME][LIT_CHARS /bin/mounter]]} ) (Com {[LIT_CHARS cp]} {[DQ [VarSub dst_dir][LIT_CHARS /kubernetes/gci-trusty/health-monitor.sh]]} {[DQ [VarSub KUBE_HOME][LIT_CHARS /bin/health-monitor.sh]]} ) (Com {[LIT_CHARS chmod]} {[LIT_CHARS -R]} {[LIT_CHARS 755]} {[DQ [VarSub kube_bin]]} ) (Com {[LIT_CHARS install-rkt]} ) (Com {[LIT_CHARS rm]} {[LIT_CHARS -rf]} {[DQ [VarSub KUBE_HOME][LIT_CHARS /kubernetes]]} ) (Com {[LIT_CHARS rm]} {[LIT_CHARS -f]} {[DQ [VarSub KUBE_HOME][LIT_CHARS /][VarSub server_binary_tar]]} ) (Com {[LIT_CHARS rm]} {[LIT_CHARS -f]} {[DQ [VarSub KUBE_HOME][LIT_CHARS /][VarSub server_binary_tar][LIT_CHARS .sha1]]} ) (Com {[LIT_CHARS rm]} {[LIT_CHARS -f]} {[DQ [VarSub KUBE_HOME][LIT_CHARS /][VarSub manifests_tar]]} ) (Com {[LIT_CHARS rm]} {[LIT_CHARS -f]} {[DQ [VarSub KUBE_HOME][LIT_CHARS /][VarSub manifests_tar][LIT_CHARS .sha1]]} ) ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Start to install kubernetes files"]]} ) (Com {[LIT_CHARS set-broken-motd]} ) (= scope= flags=0 words=[] bindings=[('KUBE_HOME', {[DQ [LIT_CHARS /home/kubernetes]]})]) (Com {[LIT_CHARS download-kube-env]} ) (Com {[LIT_CHARS source]} {[DQ [VarSub KUBE_HOME][LIT_CHARS /kube-env]]} ) (Com {[LIT_CHARS install-kube-binary-config]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Done for installing kubernetes files"]]} ) )