(List (Com {[LIT_CHARS set]} {[LIT_CHARS -e]} ) (= scope= flags=0 words=[] bindings=[('KUBE_ROOT', {[ComSub (Com {[LIT_CHARS dirname]} {[DQ [VarSub BASH_SOURCE]]})] [LIT_CHARS /../..]})]) (= scope= flags=2 words=[] bindings=[('ROOT', {[ComSub (Com {[LIT_CHARS dirname]} {[DQ [VarSub BASH_SOURCE]]})]})]) (Com {[LIT_CHARS source]} {[DQ [VarSub ROOT][LIT_CHARS /][VarSub KUBE_CONFIG_FILE test_op=VS_TEST_COLON_HYPHEN {[DQ [LIT_CHARS config-default.sh]]}]]} ) (Com {[LIT_CHARS source]} {[DQ [VarSub KUBE_ROOT][LIT_CHARS /cluster/common.sh]]} ) (If (Com {[LIT_DBRACKET_LIKE "["]} {[VarSub CREATE_IMAGE]} {[LIT_DBRACKET_LIKE "="]} {[LIT_CHARS true]} {[LIT_DBRACKET_LIKE "]"]} ) (Com {[LIT_CHARS source]} {[DQ [VarSub ROOT][LIT_CHARS /config-image.sh]]} ) ) (FunctionDef verify-prereqs [] (For client [{[LIT_CHARS swift]}, {[LIT_CHARS glance]}, {[LIT_CHARS nova]}, {[LIT_CHARS heat]}, {[LIT_CHARS openstack]}]) (If (Com {[LIT_CHARS which]} {[VarSub client]} < (FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 1), (DescriptorRedirectNode target={[LIT_CHARS 1]} &"> 2), > ) (Com {[LIT_CHARS echo]} {[DQ [VarSub client][LIT_CHARS " client installed"]]} ) (ElseTrue) (List (Com {[LIT_CHARS echo]} {[DQ [VarSub client][LIT_CHARS " client does not exist"]]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Please install "][VarSub client][LIT_CHARS " client, and retry."]]} ) (Com {[LIT_CHARS exit]} {[LIT_CHARS 1]} ) ) ) ) ) (FunctionDef kube-up [] (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "kube-up for provider "][VarSub KUBERNETES_PROVIDER]]} ) (Com {[LIT_CHARS create-stack]} ) ) ) (FunctionDef validate-cluster [] (While (DParen {A2 AS_OP_GE {A1 AS_OP_DMINUS {A Atom NODE_ARITH_WORD {[VarSub STACK_CREATE_TIMEOUT]}} } {A Atom NODE_ARITH_WORD {[AS_NUM_LITERAL 0]}}}) (List (= scope= flags=0 words=[] bindings=[('status', {[ComSub (Pipeline (Com {[LIT_CHARS openstack]} {[LIT_CHARS stack]} {[LIT_CHARS show]} {[DQ [VarSub STACK_NAME]]}) (Com {[LIT_CHARS awk]} {[SQ ]}) )]})]) (If (DBracket {B1 UNARY_STRING_n {[VarSub status]}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Cluster status "][VarSub status]]} ) (If (Com {[LIT_DBRACKET_LIKE "["]} {[VarSub status]} {[LIT_DBRACKET_LIKE "="]} {[DQ [LIT_CHARS CREATE_COMPLETE]]} {[LIT_DBRACKET_LIKE "]"]} ) (List (Com {[LIT_CHARS configure-kubectl]} ) (Com {[LIT_CHARS break]} ) ) (Com {[LIT_DBRACKET_LIKE "["]} {[VarSub status]} {[LIT_DBRACKET_LIKE "="]} {[DQ [LIT_CHARS CREATE_FAILED]]} {[LIT_DBRACKET_LIKE "]"]} ) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Cluster not created. Please check stack logs to find the problem"]]} ) (Com {[LIT_CHARS break]} ) ) ) ) (ElseTrue) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "Cluster not created. Please verify if process started correctly"]]} ) (Com {[LIT_CHARS break]} ) ) ) (Com {[LIT_CHARS sleep]} {[LIT_CHARS 60]} ) ) ) ) (FunctionDef create-stack [] (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "[INFO] Execute commands to create Kubernetes cluster"]]} ) (Com {[LIT_CHARS source]} {[DQ [VarSub ROOT][LIT_CHARS /openrc-swift.sh]]} ) (Com {[LIT_CHARS upload-resources]} ) (Com {[LIT_CHARS source]} {[DQ [VarSub ROOT][LIT_CHARS /openrc-default.sh]]} ) (Com {[LIT_CHARS create-glance-image]} ) (Com {[LIT_CHARS add-keypair]} ) (Com {[LIT_CHARS run-heat-script]} ) ) ) (FunctionDef upload-resources [] (List (Com {[LIT_CHARS swift]} {[LIT_CHARS post]} {[LIT_CHARS kubernetes]} {[LIT_CHARS --read-acl]} {[SQ ]} ) (= scope= flags=0 words=[] bindings=[('locations', {[Array {OP_NEWLINE "\n"} {[DQ [VarSub ROOT][LIT_CHARS /../../_output/release-tars/][VarSub KUBERNETES_RELEASE_TAR]]} {OP_NEWLINE "\n"} {[DQ [VarSub ROOT][LIT_CHARS /../../server/][VarSub KUBERNETES_RELEASE_TAR]]} {OP_NEWLINE "\n"}]})]) (= scope= flags=0 words=[] bindings=[('RELEASE_TAR_LOCATION', {[ComSub (Pipeline (Subshell (AndOr OP_OR_IF (Com redirects=[(FilenameRedirectNode filename={[LIT_CHARS /dev/null]} "> 2)]{[LIT_CHARS ls]} {[LIT_CHARS -t]} {[DQ [VarSub locations bracket_op=(Index {A Atom NODE_ARITH_WORD {AS_OP_AT "@"}})]]}) (Com {[LIT_CHARS true]}) ) ) (Com {[LIT_CHARS head]} {[LIT_CHARS -1]}) )]})]) (= scope= flags=0 words=[] bindings=[('RELEASE_TAR_PATH', {[ComSub (Com {[LIT_CHARS dirname]} {[VarSub RELEASE_TAR_LOCATION]})]})]) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "[INFO] Uploading "][VarSub KUBERNETES_RELEASE_TAR]]} ) (Com {[LIT_CHARS swift]} {[LIT_CHARS upload]} {[LIT_CHARS kubernetes]} {[VarSub RELEASE_TAR_PATH] [LIT_CHARS /] [VarSub KUBERNETES_RELEASE_TAR]} {[LIT_CHARS --object-name]} {[LIT_CHARS kubernetes-server.tar.gz]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "[INFO] Uploading kubernetes-salt.tar.gz"]]} ) (Com {[LIT_CHARS swift]} {[LIT_CHARS upload]} {[LIT_CHARS kubernetes]} {[VarSub RELEASE_TAR_PATH] [LIT_CHARS /kubernetes-salt.tar.gz]} {[LIT_CHARS --object-name]} {[LIT_CHARS kubernetes-salt.tar.gz]} ) ) ) (FunctionDef add-keypair [] (List (= scope= flags=0 words=[] bindings=[('status', {[ComSub (Com {[LIT_CHARS nova]} {[LIT_CHARS keypair-show]} {[VarSub KUBERNETES_KEYPAIR_NAME]})]})]) (If (DBracket {B! {B1 UNARY_STRING_n {[VarSub status]}}}) (List (Com {[LIT_CHARS nova]} {[LIT_CHARS keypair-add]} {[VarSub KUBERNETES_KEYPAIR_NAME]} {[LIT_CHARS --pub-key]} {[VarSub CLIENT_PUBLIC_KEY_PATH]} ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "[INFO] Key pair created"]]} ) ) (ElseTrue) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "[INFO] Key pair already exists"]]} ) ) ) ) (FunctionDef create-glance-image [] (If (DBracket {B2 BINARY_STRING_EQUAL {[VarSub CREATE_IMAGE]} {[DQ [LIT_CHARS true]]}}) (List (= scope= flags=0 words=[] bindings=[('image_status', {[ComSub (Pipeline (Com {[LIT_CHARS openstack]} {[LIT_CHARS image]} {[LIT_CHARS show]} {[VarSub OPENSTACK_IMAGE_NAME]}) (Com {[LIT_CHARS awk]} {[SQ ]}) )]})]) (If (DBracket {B! {B1 UNARY_STRING_n {[VarSub image_status]}}}) (List (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub DOWNLOAD_IMAGE]]} {[DQ [LIT_CHARS true]]}}) (List (Com {[LIT_CHARS mkdir]} {[LIT_CHARS -p]} {[VarSub IMAGE_PATH]} ) (Com {[LIT_CHARS curl]} {[LIT_CHARS -L]} {[VarSub IMAGE_URL_PATH] [LIT_CHARS /] [VarSub IMAGE_FILE]} {[LIT_CHARS -o]} {[VarSub IMAGE_PATH] [LIT_CHARS /] [VarSub IMAGE_FILE]} {[LIT_CHARS -z]} {[VarSub IMAGE_PATH] [LIT_CHARS /] [VarSub IMAGE_FILE]} ) ) ) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "[INFO] Create image "][VarSub OPENSTACK_IMAGE_NAME]]} ) (Com {[LIT_CHARS glance]} {[LIT_CHARS image-create]} {[LIT_CHARS --name]} {[VarSub OPENSTACK_IMAGE_NAME]} {[LIT_CHARS --disk-format]} {[VarSub IMAGE_FORMAT]} {[LIT_CHARS --container-format]} {[VarSub CONTAINER_FORMAT]} {[LIT_CHARS --file]} {[VarSub IMAGE_PATH] [LIT_CHARS /] [VarSub IMAGE_FILE]} ) ) (ElseTrue) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "[INFO] Image "][VarSub OPENSTACK_IMAGE_NAME][LIT_CHARS " already exists"]]} ) ) ) ) ) (FunctionDef run-heat-script [] (List (= scope= flags=0 words=[] bindings=[('stack_status', {[ComSub (Com {[LIT_CHARS openstack]} {[LIT_CHARS stack]} {[LIT_CHARS show]} {[VarSub STACK_NAME]})]})]) (If (DBracket {B1 UNARY_STRING_z {[VarSub SWIFT_SERVER_URL]}}) (= scope= flags=0 words=[] bindings=[('SWIFT_SERVER_URL', {[ComSub (Pipeline (Com {[LIT_CHARS openstack]} {[LIT_CHARS catalog]} {[LIT_CHARS show]} {[LIT_CHARS object-store]} {[LIT_CHARS --format]} {[LIT_CHARS value]}) (Com {[LIT_CHARS egrep]} {[LIT_CHARS -o]} {[DQ [LIT_CHARS "publicURL: (.+)"][LIT_OTHER "$"]]}) (Com {[LIT_CHARS cut]} {[LIT_CHARS -d] [DQ [LIT_CHARS " "]]} {[LIT_CHARS -f2]}) )]})]) ) (= scope= flags=0 words=[] bindings=[('swift_repo_url', {[DQ [VarSub SWIFT_SERVER_URL][LIT_CHARS /kubernetes]]})]) (If (Com {[LIT_DBRACKET_LIKE "["]} {[VarSub CREATE_IMAGE]} {[LIT_DBRACKET_LIKE "="]} {[LIT_CHARS true]} {[LIT_DBRACKET_LIKE "]"]} ) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "[INFO] Retrieve new image ID"]]} ) (= scope= flags=0 words=[] bindings=[('IMAGE_ID', {[ComSub (Pipeline (Com {[LIT_CHARS openstack]} {[LIT_CHARS image]} {[LIT_CHARS show]} {[VarSub OPENSTACK_IMAGE_NAME]}) (Com {[LIT_CHARS awk]} {[SQ ]}) )]})]) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "[INFO] Image Id "][VarSub IMAGE_ID]]} ) ) ) (If (DBracket {B! {B1 UNARY_STRING_n {[VarSub stack_status]}}}) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "[INFO] Create stack "][VarSub STACK_NAME]]} ) (Subshell (List (Com {[LIT_CHARS cd]} {[VarSub ROOT] [LIT_CHARS /kubernetes-heat]} ) (Com {[LIT_CHARS openstack]} {[LIT_CHARS stack]} {[LIT_CHARS create]} {[LIT_CHARS --timeout]} {[LIT_CHARS 60]} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "external_network="] [VarSub EXTERNAL_NETWORK] =} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "lbaas_version="] [VarSub LBAAS_VERSION] =} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "fixed_network_cidr="] [VarSub FIXED_NETWORK_CIDR] =} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "ssh_key_name="] [VarSub KUBERNETES_KEYPAIR_NAME] =} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "server_image="] [VarSub IMAGE_ID] =} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "master_flavor="] [VarSub MASTER_FLAVOR] =} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "minion_flavor="] [VarSub MINION_FLAVOR] =} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "number_of_minions="] [VarSub NUMBER_OF_MINIONS] =} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "max_number_of_minions="] [VarSub MAX_NUMBER_OF_MINIONS] =} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "dns_nameserver="] [VarSub DNS_SERVER] =} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "kubernetes_salt_url="] [VarSub swift_repo_url] [LIT_CHARS /kubernetes-salt.tar.gz] =} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "kubernetes_server_url="] [VarSub swift_repo_url] [LIT_CHARS /kubernetes-server.tar.gz] =} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "os_auth_url="] [VarSub OS_AUTH_URL] =} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "os_username="] [VarSub OS_USERNAME] =} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "os_password="] [VarSub OS_PASSWORD] =} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "os_region_name="] [VarSub OS_REGION_NAME] =} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "os_tenant_id="] [VarSub OS_TENANT_ID] =} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "enable_proxy="] [VarSub ENABLE_PROXY] =} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "ftp_proxy="] [DQ [VarSub FTP_PROXY]] =} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "http_proxy="] [DQ [VarSub HTTP_PROXY]] =} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "https_proxy="] [DQ [VarSub HTTPS_PROXY]] =} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "socks_proxy="] [DQ [VarSub SOCKS_PROXY]] =} {[LIT_CHARS --parameter]} {[LIT_VAR_LIKE "no_proxy="] [DQ [VarSub NO_PROXY]] =} {[LIT_CHARS --template]} {[LIT_CHARS kubecluster.yaml]} {[VarSub STACK_NAME]} ) ) ) ) (ElseTrue) (List (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "[INFO] Stack "][VarSub STACK_NAME][LIT_CHARS " already exists"]]} ) (Com {[LIT_CHARS openstack]} {[LIT_CHARS stack]} {[LIT_CHARS show]} {[VarSub STACK_NAME]} ) ) ) ) ) (FunctionDef configure-kubectl [] (List (= scope= flags=1 words=[] bindings=[('KUBE_MASTER_IP', {[ComSub (Pipeline (Com {[LIT_CHARS nova]} {[LIT_CHARS show]} {[DQ [VarSub STACK_NAME]] [LIT_CHARS -master]}) (Com {[LIT_CHARS awk]} {[SQ ]}) )]})]) (= scope= flags=1 words=[] bindings=[('CONTEXT', {[DQ [LIT_CHARS openstack-][VarSub STACK_NAME]]})]) (= scope= flags=1 words=[] bindings=[('KUBE_BEARER_TOKEN', {[DQ [LIT_CHARS TokenKubelet]]})]) (If (DBracket {B2 BINARY_STRING_EQUAL {[DQ [VarSub ENABLE_PROXY test_op=VS_TEST_COLON_HYPHEN {}]]} {[DQ [LIT_CHARS true]]}}) (List (Com {[LIT_CHARS echo]} {[SQ ] [DQ [VarSub KUBE_MASTER_IP]]} < (FilenameRedirectNode filename={[LIT_CHARS /tmp/kube-proxy-env]} "> 1), > ) (Com {[LIT_CHARS echo]} {[SQ ] [DQ [VarSub KUBE_MASTER_IP]]} < (FilenameRedirectNode filename={[LIT_CHARS /tmp/kube-proxy-env]} >"> 1), > ) (Com {[LIT_CHARS .]} {[LIT_CHARS /tmp/kube-proxy-env]} ) ) ) (Com {[LIT_CHARS create-kubeconfig]} ) ) ) (FunctionDef kube-down [] (List (Com {[LIT_CHARS source]} {[DQ [VarSub ROOT][LIT_CHARS /openrc-default.sh]]} ) (Com {[LIT_CHARS openstack]} {[LIT_CHARS stack]} {[LIT_CHARS delete]} {[VarSub STACK_NAME]} ) ) ) (FunctionDef prepare-e2e [] (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "TODO: prepare-e2e"]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) ) (FunctionDef test-build-release [] (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "test-build-release() "]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) ) (FunctionDef detect-master [] (List (Com {[LIT_CHARS source]} {[DQ [VarSub ROOT][LIT_CHARS /][VarSub KUBE_CONFIG_FILE test_op=VS_TEST_COLON_HYPHEN {[DQ [LIT_CHARS config-default.sh]]}]]} ) (Com {[LIT_CHARS source]} {[DQ [VarSub ROOT][LIT_CHARS /openrc-default.sh]]} ) (= scope= flags=1 words=[] bindings=[('KUBE_MASTER_IP', {[ComSub (Pipeline (Com {[LIT_CHARS nova]} {[LIT_CHARS show]} {[DQ [VarSub STACK_NAME]] [LIT_CHARS -master]}) (Com {[LIT_CHARS awk]} {[SQ ]}) )]})]) (Com {[LIT_CHARS echo]} {[DQ [LIT_CHARS "KUBE_MASTER_IP: "][VarSub KUBE_MASTER_IP]]} < (DescriptorRedirectNode target={[LIT_CHARS 2]} &"> 1), > ) ) ) )