(List (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! If you are using Ubuntu Trusty,\n"][LIT_CHARS "check log file /var/log/syslog. If you are using GCI image, use\n"][RIGHT_D_QUOTE "\""][LIT_CHARS "journalctl | grep kube"][RIGHT_D_QUOTE "\""][LIT_CHARS " to find more information.\n"]]} 0), > ) ) (FunctionDef download_kube_env [] (List (= scope= flags=2 words=[] 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={[LIT_CHARS /etc/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=[] bindings=[('file', {[DQ [VarSub 1]]})]) (= scope= flags=0 words=[] 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 (Com {[LIT_DBRACKET_LIKE "["]} {[DQ [VarSub actual]]} {[LIT_NEQUAL "!="]} {[DQ [VarSub expected]]} {[LIT_DBRACKET_LIKE "]"]} ) (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=[] bindings=[('file_hash', {[DQ [VarSub 1]]})]) (= scope= flags=0 words=[] bindings=[('tmpfile_urls', {[DQ [VarSub 2]]})]) (While (Com {[LIT_CHARS true]} ) (While (Com {[LIT_CHARS read]} {[LIT_CHARS -r]} {[LIT_CHARS url]} ) (List (If (Com {[LIT_DBRACKET_LIKE "["]} {[LIT_OTHER "!"]} {[LIT_CHARS -n]} {[DQ [VarSub file_hash]]} {[LIT_DBRACKET_LIKE "]"]} ) (= scope= flags=0 words=[] bindings=[('url', {[DQ [VarSub url transform_ops=[PatSub {[LIT_CHARS .tar.gz]} {[LIT_CHARS .tar.gz.sha1]}]]]})]) ) (= 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 --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 (Com {[LIT_DBRACKET_LIKE "["]} {[LIT_CHARS -n]} {[DQ [VarSub file_hash]]} {[LIT_DBRACKET_LIKE "]"]} ) (Pipeline! (Com {[LIT_CHARS validate_hash]} {[DQ [VarSub file]]} {[DQ [VarSub file_hash]]} ) ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "== Hash validation of "][VarSub url][LIT_CHARS " failed. Retrying. =="]]} ) (ElseTrue) (List (If (Com {[LIT_DBRACKET_LIKE "["]} {[LIT_CHARS -n]} {[DQ [VarSub file_hash]]} {[LIT_DBRACKET_LIKE "]"]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "== Downloaded "][VarSub url][LIT_CHARS " (SHA1 = "][VarSub file_hash][LIT_CHARS ") =="]]} ) (ElseTrue) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "== Downloaded "][VarSub url][LIT_CHARS " =="]]} ) ) (Com {[LIT_CHARS return]} ) ) ) ) ) ) ) ) (FunctionDef install_kube_binary_config [] (List (= scope= flags=0 words=[] bindings=[('tmp_binary_urls', {[ComSub (Com {[LIT_CHARS mktemp]} {[LIT_CHARS /tmp/kube-temp.XXXXXX]})]})]) (Pipeline (Com {[LIT_CHARS echo]} {[DQ [VarSub SERVER_BINARY_TAR_URL]]} ) (Com {[LIT_CHARS tr]} {[DQ [LIT_CHARS ","]]} {[DQ [\ LIT_ESCAPED_CHAR "\\n"]]} < (FilenameRedirectNode filename={[DQ [VarSub tmp_binary_urls]]} "> 1), > ) ) (= scope= flags=0 words=[] bindings=[('tmp_manifests_urls', {[ComSub (Com {[LIT_CHARS mktemp]} {[LIT_CHARS /tmp/kube-temp.XXXXXX]})]})]) (Pipeline (Com {[LIT_CHARS echo]} {[DQ [VarSub KUBE_MANIFESTS_TAR_URL]]} ) (Com {[LIT_CHARS tr]} {[DQ [LIT_CHARS ","]]} {[DQ [\ LIT_ESCAPED_CHAR "\\n"]]} < (FilenameRedirectNode filename={[DQ [VarSub tmp_manifests_urls]]} "> 1), > ) ) (= scope= flags=0 words=[] bindings=[('kube_home', {[DQ [LIT_CHARS /home/kubernetes]]})]) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[DQ [VarSub kube_home]]} ) (Com {[LIT_CHARS cd]} {[DQ [VarSub kube_home]]} ) (Com {[LIT_CHARS read]} {[LIT_CHARS -r]} {[LIT_CHARS server_binary_tar_url]} < (FilenameRedirectNode filename={[DQ [VarSub tmp_binary_urls]]} 0), > ) (= scope= flags=2 words=[] bindings=[('server_binary_tar', {[DQ [VarSub server_binary_tar_url transform_ops=[VS_UNARY_DPOUND {[LIT_CHARS "*"] [LIT_SLASH /]}]]]})]) (If (Com {[LIT_DBRACKET_LIKE "["]} {[LIT_CHARS -n]} {[DQ [VarSub SERVER_BINARY_TAR_HASH test_op=VS_TEST_COLON_HYPHEN {}]]} {[LIT_DBRACKET_LIKE "]"]} ) (= scope= flags=2 words=[] 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 tmp_binary_urls]]} ) (= scope= flags=2 words=[] 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 tmp_binary_urls]]} ) (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 (Com {[LIT_DBRACKET_LIKE "["]} {[DQ [VarSub KUBERNETES_MASTER test_op=VS_TEST_COLON_HYPHEN {}]]} {[LIT_DBRACKET_LIKE "="]} {[DQ [LIT_CHARS false]]} {[LIT_DBRACKET_LIKE "]"]} ) (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=2 words=[] bindings=[('BIN_PATH', {[DQ [LIT_CHARS /usr/bin]]})]) (If (AndOr OP_OR_IF (Pipeline! (Com {[LIT_CHARS which]} {[LIT_CHARS kubelet]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 1), > ) ) (Pipeline! (Com {[LIT_CHARS which]} {[LIT_CHARS kubectl]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 1), > ) ) ) (List (Com {[LIT_CHARS cp]} {[DQ [VarSub src_dir][LIT_CHARS /kubelet]]} {[DQ [VarSub BIN_PATH]]} ) (Com {[LIT_CHARS cp]} {[DQ [VarSub src_dir][LIT_CHARS /kubectl]]} {[DQ [VarSub BIN_PATH]]} ) ) (ElseTrue) (List (= scope= flags=2 words=[] bindings=[('kube_bin', {[DQ [VarSub kube_home][LIT_CHARS /bin]]})]) (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[DQ [VarSub kube_bin]]} ) (Com {[LIT_CHARS mount]} {[LIT_CHARS --bind]} {[DQ [VarSub kube_bin]]} {[DQ [VarSub kube_bin]]} ) (Com {[LIT_CHARS mount]} {[LIT_CHARS -o]} {[LIT_CHARS remount] [LIT_COMMA ","] [LIT_CHARS rw] [LIT_COMMA ","] [LIT_CHARS exec]} {[DQ [VarSub kube_bin]]} ) (Com {[LIT_CHARS cp]} {[DQ [VarSub src_dir][LIT_CHARS /kubelet]]} {[DQ [VarSub kube_bin]]} ) (Com {[LIT_CHARS cp]} {[DQ [VarSub src_dir][LIT_CHARS /kubectl]]} {[DQ [VarSub kube_bin]]} ) (Com {[LIT_CHARS chmod]} {[LIT_CHARS 544]} {[DQ [VarSub kube_bin][LIT_CHARS /kubelet]]} ) (Com {[LIT_CHARS chmod]} {[LIT_CHARS 544]} {[DQ [VarSub kube_bin][LIT_CHARS /kubectl]]} ) (= scope= flags=2 words=[] bindings=[('builtin_version', {[DQ [ComSub (Pipeline (Com {[LIT_CHARS /usr/bin/kubelet]} {[LIT_CHARS --version] [LIT_DBRACKET_LIKE "="] [LIT_CHARS true]}) (Com {[LIT_CHARS cut]} {[LIT_CHARS -f2]} {[LIT_CHARS -d]} {[DQ [LIT_CHARS " "]]}) )]]})]) (= scope= flags=2 words=[] bindings=[('required_version', {[DQ [ComSub (Pipeline (Com {[LIT_CHARS /home/kubernetes/bin/kubelet]} {[LIT_CHARS --version] [LIT_DBRACKET_LIKE "="] [LIT_CHARS true]}) (Com {[LIT_CHARS cut]} {[LIT_CHARS -f2]} {[LIT_CHARS -d]} {[DQ [LIT_CHARS " "]]}) )]]})]) (If (AndOr OP_OR_IF (Com {[LIT_DBRACKET_LIKE "["]} {[DQ [VarSub TEST_CLUSTER test_op=VS_TEST_COLON_HYPHEN {}]]} {[LIT_DBRACKET_LIKE "="]} {[DQ [LIT_CHARS true]]} {[LIT_DBRACKET_LIKE "]"]} ) (Com {[LIT_DBRACKET_LIKE "["]} {[DQ [VarSub builtin_version]]} {[LIT_NEQUAL "!="]} {[DQ [VarSub required_version]]} {[LIT_DBRACKET_LIKE "]"]} ) ) (List (Com {[LIT_CHARS mount]} {[LIT_CHARS --bind]} {[DQ [VarSub kube_bin][LIT_CHARS /kubelet]]} {[DQ [VarSub BIN_PATH][LIT_CHARS /kubelet]]} ) (Com {[LIT_CHARS mount]} {[LIT_CHARS --bind]} {[DQ [VarSub kube_bin][LIT_CHARS /kubectl]]} {[DQ [VarSub BIN_PATH][LIT_CHARS /kubectl]]} ) ) (ElseTrue) (List (Com {[LIT_CHARS rm]} {[LIT_CHARS -f]} {[DQ [VarSub kube_bin][LIT_CHARS /kubelet]]} ) (Com {[LIT_CHARS rm]} {[LIT_CHARS -f]} {[DQ [VarSub kube_bin][LIT_CHARS /kubectl]]} ) ) ) ) ) (Com {[LIT_CHARS cp]} {[DQ [VarSub kube_home][LIT_CHARS /kubernetes/LICENSES]]} {[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]]} ) (Com {[LIT_CHARS read]} {[LIT_CHARS -r]} {[LIT_CHARS manifests_tar_url]} < (FilenameRedirectNode filename={[DQ [VarSub tmp_manifests_urls]]} 0), > ) (= scope= flags=2 words=[] bindings=[('manifests_tar', {[DQ [VarSub manifests_tar_url 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=2 words=[] 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 tmp_manifests_urls]]} ) (= scope= flags=2 words=[] 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 tmp_manifests_urls]]} ) (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=2 words=[] 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 (Com {[LIT_DBRACKET_LIKE "["]} {[DQ [VarSub kube_addon_registry]]} {[LIT_NEQUAL "!="]} {[DQ [LIT_CHARS gcr.io/google_containers]]} {[LIT_DBRACKET_LIKE "]"]} ) (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/trusty-configure-helper.sh]]} {[LIT_CHARS /etc/kube-configure-helper.sh]} ) (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 rm]} {[LIT_CHARS -f]} {[DQ [VarSub tmp_binary_urls]]} ) (Com {[LIT_CHARS rm]} {[LIT_CHARS -f]} {[DQ [VarSub tmp_manifests_urls]]} ) ) ) )