Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Ignore zshippable in minor version during upgrade #4378

Closed

Conversation

adduarte
Copy link

@adduarte adduarte commented Feb 14, 2023

During dev testing of cluster upgrade functionality, some of the package versions will have the postfix "-zshippable".

The libraries used to compare versions of packages during upgrade look at a version string like "0.12.1+vmware.2-tkg.2-zshippable", and assume the minor version, "2-zshippable", is a non-number.

The libraries also look at a version string like "0.12.1+vmware.2-tkg.3", and assume the minor version "3" is a number.

The problem comes about because the same libraries see a non-number minor version as newer than any number version.
So the version 0.12.1+vmware.2-tkg.2-zshippable is newer than 0.12.1+vmware.2-tkg.3, which is incorrect

To allow for dev testing to proceed we remove the "-zshippable" postfix right before the version strings are compared.

What this PR does / why we need it

Which issue(s) this PR fixes

Fixes #4379

Describe testing done for PR

Unit test added

Release note

the postfix "-zshippable" is ignore when comparing package versions during upgrade.

Additional information

Special notes for your reviewer

@codecov
Copy link

codecov bot commented Feb 14, 2023

Codecov Report

Merging #4378 (c8c4d34) into main (0c0f23e) will decrease coverage by 0.91%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #4378      +/-   ##
==========================================
- Coverage   49.52%   48.61%   -0.91%     
==========================================
  Files         452      482      +30     
  Lines       44986    47108    +2122     
==========================================
+ Hits        22278    22901     +623     
- Misses      20584    22031    +1447     
- Partials     2124     2176      +52     
Impacted Files Coverage Δ
addons/webhooks/clusterbootstrap_webhook.go 45.47% <100.00%> (+0.29%) ⬆️
addons/controllers/addon_controller.go 63.40% <0.00%> (-2.07%) ⬇️
...ons/controllers/packageinstallstatus_controller.go 77.99% <0.00%> (-1.16%) ⬇️
addons/controllers/clusterbootstrap_controller.go 64.50% <0.00%> (-0.09%) ⬇️
cmd/cli/plugin/cluster/delete_node_pool.go 16.66% <0.00%> (ø)
cmd/cli/plugin/cluster/get.go 6.27% <0.00%> (ø)
.../isolated-cluster/imgpkginterface/client_imgpkg.go 0.00% <0.00%> (ø)
cmd/cli/plugin/cluster/delete.go 12.50% <0.00%> (ø)
.../cli/plugin/cluster/get_machinehealthcheck_node.go 9.30% <0.00%> (ø)
cmd/cli/plugin/isolated-cluster/main.go 0.00% <0.00%> (ø)
... and 27 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

During dev testing of cluster upgrade functionality,
some  of the package versions will have the postfix "-zshippable".

The libraries used to compare versions of packages during upgrade
look at a version string like "0.12.1+vmware.2-tkg.2-zshippable",
and assume the minor version, "2-zshippable", is a non-number.

The libraries also look at a version string like "0.12.1+vmware.2-tkg.3",
and assume the minor version "3" is a number.

The problem comes about because the same libraries see a non-number
minor version as newer than any number version.
So the version 0.12.1+vmware.2-tkg.2-zshippable is newer than
0.12.1+vmware.2-tkg.3, which is incorrect

To allow for dev testing to proceed we remove the "-zshippable" postfix
right before the version strings are compared.
@adduarte adduarte force-pushed the topic/adduarte/fix_upgrade_version_build_comparison branch from f4f405e to c8c4d34 Compare February 14, 2023 18:50
@adduarte adduarte closed this Mar 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zshippable in minor versions cause upgrade to fail
2 participants