util.sh 2.4 KB

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