Skip to content

Commit

Permalink
move teardown
Browse files Browse the repository at this point in the history
  • Loading branch information
Zash committed Mar 11, 2025
1 parent e8bb2f0 commit af0c073
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions bin/apply.bash
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ apps_apply() {
log_info "---"
log_info "Start Apps ${action} on ${2/_/ }"

validate_version
# TODO ensure not in the middle of migration

if [ "${5:-}" == "--dry-run" ]; then
log_info "---"
log_info "Skipping apps ${action} because dry-run"
Expand Down
7 changes: 7 additions & 0 deletions bin/common.bash
Original file line number Diff line number Diff line change
Expand Up @@ -640,3 +640,10 @@ with_s3cfg() {
get_version() {
"${here}/ops.bash" kubectl "${1}" get cm -n kube-system apps-meta -o jsonpath --template='{.data.version}'
}


migration_status() {
local repo_version
repo_version="$(version_get)"
"${here}/ops.bash" kubectl "${1}" get cm -n kube-system apps-upgrade >/dev/null
}
5 changes: 4 additions & 1 deletion tests/integration/upgrade/bin-upgrade.bats
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ setup() {
# TODO set version in config, reset in-cluster version cm
}

teardown() {
ck8s ops kubectl sc delete -n kube-system configmap apps-version || true
}

teardown_file() {
local_cluster.delete
local_cluster.teardown
Expand Down Expand Up @@ -138,7 +142,6 @@ teardown_file() {
@test "no upgrade apply without upgrade prepare" {
# test 2
run yq -i '.global.ck8sVersion="v0.41.0"' "${CK8S_CONFIG_PATH}/defaults/common-config.yaml"
run ck8s ops kubectl sc delete -n kube-system configmap apps-version

gitversion.mock_static "v0.42.0"
run ck8s version config
Expand Down

0 comments on commit af0c073

Please sign in to comment.