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

Fix upgrade check to allow upgrades to 2.x.x #3990

Merged
merged 1 commit into from
Dec 1, 2022

Conversation

tenczar
Copy link
Contributor

@tenczar tenczar commented Nov 23, 2022

This change updates are upgrade validation logic to allow users to upgrade from 1.6.x to 2.x.x. It will return an error if a user attempts to upgrade from a version less than 1.6 or if they try to upgrade to major version 3. Obviously that check will need to be updated on release of major version 3.

What this PR does / why we need it

This fix allows us to move to TKG with major version 2. A previous check would throw an error if the major version was changed.

Which issue(s) this PR fixes

Fixes #

Describe testing done for PR

Updated unit tests to include validation that upgrades to major version 3 still throw an error. Also added test to make sure an error is thrown when upgrade to v2 from a version less than v1.6

Release note

Upgrades to major version 2 no longer throw an error.

Additional information

Special notes for your reviewer

@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3990/20221123203036/clustergen.diff.txt
Author/reviewers:
Please review to verify that the effects on the generated cluster configurations are exactly what the PR intended, and give a thumbs-up if so.

@codecov
Copy link

codecov bot commented Nov 23, 2022

Codecov Report

Merging #3990 (c0f742c) into main (69bb600) will decrease coverage by 0.86%.
The diff coverage is 26.31%.

@@            Coverage Diff             @@
##             main    #3990      +/-   ##
==========================================
- Coverage   48.22%   47.36%   -0.87%     
==========================================
  Files         433      456      +23     
  Lines       43122    44597    +1475     
==========================================
+ Hits        20795    21122     +327     
- Misses      20343    21469    +1126     
- Partials     1984     2006      +22     
Impacted Files Coverage Δ
tkg/client/client.go 81.25% <ø> (ø)
tkg/client/init.go 4.87% <0.00%> (-0.08%) ⬇️
tkg/clusterclient/clusterclient.go 48.20% <0.00%> (-0.08%) ⬇️
tkg/client/upgrade_region.go 23.70% <100.00%> (+0.35%) ⬆️
addons/controllers/clusterbootstrap_controller.go 64.75% <0.00%> (-1.64%) ⬇️
...ons/controllers/packageinstallstatus_controller.go 79.15% <0.00%> (-1.16%) ⬇️
...i/plugin/cluster/delete_machinehealthcheck_node.go 16.66% <0.00%> (ø)
cmd/cli/plugin/cluster/credentials_update.go 8.73% <0.00%> (ø)
... and 22 more

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

tkg/client/upgrade_region.go Outdated Show resolved Hide resolved
tkg/client/upgrade_region.go Outdated Show resolved Hide resolved
tkg/client/upgrade_region_test.go Outdated Show resolved Hide resolved
This change updates are upgrade validation logic to allow users to
upgrade from 1.6.x to 2.x.x. It will return an error if a user attempts
to upgrade from a version less than 1.6 or if they try to upgrade to
major version 3. Obviously that check will need to be updated on release
of major version 3.
@tenczar tenczar force-pushed the update_major_ver_change branch from 6af682b to c0f742c Compare November 30, 2022 00:55
@github-actions
Copy link

Cluster Generation A/B Results:
https://storage.googleapis.com/tkg-clustergen/3990/20221130011038/clustergen.diff.txt
Author/reviewers:
Please review to verify that the effects on the generated cluster configurations are exactly what the PR intended, and give a thumbs-up if so.

Copy link
Member

@zjs zjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tenczar tenczar added the ok-to-merge PRs should be labelled with this before merging label Dec 1, 2022
@tenczar tenczar merged commit 99a8d0f into vmware-tanzu:main Dec 1, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
cla-not-required ok-to-merge PRs should be labelled with this before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants