Repository: kubernetes-sigs/cluster-api-provider-vsphere

Issue:
Automate update of vm-operator CRDs
/kind cleanup

under `config/deployments/integration-tests/crds` we store a copy of vm-operators CRDs that currently must be updated manually.

in order to improve this, we can use the same machinery we are using to create test images for the vm-operator, which are cloning the repo in a temporary folder



Hints from issue comments:
@k8s-triage-robot: The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:
- After 90d of inactivity, `lifecycle/stale` is applied
- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied
- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed

You can:
- Mark this issue as fresh with `/remove-lifecycle stale`
- Close this issue with `/close`
- Offer to help out with [Issue Triage][1]

Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community).

/lifecycle stale

[1]: https://www.kubernetes.dev/docs/guide/issue-triage/@chrischdi: /remove-lifecycle stale@k8s-triage-robot: The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:
- After 90d of inactivity, `lifecycle/stale` is applied
- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied
- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed

You can:
- Mark this issue as fresh with `/remove-lifecycle stale`
- Close this issue with `/close`
- Offer to help out with [Issue Triage][1]

Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community).

/lifecycle stale

[1]: https://www.kubernetes.dev/docs/guide/issue-triage/@k8s-triage-robot: The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:
- After 90d of inactivity, `lifecycle/stale` is applied
- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied
- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed

You can:
- Mark this issue as fresh with `/remove-lifecycle rotten`
- Close this issue with `/close`
- Offer to help out with [Issue Triage][1]

Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community).

/lifecycle rotten

[1]: https://www.kubernetes.dev/docs/guide/issue-triage/@fabriziopandini: /remove-lifecycle rotten
Let's keep this around for some time more while we get a better understanding of what this bump really implies (not sure it can be automated/it is worth the effort given that we are not bumping so frequently)@k8s-triage-robot: The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:
- After 90d of inactivity, `lifecycle/stale` is applied
- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied
- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed

You can:
- Mark this issue as fresh with `/remove-lifecycle stale`
- Close this issue with `/close`
- Offer to help out with [Issue Triage][1]

Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community).

/lifecycle stale

[1]: https://www.kubernetes.dev/docs/guide/issue-triage/@k8s-triage-robot: The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:
- After 90d of inactivity, `lifecycle/stale` is applied
- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied
- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed

You can:
- Mark this issue as fresh with `/remove-lifecycle rotten`
- Close this issue with `/close`
- Offer to help out with [Issue Triage][1]

Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community).

/lifecycle rotten

[1]: https://www.kubernetes.dev/docs/guide/issue-triage/@chrischdi: /remove-lifecycle rotten@k8s-triage-robot: The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:
- After 90d of inactivity, `lifecycle/stale` is applied
- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied
- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed

You can:
- Mark this issue as fresh with `/remove-lifecycle stale`
- Close this issue with `/close`
- Offer to help out with [Issue Triage][1]

Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community).

/lifecycle stale

[1]: https://www.kubernetes.dev/docs/guide/issue-triage/@fabriziopandini: /close
Due to lack of bandwidth@k8s-ci-robot: @fabriziopandini: Closing this issue.

<details>

In response to [this](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/issues/2922#issuecomment-2976017459):

>/close
>Due to lack of bandwidth


Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
</details>

Solution patch:
diff --git a/go.mod b/go.mod
index c76f7c0a..b6a783e3 100644
--- a/go.mod
+++ b/go.mod
@@ -4,6 +4,8 @@ go 1.21
 
 replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.7.0
 
+replace github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels => github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels v0.0.0-20240404200847-de75746a9505
+
 require (
 	github.com/blang/semver/v4 v4.0.0
 	github.com/go-logr/logr v1.4.1
@@ -14,11 +16,11 @@ require (
 	github.com/pkg/errors v0.9.1
 	github.com/spf13/cobra v1.8.0
 	github.com/stretchr/testify v1.9.0
-	github.com/vmware-tanzu/net-operator-api v0.0.0-20231019160108-42131d6e8360
+	github.com/vmware-tanzu/net-operator-api v0.0.0-20240326163340-1f32d6bf7f9d
 	github.com/vmware-tanzu/nsx-operator/pkg/apis v0.1.0
-	github.com/vmware-tanzu/vm-operator/api v1.8.5
-	github.com/vmware-tanzu/vm-operator/external/ncp v0.0.0-20231214185006-5477585eebfd
-	github.com/vmware-tanzu/vm-operator/external/tanzu-topology v0.0.0-20231214185006-5477585eebfd
+	github.com/vmware-tanzu/vm-operator/api v1.8.6
+	github.com/vmware-tanzu/vm-operator/external/ncp v0.0.0-20240404200847-de75746a9505
+	github.com/vmware-tanzu/vm-operator/external/tanzu-topology v0.0.0-20240404200847-de75746a9505
 	github.com/vmware/govmomi v0.37.0
 	golang.org/x/exp v0.0.0-20230905200255-921286631fa9
 	golang.org/x/mod v0.17.0
diff --git a/go.sum b/go.sum
index 86cfa119..eb06dcd1 100644
--- a/go.sum
+++ b/go.sum
@@ -549,16 +549,18 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1
 github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE=
 github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk=
 github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
-github.com/vmware-tanzu/net-operator-api v0.0.0-20231019160108-42131d6e8360 h1:yG158jviUd3wRqCTJcSDzp+prUZWtSA9dhfm/Rf8m9M=
-github.com/vmware-tanzu/net-operator-api v0.0.0-20231019160108-42131d6e8360/go.mod h1:dtVG693FvGuOSxJvTaKRVGU0EJR8yvLG3E2VaDDHILM=
+github.com/vmware-tanzu/net-operator-api v0.0.0-20240326163340-1f32d6bf7f9d h1:cgx9UH/r53bKU/Gbv8IPsUZ34bj5+ItijA2JCUS3kVk=
+github.com/vmware-tanzu/net-operator-api v0.0.0-20240326163340-1f32d6bf7f9d/go.mod h1:JbFOh22iDsT5BowJe0GgpMI5e2/S7cWaJlv9LdURVQM=
 github.com/vmware-tanzu/nsx-operator/pkg/apis v0.1.0 h1:HdnQb/X9vJ8a5WQ03g/0nDr9igIIK1fF6wO5wOtkJT4=
 github.com/vmware-tanzu/nsx-operator/pkg/apis v0.1.0/go.mod h1:Q4JzNkNMvjo7pXtlB5/R3oME4Nhah7fAObWgghVmtxk=
-github.com/vmware-tanzu/vm-operator/api v1.8.5 h1:E8rpRdV8+cNp/eNZ/QUHvlrbpPh8uk6bKqwEEmGWe64=
-github.com/vmware-tanzu/vm-operator/api v1.8.5/go.mod h1:SXaSFtnw2502Tzy0bfQVHrvbFDijR96r1ihUYQWPOK8=
-github.com/vmware-tanzu/vm-operator/external/ncp v0.0.0-20231214185006-5477585eebfd h1:qdfVf7KFW+XX7+D4xC/mlBpRA9+B+opdDPxGdqjxO+4=
-github.com/vmware-tanzu/vm-operator/external/ncp v0.0.0-20231214185006-5477585eebfd/go.mod h1:5rqRJ9zGR+KnKbkGx373WgN8xJpvAj99kHnfoDYRO5I=
-github.com/vmware-tanzu/vm-operator/external/tanzu-topology v0.0.0-20231214185006-5477585eebfd h1:BleW2NxLCPbLvFoTzhoX/DsjCJuKyEdcmvYiY04k18U=
-github.com/vmware-tanzu/vm-operator/external/tanzu-topology v0.0.0-20231214185006-5477585eebfd/go.mod h1:dfYrWS8DMRN+XZfhu8M4LVHmeGvYB29Ipd7j4uIq+mU=
+github.com/vmware-tanzu/vm-operator/api v1.8.6 h1:NIndORjcnSmIlQsCMIewpIwg/ocRVDh2lYjOroTVLrU=
+github.com/vmware-tanzu/vm-operator/api v1.8.6/go.mod h1:HHA2SNI9B5Yqtyp5t+Gt9WTWBi/fIkM6+MukDDSf11A=
+github.com/vmware-tanzu/vm-operator/external/ncp v0.0.0-20240404200847-de75746a9505 h1:y4wXx1FUFqqSgJ/xUOEM1DLS2Uu0KaeLADWpzpioGTU=
+github.com/vmware-tanzu/vm-operator/external/ncp v0.0.0-20240404200847-de75746a9505/go.mod h1:5rqRJ9zGR+KnKbkGx373WgN8xJpvAj99kHnfoDYRO5I=
+github.com/vmware-tanzu/vm-operator/external/tanzu-topology v0.0.0-20240404200847-de75746a9505 h1:/6vFL20UMHOeTf/mb+dKf5sFG0FBbyrCBY/71QKAIE0=
+github.com/vmware-tanzu/vm-operator/external/tanzu-topology v0.0.0-20240404200847-de75746a9505/go.mod h1:dfYrWS8DMRN+XZfhu8M4LVHmeGvYB29Ipd7j4uIq+mU=
+github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels v0.0.0-20240404200847-de75746a9505 h1:LRMZ+zzb944d6r+uYsE+CuJ3zVBE6Hc8vjH7IJX2QY4=
+github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels v0.0.0-20240404200847-de75746a9505/go.mod h1:M+6bZCS8vSjCN9OOppnAyYxeBxY1U0wG6+j3CvIrOHY=
 github.com/vmware/govmomi v0.37.0 h1:xX5AnIrVn4yfH0fYSjyjMg/Kq6q7cNxA+vyfV5YcF70=
 github.com/vmware/govmomi v0.37.0/go.mod h1:mtGWtM+YhTADHlCgJBiskSRPOZRsN9MSjPzaZLte/oQ=
 github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8=



Test patch:
diff --git a/config/deployments/integration-tests/crds/vmoperator.vmware.com_clustervirtualmachineimages.yaml b/config/deployments/integration-tests/crds/vmoperator.vmware.com_clustervirtualmachineimages.yaml
index 054b89dc..6cf19e44 100644
--- a/config/deployments/integration-tests/crds/vmoperator.vmware.com_clustervirtualmachineimages.yaml
+++ b/config/deployments/integration-tests/crds/vmoperator.vmware.com_clustervirtualmachineimages.yaml
@@ -220,8 +220,14 @@ spec:
                   type: object
                 type: array
               contentLibraryRef:
-                description: ContentLibraryRef is a reference to the source ContentLibrary/ClusterContentLibrary
-                  resource.
+                description: "ContentLibraryRef is a reference to the source ContentLibrary/ClusterContentLibrary
+                  resource. \n Deprecated: This field is provider specific but the
+                  VirtualMachineImage types are intended to be provider generic. This
+                  field does not exist in later API versions. Instead, the Spec.ProviderRef
+                  field should be used to look up the provider. For images provided
+                  by a Content Library, the ProviderRef will point to either a ContentLibraryItem
+                  or ClusterContentLibraryItem that contains a reference to the Content
+                  Library."
                 properties:
                   apiGroup:
                     description: APIGroup is the group for the resource being referenced.
diff --git a/config/deployments/integration-tests/crds/vmoperator.vmware.com_virtualmachineclasses.yaml b/config/deployments/integration-tests/crds/vmoperator.vmware.com_virtualmachineclasses.yaml
index 6f8f7033..6a937db6 100644
--- a/config/deployments/integration-tests/crds/vmoperator.vmware.com_virtualmachineclasses.yaml
+++ b/config/deployments/integration-tests/crds/vmoperator.vmware.com_virtualmachineclasses.yaml
@@ -14,7 +14,7 @@ spec:
     shortNames:
     - vmclass
     singular: virtualmachineclass
-  scope: Cluster
+  scope: Namespaced
   versions:
   - additionalPrinterColumns:
     - jsonPath: .spec.hardware.cpus
diff --git a/config/deployments/integration-tests/crds/vmoperator.vmware.com_virtualmachineimages.yaml b/config/deployments/integration-tests/crds/vmoperator.vmware.com_virtualmachineimages.yaml
index ad229a32..aea270e1 100644
--- a/config/deployments/integration-tests/crds/vmoperator.vmware.com_virtualmachineimages.yaml
+++ b/config/deployments/integration-tests/crds/vmoperator.vmware.com_virtualmachineimages.yaml
@@ -15,7 +15,7 @@ spec:
     - vmi
     - vmimage
     singular: virtualmachineimage
-  scope: Cluster
+  scope: Namespaced
   versions:
   - additionalPrinterColumns:
     - jsonPath: .status.imageName
@@ -220,8 +220,14 @@ spec:
                   type: object
                 type: array
               contentLibraryRef:
-                description: ContentLibraryRef is a reference to the source ContentLibrary/ClusterContentLibrary
-                  resource.
+                description: "ContentLibraryRef is a reference to the source ContentLibrary/ClusterContentLibrary
+                  resource. \n Deprecated: This field is provider specific but the
+                  VirtualMachineImage types are intended to be provider generic. This
+                  field does not exist in later API versions. Instead, the Spec.ProviderRef
+                  field should be used to look up the provider. For images provided
+                  by a Content Library, the ProviderRef will point to either a ContentLibraryItem
+                  or ClusterContentLibraryItem that contains a reference to the Content
+                  Library."
                 properties:
                   apiGroup:
                     description: APIGroup is the group for the resource being referenced.
diff --git a/config/deployments/integration-tests/crds/vmoperator.vmware.com_virtualmachines.yaml b/config/deployments/integration-tests/crds/vmoperator.vmware.com_virtualmachines.yaml
index 9119ff6f..63dc346c 100644
--- a/config/deployments/integration-tests/crds/vmoperator.vmware.com_virtualmachines.yaml
+++ b/config/deployments/integration-tests/crds/vmoperator.vmware.com_virtualmachines.yaml
@@ -98,11 +98,21 @@ spec:
                   description.
                 type: string
               imageName:
-                description: ImageName describes the name of a VirtualMachineImage
-                  that is to be used as the base Operating System image of the desired
-                  VirtualMachine instances.  The VirtualMachineImage resources can
-                  be introspected to discover identifying attributes that may help
-                  users to identify the desired image to use.
+                description: "ImageName describes the name of the image resource used
+                  to deploy this VM. \n This field may be used to specify the name
+                  of a VirtualMachineImage or ClusterVirtualMachineImage resource.
+                  The resolver first checks to see if there is a VirtualMachineImage
+                  with the specified name. If no such resource exists, the resolver
+                  then checks to see if there is a ClusterVirtualMachineImage resource
+                  with the specified name in the same Namespace as the VM being deployed.
+                  \n This field may also be used to specify the display name (vSphere
+                  name) of a VirtualMachineImage or ClusterVirtualMachineImage resource.
+                  If the display name unambiguously resolves to a distinct VM image
+                  (among all existing VirtualMachineImages in the VM's namespace and
+                  all existing ClusterVirtualMachineImages), then a mutation webhook
+                  updates this field with the VM image resource name. If the display
+                  name resolves to multiple or no VM images, then the mutation webhook
+                  denies the request and outputs an error message accordingly."
                 type: string
               minHardwareVersion:
                 description: "MinHardwareVersion specifies the desired minimum hardware
@@ -120,29 +130,30 @@ spec:
                   field's value is 13, then the VM will be upgraded to hardware version
                   13. However, if the observed hardware version is 17 and this field's
                   value is 13, no change will occur. \n Several features are hardware
-                  version dependent, for example: \n * NVMe Controllers        \t\t
-                  >= 14 * Dynamic Direct Path I/O devices >= 17 \n Please refer to
-                  https://kb.vmware.com/s/article/1003746 for a list of VM hardware
-                  versions. \n It is important to remember that a VM's hardware version
-                  may not be downgraded and upgrading a VM deployed from an image
-                  based on an older hardware version to a more recent one may result
-                  in unpredictable behavior. In other words, please be careful when
-                  choosing to upgrade a VM to a newer hardware version."
+                  version dependent, for example: \n * NVMe Controllers                >=
+                  14 * Dynamic Direct Path I/O devices >= 17 \n Please refer to https://kb.vmware.com/s/article/1003746
+                  for a list of VM hardware versions. \n It is important to remember
+                  that a VM's hardware version may not be downgraded and upgrading
+                  a VM deployed from an image based on an older hardware version to
+                  a more recent one may result in unpredictable behavior. In other
+                  words, please be careful when choosing to upgrade a VM to a newer
+                  hardware version."
                 format: int32
                 minimum: 13
                 type: integer
               networkInterfaces:
-                description: NetworkInterfaces describes a list of VirtualMachineNetworkInterfaces
+                description: "NetworkInterfaces describes a list of VirtualMachineNetworkInterfaces
                   to be configured on the VirtualMachine instance. Each of these VirtualMachineNetworkInterfaces
                   describes external network integration configurations that are to
                   be used by the VirtualMachine controller when integrating the VirtualMachine
-                  into one or more external networks.
+                  into one or more external networks. \n The maximum number of network
+                  interface allowed is 10 because of the limit built into vSphere."
                 items:
                   description: VirtualMachineNetworkInterface defines the properties
                     of a network interface to attach to a VirtualMachine instance.  A
                     VirtualMachineNetworkInterface describes network interface configuration
                     that is used by the VirtualMachine controller when integrating
-                    the VirtualMachine into a VirtualNetwork.  Currently, only NSX-T
+                    the VirtualMachine into a VirtualNetwork. Currently, only NSX-T
                     and vSphere Distributed Switch (VDS) type network integrations
                     are supported using this VirtualMachineNetworkInterface structure.
                   properties:
@@ -162,8 +173,9 @@ spec:
                       type: string
                     networkType:
                       description: NetworkType describes the type of VirtualNetwork
-                        that is referenced by the NetworkName.  Currently, the only
-                        supported NetworkTypes are "nsx-t" and "vsphere-distributed".
+                        that is referenced by the NetworkName. Currently, the supported
+                        NetworkTypes are "nsx-t", "nsx-t-subnet", "nsx-t-subnetset"
+                        and "vsphere-distributed".
                       type: string
                     providerRef:
                       description: ProviderRef is reference to a network interface
@@ -189,6 +201,7 @@ spec:
                       - name
                       type: object
                   type: object
+                maxItems: 10
                 type: array
               nextRestartTime:
                 description: "NextRestartTime may be used to restart the VM, in accordance
@@ -278,7 +291,10 @@ spec:
                     minimum: 1
                     type: integer
                   tcpSocket:
-                    description: TCPSocket specifies an action involving a TCP port.
+                    description: "TCPSocket specifies an action involving a TCP port.
+                      \n Deprecated: The TCPSocket action requires network connectivity
+                      that is not supported in all environments. This field will be
+                      removed in a later API version."
                     properties:
                       host:
                         description: Host is an optional host name to connect to.  Host
diff --git a/config/deployments/integration-tests/crds/vmoperator.vmware.com_virtualmachineservices.yaml b/config/deployments/integration-tests/crds/vmoperator.vmware.com_virtualmachineservices.yaml
index 12d73793..d0cb5f73 100644
--- a/config/deployments/integration-tests/crds/vmoperator.vmware.com_virtualmachineservices.yaml
+++ b/config/deployments/integration-tests/crds/vmoperator.vmware.com_virtualmachineservices.yaml
@@ -79,7 +79,10 @@ spec:
                   This feature depends on whether the underlying load balancer provider
                   supports specifying the loadBalancerIP when a load balancer is created.
                   This field will be ignored if the provider does not support the
-                  feature.'
+                  feature. Deprecated: This field was under-specified and its meaning
+                  varies across implementations. Using it is non-portable and it may
+                  not support dual-stack. Users are encouraged to use implementation-specific
+                  annotations when available.'
                 type: string
               loadBalancerSourceRanges:
                 description: 'LoadBalancerSourceRanges is an array of IP addresses
diff --git a/pkg/services/vmoperator/vmopmachine_test.go b/pkg/services/vmoperator/vmopmachine_test.go
index 38c6a1ed..063023c4 100644
--- a/pkg/services/vmoperator/vmopmachine_test.go
+++ b/pkg/services/vmoperator/vmopmachine_test.go
@@ -37,7 +37,7 @@ import (
 	vmwarev1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1"
 	"sigs.k8s.io/cluster-api-provider-vsphere/pkg/context/fake"
 	"sigs.k8s.io/cluster-api-provider-vsphere/pkg/context/vmware"
-	network "sigs.k8s.io/cluster-api-provider-vsphere/pkg/services/network"
+	"sigs.k8s.io/cluster-api-provider-vsphere/pkg/services/network"
 	"sigs.k8s.io/cluster-api-provider-vsphere/pkg/util"
 )
 
@@ -393,7 +393,7 @@ var _ = Describe("VirtualMachine tests", func() {
 			requeue, err = vmService.ReconcileNormal(ctx, supervisorMachineContext)
 			verifyOutput(supervisorMachineContext)
 
-			Expect(vmopVM.Spec.ReadinessProbe.TCPSocket.Port.IntValue()).To(Equal(defaultAPIBindPort))
+			Expect(vmopVM.Spec.ReadinessProbe.TCPSocket.Port.IntValue()).To(Equal(defaultAPIBindPort)) //nolint:staticcheck
 		})
 
 		Specify("Reconcile invalid Machine", func() {
diff --git a/test/go.mod b/test/go.mod
index 01513507..dd782cd5 100644
--- a/test/go.mod
+++ b/test/go.mod
@@ -8,15 +8,17 @@ replace sigs.k8s.io/cluster-api/test => sigs.k8s.io/cluster-api/test v1.7.0
 
 replace sigs.k8s.io/cluster-api-provider-vsphere => ../
 
+replace github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels => github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels v0.0.0-20240404200847-de75746a9505
+
 require (
 	github.com/dougm/pretty v0.0.0-20171025230240-2ee9d7453c02
 	github.com/onsi/ginkgo/v2 v2.17.1
 	github.com/onsi/gomega v1.32.0
 	github.com/pkg/errors v0.9.1
 	github.com/spf13/pflag v1.0.5
-	github.com/vmware-tanzu/net-operator-api v0.0.0-20231019160108-42131d6e8360
-	github.com/vmware-tanzu/vm-operator/api v1.8.5
-	github.com/vmware-tanzu/vm-operator/external/tanzu-topology v0.0.0-20231214185006-5477585eebfd
+	github.com/vmware-tanzu/net-operator-api v0.0.0-20240326163340-1f32d6bf7f9d
+	github.com/vmware-tanzu/vm-operator/api v1.8.6
+	github.com/vmware-tanzu/vm-operator/external/tanzu-topology v0.0.0-20240404200847-de75746a9505
 	github.com/vmware/govmomi v0.37.0
 	golang.org/x/crypto v0.22.0
 	gopkg.in/yaml.v2 v2.4.0
@@ -125,7 +127,7 @@ require (
 	github.com/stoewer/go-strcase v1.2.0 // indirect
 	github.com/subosito/gotenv v1.6.0 // indirect
 	github.com/valyala/fastjson v1.6.4 // indirect
-	github.com/vmware-tanzu/vm-operator/external/ncp v0.0.0-20231214185006-5477585eebfd // indirect
+	github.com/vmware-tanzu/vm-operator/external/ncp v0.0.0-20240404200847-de75746a9505 // indirect
 	go.etcd.io/etcd/api/v3 v3.5.13 // indirect
 	go.etcd.io/etcd/client/pkg/v3 v3.5.13 // indirect
 	go.etcd.io/etcd/client/v3 v3.5.13 // indirect
diff --git a/test/go.sum b/test/go.sum
index eaf09f57..bcd8cbfb 100644
--- a/test/go.sum
+++ b/test/go.sum
@@ -628,16 +628,18 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1
 github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
 github.com/valyala/fastjson v1.6.4 h1:uAUNq9Z6ymTgGhcm0UynUAB6tlbakBrz6CQFax3BXVQ=
 github.com/valyala/fastjson v1.6.4/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY=
-github.com/vmware-tanzu/net-operator-api v0.0.0-20231019160108-42131d6e8360 h1:yG158jviUd3wRqCTJcSDzp+prUZWtSA9dhfm/Rf8m9M=
-github.com/vmware-tanzu/net-operator-api v0.0.0-20231019160108-42131d6e8360/go.mod h1:dtVG693FvGuOSxJvTaKRVGU0EJR8yvLG3E2VaDDHILM=
+github.com/vmware-tanzu/net-operator-api v0.0.0-20240326163340-1f32d6bf7f9d h1:cgx9UH/r53bKU/Gbv8IPsUZ34bj5+ItijA2JCUS3kVk=
+github.com/vmware-tanzu/net-operator-api v0.0.0-20240326163340-1f32d6bf7f9d/go.mod h1:JbFOh22iDsT5BowJe0GgpMI5e2/S7cWaJlv9LdURVQM=
 github.com/vmware-tanzu/nsx-operator/pkg/apis v0.1.0 h1:HdnQb/X9vJ8a5WQ03g/0nDr9igIIK1fF6wO5wOtkJT4=
 github.com/vmware-tanzu/nsx-operator/pkg/apis v0.1.0/go.mod h1:Q4JzNkNMvjo7pXtlB5/R3oME4Nhah7fAObWgghVmtxk=
-github.com/vmware-tanzu/vm-operator/api v1.8.5 h1:E8rpRdV8+cNp/eNZ/QUHvlrbpPh8uk6bKqwEEmGWe64=
-github.com/vmware-tanzu/vm-operator/api v1.8.5/go.mod h1:SXaSFtnw2502Tzy0bfQVHrvbFDijR96r1ihUYQWPOK8=
-github.com/vmware-tanzu/vm-operator/external/ncp v0.0.0-20231214185006-5477585eebfd h1:qdfVf7KFW+XX7+D4xC/mlBpRA9+B+opdDPxGdqjxO+4=
-github.com/vmware-tanzu/vm-operator/external/ncp v0.0.0-20231214185006-5477585eebfd/go.mod h1:5rqRJ9zGR+KnKbkGx373WgN8xJpvAj99kHnfoDYRO5I=
-github.com/vmware-tanzu/vm-operator/external/tanzu-topology v0.0.0-20231214185006-5477585eebfd h1:BleW2NxLCPbLvFoTzhoX/DsjCJuKyEdcmvYiY04k18U=
-github.com/vmware-tanzu/vm-operator/external/tanzu-topology v0.0.0-20231214185006-5477585eebfd/go.mod h1:dfYrWS8DMRN+XZfhu8M4LVHmeGvYB29Ipd7j4uIq+mU=
+github.com/vmware-tanzu/vm-operator/api v1.8.6 h1:NIndORjcnSmIlQsCMIewpIwg/ocRVDh2lYjOroTVLrU=
+github.com/vmware-tanzu/vm-operator/api v1.8.6/go.mod h1:HHA2SNI9B5Yqtyp5t+Gt9WTWBi/fIkM6+MukDDSf11A=
+github.com/vmware-tanzu/vm-operator/external/ncp v0.0.0-20240404200847-de75746a9505 h1:y4wXx1FUFqqSgJ/xUOEM1DLS2Uu0KaeLADWpzpioGTU=
+github.com/vmware-tanzu/vm-operator/external/ncp v0.0.0-20240404200847-de75746a9505/go.mod h1:5rqRJ9zGR+KnKbkGx373WgN8xJpvAj99kHnfoDYRO5I=
+github.com/vmware-tanzu/vm-operator/external/tanzu-topology v0.0.0-20240404200847-de75746a9505 h1:/6vFL20UMHOeTf/mb+dKf5sFG0FBbyrCBY/71QKAIE0=
+github.com/vmware-tanzu/vm-operator/external/tanzu-topology v0.0.0-20240404200847-de75746a9505/go.mod h1:dfYrWS8DMRN+XZfhu8M4LVHmeGvYB29Ipd7j4uIq+mU=
+github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels v0.0.0-20240404200847-de75746a9505 h1:LRMZ+zzb944d6r+uYsE+CuJ3zVBE6Hc8vjH7IJX2QY4=
+github.com/vmware-tanzu/vm-operator/pkg/constants/testlabels v0.0.0-20240404200847-de75746a9505/go.mod h1:M+6bZCS8vSjCN9OOppnAyYxeBxY1U0wG6+j3CvIrOHY=
 github.com/vmware/govmomi v0.37.0 h1:xX5AnIrVn4yfH0fYSjyjMg/Kq6q7cNxA+vyfV5YcF70=
 github.com/vmware/govmomi v0.37.0/go.mod h1:mtGWtM+YhTADHlCgJBiskSRPOZRsN9MSjPzaZLte/oQ=
 github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8=