From d69553f90418d221750082360774bcbe40f8a84c Mon Sep 17 00:00:00 2001 From: Alexey Odinokov Date: Thu, 4 Mar 2021 23:09:10 +0000 Subject: [PATCH] Kubeconfig: switching from kustomize to airshipctl command Since [1] has been merged it's possible to use that command to generate kubeconfig in proper way. This patchset introduces that changes as well as cleans up for non-needed anymore due to that changes steps in gating. [1]: https://review.opendev.org/c/airship/airshipctl/+/774709 Change-Id: Ifc07c56c126c782d940a8ca4d111c59c5d3c9c78 --- tools/deployment/23_generate_secrets.sh | 9 +++++++-- tools/gate/00_setup.sh | 2 +- zuul.d/jobs.yaml | 2 -- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/deployment/23_generate_secrets.sh b/tools/deployment/23_generate_secrets.sh index f6f4d0c80..336aa3e67 100755 --- a/tools/deployment/23_generate_secrets.sh +++ b/tools/deployment/23_generate_secrets.sh @@ -25,8 +25,13 @@ export EXTERNAL_KUBECONFIG=${EXTERNAL_KUBECONFIG:-""} export SITE=${SITE:-"test-site"} if [[ -z "$EXTERNAL_KUBECONFIG" ]]; then - # TODO: use airshipctl cluster get-kubeconfig command when it's implemented - KUSTOMIZE_PLUGIN_HOME=./ kustomize build --enable_alpha_plugins "${AIRSHIP_CONFIG_MANIFEST_DIRECTORY}/$(basename ${AIRSHIP_CONFIG_PHASE_REPO_URL})/manifests/site/$SITE/kubeconfig/" | yq '.config' --yaml-output > ~/.airship/kubeconfig + # we want to take config from bundle - remove kubeconfig file so + # airshipctl could regenerated it from kustomize + [ -f "~/.airship/kubeconfig" ] && rm ~/.airship/kubeconfig + # we need to use tmp file, because airshipctl uses it and fails + # if we write directly + airshipctl cluster get-kubeconfig > ~/.airship/tmp-kubeconfig + mv ~/.airship/tmp-kubeconfig ~/.airship/kubeconfig fi #backward compatibility with previous behavior diff --git a/tools/gate/00_setup.sh b/tools/gate/00_setup.sh index 285ca1ed7..54b4125a7 100755 --- a/tools/gate/00_setup.sh +++ b/tools/gate/00_setup.sh @@ -36,7 +36,7 @@ sudo apt update sudo DEBIAN_FRONTEND=noninteractive apt -y install software-properties-common python3-pip curl wget ca-certificates sudo DEBIAN_FRONTEND=noninteractive apt -y --no-install-recommends install docker.io make -PACKAGES="yq ansible netaddr" +PACKAGES="ansible netaddr" if [[ -z "${http_proxy}" ]]; then sudo pip3 install $PACKAGES else diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 9c06ac081..da48d38d6 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -126,8 +126,6 @@ vars: site_name: test-site gate_scripts: - - ./tools/deployment/provider_common/03_install_pip.sh - - ./tools/deployment/provider_common/04_install_yq.sh - ./tools/deployment/01_install_kubectl.sh # 21_systemwide_executable.sh is run in the build-gate pre-run above - ./tools/deployment/22_test_configs.sh