k8s.io/kubernetes@v1.31.0-alpha.0.0.20240520171757-56147500dadc/cluster/skeleton/util.sh (about) 1 #!/usr/bin/env bash 2 3 # Copyright 2016 The Kubernetes Authors. 4 # 5 # Licensed under the Apache License, Version 2.0 (the "License"); 6 # you may not use this file except in compliance with the License. 7 # You may obtain a copy of the License at 8 # 9 # http://www.apache.org/licenses/LICENSE-2.0 10 # 11 # Unless required by applicable law or agreed to in writing, software 12 # distributed under the License is distributed on an "AS IS" BASIS, 13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 # See the License for the specific language governing permissions and 15 # limitations under the License. 16 17 # This script contains the helper functions that each provider hosting 18 # Kubernetes must implement to use cluster/kube-*.sh scripts. 19 20 # Must ensure that the following ENV vars are set 21 function detect-master { 22 echo "KUBE_MASTER_IP: ${KUBE_MASTER_IP:-}" 1>&2 23 echo "KUBE_MASTER: ${KUBE_MASTER:-}" 1>&2 24 } 25 26 # Get node names if they are not static. 27 function detect-node-names { 28 echo "NODE_NAMES: [${NODE_NAMES[*]}]" 1>&2 29 } 30 31 # Get node IP addresses and store in KUBE_NODE_IP_ADDRESSES[] 32 function detect-nodes { 33 echo "KUBE_NODE_IP_ADDRESSES: [${KUBE_NODE_IP_ADDRESSES[*]}]" 1>&2 34 } 35 36 # Verify prereqs on host machine 37 function verify-prereqs { 38 echo "Skeleton Provider: verify-prereqs not implemented" 1>&2 39 } 40 41 # Validate a kubernetes cluster 42 function validate-cluster { 43 # by default call the generic validate-cluster.sh script, customizable by 44 # any cluster provider if this does not fit. 45 "${KUBE_ROOT}/cluster/validate-cluster.sh" 46 } 47 48 # Instantiate a kubernetes cluster 49 function kube-up { 50 echo "Skeleton Provider: kube-up not implemented" 1>&2 51 } 52 53 # Delete a kubernetes cluster 54 function kube-down { 55 echo "Skeleton Provider: kube-down not implemented" 1>&2 56 } 57 58 # Execute prior to running tests to build a release if required for env 59 function test-build-release { 60 echo "Skeleton Provider: test-build-release not implemented" 1>&2 61 } 62 63 # Execute prior to running tests to initialize required structure 64 function test-setup { 65 echo "Skeleton Provider: test-setup not implemented" 1>&2 66 } 67 68 # Execute after running tests to perform any required clean-up 69 function test-teardown { 70 echo "Skeleton Provider: test-teardown not implemented" 1>&2 71 } 72 73 function prepare-e2e { 74 echo "Skeleton Provider: prepare-e2e not implemented" 1>&2 75 } 76 77 function detect-project { 78 echo "Skeleton Provider: detect-project not implemented" 1>&2 79 }