mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Unzipping the kubectl package to platforms so the validation script can find kubectl.
This commit is contained in:
parent
a49d5c1fd0
commit
64d849e4bb
@ -27,9 +27,11 @@ KUBE_ROOT=$(readlink -m ${JUJU_PATH}/../../)
|
|||||||
source "${JUJU_PATH}/${KUBE_CONFIG_FILE-config-default.sh}"
|
source "${JUJU_PATH}/${KUBE_CONFIG_FILE-config-default.sh}"
|
||||||
# This attempts installation of Juju - This really needs to support multiple
|
# This attempts installation of Juju - This really needs to support multiple
|
||||||
# providers/distros - but I'm super familiar with ubuntu so assume that for now.
|
# providers/distros - but I'm super familiar with ubuntu so assume that for now.
|
||||||
source ${JUJU_PATH}/prereqs/ubuntu-juju.sh
|
source "${JUJU_PATH}/prereqs/ubuntu-juju.sh"
|
||||||
export JUJU_REPOSITORY=${JUJU_PATH}/charms
|
export JUJU_REPOSITORY="${JUJU_PATH}/charms"
|
||||||
KUBE_BUNDLE_PATH=${JUJU_PATH}/bundles/local.yaml
|
KUBE_BUNDLE_PATH="${JUJU_PATH}/bundles/local.yaml"
|
||||||
|
# The directory for the kubectl binary, this is one of the paths in kubectl.sh.
|
||||||
|
KUBECTL_DIR="${KUBE_ROOT}/platforms/linux/amd64"
|
||||||
|
|
||||||
|
|
||||||
function build-local() {
|
function build-local() {
|
||||||
@ -78,16 +80,15 @@ function kube-up() {
|
|||||||
detect-master
|
detect-master
|
||||||
detect-nodes
|
detect-nodes
|
||||||
|
|
||||||
local prefix=$RANDOM
|
# Copy kubectl, the cert and key to this machine from master.
|
||||||
export KUBECONFIG=/tmp/${prefix}/config
|
|
||||||
# Copy the cert and key to this machine.
|
|
||||||
(
|
(
|
||||||
umask 077
|
umask 077
|
||||||
mkdir -p /tmp/${prefix}
|
mkdir -p ${KUBECTL_DIR}
|
||||||
juju scp ${KUBE_MASTER_NAME}:kubectl_package.tar.gz /tmp/${prefix}/
|
juju scp ${KUBE_MASTER_NAME}:kubectl_package.tar.gz ${KUBECTL_DIR}
|
||||||
ls -al /tmp/${prefix}/
|
tar xfz ${KUBECTL_DIR}/kubectl_package.tar.gz -C ${KUBECTL_DIR}
|
||||||
tar xfz /tmp/${prefix}/kubectl_package.tar.gz -C /tmp/${prefix}
|
|
||||||
)
|
)
|
||||||
|
# Export the location of the kubectl configuration file.
|
||||||
|
export KUBECONFIG="${KUBECTL_DIR}/config"
|
||||||
}
|
}
|
||||||
|
|
||||||
function kube-down() {
|
function kube-down() {
|
||||||
@ -95,6 +96,10 @@ function kube-down() {
|
|||||||
local jujuenv
|
local jujuenv
|
||||||
jujuenv=$(juju switch)
|
jujuenv=$(juju switch)
|
||||||
juju destroy-model ${jujuenv} ${force} || true
|
juju destroy-model ${jujuenv} ${force} || true
|
||||||
|
# Clean up the generated charm files.
|
||||||
|
rm -rf ${KUBE_ROOT}/cluster/juju/charms
|
||||||
|
# Clean up the kubectl binary and config file.
|
||||||
|
rm -rf ${KUBECTL_DIR}
|
||||||
}
|
}
|
||||||
|
|
||||||
function prepare-e2e() {
|
function prepare-e2e() {
|
||||||
|
Loading…
Reference in New Issue
Block a user