upgrade: fix 2.6 -> 2.7 migration for 2.7.1 patch (#1649)

* upgrade: fix 2.6 -> 2.7 migration for 2.7.1 patch

Also correctly set microservice version from config.
Previously the key was ignored and microservices were always
tried for an upgrade.

* ci: add simulatedTargetVersion to e2e-upgrade

This allows us to build a CLI that reports the given version during
an upgrade test. With this we can test patch upgrades.

Signed-off-by: Otto Bittner <cobittner@posteo.net>

* ci: e2e-upgrade, case-insensitive string compare

* hack: fix v-prefixing in pseudo-version tool

pre-release versions and release versions behaved differently.
This lead to a duplicate v prefix in the cli's version.

Signed-off-by: Otto Bittner <cobittner@posteo.net>

---------

Signed-off-by: Otto Bittner <cobittner@posteo.net>
Co-authored-by: Otto Bittner <cobittner@posteo.net>
This commit is contained in:
Paul Meyer 2023-05-02 12:56:26 +02:00 committed by GitHub
parent 9bee6fc69c
commit 3a9291499b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 108 additions and 53 deletions

View file

@ -95,9 +95,15 @@ func main() {
default:
if !strings.Contains(*base, "pre") {
// "v2.7.0" inside the version.txt will lead to "v2.7.0" as version
fmt.Println(*base)
// "2.7.0" inside the version.txt will lead to "2.7.0" as version
if *skipV {
fmt.Println(strings.TrimPrefix(*base, "v"))
} else {
fmt.Println(*base)
}
} else {
// "2.7.0-pre" inside the version.txt will lead to "v2.7.0-pre.0.20230313121936-bab76e8a9acf" as version
// "v2.7.0-pre" inside the version.txt will lead to "v2.7.0-pre.0.20230313121936-bab76e8a9acf" as version
// "2.7.0-pre" inside the version.txt will lead to "v0.0.0-20230313121936-bab76e8a9acf" as version
fmt.Println(version)
}
}