vmware / go-vcloud-director

Golang SDK for VMware Cloud Director
Other
76 stars 79 forks source link

Fix TKG OVA template upgrade mechanism in CSE #663

Closed adambarreiro closed 2 months ago

adambarreiro commented 3 months ago

Description

The CSE UI Plugin allows to perform a cluster upgrade when the chosen OVA template only differs in the Kubernetes version (or in other words, the TKG version remains the same).

Our code, however, only allows to perform upgrades when both TKG version and Kubernetes version are higher, which is wrong.

This PR fixes this, by allowing the TKG version to be equal as well.

Testing

Environment: For instance, we can upload these two OVAs in the tkg catalog in VCD (they have both the same TKG version v2.4.0):

govcd_test_config.yaml: Set ovaName: "ubuntu-2004-kube-v1.26.8+vmware.1-tkg.1-b8c57a6c8c98d227f74e7b1a9eef27st" (the lowest Kubernetes version)

Then run Test_Cse (it should take 45-150min)

Without the patch, the update is skipped and it outputs:

WARNING: CseKubernetesCluster.UpgradeCluster method not tested. It was skipped as there's no OVA to upgrade the cluster

With the patch, upgrade should be run and the warning does not appear.