Skip to content

Commit

Permalink
Set spec.api.externalAddress for smoke-tests
Browse files Browse the repository at this point in the history
Signed-off-by: Kimmo Lehto <[email protected]>
  • Loading branch information
kke committed Nov 25, 2024
1 parent 6a5d5c7 commit 58c3c61
Show file tree
Hide file tree
Showing 23 changed files with 50 additions and 1 deletion.
2 changes: 2 additions & 0 deletions smoke-test/k0sctl-controller-swap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ spec:
version: "${K0S_VERSION}"
config:
spec:
api:
externalAddress: "${EXTERNAL_ADDRESS}"
telemetry:
enabled: false

2 changes: 2 additions & 0 deletions smoke-test/k0sctl-downloadurl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ spec:
k0s:
config:
spec:
api:
externalAddress: "${EXTERNAL_ADDRESS}"
telemetry:
enabled: false
2 changes: 2 additions & 0 deletions smoke-test/k0sctl-dryrun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ spec:
version: "${K0S_VERSION}"
config:
spec:
api:
externalAddress: "${EXTERNAL_ADDRESS}"
telemetry:
enabled: false
2 changes: 2 additions & 0 deletions smoke-test/k0sctl-dynamic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ spec:
dynamicConfig: true
config:
spec:
api:
externalAddress: "${EXTERNAL_ADDRESS}"
telemetry:
enabled: false
2 changes: 2 additions & 0 deletions smoke-test/k0sctl-files.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,7 @@ spec:
version: "$K0S_VERSION"
config:
spec:
api:
externalAddress: "${EXTERNAL_ADDRESS}"
telemetry:
enabled: false
2 changes: 2 additions & 0 deletions smoke-test/k0sctl-installflags.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ spec:
version: "${K0S_VERSION}"
config:
spec:
api:
externalAddress: "${EXTERNAL_ADDRESS}"
telemetry:
enabled: false
2 changes: 2 additions & 0 deletions smoke-test/k0sctl-openssh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ spec:
version: "${K0S_VERSION}"
config:
spec:
api:
externalAddress: "${EXTERNAL_ADDRESS}"
telemetry:
enabled: false
2 changes: 2 additions & 0 deletions smoke-test/k0sctl-rootless.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ spec:
version: "${K0S_VERSION}"
config:
spec:
api:
externalAddress: "${EXTERNAL_ADDRESS}"
telemetry:
enabled: false
4 changes: 3 additions & 1 deletion smoke-test/k0sctl-single.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,7 @@ spec:
version: "$K0S_VERSION"
config:
spec:
api:
externalAddress: "${EXTERNAL_ADDRESS}"
telemetry:
enabled: false
enabled: false
2 changes: 2 additions & 0 deletions smoke-test/k0sctl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@ spec:
version: "${K0S_VERSION}"
config:
spec:
api:
externalAddress: "${EXTERNAL_ADDRESS}"
telemetry:
enabled: false
2 changes: 2 additions & 0 deletions smoke-test/smoke-backup-restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ runCleanup() {

deleteCluster
createCluster
export EXTERNAL_ADDRESS=$(externalAddress)

../k0sctl init
../k0sctl apply --config "${K0SCTL_CONFIG}" --debug

Expand Down
2 changes: 2 additions & 0 deletions smoke-test/smoke-basic-openssh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ cleanup_openssh() {
deleteCluster
createCluster

export EXTERNAL_ADDRESS=$(externalAddress)

echo "* Create SSH config"
mkdir -p ~/.ssh
mkdir -p ssh
Expand Down
2 changes: 2 additions & 0 deletions smoke-test/smoke-basic-rootless.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ trap cleanup EXIT
deleteCluster
createCluster

export EXTERNAL_ADDRESS=$(externalAddress)

for host in manager0 worker0; do
echo "* Creating ${SSH_USER} on ${host}"
bootloose ssh "root@${host}" -- groupadd --system k0sctl-admin
Expand Down
2 changes: 2 additions & 0 deletions smoke-test/smoke-basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ trap cleanup EXIT
deleteCluster
createCluster

export EXTERNAL_ADDRESS=$(externalAddress)

echo "* Starting apply"
../k0sctl apply --config "${K0SCTL_CONFIG}" --kubeconfig-out applykubeconfig --debug
echo "* Apply OK"
Expand Down
2 changes: 2 additions & 0 deletions smoke-test/smoke-controller-swap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ trap cleanup EXIT
deleteCluster
createCluster

export EXTERNAL_ADDRESS=$(externalAddress)

echo "* Starting apply"
../k0sctl apply --config "${K0SCTL_CONFIG}" --debug
echo "* Apply OK"
Expand Down
2 changes: 2 additions & 0 deletions smoke-test/smoke-dryrun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ applyConfig() {
deleteCluster
createCluster

export EXTERNAL_ADDRESS=$(externalAddress)

K0S_VERSION="${K0S_FROM}"

colorEcho 3 "Installing ${K0S_VERSION} with --dry-run"
Expand Down
2 changes: 2 additions & 0 deletions smoke-test/smoke-dynamic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ trap cleanup EXIT
deleteCluster
createCluster

export EXTERNAL_ADDRESS=$(externalAddress)

echo "* Starting apply"
../k0sctl apply --config "${K0SCTL_CONFIG}" --debug
echo "* Apply OK"
Expand Down
2 changes: 2 additions & 0 deletions smoke-test/smoke-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ envsubst < k0sctl-files.yaml.tpl > k0sctl.yaml
deleteCluster
createCluster

export EXTERNAL_ADDRESS=$(externalAddress)

remoteCommand() {
local userhost="$1"
shift
Expand Down
2 changes: 2 additions & 0 deletions smoke-test/smoke-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ trap cleanup EXIT

deleteCluster
createCluster

# this will not work as init does not set spec.api.externalAddress
../k0sctl init --key-path ./id_rsa_k0s 127.0.0.1:9022 [email protected]:9023 | ../k0sctl apply --config - --debug
2 changes: 2 additions & 0 deletions smoke-test/smoke-reinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ trap cleanup EXIT
deleteCluster
createCluster

export EXTERNAL_ADDRESS=$(externalAddress)

remoteCommand() {
local userhost="$1"
shift
Expand Down
3 changes: 3 additions & 0 deletions smoke-test/smoke-reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ trap cleanup EXIT

deleteCluster
createCluster

export EXTERNAL_ADDRESS=$(externalAddress)

echo "* Applying"
../k0sctl apply --config "${K0SCTL_CONFIG}" --debug
echo "* Resetting"
Expand Down
2 changes: 2 additions & 0 deletions smoke-test/smoke-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ trap cleanup EXIT
deleteCluster
createCluster

export EXTERNAL_ADDRESS=$(externalAddress)

remoteCommand() {
local userhost="$1"
shift
Expand Down
4 changes: 4 additions & 0 deletions smoke-test/smoke.common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ export PRESERVE_CLUSTER="${PRESERVE_CLUSTER:-""}"
export DISABLE_TELEMETRY=true
export K0S_VERSION

externalAddress() {
bootloose show manager0 -o json | grep '"ip":' | head -1 | cut -d'"' -f4
}

createCluster() {
envsubst < "${BOOTLOOSE_TEMPLATE}" > bootloose.yaml
bootloose create
Expand Down

0 comments on commit 58c3c61

Please sign in to comment.