#!/bin/bash # Copyright 2016 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # This script contains the helper functions that each provider hosting # Kubernetes must implement to use cluster/kube-*.sh scripts. # Must ensure that the following ENV vars are set proc detect-master { echo "KUBE_MASTER_IP: $KUBE_MASTER_IP" !1 > !2 echo "KUBE_MASTER: $KUBE_MASTER" !1 > !2 } # Get node names if they are not static. proc detect-node-names { echo "NODE_NAMES: [$(NODE_NAMES[*])]" !1 > !2 } # Get node IP addresses and store in KUBE_NODE_IP_ADDRESSES[] proc detect-nodes { echo "KUBE_NODE_IP_ADDRESSES: [$(KUBE_NODE_IP_ADDRESSES[*])]" !1 > !2 } # Verify prereqs on host machine proc verify-prereqs { echo "Skeleton Provider: verify-prereqs not implemented" !1 > !2 } # Validate a kubernetes cluster proc validate-cluster { # by default call the generic validate-cluster.sh script, customizable by # any cluster provider if this does not fit. "$(KUBE_ROOT)/cluster/validate-cluster.sh" } # Instantiate a kubernetes cluster proc kube-up { echo "Skeleton Provider: kube-up not implemented" !1 > !2 } # Delete a kubernetes cluster proc kube-down { echo "Skeleton Provider: kube-down not implemented" !1 > !2 } # Update a kubernetes cluster proc kube-push { echo "Skeleton Provider: kube-push not implemented" !1 > !2 } # Prepare update a kubernetes component proc prepare-push { echo "Skeleton Provider: prepare-push not implemented" !1 > !2 } # Update a kubernetes master proc push-master { echo "Skeleton Provider: push-master not implemented" !1 > !2 } # Update a kubernetes node proc push-node { echo "Skeleton Provider: push-node not implemented" !1 > !2 } # Execute prior to running tests to build a release if required for env proc test-build-release { echo "Skeleton Provider: test-build-release not implemented" !1 > !2 } # Execute prior to running tests to initialize required structure proc test-setup { echo "Skeleton Provider: test-setup not implemented" !1 > !2 } # Execute after running tests to perform any required clean-up proc test-teardown { echo "Skeleton Provider: test-teardown not implemented" !1 > !2 } proc prepare-e2e { echo "Skeleton Provider: prepare-e2e not implemented" !1 > !2 } proc detect-project { echo "Skeleton Provider: detect-project not implemented" !1 > !2 } (CommandList children: [ (FuncDef name: detect-master body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ("KUBE_MASTER_IP: ") ($ VSub_Name "$KUBE_MASTER_IP"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[68])] ) (SimpleCommand words: [{(echo)} {(DQ ("KUBE_MASTER: ") ($ VSub_Name "$KUBE_MASTER"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[79])] ) ] spids: [58] ) spids: [54 57] ) (FuncDef name: detect-node-names body: (BraceGroup children: [ (SimpleCommand words: [ {(echo)} { (DQ ("NODE_NAMES: [") (BracedVarSub token: bracket_op: (WholeArray op_id:Arith_Star) spids: [99 104] ) ("]") ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[108])] ) ] spids: [92] ) spids: [88 91] ) (FuncDef name: detect-nodes body: (BraceGroup children: [ (SimpleCommand words: [ {(echo)} { (DQ ("KUBE_NODE_IP_ADDRESSES: [") (BracedVarSub token: bracket_op: (WholeArray op_id:Arith_Star) spids: [128 133] ) ("]") ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[137])] ) ] spids: [121] ) spids: [117 120] ) (FuncDef name: verify-prereqs body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ("Skeleton Provider: verify-prereqs not implemented"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[159])] ) ] spids: [150] ) spids: [146 149] ) (FuncDef name: validate-cluster body: (BraceGroup children: [(C {(DQ (${ VSub_Name KUBE_ROOT) (/cluster/validate-cluster.sh))})] spids: [172] ) spids: [168 171] ) (FuncDef name: kube-up body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ("Skeleton Provider: kube-up not implemented"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[209])] ) ] spids: [200] ) spids: [196 199] ) (FuncDef name: kube-down body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ("Skeleton Provider: kube-down not implemented"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[231])] ) ] spids: [222] ) spids: [218 221] ) (FuncDef name: kube-push body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ("Skeleton Provider: kube-push not implemented"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[253])] ) ] spids: [244] ) spids: [240 243] ) (FuncDef name: prepare-push body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ("Skeleton Provider: prepare-push not implemented"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[275])] ) ] spids: [266] ) spids: [262 265] ) (FuncDef name: push-master body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ("Skeleton Provider: push-master not implemented"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[297])] ) ] spids: [288] ) spids: [284 287] ) (FuncDef name: push-node body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ("Skeleton Provider: push-node not implemented"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[319])] ) ] spids: [310] ) spids: [306 309] ) (FuncDef name: test-build-release body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ("Skeleton Provider: test-build-release not implemented"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[341])] ) ] spids: [332] ) spids: [328 331] ) (FuncDef name: test-setup body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ("Skeleton Provider: test-setup not implemented"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[363])] ) ] spids: [354] ) spids: [350 353] ) (FuncDef name: test-teardown body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ("Skeleton Provider: test-teardown not implemented"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[385])] ) ] spids: [376] ) spids: [372 375] ) (FuncDef name: prepare-e2e body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ("Skeleton Provider: prepare-e2e not implemented"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[404])] ) ] spids: [395] ) spids: [391 394] ) (FuncDef name: detect-project body: (BraceGroup children: [ (SimpleCommand words: [{(echo)} {(DQ ("Skeleton Provider: detect-project not implemented"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:1 arg_word:{(2)} spids:[423])] ) ] spids: [414] ) spids: [410 413] ) ] )