mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-30 04:06:34 +09:00
fix(capi-providers-core): name the version the upgrade hook rejects
The hook reported every malformed version as an installed one, also when the bad value was the requested spec.version or the bridge or target release from the chart, which sent an operator to look at the wrong field. The message now says which version it checked. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la>
This commit is contained in:
2 files changed
+27
-11
No files matched your search
@@ -216,6 +216,22 @@ accepted_patches() {
|
||||
[ "$(accepted_patches)" = '[]' ]
|
||||
}
|
||||
|
||||
@test "a malformed requested version is reported as the requested one" {
|
||||
fixture '.providers["cluster-api"].spec.version = "invalid"'
|
||||
run bash "$UPGRADE_SCRIPT"
|
||||
[ "$status" -ne 0 ]
|
||||
[[ "$output" == *"invalid requested version: invalid"* ]]
|
||||
[ "$(accepted_patches)" = '[]' ]
|
||||
}
|
||||
|
||||
@test "a malformed target release is not reported as an installed version" {
|
||||
export TARGET_VERSION=invalid
|
||||
run bash "$UPGRADE_SCRIPT"
|
||||
[ "$status" -ne 0 ]
|
||||
[[ "$output" == *"invalid target version: invalid"* ]]
|
||||
[ "$(accepted_patches)" = '[]' ]
|
||||
}
|
||||
|
||||
@test "versions outside the intermediate upgrade window are rejected" {
|
||||
fixture '.providers["cluster-api"].status.installedVersion = "v1.9.0-core" | .providers["cluster-api"].spec.version = "v1.9.0-core"'
|
||||
run bash "$UPGRADE_SCRIPT"
|
||||
|
||||
Reference in new issue
Block a user