mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Move KUBERNETES_PROVIDER setting into cluster/kube-util.sh.
This commit is contained in:
parent
e8fda8c9e8
commit
401985bf6c
@ -28,7 +28,6 @@ if [[ "${KUBERNETES_PROVIDER:-gce}" != "gce" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||||
source "${KUBE_ROOT}/cluster/kube-env.sh"
|
|
||||||
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
||||||
|
|
||||||
function usage() {
|
function usage() {
|
||||||
|
@ -26,7 +26,6 @@ if [ -f "${KUBE_ROOT}/cluster/env.sh" ]; then
|
|||||||
source "${KUBE_ROOT}/cluster/env.sh"
|
source "${KUBE_ROOT}/cluster/env.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
source "${KUBE_ROOT}/cluster/kube-env.sh"
|
|
||||||
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
||||||
|
|
||||||
echo "Bringing down cluster using provider: $KUBERNETES_PROVIDER"
|
echo "Bringing down cluster using provider: $KUBERNETES_PROVIDER"
|
||||||
|
@ -14,14 +14,6 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
# Set the default provider of Kubernetes cluster to know where to load provider-specific scripts
|
|
||||||
# You can override the default provider by exporting the KUBERNETES_PROVIDER
|
|
||||||
# variable in your bashrc
|
|
||||||
#
|
|
||||||
# The valid values: 'gce', 'gke', 'aws', 'vagrant', 'vsphere', 'libvirt-coreos', 'juju'
|
|
||||||
|
|
||||||
KUBERNETES_PROVIDER=${KUBERNETES_PROVIDER:-gce}
|
|
||||||
|
|
||||||
# Some useful colors.
|
# Some useful colors.
|
||||||
if [[ -z "${color_start-}" ]]; then
|
if [[ -z "${color_start-}" ]]; then
|
||||||
declare -r color_start="\033["
|
declare -r color_start="\033["
|
||||||
|
@ -29,7 +29,6 @@ if [ -f "${KUBE_ROOT}/cluster/env.sh" ]; then
|
|||||||
source "${KUBE_ROOT}/cluster/env.sh"
|
source "${KUBE_ROOT}/cluster/env.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
source "${KUBE_ROOT}/cluster/kube-env.sh"
|
|
||||||
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
||||||
|
|
||||||
function usage() {
|
function usage() {
|
||||||
|
@ -31,7 +31,6 @@ if [ -f "${KUBE_ROOT}/cluster/env.sh" ]; then
|
|||||||
source "${KUBE_ROOT}/cluster/env.sh"
|
source "${KUBE_ROOT}/cluster/env.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
source "${KUBE_ROOT}/cluster/kube-env.sh"
|
|
||||||
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,9 +14,12 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
# A library of helper functions that each provider hosting Kubernetes must implement to use cluster/kube-*.sh scripts.
|
# This script contains skeletons of helper functions that each provider hosting
|
||||||
|
# Kubernetes must implement to use cluster/kube-*.sh scripts.
|
||||||
|
# It sets KUBERNETES_PROVIDER to its default value (gce) if it is unset, and
|
||||||
|
# then sources cluster/${KUBERNETES_PROVIDER}/util.sh.
|
||||||
|
|
||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
KUBERNETES_PROVIDER="${KUBERNETES_PROVIDER:-gce}"
|
||||||
|
|
||||||
# Must ensure that the following ENV vars are set
|
# Must ensure that the following ENV vars are set
|
||||||
function detect-master {
|
function detect-master {
|
||||||
@ -91,10 +94,8 @@ function test-teardown {
|
|||||||
echo "TODO: test-teardown" 1>&2
|
echo "TODO: test-teardown" 1>&2
|
||||||
}
|
}
|
||||||
|
|
||||||
# Providers util.sh scripts should define functions that override the above default functions impls
|
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||||
if [ -n "${KUBERNETES_PROVIDER}" ]; then
|
PROVIDER_UTILS="${KUBE_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh"
|
||||||
PROVIDER_UTILS="${KUBE_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh"
|
if [ -f ${PROVIDER_UTILS} ]; then
|
||||||
if [ -f ${PROVIDER_UTILS} ]; then
|
source "${PROVIDER_UTILS}"
|
||||||
source "${PROVIDER_UTILS}"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
@ -31,7 +31,6 @@ set -o pipefail
|
|||||||
|
|
||||||
|
|
||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||||
source "${KUBE_ROOT}/cluster/kube-env.sh"
|
|
||||||
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
||||||
|
|
||||||
# Get the absolute path of the directory component of a file, i.e. the
|
# Get the absolute path of the directory component of a file, i.e. the
|
||||||
|
@ -24,7 +24,6 @@ set -o pipefail
|
|||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||||
: ${KUBE_CONFIG_FILE:="config-test.sh"}
|
: ${KUBE_CONFIG_FILE:="config-test.sh"}
|
||||||
|
|
||||||
source "${KUBE_ROOT}/cluster/kube-env.sh"
|
|
||||||
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
||||||
|
|
||||||
readonly report_dir="${1:-_artifacts}"
|
readonly report_dir="${1:-_artifacts}"
|
||||||
|
@ -23,8 +23,7 @@
|
|||||||
# exit on any error
|
# exit on any error
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
source $(dirname $0)/../kube-env.sh
|
source $(dirname $0)/../kube-util.sh
|
||||||
source $(dirname $0)/../$KUBERNETES_PROVIDER/util.sh
|
|
||||||
|
|
||||||
echo "Starting cluster using provider: $KUBERNETES_PROVIDER"
|
echo "Starting cluster using provider: $KUBERNETES_PROVIDER"
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ set -o nounset
|
|||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||||
source "${KUBE_ROOT}/cluster/kube-env.sh"
|
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
||||||
|
|
||||||
echo "Testing cluster with provider: ${KUBERNETES_PROVIDER}" 1>&2
|
echo "Testing cluster with provider: ${KUBERNETES_PROVIDER}" 1>&2
|
||||||
|
|
||||||
|
@ -25,8 +25,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
|||||||
|
|
||||||
export KUBECTL KUBE_CONFIG_FILE
|
export KUBECTL KUBE_CONFIG_FILE
|
||||||
|
|
||||||
source "${KUBE_ROOT}/cluster/kube-env.sh"
|
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
||||||
source "${KUBE_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh"
|
|
||||||
|
|
||||||
prepare-e2e
|
prepare-e2e
|
||||||
|
|
||||||
|
@ -25,8 +25,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
|||||||
|
|
||||||
export KUBECTL KUBE_CONFIG_FILE
|
export KUBECTL KUBE_CONFIG_FILE
|
||||||
|
|
||||||
source "${KUBE_ROOT}/cluster/kube-env.sh"
|
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
||||||
source "${KUBE_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh"
|
|
||||||
|
|
||||||
prepare-e2e
|
prepare-e2e
|
||||||
|
|
||||||
|
@ -25,8 +25,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
|||||||
|
|
||||||
export KUBECTL KUBE_CONFIG_FILE
|
export KUBECTL KUBE_CONFIG_FILE
|
||||||
|
|
||||||
source "${KUBE_ROOT}/cluster/kube-env.sh"
|
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
||||||
source "${KUBE_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh"
|
|
||||||
|
|
||||||
prepare-e2e
|
prepare-e2e
|
||||||
|
|
||||||
|
@ -25,8 +25,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
|||||||
|
|
||||||
export KUBECTL KUBE_CONFIG_FILE
|
export KUBECTL KUBE_CONFIG_FILE
|
||||||
|
|
||||||
source "${KUBE_ROOT}/cluster/kube-env.sh"
|
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
||||||
source "${KUBE_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh"
|
|
||||||
|
|
||||||
prepare-e2e
|
prepare-e2e
|
||||||
|
|
||||||
|
@ -25,8 +25,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
|||||||
|
|
||||||
export KUBECTL KUBE_CONFIG_FILE
|
export KUBECTL KUBE_CONFIG_FILE
|
||||||
|
|
||||||
source "${KUBE_ROOT}/cluster/kube-env.sh"
|
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
||||||
source "${KUBE_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh"
|
|
||||||
|
|
||||||
prepare-e2e
|
prepare-e2e
|
||||||
|
|
||||||
|
@ -25,8 +25,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
|||||||
|
|
||||||
export KUBECTL KUBE_CONFIG_FILE
|
export KUBECTL KUBE_CONFIG_FILE
|
||||||
|
|
||||||
source "${KUBE_ROOT}/cluster/kube-env.sh"
|
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
||||||
source "${KUBE_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh"
|
|
||||||
|
|
||||||
prepare-e2e
|
prepare-e2e
|
||||||
|
|
||||||
|
@ -25,8 +25,7 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
|||||||
|
|
||||||
export KUBECTL KUBE_CONFIG_FILE
|
export KUBECTL KUBE_CONFIG_FILE
|
||||||
|
|
||||||
source "${KUBE_ROOT}/cluster/kube-env.sh"
|
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
||||||
source "${KUBE_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh"
|
|
||||||
|
|
||||||
prepare-e2e
|
prepare-e2e
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ e2e_test=$(kube::util::find-binary "e2e.test")
|
|||||||
|
|
||||||
export KUBECTL KUBE_CONFIG_FILE
|
export KUBECTL KUBE_CONFIG_FILE
|
||||||
|
|
||||||
source "${KUBE_ROOT}/cluster/kube-env.sh"
|
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
||||||
|
|
||||||
# ---- Do cloud-provider-specific setup
|
# ---- Do cloud-provider-specific setup
|
||||||
if [[ -n "${KUBERNETES_CONFORMANCE_TEST:-}" ]]; then
|
if [[ -n "${KUBERNETES_CONFORMANCE_TEST:-}" ]]; then
|
||||||
@ -53,8 +53,6 @@ if [[ -n "${KUBERNETES_CONFORMANCE_TEST:-}" ]]; then
|
|||||||
else
|
else
|
||||||
echo "Setting up for KUBERNETES_PROVIDER=\"${KUBERNETES_PROVIDER}\"."
|
echo "Setting up for KUBERNETES_PROVIDER=\"${KUBERNETES_PROVIDER}\"."
|
||||||
|
|
||||||
source "${KUBE_ROOT}/cluster/${KUBERNETES_PROVIDER}/util.sh"
|
|
||||||
|
|
||||||
prepare-e2e
|
prepare-e2e
|
||||||
|
|
||||||
detect-master >/dev/null
|
detect-master >/dev/null
|
||||||
|
Loading…
Reference in New Issue
Block a user