🐛 Honor v1a1 VMMetadata ConfigMapName in v1a3 using annotations
What does this PR do, and why is it needed?
Our initial implementation involved a configMap fallback when the secret for the VM was not present. This can cause issues when a secret with the same name is present in the same namespace. Therefore, this change populates an annotation during up conversion to handle cases where v1a3 needs to use a configMap instead of a secret. On down conversion back to v1a1, the ConfigMapName field is set based on existance of the same annotation.
Which issue(s) is/are addressed by this PR? (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #486
Are there any special notes for your reviewer:
Testing done on supervisor -- Deployed a VM in a namespace having both a secret and configMap of the same name. v1a1 VM referencing the configMap used the same to bootstrap instead of the secret. Also verified that the annotation exists on the v1a3 VM and not on the v1a1 VM on down conversion.
Please add a release note if necessary:
Honors v1a1 VMMetadata ConfigMapName field in v1a3 using annotations since v1a3 does not directly support bootstrapping via configMap transport resource
| Package | Line Rate | Health |
|---|---|---|
| github.com/vmware-tanzu/vm-operator/api/v1alpha1 | 42% | ❌ |
| github.com/vmware-tanzu/vm-operator/api/v1alpha2 | 9% | ❌ |
| github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/clustercontentlibraryitem | 82% | ✔ |
| github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/contentlibraryitem | 86% | ✔ |
| github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/utils | 32% | ❌ |
| github.com/vmware-tanzu/vm-operator/controllers/infra/configmap | 73% | ➖ |
| github.com/vmware-tanzu/vm-operator/controllers/infra/node | 77% | ➖ |
| github.com/vmware-tanzu/vm-operator/controllers/infra/secret | 77% | ➖ |
| github.com/vmware-tanzu/vm-operator/controllers/util/encoding | 73% | ➖ |
| github.com/vmware-tanzu/vm-operator/controllers/virtualmachine | 69% | ➖ |
| github.com/vmware-tanzu/vm-operator/controllers/virtualmachineclass | 21% | ❌ |
| github.com/vmware-tanzu/vm-operator/controllers/virtualmachinepublishrequest | 81% | ✔ |
| github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice | 83% | ✔ |
| github.com/vmware-tanzu/vm-operator/controllers/virtualmachineservice/providers | 92% | ✔ |
| github.com/vmware-tanzu/vm-operator/controllers/virtualmachinesetresourcepolicy | 81% | ✔ |
| github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1 | 72% | ➖ |
| github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1/conditions | 88% | ✔ |
| github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha1/patch | 78% | ➖ |
| github.com/vmware-tanzu/vm-operator/controllers/virtualmachinewebconsolerequest/v1alpha2 | 73% | ➖ |
| github.com/vmware-tanzu/vm-operator/controllers/volume | 86% | ✔ |
| github.com/vmware-tanzu/vm-operator/pkg/conditions | 88% | ✔ |
| github.com/vmware-tanzu/vm-operator/pkg/config | 100% | ✔ |
| github.com/vmware-tanzu/vm-operator/pkg/config/env | 100% | ✔ |
| github.com/vmware-tanzu/vm-operator/pkg/patch | 16% | ❌ |
| github.com/vmware-tanzu/vm-operator/pkg/prober | 54% | ❌ |
| github.com/vmware-tanzu/vm-operator/pkg/prober/probe | 91% | ✔ |
| github.com/vmware-tanzu/vm-operator/pkg/prober/worker | 77% | ➖ |
| github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere | 71% | ➖ |
| github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/client | 57% | ❌ |
| github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/clustermodules | 71% | ➖ |
| github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/config | 72% | ➖ |
| github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/contentlibrary | 72% | ➖ |
| github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/credentials | 100% | ✔ |
| github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/network | 80% | ➖ |
| github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/placement | 77% | ➖ |
| github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/session | 34% | ❌ |
| github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/sysprep | 100% | ✔ |
| github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/vcenter | 83% | ✔ |
| github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/virtualmachine | 75% | ➖ |
| github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/vmlifecycle | 66% | ➖ |
| github.com/vmware-tanzu/vm-operator/pkg/record | 78% | ➖ |
| github.com/vmware-tanzu/vm-operator/pkg/topology | 55% | ❌ |
| github.com/vmware-tanzu/vm-operator/pkg/util | 78% | ➖ |
| github.com/vmware-tanzu/vm-operator/pkg/util/cloudinit | 89% | ✔ |
| github.com/vmware-tanzu/vm-operator/pkg/util/cloudinit/validate | 91% | ✔ |
| github.com/vmware-tanzu/vm-operator/pkg/util/image | 100% | ✔ |
| github.com/vmware-tanzu/vm-operator/pkg/util/kube | 90% | ✔ |
| github.com/vmware-tanzu/vm-operator/pkg/util/vmopv1 | 93% | ✔ |
| github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/client | 68% | ➖ |
| github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/vm | 78% | ➖ |
| github.com/vmware-tanzu/vm-operator/pkg/webconsolevalidation | 51% | ❌ |
| github.com/vmware-tanzu/vm-operator/webhooks/common | 100% | ✔ |
| github.com/vmware-tanzu/vm-operator/webhooks/persistentvolumeclaim/validation | 95% | ✔ |
| github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/mutation | 87% | ✔ |
| github.com/vmware-tanzu/vm-operator/webhooks/virtualmachine/validation | 95% | ✔ |
| github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/mutation | 62% | ➖ |
| github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineclass/validation | 89% | ✔ |
| github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinepublishrequest/validation | 92% | ✔ |
| github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/mutation | 67% | ➖ |
| github.com/vmware-tanzu/vm-operator/webhooks/virtualmachineservice/validation | 92% | ✔ |
| github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinesetresourcepolicy/validation | 89% | ✔ |
| github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinewebconsolerequest/v1alpha1/validation | 92% | ✔ |
| github.com/vmware-tanzu/vm-operator/webhooks/virtualmachinewebconsolerequest/v1alpha2/validation | 92% | ✔ |
| Summary | 56% (8158 / 14539) | ❌ |