vmware-tanzu / vm-operator

Self-service manage your virtual infrastructure...
Other
106 stars 48 forks source link

🌱 Remove use of deprecated kustomize symbols #748

Closed akutz closed 1 month ago

akutz commented 1 month ago

What does this PR do, and why is it needed?

This patch updates the use of Kustomize to no longer use the deprecated symbols, ex. vars, patchesStrategicMerge, and patchesJson6902. These have been replaced with replacements and patches (respectively).

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 NA

Are there any special notes for your reviewer:

To validate this I ran make kustomize-local and applied it to a local Kind cluster to ensure the YAML was valid. I also ran the same on main and compared the results to the PR:

Local Deployment

diff -u config/local/infrastructure-components-original.yaml config/local/infrastructure-components.yaml
--- config/local/infrastructure-components-original.yaml    2024-10-15 12:08:48.362923758 -0500
+++ config/local/infrastructure-components.yaml 2024-10-16 13:47:53.555437716 -0500
@@ -13688,7 +13688,7 @@
   ports:
   - name: https
     port: 8443
-    targetPort: https
+    targetPort: metrics-server
   selector:
     control-plane: controller-manager
 ---
@@ -13703,7 +13703,7 @@
   ports:
   - name: http
     port: 80
-    targetPort: 9868
+    targetPort: wcv-server
   selector:
     app: web-console-validator
 ---
@@ -13716,7 +13716,7 @@
   ports:
   - name: https
     port: 443
-    targetPort: 9878
+    targetPort: webhook-server
   selector:
     control-plane: controller-manager
 ---
@@ -13725,9 +13725,6 @@
 metadata:
   annotations:
     kubectl.kubernetes.io/default-container: manager
-    webhooks.vmoperator.vmware.com/secret-volume-mount-path: /tmp/k8s-webhook-server/serving-certs
-    webhooks.vmoperator.vmware.com/secret-volume-name: cert
-    webhooks.vmoperator.vmware.com/service-container-port: "9878"
   labels:
     control-plane: controller-manager
     controller-tools.k8s.io: "1.0"
@@ -13871,7 +13868,7 @@
         name: kube-rbac-proxy
         ports:
         - containerPort: 8443
-          name: https
+          name: metrics-server
       nodeSelector:
         node-role.kubernetes.io/control-plane: ""
       terminationGracePeriodSeconds: 10
@@ -13933,6 +13930,7 @@
         name: web-console-validator
         ports:
         - containerPort: 9868
+          name: wcv-server
         resources:
           limits:
             cpu: 100m

WCP Deployment

diff -u config/wcp/infrastructure-components-original.yaml config/wcp/infrastructure-components.yaml
--- config/wcp/infrastructure-components-original.yaml  2024-10-15 12:07:58.960034322 -0500
+++ config/wcp/infrastructure-components.yaml   2024-10-16 13:49:40.977703430 -0500
@@ -12926,7 +12926,7 @@
   ports:
   - name: https
     port: 9848
-    targetPort: https
+    targetPort: metrics-server
   selector:
     control-plane: controller-manager
 ---
@@ -12941,7 +12941,7 @@
   ports:
   - name: http
     port: 80
-    targetPort: 9868
+    targetPort: wcv-server
   selector:
     app: web-console-validator
 ---
@@ -12954,7 +12954,7 @@
   ports:
   - name: https
     port: 443
-    targetPort: 9878
+    targetPort: webhook-server
   selector:
     control-plane: controller-manager
 ---
@@ -12963,9 +12963,6 @@
 metadata:
   annotations:
     kubectl.kubernetes.io/default-container: manager
-    webhooks.vmoperator.vmware.com/secret-volume-mount-path: /tmp/k8s-webhook-server/serving-certs
-    webhooks.vmoperator.vmware.com/secret-volume-name: cert
-    webhooks.vmoperator.vmware.com/service-container-port: "9878"
   labels:
     control-plane: controller-manager
     controller-tools.k8s.io: "1.0"
@@ -13133,7 +13130,7 @@
         name: kube-rbac-proxy
         ports:
         - containerPort: 9848
-          name: https
+          name: metrics-server
       hostNetwork: true
       nodeSelector:
         node-role.kubernetes.io/control-plane: ""
@@ -13210,6 +13207,7 @@
         name: web-console-validator
         ports:
         - containerPort: 9868
+          name: wcv-server
         resources:
           limits:
             cpu: 100m

I also checked local-vcsim and wcp-no-configmap, I just did not list them here. It is as expected, which means the changes are fine.

Please add a release note if necessary:

Replace deprecated kustomize symbols with components, replacements, and patches
github-actions[bot] commented 1 month ago

Code Coverage

Package Line Rate Health
github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/clustercontentlibraryitem 82%
github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/contentlibraryitem 85%
github.com/vmware-tanzu/vm-operator/controllers/contentlibrary/utils 97%
github.com/vmware-tanzu/vm-operator/controllers/infra/capability/configmap 86%
github.com/vmware-tanzu/vm-operator/controllers/infra/capability/crd 93%
github.com/vmware-tanzu/vm-operator/controllers/infra/configmap 71%
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/infra/validatingwebhookconfiguration 85%
github.com/vmware-tanzu/vm-operator/controllers/infra/zone 76%
github.com/vmware-tanzu/vm-operator/controllers/storageclass 94%
github.com/vmware-tanzu/vm-operator/controllers/storagepolicyquota 97%
github.com/vmware-tanzu/vm-operator/controllers/util/encoding 73%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachine/storagepolicyusage 99%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachine/virtualmachine 86%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachine/volume 88%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachineclass 75%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinepublishrequest 81%
github.com/vmware-tanzu/vm-operator/controllers/virtualmachinereplicaset 68%
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 80%
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/pkg/bitmask 100%
github.com/vmware-tanzu/vm-operator/pkg/builder 95%
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/capabilities 100%
github.com/vmware-tanzu/vm-operator/pkg/config/env 100%
github.com/vmware-tanzu/vm-operator/pkg/context/generic 100%
github.com/vmware-tanzu/vm-operator/pkg/context/operation 100%
github.com/vmware-tanzu/vm-operator/pkg/patch 78%
github.com/vmware-tanzu/vm-operator/pkg/prober 91%
github.com/vmware-tanzu/vm-operator/pkg/prober/probe 90%
github.com/vmware-tanzu/vm-operator/pkg/prober/worker 77%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere 75%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/client 80%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/clustermodules 71%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/config 89%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/contentlibrary 74%
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 79%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/session 71%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/storage 44%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/sysprep 100%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/vcenter 82%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/virtualmachine 84%
github.com/vmware-tanzu/vm-operator/pkg/providers/vsphere/vmlifecycle 67%
github.com/vmware-tanzu/vm-operator/pkg/record 78%
github.com/vmware-tanzu/vm-operator/pkg/topology 91%
github.com/vmware-tanzu/vm-operator/pkg/util 87%
github.com/vmware-tanzu/vm-operator/pkg/util/annotations 100%
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 87%
github.com/vmware-tanzu/vm-operator/pkg/util/kube/cource 100%
github.com/vmware-tanzu/vm-operator/pkg/util/kube/internal 100%
github.com/vmware-tanzu/vm-operator/pkg/util/kube/spq 100%
github.com/vmware-tanzu/vm-operator/pkg/util/paused 100%
github.com/vmware-tanzu/vm-operator/pkg/util/ptr 100%
github.com/vmware-tanzu/vm-operator/pkg/util/resize 97%
github.com/vmware-tanzu/vm-operator/pkg/util/vmopv1 92%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/client 64%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/vm 79%
github.com/vmware-tanzu/vm-operator/pkg/util/vsphere/watcher 86%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig 95%
github.com/vmware-tanzu/vm-operator/pkg/vmconfig/crypto 98%
github.com/vmware-tanzu/vm-operator/pkg/webconsolevalidation 100%
github.com/vmware-tanzu/vm-operator/services/vm-watcher 91%
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/unifiedstoragequota/validation 92%
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/virtualmachinereplicaset/validation 90%
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 83% (10349 / 12453)

Minimum allowed line rate is 79%