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
This commit is contained in:
Alexey Odinokov 2021-03-04 23:09:10 +00:00 committed by Alexey
parent 7998615a7b
commit d69553f904
3 changed files with 8 additions and 5 deletions

View File

@ -25,8 +25,13 @@ export EXTERNAL_KUBECONFIG=${EXTERNAL_KUBECONFIG:-""}
export SITE=${SITE:-"test-site"} export SITE=${SITE:-"test-site"}
if [[ -z "$EXTERNAL_KUBECONFIG" ]]; then if [[ -z "$EXTERNAL_KUBECONFIG" ]]; then
# TODO: use airshipctl cluster get-kubeconfig command when it's implemented # we want to take config from bundle - remove kubeconfig file so
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 # 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 fi
#backward compatibility with previous behavior #backward compatibility with previous behavior

View File

@ -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 install software-properties-common python3-pip curl wget ca-certificates
sudo DEBIAN_FRONTEND=noninteractive apt -y --no-install-recommends install docker.io make 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 if [[ -z "${http_proxy}" ]]; then
sudo pip3 install $PACKAGES sudo pip3 install $PACKAGES
else else

View File

@ -126,8 +126,6 @@
vars: vars:
site_name: test-site site_name: test-site
gate_scripts: gate_scripts:
- ./tools/deployment/provider_common/03_install_pip.sh
- ./tools/deployment/provider_common/04_install_yq.sh
- ./tools/deployment/01_install_kubectl.sh - ./tools/deployment/01_install_kubectl.sh
# 21_systemwide_executable.sh is run in the build-gate pre-run above # 21_systemwide_executable.sh is run in the build-gate pre-run above
- ./tools/deployment/22_test_configs.sh - ./tools/deployment/22_test_configs.sh