diff --git a/go.mod b/go.mod index fbd0fec06..6c2b43c99 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,6 @@ require ( k8s.io/code-generator v0.29.0 k8s.io/component-base v0.29.0 k8s.io/klog/v2 v2.110.1 - sigs.k8s.io/structured-merge-diff/v4 v4.4.1 sigs.k8s.io/yaml v1.4.0 ) @@ -92,17 +91,17 @@ require ( go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.25.0 // indirect - golang.org/x/crypto v0.14.0 // indirect + golang.org/x/crypto v0.18.0 // indirect golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 // indirect - golang.org/x/mod v0.13.0 // indirect - golang.org/x/net v0.17.0 // indirect + golang.org/x/mod v0.14.0 // indirect + golang.org/x/net v0.20.0 // indirect golang.org/x/oauth2 v0.12.0 // indirect - golang.org/x/sync v0.4.0 // indirect - golang.org/x/sys v0.15.0 // indirect - golang.org/x/term v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect + golang.org/x/sync v0.6.0 // indirect + golang.org/x/sys v0.16.0 // indirect + golang.org/x/term v0.16.0 // indirect + golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.14.0 // indirect + golang.org/x/tools v0.17.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e // indirect @@ -123,4 +122,5 @@ require ( sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0 // indirect sigs.k8s.io/controller-runtime v0.14.5 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) diff --git a/go.sum b/go.sum index 25299cfff..58dc34c9e 100644 --- a/go.sum +++ b/go.sum @@ -293,15 +293,15 @@ go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 h1:5llv2sWeaMSnA3w2kS57ouQQ4pudlXrR0dCgw51QK9o= golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= -golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -311,8 +311,8 @@ golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -320,8 +320,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= -golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -332,17 +332,17 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= -golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= +golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -353,8 +353,8 @@ golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= -golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= +golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/pkg/cloudprovider/vsphereparavirtual/instances.go b/pkg/cloudprovider/vsphereparavirtual/instances.go index e1f8b997c..7e73f7c3e 100644 --- a/pkg/cloudprovider/vsphereparavirtual/instances.go +++ b/pkg/cloudprovider/vsphereparavirtual/instances.go @@ -32,12 +32,12 @@ import ( "k8s.io/klog/v2" vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - vmopclient "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned" + vmop "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmoperator" "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmservice" ) type instances struct { - vmClient vmopclient.Interface + vmClient vmop.VmoperatorV1alpha1Interface namespace string } diff --git a/pkg/cloudprovider/vsphereparavirtual/instances_test.go b/pkg/cloudprovider/vsphereparavirtual/instances_test.go index b32af288a..9de735f84 100644 --- a/pkg/cloudprovider/vsphereparavirtual/instances_test.go +++ b/pkg/cloudprovider/vsphereparavirtual/instances_test.go @@ -30,7 +30,9 @@ import ( "k8s.io/client-go/rest" clientgotesting "k8s.io/client-go/testing" cloudprovider "k8s.io/cloud-provider" - fakevmclient "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/fake" + vmopclient "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmoperator/client" + + dynamicfake "k8s.io/client-go/dynamic/fake" ) var ( @@ -87,13 +89,16 @@ func TestNewInstances(t *testing.T) { } } -func initTest(testVM *vmopv1alpha1.VirtualMachine) (*instances, *fakevmclient.Clientset, error) { - fc := fakevmclient.NewSimpleClientset() +func initTest(testVM *vmopv1alpha1.VirtualMachine) (*instances, *dynamicfake.FakeDynamicClient, error) { + scheme := runtime.NewScheme() + _ = vmopv1alpha1.AddToScheme(scheme) + fc := dynamicfake.NewSimpleDynamicClient(scheme) + fcw := vmopclient.NewFakeClient(fc) instance := &instances{ - vmClient: fc, + vmClient: fcw, namespace: testClusterNameSpace, } - _, err := fc.VmoperatorV1alpha1().VirtualMachines(testVM.Namespace).Create(context.TODO(), testVM, metav1.CreateOptions{}) + _, err := fcw.VirtualMachines(testVM.Namespace).Create(context.TODO(), testVM, metav1.CreateOptions{}) return instance, fc, err } @@ -160,7 +165,7 @@ func TestInstanceIDThrowsErr(t *testing.T) { instance, fc, err := initTest(testCase.testVM) assert.NoError(t, err) fc.PrependReactor("get", "virtualmachines", func(action clientgotesting.Action) (handled bool, ret runtime.Object, err error) { - return true, &vmopv1alpha1.VirtualMachine{}, fmt.Errorf("Internal error getting VMs") + return true, nil, fmt.Errorf("Internal error getting VMs") }) instanceID, err := instance.InstanceID(context.Background(), testVMName) assert.NotEqual(t, nil, err) @@ -322,7 +327,7 @@ func TestNodeAddressesByProviderIDInternalErr(t *testing.T) { instance, fc, err := initTest(testCase.testVM) assert.NoError(t, err) fc.PrependReactor("list", "virtualmachines", func(action clientgotesting.Action) (handled bool, ret runtime.Object, err error) { - return true, &vmopv1alpha1.VirtualMachineList{}, fmt.Errorf("Internal error listing VMs") + return true, nil, fmt.Errorf("Internal error listing VMs") }) ret, err := instance.NodeAddressesByProviderID(context.Background(), testProviderID) assert.NotEqual(t, nil, err) @@ -397,7 +402,7 @@ func TestNodeAddressesInternalErr(t *testing.T) { instance, fc, err := initTest(testCase.testVM) assert.NoError(t, err) fc.PrependReactor("get", "virtualmachines", func(action clientgotesting.Action) (handled bool, ret runtime.Object, err error) { - return true, &vmopv1alpha1.VirtualMachine{}, fmt.Errorf("Internal error getting VMs") + return true, nil, fmt.Errorf("Internal error getting VMs") }) ret, err := instance.NodeAddresses(context.Background(), testVMName) assert.NotEqual(t, nil, err) diff --git a/pkg/cloudprovider/vsphereparavirtual/loadbalancer_test.go b/pkg/cloudprovider/vsphereparavirtual/loadbalancer_test.go index 32fa77c04..1c61d8439 100644 --- a/pkg/cloudprovider/vsphereparavirtual/loadbalancer_test.go +++ b/pkg/cloudprovider/vsphereparavirtual/loadbalancer_test.go @@ -26,15 +26,18 @@ import ( v1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" + dynamicfake "k8s.io/client-go/dynamic/fake" "k8s.io/client-go/rest" clientgotesting "k8s.io/client-go/testing" cloudprovider "k8s.io/cloud-provider" - fakevmclient "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/fake" "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmservice" vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" + + vmopclient "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmoperator/client" ) var ( @@ -50,13 +53,14 @@ var ( } ) -func newTestLoadBalancer() (cloudprovider.LoadBalancer, *fakevmclient.Clientset) { - fc := fakevmclient.NewSimpleClientset() +func newTestLoadBalancer() (cloudprovider.LoadBalancer, *vmopclient.FakeClient) { + scheme := runtime.NewScheme() + _ = vmopv1alpha1.AddToScheme(scheme) + fc := dynamicfake.NewSimpleDynamicClient(scheme) + fcw := vmopclient.NewFakeClient(fc) - vms := vmservice.NewVMService(fc, testClusterNameSpace, &testOwnerReference) - return &loadBalancer{ - vmService: vms, - }, fc + vms := vmservice.NewVMService(fcw, testClusterNameSpace, &testOwnerReference) + return &loadBalancer{vmService: vms}, fcw } func TestNewLoadBalancer(t *testing.T) { @@ -146,7 +150,7 @@ func TestUpdateLoadBalancer(t *testing.T) { for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) { - lb, fc := newTestLoadBalancer() + lb, fcw := newTestLoadBalancer() testK8sService := &v1.Service{ ObjectMeta: metav1.ObjectMeta{ Name: testK8sServiceName, @@ -172,8 +176,8 @@ func TestUpdateLoadBalancer(t *testing.T) { if testCase.expectErr { // Ensure that the client Update call returns an error on update - fc.PrependReactor("update", "virtualmachineservices", func(action clientgotesting.Action) (handled bool, ret runtime.Object, err error) { - return true, &vmopv1alpha1.VirtualMachineService{}, fmt.Errorf("Some undefined update error") + fcw.DynamicClient.PrependReactor("update", "virtualmachineservices", func(action clientgotesting.Action) (handled bool, ret runtime.Object, err error) { + return true, nil, fmt.Errorf("Some undefined update error") }) err = lb.UpdateLoadBalancer(context.Background(), testClustername, testK8sService, []*v1.Node{}) assert.Error(t, err) @@ -186,7 +190,7 @@ func TestUpdateLoadBalancer(t *testing.T) { } func TestEnsureLoadBalancer_VMServiceExternalTrafficPolicyLocal(t *testing.T) { - lb, fc := newTestLoadBalancer() + lb, fcw := newTestLoadBalancer() testK8sService := &v1.Service{ ObjectMeta: metav1.ObjectMeta{ Name: testK8sServiceName, @@ -197,8 +201,8 @@ func TestEnsureLoadBalancer_VMServiceExternalTrafficPolicyLocal(t *testing.T) { }, } - fc.PrependReactor("create", "virtualmachineservices", func(action clientgotesting.Action) (handled bool, ret runtime.Object, err error) { - return true, &vmopv1alpha1.VirtualMachineService{ + fcw.DynamicClient.PrependReactor("create", "virtualmachineservices", func(action clientgotesting.Action) (handled bool, ret runtime.Object, err error) { + unstructuredObj, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(&vmopv1alpha1.VirtualMachineService{ Status: vmopv1alpha1.VirtualMachineServiceStatus{ LoadBalancer: vmopv1alpha1.LoadBalancerStatus{ Ingress: []vmopv1alpha1.LoadBalancerIngress{ @@ -208,7 +212,8 @@ func TestEnsureLoadBalancer_VMServiceExternalTrafficPolicyLocal(t *testing.T) { }, }, }, - }, nil + }) + return true, &unstructured.Unstructured{Object: unstructuredObj}, nil }) _, ensureErr := lb.EnsureLoadBalancer(context.Background(), testClustername, testK8sService, []*v1.Node{}) @@ -242,14 +247,14 @@ func TestEnsureLoadBalancer(t *testing.T) { for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) { - lb, fc := newTestLoadBalancer() + lb, fcw := newTestLoadBalancer() testK8sService := &v1.Service{ ObjectMeta: metav1.ObjectMeta{ Name: testK8sServiceName, Namespace: testK8sServiceNameSpace, }, } - fc.PrependReactor("create", "virtualmachineservices", testCase.createFunc) + fcw.DynamicClient.PrependReactor("create", "virtualmachineservices", testCase.createFunc) _, ensureErr := lb.EnsureLoadBalancer(context.Background(), testClustername, testK8sService, []*v1.Node{}) assert.Equal(t, ensureErr.Error(), testCase.expectErr.Error()) @@ -261,7 +266,7 @@ func TestEnsureLoadBalancer(t *testing.T) { } func TestEnsureLoadBalancer_VMServiceCreatedIPFound(t *testing.T) { - lb, fc := newTestLoadBalancer() + lb, fcw := newTestLoadBalancer() testK8sService := &v1.Service{ ObjectMeta: metav1.ObjectMeta{ Name: testK8sServiceName, @@ -269,8 +274,8 @@ func TestEnsureLoadBalancer_VMServiceCreatedIPFound(t *testing.T) { }, } // Ensure that the client Create call returns a VMService with a valid IP - fc.PrependReactor("create", "virtualmachineservices", func(action clientgotesting.Action) (handled bool, ret runtime.Object, err error) { - return true, &vmopv1alpha1.VirtualMachineService{ + fcw.DynamicClient.PrependReactor("create", "virtualmachineservices", func(action clientgotesting.Action) (handled bool, ret runtime.Object, err error) { + unstructuredObj, _ := runtime.DefaultUnstructuredConverter.ToUnstructured(&vmopv1alpha1.VirtualMachineService{ Status: vmopv1alpha1.VirtualMachineServiceStatus{ LoadBalancer: vmopv1alpha1.LoadBalancerStatus{ Ingress: []vmopv1alpha1.LoadBalancerIngress{ @@ -301,7 +306,9 @@ func TestEnsureLoadBalancer_VMServiceCreatedIPFound(t *testing.T) { vmservice.NodeSelectorKey: vmservice.NodeRole, }, }, - }, nil + }) + + return true, &unstructured.Unstructured{Object: unstructuredObj}, nil }) status, ensureErr := lb.EnsureLoadBalancer(context.Background(), testClustername, testK8sService, []*v1.Node{}) @@ -335,7 +342,7 @@ func TestEnsureLoadBalancer_DeleteLB(t *testing.T) { for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) { - lb, fc := newTestLoadBalancer() + lb, fcw := newTestLoadBalancer() testK8sService := &v1.Service{ ObjectMeta: metav1.ObjectMeta{ Name: testK8sServiceName, @@ -347,7 +354,7 @@ func TestEnsureLoadBalancer_DeleteLB(t *testing.T) { err := lb.EnsureLoadBalancerDeleted(context.Background(), testClustername, testK8sService) assert.NoError(t, err) - fc.PrependReactor("delete", "virtualmachineservices", testCase.deleteFunc) + fcw.DynamicClient.PrependReactor("delete", "virtualmachineservices", testCase.deleteFunc) err = lb.EnsureLoadBalancerDeleted(context.Background(), "test", testK8sService) if err != nil { diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/internal/internal.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/internal/internal.go deleted file mode 100644 index eb6431c35..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/internal/internal.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package internal - -import ( - "fmt" - "sync" - - typed "sigs.k8s.io/structured-merge-diff/v4/typed" -) - -func Parser() *typed.Parser { - parserOnce.Do(func() { - var err error - parser, err = typed.NewParser(schemaYAML) - if err != nil { - panic(fmt.Sprintf("Failed to parse schema: %v", err)) - } - }) - return parser -} - -var parserOnce sync.Once -var parser *typed.Parser -var schemaYAML = typed.YAMLObject(`types: -- name: __untyped_atomic_ - scalar: untyped - list: - elementType: - namedType: __untyped_atomic_ - elementRelationship: atomic - map: - elementType: - namedType: __untyped_atomic_ - elementRelationship: atomic -- name: __untyped_deduced_ - scalar: untyped - list: - elementType: - namedType: __untyped_atomic_ - elementRelationship: atomic - map: - elementType: - namedType: __untyped_deduced_ - elementRelationship: separable -`) diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/utils.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/utils.go deleted file mode 100644 index a557dfba3..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/utils.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package applyconfiguration - -import ( - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - schema "k8s.io/apimachinery/pkg/runtime/schema" - vmopv1alpha1 "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1" -) - -// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no -// apply configuration type exists for the given GroupVersionKind. -func ForKind(kind schema.GroupVersionKind) interface{} { - switch kind { - // Group=vmoperator.vmware.com, Version=v1alpha1 - case v1alpha1.SchemeGroupVersion.WithKind("ClusterModuleSpec"): - return &vmopv1alpha1.ClusterModuleSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ClusterModuleStatus"): - return &vmopv1alpha1.ClusterModuleStatusApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("FolderSpec"): - return &vmopv1alpha1.FolderSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("LoadBalancerIngress"): - return &vmopv1alpha1.LoadBalancerIngressApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("LoadBalancerStatus"): - return &vmopv1alpha1.LoadBalancerStatusApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("NetworkInterfaceProviderReference"): - return &vmopv1alpha1.NetworkInterfaceProviderReferenceApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("Probe"): - return &vmopv1alpha1.ProbeApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ResourcePoolSpec"): - return &vmopv1alpha1.ResourcePoolSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("TCPSocketAction"): - return &vmopv1alpha1.TCPSocketActionApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachine"): - return &vmopv1alpha1.VirtualMachineApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineAdvancedOptions"): - return &vmopv1alpha1.VirtualMachineAdvancedOptionsApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineClass"): - return &vmopv1alpha1.VirtualMachineClassApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineClassHardware"): - return &vmopv1alpha1.VirtualMachineClassHardwareApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineClassPolicies"): - return &vmopv1alpha1.VirtualMachineClassPoliciesApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineClassResources"): - return &vmopv1alpha1.VirtualMachineClassResourcesApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineClassSpec"): - return &vmopv1alpha1.VirtualMachineClassSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineCondition"): - return &vmopv1alpha1.VirtualMachineConditionApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineImage"): - return &vmopv1alpha1.VirtualMachineImageApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineImageOSInfo"): - return &vmopv1alpha1.VirtualMachineImageOSInfoApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineImageProductInfo"): - return &vmopv1alpha1.VirtualMachineImageProductInfoApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineImageSpec"): - return &vmopv1alpha1.VirtualMachineImageSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineImageStatus"): - return &vmopv1alpha1.VirtualMachineImageStatusApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineMetadata"): - return &vmopv1alpha1.VirtualMachineMetadataApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineNetworkInterface"): - return &vmopv1alpha1.VirtualMachineNetworkInterfaceApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachinePort"): - return &vmopv1alpha1.VirtualMachinePortApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineResourceSpec"): - return &vmopv1alpha1.VirtualMachineResourceSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineService"): - return &vmopv1alpha1.VirtualMachineServiceApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineServicePort"): - return &vmopv1alpha1.VirtualMachineServicePortApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineServiceSpec"): - return &vmopv1alpha1.VirtualMachineServiceSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineServiceStatus"): - return &vmopv1alpha1.VirtualMachineServiceStatusApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineSetResourcePolicy"): - return &vmopv1alpha1.VirtualMachineSetResourcePolicyApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineSetResourcePolicySpec"): - return &vmopv1alpha1.VirtualMachineSetResourcePolicySpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineSetResourcePolicyStatus"): - return &vmopv1alpha1.VirtualMachineSetResourcePolicyStatusApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineSpec"): - return &vmopv1alpha1.VirtualMachineSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineStatus"): - return &vmopv1alpha1.VirtualMachineStatusApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineVolume"): - return &vmopv1alpha1.VirtualMachineVolumeApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineVolumeProvisioningOptions"): - return &vmopv1alpha1.VirtualMachineVolumeProvisioningOptionsApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineVolumeStatus"): - return &vmopv1alpha1.VirtualMachineVolumeStatusApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("VsphereVolumeSource"): - return &vmopv1alpha1.VsphereVolumeSourceApplyConfiguration{} - - } - return nil -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/clustermodulespec.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/clustermodulespec.go deleted file mode 100644 index 05f64e7fd..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/clustermodulespec.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// ClusterModuleSpecApplyConfiguration represents an declarative configuration of the ClusterModuleSpec type for use -// with apply. -type ClusterModuleSpecApplyConfiguration struct { - GroupName *string `json:"groupname,omitempty"` -} - -// ClusterModuleSpecApplyConfiguration constructs an declarative configuration of the ClusterModuleSpec type for use with -// apply. -func ClusterModuleSpec() *ClusterModuleSpecApplyConfiguration { - return &ClusterModuleSpecApplyConfiguration{} -} - -// WithGroupName sets the GroupName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GroupName field is set to the value of the last call. -func (b *ClusterModuleSpecApplyConfiguration) WithGroupName(value string) *ClusterModuleSpecApplyConfiguration { - b.GroupName = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/clustermodulestatus.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/clustermodulestatus.go deleted file mode 100644 index 50b933943..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/clustermodulestatus.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// ClusterModuleStatusApplyConfiguration represents an declarative configuration of the ClusterModuleStatus type for use -// with apply. -type ClusterModuleStatusApplyConfiguration struct { - GroupName *string `json:"groupname,omitempty"` - ModuleUuid *string `json:"moduleUUID,omitempty"` -} - -// ClusterModuleStatusApplyConfiguration constructs an declarative configuration of the ClusterModuleStatus type for use with -// apply. -func ClusterModuleStatus() *ClusterModuleStatusApplyConfiguration { - return &ClusterModuleStatusApplyConfiguration{} -} - -// WithGroupName sets the GroupName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GroupName field is set to the value of the last call. -func (b *ClusterModuleStatusApplyConfiguration) WithGroupName(value string) *ClusterModuleStatusApplyConfiguration { - b.GroupName = &value - return b -} - -// WithModuleUuid sets the ModuleUuid field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ModuleUuid field is set to the value of the last call. -func (b *ClusterModuleStatusApplyConfiguration) WithModuleUuid(value string) *ClusterModuleStatusApplyConfiguration { - b.ModuleUuid = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/folderspec.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/folderspec.go deleted file mode 100644 index 89a5f83df..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/folderspec.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// FolderSpecApplyConfiguration represents an declarative configuration of the FolderSpec type for use -// with apply. -type FolderSpecApplyConfiguration struct { - Name *string `json:"name,omitempty"` -} - -// FolderSpecApplyConfiguration constructs an declarative configuration of the FolderSpec type for use with -// apply. -func FolderSpec() *FolderSpecApplyConfiguration { - return &FolderSpecApplyConfiguration{} -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *FolderSpecApplyConfiguration) WithName(value string) *FolderSpecApplyConfiguration { - b.Name = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/loadbalanceringress.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/loadbalanceringress.go deleted file mode 100644 index 5f33a9469..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/loadbalanceringress.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// LoadBalancerIngressApplyConfiguration represents an declarative configuration of the LoadBalancerIngress type for use -// with apply. -type LoadBalancerIngressApplyConfiguration struct { - IP *string `json:"ip,omitempty"` - Hostname *string `json:"hostname,omitempty"` -} - -// LoadBalancerIngressApplyConfiguration constructs an declarative configuration of the LoadBalancerIngress type for use with -// apply. -func LoadBalancerIngress() *LoadBalancerIngressApplyConfiguration { - return &LoadBalancerIngressApplyConfiguration{} -} - -// WithIP sets the IP field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the IP field is set to the value of the last call. -func (b *LoadBalancerIngressApplyConfiguration) WithIP(value string) *LoadBalancerIngressApplyConfiguration { - b.IP = &value - return b -} - -// WithHostname sets the Hostname field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Hostname field is set to the value of the last call. -func (b *LoadBalancerIngressApplyConfiguration) WithHostname(value string) *LoadBalancerIngressApplyConfiguration { - b.Hostname = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/loadbalancerstatus.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/loadbalancerstatus.go deleted file mode 100644 index d2d6ae4c6..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/loadbalancerstatus.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// LoadBalancerStatusApplyConfiguration represents an declarative configuration of the LoadBalancerStatus type for use -// with apply. -type LoadBalancerStatusApplyConfiguration struct { - Ingress []LoadBalancerIngressApplyConfiguration `json:"ingress,omitempty"` -} - -// LoadBalancerStatusApplyConfiguration constructs an declarative configuration of the LoadBalancerStatus type for use with -// apply. -func LoadBalancerStatus() *LoadBalancerStatusApplyConfiguration { - return &LoadBalancerStatusApplyConfiguration{} -} - -// WithIngress adds the given value to the Ingress field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Ingress field. -func (b *LoadBalancerStatusApplyConfiguration) WithIngress(values ...*LoadBalancerIngressApplyConfiguration) *LoadBalancerStatusApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithIngress") - } - b.Ingress = append(b.Ingress, *values[i]) - } - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/networkinterfaceproviderreference.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/networkinterfaceproviderreference.go deleted file mode 100644 index 18187b26c..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/networkinterfaceproviderreference.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// NetworkInterfaceProviderReferenceApplyConfiguration represents an declarative configuration of the NetworkInterfaceProviderReference type for use -// with apply. -type NetworkInterfaceProviderReferenceApplyConfiguration struct { - APIGroup *string `json:"apiGroup,omitempty"` - Kind *string `json:"kind,omitempty"` - Name *string `json:"name,omitempty"` - APIVersion *string `json:"apiVersion,omitempty"` -} - -// NetworkInterfaceProviderReferenceApplyConfiguration constructs an declarative configuration of the NetworkInterfaceProviderReference type for use with -// apply. -func NetworkInterfaceProviderReference() *NetworkInterfaceProviderReferenceApplyConfiguration { - return &NetworkInterfaceProviderReferenceApplyConfiguration{} -} - -// WithAPIGroup sets the APIGroup field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIGroup field is set to the value of the last call. -func (b *NetworkInterfaceProviderReferenceApplyConfiguration) WithAPIGroup(value string) *NetworkInterfaceProviderReferenceApplyConfiguration { - b.APIGroup = &value - return b -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *NetworkInterfaceProviderReferenceApplyConfiguration) WithKind(value string) *NetworkInterfaceProviderReferenceApplyConfiguration { - b.Kind = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *NetworkInterfaceProviderReferenceApplyConfiguration) WithName(value string) *NetworkInterfaceProviderReferenceApplyConfiguration { - b.Name = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *NetworkInterfaceProviderReferenceApplyConfiguration) WithAPIVersion(value string) *NetworkInterfaceProviderReferenceApplyConfiguration { - b.APIVersion = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/probe.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/probe.go deleted file mode 100644 index e27555a53..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/probe.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// ProbeApplyConfiguration represents an declarative configuration of the Probe type for use -// with apply. -type ProbeApplyConfiguration struct { - TCPSocket *TCPSocketActionApplyConfiguration `json:"tcpSocket,omitempty"` - TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` - PeriodSeconds *int32 `json:"periodSeconds,omitempty"` -} - -// ProbeApplyConfiguration constructs an declarative configuration of the Probe type for use with -// apply. -func Probe() *ProbeApplyConfiguration { - return &ProbeApplyConfiguration{} -} - -// WithTCPSocket sets the TCPSocket field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the TCPSocket field is set to the value of the last call. -func (b *ProbeApplyConfiguration) WithTCPSocket(value *TCPSocketActionApplyConfiguration) *ProbeApplyConfiguration { - b.TCPSocket = value - return b -} - -// WithTimeoutSeconds sets the TimeoutSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the TimeoutSeconds field is set to the value of the last call. -func (b *ProbeApplyConfiguration) WithTimeoutSeconds(value int32) *ProbeApplyConfiguration { - b.TimeoutSeconds = &value - return b -} - -// WithPeriodSeconds sets the PeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the PeriodSeconds field is set to the value of the last call. -func (b *ProbeApplyConfiguration) WithPeriodSeconds(value int32) *ProbeApplyConfiguration { - b.PeriodSeconds = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/resourcepoolspec.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/resourcepoolspec.go deleted file mode 100644 index 2aad5744d..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/resourcepoolspec.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// ResourcePoolSpecApplyConfiguration represents an declarative configuration of the ResourcePoolSpec type for use -// with apply. -type ResourcePoolSpecApplyConfiguration struct { - Name *string `json:"name,omitempty"` - Reservations *VirtualMachineResourceSpecApplyConfiguration `json:"reservations,omitempty"` - Limits *VirtualMachineResourceSpecApplyConfiguration `json:"limits,omitempty"` -} - -// ResourcePoolSpecApplyConfiguration constructs an declarative configuration of the ResourcePoolSpec type for use with -// apply. -func ResourcePoolSpec() *ResourcePoolSpecApplyConfiguration { - return &ResourcePoolSpecApplyConfiguration{} -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *ResourcePoolSpecApplyConfiguration) WithName(value string) *ResourcePoolSpecApplyConfiguration { - b.Name = &value - return b -} - -// WithReservations sets the Reservations field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Reservations field is set to the value of the last call. -func (b *ResourcePoolSpecApplyConfiguration) WithReservations(value *VirtualMachineResourceSpecApplyConfiguration) *ResourcePoolSpecApplyConfiguration { - b.Reservations = value - return b -} - -// WithLimits sets the Limits field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Limits field is set to the value of the last call. -func (b *ResourcePoolSpecApplyConfiguration) WithLimits(value *VirtualMachineResourceSpecApplyConfiguration) *ResourcePoolSpecApplyConfiguration { - b.Limits = value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/tcpsocketaction.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/tcpsocketaction.go deleted file mode 100644 index f755c5846..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/tcpsocketaction.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - intstr "k8s.io/apimachinery/pkg/util/intstr" -) - -// TCPSocketActionApplyConfiguration represents an declarative configuration of the TCPSocketAction type for use -// with apply. -type TCPSocketActionApplyConfiguration struct { - Port *intstr.IntOrString `json:"port,omitempty"` - Host *string `json:"host,omitempty"` -} - -// TCPSocketActionApplyConfiguration constructs an declarative configuration of the TCPSocketAction type for use with -// apply. -func TCPSocketAction() *TCPSocketActionApplyConfiguration { - return &TCPSocketActionApplyConfiguration{} -} - -// WithPort sets the Port field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Port field is set to the value of the last call. -func (b *TCPSocketActionApplyConfiguration) WithPort(value intstr.IntOrString) *TCPSocketActionApplyConfiguration { - b.Port = &value - return b -} - -// WithHost sets the Host field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Host field is set to the value of the last call. -func (b *TCPSocketActionApplyConfiguration) WithHost(value string) *TCPSocketActionApplyConfiguration { - b.Host = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachine.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachine.go deleted file mode 100644 index 96358cbd5..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachine.go +++ /dev/null @@ -1,219 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// VirtualMachineApplyConfiguration represents an declarative configuration of the VirtualMachine type for use -// with apply. -type VirtualMachineApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *VirtualMachineSpecApplyConfiguration `json:"spec,omitempty"` - Status *VirtualMachineStatusApplyConfiguration `json:"status,omitempty"` -} - -// VirtualMachine constructs an declarative configuration of the VirtualMachine type for use with -// apply. -func VirtualMachine(name, namespace string) *VirtualMachineApplyConfiguration { - b := &VirtualMachineApplyConfiguration{} - b.WithName(name) - b.WithNamespace(namespace) - b.WithKind("VirtualMachine") - b.WithAPIVersion("vmoperator.vmware.com/v1alpha1") - return b -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *VirtualMachineApplyConfiguration) WithKind(value string) *VirtualMachineApplyConfiguration { - b.Kind = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *VirtualMachineApplyConfiguration) WithAPIVersion(value string) *VirtualMachineApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *VirtualMachineApplyConfiguration) WithName(value string) *VirtualMachineApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value - return b -} - -// WithGenerateName sets the GenerateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GenerateName field is set to the value of the last call. -func (b *VirtualMachineApplyConfiguration) WithGenerateName(value string) *VirtualMachineApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *VirtualMachineApplyConfiguration) WithNamespace(value string) *VirtualMachineApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value - return b -} - -// WithUID sets the UID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UID field is set to the value of the last call. -func (b *VirtualMachineApplyConfiguration) WithUID(value types.UID) *VirtualMachineApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value - return b -} - -// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *VirtualMachineApplyConfiguration) WithResourceVersion(value string) *VirtualMachineApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value - return b -} - -// WithGeneration sets the Generation field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Generation field is set to the value of the last call. -func (b *VirtualMachineApplyConfiguration) WithGeneration(value int64) *VirtualMachineApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value - return b -} - -// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *VirtualMachineApplyConfiguration) WithCreationTimestamp(value metav1.Time) *VirtualMachineApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value - return b -} - -// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *VirtualMachineApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *VirtualMachineApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value - return b -} - -// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *VirtualMachineApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *VirtualMachineApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value - return b -} - -// WithLabels puts the entries into the Labels field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Labels field, -// overwriting an existing map entries in Labels field with the same key. -func (b *VirtualMachineApplyConfiguration) WithLabels(entries map[string]string) *VirtualMachineApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Labels[k] = v - } - return b -} - -// WithAnnotations puts the entries into the Annotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Annotations field, -// overwriting an existing map entries in Annotations field with the same key. -func (b *VirtualMachineApplyConfiguration) WithAnnotations(entries map[string]string) *VirtualMachineApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - return b -} - -// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *VirtualMachineApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *VirtualMachineApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) - } - return b -} - -// WithFinalizers adds the given value to the Finalizers field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *VirtualMachineApplyConfiguration) WithFinalizers(values ...string) *VirtualMachineApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *VirtualMachineApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { - if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} - } -} - -// WithSpec sets the Spec field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Spec field is set to the value of the last call. -func (b *VirtualMachineApplyConfiguration) WithSpec(value *VirtualMachineSpecApplyConfiguration) *VirtualMachineApplyConfiguration { - b.Spec = value - return b -} - -// WithStatus sets the Status field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Status field is set to the value of the last call. -func (b *VirtualMachineApplyConfiguration) WithStatus(value *VirtualMachineStatusApplyConfiguration) *VirtualMachineApplyConfiguration { - b.Status = value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineadvancedoptions.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineadvancedoptions.go deleted file mode 100644 index 32e435a95..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineadvancedoptions.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// VirtualMachineAdvancedOptionsApplyConfiguration represents an declarative configuration of the VirtualMachineAdvancedOptions type for use -// with apply. -type VirtualMachineAdvancedOptionsApplyConfiguration struct { - DefaultVolumeProvisioningOptions *VirtualMachineVolumeProvisioningOptionsApplyConfiguration `json:"defaultVolumeProvisioningOptions,omitempty"` - ChangeBlockTracking *bool `json:"changeBlockTracking,omitempty"` -} - -// VirtualMachineAdvancedOptionsApplyConfiguration constructs an declarative configuration of the VirtualMachineAdvancedOptions type for use with -// apply. -func VirtualMachineAdvancedOptions() *VirtualMachineAdvancedOptionsApplyConfiguration { - return &VirtualMachineAdvancedOptionsApplyConfiguration{} -} - -// WithDefaultVolumeProvisioningOptions sets the DefaultVolumeProvisioningOptions field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DefaultVolumeProvisioningOptions field is set to the value of the last call. -func (b *VirtualMachineAdvancedOptionsApplyConfiguration) WithDefaultVolumeProvisioningOptions(value *VirtualMachineVolumeProvisioningOptionsApplyConfiguration) *VirtualMachineAdvancedOptionsApplyConfiguration { - b.DefaultVolumeProvisioningOptions = value - return b -} - -// WithChangeBlockTracking sets the ChangeBlockTracking field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ChangeBlockTracking field is set to the value of the last call. -func (b *VirtualMachineAdvancedOptionsApplyConfiguration) WithChangeBlockTracking(value bool) *VirtualMachineAdvancedOptionsApplyConfiguration { - b.ChangeBlockTracking = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineclass.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineclass.go deleted file mode 100644 index 896559c62..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineclass.go +++ /dev/null @@ -1,219 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// VirtualMachineClassApplyConfiguration represents an declarative configuration of the VirtualMachineClass type for use -// with apply. -type VirtualMachineClassApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *VirtualMachineClassSpecApplyConfiguration `json:"spec,omitempty"` - Status *vmopv1alpha1.VirtualMachineClassStatus `json:"status,omitempty"` -} - -// VirtualMachineClass constructs an declarative configuration of the VirtualMachineClass type for use with -// apply. -func VirtualMachineClass(name string) *VirtualMachineClassApplyConfiguration { - b := &VirtualMachineClassApplyConfiguration{} - b.WithName(name) - b.WithKind("VirtualMachineClass") - b.WithAPIVersion("vmoperator.vmware.com/v1alpha1") - return b -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *VirtualMachineClassApplyConfiguration) WithKind(value string) *VirtualMachineClassApplyConfiguration { - b.Kind = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *VirtualMachineClassApplyConfiguration) WithAPIVersion(value string) *VirtualMachineClassApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *VirtualMachineClassApplyConfiguration) WithName(value string) *VirtualMachineClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value - return b -} - -// WithGenerateName sets the GenerateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GenerateName field is set to the value of the last call. -func (b *VirtualMachineClassApplyConfiguration) WithGenerateName(value string) *VirtualMachineClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *VirtualMachineClassApplyConfiguration) WithNamespace(value string) *VirtualMachineClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value - return b -} - -// WithUID sets the UID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UID field is set to the value of the last call. -func (b *VirtualMachineClassApplyConfiguration) WithUID(value types.UID) *VirtualMachineClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value - return b -} - -// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *VirtualMachineClassApplyConfiguration) WithResourceVersion(value string) *VirtualMachineClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value - return b -} - -// WithGeneration sets the Generation field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Generation field is set to the value of the last call. -func (b *VirtualMachineClassApplyConfiguration) WithGeneration(value int64) *VirtualMachineClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value - return b -} - -// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *VirtualMachineClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *VirtualMachineClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value - return b -} - -// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *VirtualMachineClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *VirtualMachineClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value - return b -} - -// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *VirtualMachineClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *VirtualMachineClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value - return b -} - -// WithLabels puts the entries into the Labels field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Labels field, -// overwriting an existing map entries in Labels field with the same key. -func (b *VirtualMachineClassApplyConfiguration) WithLabels(entries map[string]string) *VirtualMachineClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Labels[k] = v - } - return b -} - -// WithAnnotations puts the entries into the Annotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Annotations field, -// overwriting an existing map entries in Annotations field with the same key. -func (b *VirtualMachineClassApplyConfiguration) WithAnnotations(entries map[string]string) *VirtualMachineClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - return b -} - -// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *VirtualMachineClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *VirtualMachineClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) - } - return b -} - -// WithFinalizers adds the given value to the Finalizers field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *VirtualMachineClassApplyConfiguration) WithFinalizers(values ...string) *VirtualMachineClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *VirtualMachineClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { - if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} - } -} - -// WithSpec sets the Spec field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Spec field is set to the value of the last call. -func (b *VirtualMachineClassApplyConfiguration) WithSpec(value *VirtualMachineClassSpecApplyConfiguration) *VirtualMachineClassApplyConfiguration { - b.Spec = value - return b -} - -// WithStatus sets the Status field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Status field is set to the value of the last call. -func (b *VirtualMachineClassApplyConfiguration) WithStatus(value vmopv1alpha1.VirtualMachineClassStatus) *VirtualMachineClassApplyConfiguration { - b.Status = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineclasshardware.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineclasshardware.go deleted file mode 100644 index dd6a6191f..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineclasshardware.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - resource "k8s.io/apimachinery/pkg/api/resource" -) - -// VirtualMachineClassHardwareApplyConfiguration represents an declarative configuration of the VirtualMachineClassHardware type for use -// with apply. -type VirtualMachineClassHardwareApplyConfiguration struct { - Cpus *int64 `json:"cpus,omitempty"` - Memory *resource.Quantity `json:"memory,omitempty"` -} - -// VirtualMachineClassHardwareApplyConfiguration constructs an declarative configuration of the VirtualMachineClassHardware type for use with -// apply. -func VirtualMachineClassHardware() *VirtualMachineClassHardwareApplyConfiguration { - return &VirtualMachineClassHardwareApplyConfiguration{} -} - -// WithCpus sets the Cpus field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Cpus field is set to the value of the last call. -func (b *VirtualMachineClassHardwareApplyConfiguration) WithCpus(value int64) *VirtualMachineClassHardwareApplyConfiguration { - b.Cpus = &value - return b -} - -// WithMemory sets the Memory field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Memory field is set to the value of the last call. -func (b *VirtualMachineClassHardwareApplyConfiguration) WithMemory(value resource.Quantity) *VirtualMachineClassHardwareApplyConfiguration { - b.Memory = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineclasspolicies.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineclasspolicies.go deleted file mode 100644 index afaf29102..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineclasspolicies.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// VirtualMachineClassPoliciesApplyConfiguration represents an declarative configuration of the VirtualMachineClassPolicies type for use -// with apply. -type VirtualMachineClassPoliciesApplyConfiguration struct { - Resources *VirtualMachineClassResourcesApplyConfiguration `json:"resources,omitempty"` -} - -// VirtualMachineClassPoliciesApplyConfiguration constructs an declarative configuration of the VirtualMachineClassPolicies type for use with -// apply. -func VirtualMachineClassPolicies() *VirtualMachineClassPoliciesApplyConfiguration { - return &VirtualMachineClassPoliciesApplyConfiguration{} -} - -// WithResources sets the Resources field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Resources field is set to the value of the last call. -func (b *VirtualMachineClassPoliciesApplyConfiguration) WithResources(value *VirtualMachineClassResourcesApplyConfiguration) *VirtualMachineClassPoliciesApplyConfiguration { - b.Resources = value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineclassresources.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineclassresources.go deleted file mode 100644 index 0dcfb39e4..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineclassresources.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// VirtualMachineClassResourcesApplyConfiguration represents an declarative configuration of the VirtualMachineClassResources type for use -// with apply. -type VirtualMachineClassResourcesApplyConfiguration struct { - Requests *VirtualMachineResourceSpecApplyConfiguration `json:"requests,omitempty"` - Limits *VirtualMachineResourceSpecApplyConfiguration `json:"limits,omitempty"` -} - -// VirtualMachineClassResourcesApplyConfiguration constructs an declarative configuration of the VirtualMachineClassResources type for use with -// apply. -func VirtualMachineClassResources() *VirtualMachineClassResourcesApplyConfiguration { - return &VirtualMachineClassResourcesApplyConfiguration{} -} - -// WithRequests sets the Requests field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Requests field is set to the value of the last call. -func (b *VirtualMachineClassResourcesApplyConfiguration) WithRequests(value *VirtualMachineResourceSpecApplyConfiguration) *VirtualMachineClassResourcesApplyConfiguration { - b.Requests = value - return b -} - -// WithLimits sets the Limits field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Limits field is set to the value of the last call. -func (b *VirtualMachineClassResourcesApplyConfiguration) WithLimits(value *VirtualMachineResourceSpecApplyConfiguration) *VirtualMachineClassResourcesApplyConfiguration { - b.Limits = value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineclassspec.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineclassspec.go deleted file mode 100644 index c66b0b9f7..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineclassspec.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// VirtualMachineClassSpecApplyConfiguration represents an declarative configuration of the VirtualMachineClassSpec type for use -// with apply. -type VirtualMachineClassSpecApplyConfiguration struct { - Hardware *VirtualMachineClassHardwareApplyConfiguration `json:"hardware,omitempty"` - Policies *VirtualMachineClassPoliciesApplyConfiguration `json:"policies,omitempty"` -} - -// VirtualMachineClassSpecApplyConfiguration constructs an declarative configuration of the VirtualMachineClassSpec type for use with -// apply. -func VirtualMachineClassSpec() *VirtualMachineClassSpecApplyConfiguration { - return &VirtualMachineClassSpecApplyConfiguration{} -} - -// WithHardware sets the Hardware field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Hardware field is set to the value of the last call. -func (b *VirtualMachineClassSpecApplyConfiguration) WithHardware(value *VirtualMachineClassHardwareApplyConfiguration) *VirtualMachineClassSpecApplyConfiguration { - b.Hardware = value - return b -} - -// WithPolicies sets the Policies field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Policies field is set to the value of the last call. -func (b *VirtualMachineClassSpecApplyConfiguration) WithPolicies(value *VirtualMachineClassPoliciesApplyConfiguration) *VirtualMachineClassSpecApplyConfiguration { - b.Policies = value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinecondition.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinecondition.go deleted file mode 100644 index 344ae2ae1..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinecondition.go +++ /dev/null @@ -1,80 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// VirtualMachineConditionApplyConfiguration represents an declarative configuration of the VirtualMachineCondition type for use -// with apply. -type VirtualMachineConditionApplyConfiguration struct { - Type *v1alpha1.VirtualMachineConditionType `json:"type,omitempty"` - Status *v1.ConditionStatus `json:"status,omitempty"` - LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"` - Reason *string `json:"reason,omitempty"` - Message *string `json:"message,omitempty"` -} - -// VirtualMachineConditionApplyConfiguration constructs an declarative configuration of the VirtualMachineCondition type for use with -// apply. -func VirtualMachineCondition() *VirtualMachineConditionApplyConfiguration { - return &VirtualMachineConditionApplyConfiguration{} -} - -// WithType sets the Type field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Type field is set to the value of the last call. -func (b *VirtualMachineConditionApplyConfiguration) WithType(value v1alpha1.VirtualMachineConditionType) *VirtualMachineConditionApplyConfiguration { - b.Type = &value - return b -} - -// WithStatus sets the Status field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Status field is set to the value of the last call. -func (b *VirtualMachineConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *VirtualMachineConditionApplyConfiguration { - b.Status = &value - return b -} - -// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the LastTransitionTime field is set to the value of the last call. -func (b *VirtualMachineConditionApplyConfiguration) WithLastTransitionTime(value v1.Time) *VirtualMachineConditionApplyConfiguration { - b.LastTransitionTime = &value - return b -} - -// WithReason sets the Reason field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Reason field is set to the value of the last call. -func (b *VirtualMachineConditionApplyConfiguration) WithReason(value string) *VirtualMachineConditionApplyConfiguration { - b.Reason = &value - return b -} - -// WithMessage sets the Message field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Message field is set to the value of the last call. -func (b *VirtualMachineConditionApplyConfiguration) WithMessage(value string) *VirtualMachineConditionApplyConfiguration { - b.Message = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineimage.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineimage.go deleted file mode 100644 index fc15d9bb8..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineimage.go +++ /dev/null @@ -1,218 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// VirtualMachineImageApplyConfiguration represents an declarative configuration of the VirtualMachineImage type for use -// with apply. -type VirtualMachineImageApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *VirtualMachineImageSpecApplyConfiguration `json:"spec,omitempty"` - Status *VirtualMachineImageStatusApplyConfiguration `json:"status,omitempty"` -} - -// VirtualMachineImage constructs an declarative configuration of the VirtualMachineImage type for use with -// apply. -func VirtualMachineImage(name string) *VirtualMachineImageApplyConfiguration { - b := &VirtualMachineImageApplyConfiguration{} - b.WithName(name) - b.WithKind("VirtualMachineImage") - b.WithAPIVersion("vmoperator.vmware.com/v1alpha1") - return b -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *VirtualMachineImageApplyConfiguration) WithKind(value string) *VirtualMachineImageApplyConfiguration { - b.Kind = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *VirtualMachineImageApplyConfiguration) WithAPIVersion(value string) *VirtualMachineImageApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *VirtualMachineImageApplyConfiguration) WithName(value string) *VirtualMachineImageApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value - return b -} - -// WithGenerateName sets the GenerateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GenerateName field is set to the value of the last call. -func (b *VirtualMachineImageApplyConfiguration) WithGenerateName(value string) *VirtualMachineImageApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *VirtualMachineImageApplyConfiguration) WithNamespace(value string) *VirtualMachineImageApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value - return b -} - -// WithUID sets the UID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UID field is set to the value of the last call. -func (b *VirtualMachineImageApplyConfiguration) WithUID(value types.UID) *VirtualMachineImageApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value - return b -} - -// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *VirtualMachineImageApplyConfiguration) WithResourceVersion(value string) *VirtualMachineImageApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value - return b -} - -// WithGeneration sets the Generation field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Generation field is set to the value of the last call. -func (b *VirtualMachineImageApplyConfiguration) WithGeneration(value int64) *VirtualMachineImageApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value - return b -} - -// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *VirtualMachineImageApplyConfiguration) WithCreationTimestamp(value metav1.Time) *VirtualMachineImageApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value - return b -} - -// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *VirtualMachineImageApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *VirtualMachineImageApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value - return b -} - -// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *VirtualMachineImageApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *VirtualMachineImageApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value - return b -} - -// WithLabels puts the entries into the Labels field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Labels field, -// overwriting an existing map entries in Labels field with the same key. -func (b *VirtualMachineImageApplyConfiguration) WithLabels(entries map[string]string) *VirtualMachineImageApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Labels[k] = v - } - return b -} - -// WithAnnotations puts the entries into the Annotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Annotations field, -// overwriting an existing map entries in Annotations field with the same key. -func (b *VirtualMachineImageApplyConfiguration) WithAnnotations(entries map[string]string) *VirtualMachineImageApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - return b -} - -// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *VirtualMachineImageApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *VirtualMachineImageApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) - } - return b -} - -// WithFinalizers adds the given value to the Finalizers field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *VirtualMachineImageApplyConfiguration) WithFinalizers(values ...string) *VirtualMachineImageApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *VirtualMachineImageApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { - if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} - } -} - -// WithSpec sets the Spec field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Spec field is set to the value of the last call. -func (b *VirtualMachineImageApplyConfiguration) WithSpec(value *VirtualMachineImageSpecApplyConfiguration) *VirtualMachineImageApplyConfiguration { - b.Spec = value - return b -} - -// WithStatus sets the Status field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Status field is set to the value of the last call. -func (b *VirtualMachineImageApplyConfiguration) WithStatus(value *VirtualMachineImageStatusApplyConfiguration) *VirtualMachineImageApplyConfiguration { - b.Status = value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineimageosinfo.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineimageosinfo.go deleted file mode 100644 index ee3214ee0..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineimageosinfo.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// VirtualMachineImageOSInfoApplyConfiguration represents an declarative configuration of the VirtualMachineImageOSInfo type for use -// with apply. -type VirtualMachineImageOSInfoApplyConfiguration struct { - Version *string `json:"version,omitempty"` - Type *string `json:"type,omitempty"` -} - -// VirtualMachineImageOSInfoApplyConfiguration constructs an declarative configuration of the VirtualMachineImageOSInfo type for use with -// apply. -func VirtualMachineImageOSInfo() *VirtualMachineImageOSInfoApplyConfiguration { - return &VirtualMachineImageOSInfoApplyConfiguration{} -} - -// WithVersion sets the Version field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Version field is set to the value of the last call. -func (b *VirtualMachineImageOSInfoApplyConfiguration) WithVersion(value string) *VirtualMachineImageOSInfoApplyConfiguration { - b.Version = &value - return b -} - -// WithType sets the Type field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Type field is set to the value of the last call. -func (b *VirtualMachineImageOSInfoApplyConfiguration) WithType(value string) *VirtualMachineImageOSInfoApplyConfiguration { - b.Type = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineimageproductinfo.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineimageproductinfo.go deleted file mode 100644 index 23097beb3..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineimageproductinfo.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// VirtualMachineImageProductInfoApplyConfiguration represents an declarative configuration of the VirtualMachineImageProductInfo type for use -// with apply. -type VirtualMachineImageProductInfoApplyConfiguration struct { - Product *string `json:"product,omitempty"` - Vendor *string `json:"vendor,omitempty"` - Version *string `json:"version,omitempty"` - FullVersion *string `json:"fullVersion,omitempty"` -} - -// VirtualMachineImageProductInfoApplyConfiguration constructs an declarative configuration of the VirtualMachineImageProductInfo type for use with -// apply. -func VirtualMachineImageProductInfo() *VirtualMachineImageProductInfoApplyConfiguration { - return &VirtualMachineImageProductInfoApplyConfiguration{} -} - -// WithProduct sets the Product field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Product field is set to the value of the last call. -func (b *VirtualMachineImageProductInfoApplyConfiguration) WithProduct(value string) *VirtualMachineImageProductInfoApplyConfiguration { - b.Product = &value - return b -} - -// WithVendor sets the Vendor field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Vendor field is set to the value of the last call. -func (b *VirtualMachineImageProductInfoApplyConfiguration) WithVendor(value string) *VirtualMachineImageProductInfoApplyConfiguration { - b.Vendor = &value - return b -} - -// WithVersion sets the Version field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Version field is set to the value of the last call. -func (b *VirtualMachineImageProductInfoApplyConfiguration) WithVersion(value string) *VirtualMachineImageProductInfoApplyConfiguration { - b.Version = &value - return b -} - -// WithFullVersion sets the FullVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the FullVersion field is set to the value of the last call. -func (b *VirtualMachineImageProductInfoApplyConfiguration) WithFullVersion(value string) *VirtualMachineImageProductInfoApplyConfiguration { - b.FullVersion = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineimagespec.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineimagespec.go deleted file mode 100644 index cc3ec6a11..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineimagespec.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// VirtualMachineImageSpecApplyConfiguration represents an declarative configuration of the VirtualMachineImageSpec type for use -// with apply. -type VirtualMachineImageSpecApplyConfiguration struct { - Type *string `json:"type,omitempty"` - ImageSourceType *string `json:"imageSourceType,omitempty"` - ProductInfo *VirtualMachineImageProductInfoApplyConfiguration `json:"productInfo,omitempty"` - OSInfo *VirtualMachineImageOSInfoApplyConfiguration `json:"osInfo,omitempty"` -} - -// VirtualMachineImageSpecApplyConfiguration constructs an declarative configuration of the VirtualMachineImageSpec type for use with -// apply. -func VirtualMachineImageSpec() *VirtualMachineImageSpecApplyConfiguration { - return &VirtualMachineImageSpecApplyConfiguration{} -} - -// WithType sets the Type field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Type field is set to the value of the last call. -func (b *VirtualMachineImageSpecApplyConfiguration) WithType(value string) *VirtualMachineImageSpecApplyConfiguration { - b.Type = &value - return b -} - -// WithImageSourceType sets the ImageSourceType field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ImageSourceType field is set to the value of the last call. -func (b *VirtualMachineImageSpecApplyConfiguration) WithImageSourceType(value string) *VirtualMachineImageSpecApplyConfiguration { - b.ImageSourceType = &value - return b -} - -// WithProductInfo sets the ProductInfo field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ProductInfo field is set to the value of the last call. -func (b *VirtualMachineImageSpecApplyConfiguration) WithProductInfo(value *VirtualMachineImageProductInfoApplyConfiguration) *VirtualMachineImageSpecApplyConfiguration { - b.ProductInfo = value - return b -} - -// WithOSInfo sets the OSInfo field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the OSInfo field is set to the value of the last call. -func (b *VirtualMachineImageSpecApplyConfiguration) WithOSInfo(value *VirtualMachineImageOSInfoApplyConfiguration) *VirtualMachineImageSpecApplyConfiguration { - b.OSInfo = value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineimagestatus.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineimagestatus.go deleted file mode 100644 index a0c16cb76..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineimagestatus.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// VirtualMachineImageStatusApplyConfiguration represents an declarative configuration of the VirtualMachineImageStatus type for use -// with apply. -type VirtualMachineImageStatusApplyConfiguration struct { - Uuid *string `json:"uuid,omitempty"` - InternalId *string `json:"internalId,omitempty"` - PowerState *string `json:"powerState,omitempty"` - GuestOSCustomizable *bool `json:"guestOsCustomizable,omitempty"` -} - -// VirtualMachineImageStatusApplyConfiguration constructs an declarative configuration of the VirtualMachineImageStatus type for use with -// apply. -func VirtualMachineImageStatus() *VirtualMachineImageStatusApplyConfiguration { - return &VirtualMachineImageStatusApplyConfiguration{} -} - -// WithUuid sets the Uuid field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Uuid field is set to the value of the last call. -func (b *VirtualMachineImageStatusApplyConfiguration) WithUuid(value string) *VirtualMachineImageStatusApplyConfiguration { - b.Uuid = &value - return b -} - -// WithInternalId sets the InternalId field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the InternalId field is set to the value of the last call. -func (b *VirtualMachineImageStatusApplyConfiguration) WithInternalId(value string) *VirtualMachineImageStatusApplyConfiguration { - b.InternalId = &value - return b -} - -// WithPowerState sets the PowerState field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the PowerState field is set to the value of the last call. -func (b *VirtualMachineImageStatusApplyConfiguration) WithPowerState(value string) *VirtualMachineImageStatusApplyConfiguration { - b.PowerState = &value - return b -} - -// WithGuestOSCustomizable sets the GuestOSCustomizable field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GuestOSCustomizable field is set to the value of the last call. -func (b *VirtualMachineImageStatusApplyConfiguration) WithGuestOSCustomizable(value bool) *VirtualMachineImageStatusApplyConfiguration { - b.GuestOSCustomizable = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinemetadata.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinemetadata.go deleted file mode 100644 index a61a0daca..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinemetadata.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" -) - -// VirtualMachineMetadataApplyConfiguration represents an declarative configuration of the VirtualMachineMetadata type for use -// with apply. -type VirtualMachineMetadataApplyConfiguration struct { - ConfigMapName *string `json:"configMapName,omitempty"` - Transport *v1alpha1.VirtualMachineMetadataTransport `json:"transport,omitempty"` -} - -// VirtualMachineMetadataApplyConfiguration constructs an declarative configuration of the VirtualMachineMetadata type for use with -// apply. -func VirtualMachineMetadata() *VirtualMachineMetadataApplyConfiguration { - return &VirtualMachineMetadataApplyConfiguration{} -} - -// WithConfigMapName sets the ConfigMapName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ConfigMapName field is set to the value of the last call. -func (b *VirtualMachineMetadataApplyConfiguration) WithConfigMapName(value string) *VirtualMachineMetadataApplyConfiguration { - b.ConfigMapName = &value - return b -} - -// WithTransport sets the Transport field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Transport field is set to the value of the last call. -func (b *VirtualMachineMetadataApplyConfiguration) WithTransport(value v1alpha1.VirtualMachineMetadataTransport) *VirtualMachineMetadataApplyConfiguration { - b.Transport = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinenetworkinterface.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinenetworkinterface.go deleted file mode 100644 index 98325e478..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinenetworkinterface.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// VirtualMachineNetworkInterfaceApplyConfiguration represents an declarative configuration of the VirtualMachineNetworkInterface type for use -// with apply. -type VirtualMachineNetworkInterfaceApplyConfiguration struct { - NetworkType *string `json:"networkType,omitempty"` - NetworkName *string `json:"networkName,omitempty"` - ProviderRef *NetworkInterfaceProviderReferenceApplyConfiguration `json:"providerRef,omitempty"` - EthernetCardType *string `json:"ethernetCardType,omitempty"` -} - -// VirtualMachineNetworkInterfaceApplyConfiguration constructs an declarative configuration of the VirtualMachineNetworkInterface type for use with -// apply. -func VirtualMachineNetworkInterface() *VirtualMachineNetworkInterfaceApplyConfiguration { - return &VirtualMachineNetworkInterfaceApplyConfiguration{} -} - -// WithNetworkType sets the NetworkType field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the NetworkType field is set to the value of the last call. -func (b *VirtualMachineNetworkInterfaceApplyConfiguration) WithNetworkType(value string) *VirtualMachineNetworkInterfaceApplyConfiguration { - b.NetworkType = &value - return b -} - -// WithNetworkName sets the NetworkName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the NetworkName field is set to the value of the last call. -func (b *VirtualMachineNetworkInterfaceApplyConfiguration) WithNetworkName(value string) *VirtualMachineNetworkInterfaceApplyConfiguration { - b.NetworkName = &value - return b -} - -// WithProviderRef sets the ProviderRef field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ProviderRef field is set to the value of the last call. -func (b *VirtualMachineNetworkInterfaceApplyConfiguration) WithProviderRef(value *NetworkInterfaceProviderReferenceApplyConfiguration) *VirtualMachineNetworkInterfaceApplyConfiguration { - b.ProviderRef = value - return b -} - -// WithEthernetCardType sets the EthernetCardType field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the EthernetCardType field is set to the value of the last call. -func (b *VirtualMachineNetworkInterfaceApplyConfiguration) WithEthernetCardType(value string) *VirtualMachineNetworkInterfaceApplyConfiguration { - b.EthernetCardType = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineport.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineport.go deleted file mode 100644 index ea1e78089..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineport.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1 "k8s.io/api/core/v1" -) - -// VirtualMachinePortApplyConfiguration represents an declarative configuration of the VirtualMachinePort type for use -// with apply. -type VirtualMachinePortApplyConfiguration struct { - Port *int `json:"port,omitempty"` - Ip *string `json:"ip,omitempty"` - Name *string `json:"name,omitempty"` - Protocol *v1.Protocol `json:"protocol,omitempty"` -} - -// VirtualMachinePortApplyConfiguration constructs an declarative configuration of the VirtualMachinePort type for use with -// apply. -func VirtualMachinePort() *VirtualMachinePortApplyConfiguration { - return &VirtualMachinePortApplyConfiguration{} -} - -// WithPort sets the Port field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Port field is set to the value of the last call. -func (b *VirtualMachinePortApplyConfiguration) WithPort(value int) *VirtualMachinePortApplyConfiguration { - b.Port = &value - return b -} - -// WithIp sets the Ip field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Ip field is set to the value of the last call. -func (b *VirtualMachinePortApplyConfiguration) WithIp(value string) *VirtualMachinePortApplyConfiguration { - b.Ip = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *VirtualMachinePortApplyConfiguration) WithName(value string) *VirtualMachinePortApplyConfiguration { - b.Name = &value - return b -} - -// WithProtocol sets the Protocol field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Protocol field is set to the value of the last call. -func (b *VirtualMachinePortApplyConfiguration) WithProtocol(value v1.Protocol) *VirtualMachinePortApplyConfiguration { - b.Protocol = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineresourcespec.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineresourcespec.go deleted file mode 100644 index cb9e19ba3..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineresourcespec.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - resource "k8s.io/apimachinery/pkg/api/resource" -) - -// VirtualMachineResourceSpecApplyConfiguration represents an declarative configuration of the VirtualMachineResourceSpec type for use -// with apply. -type VirtualMachineResourceSpecApplyConfiguration struct { - Cpu *resource.Quantity `json:"cpu,omitempty"` - Memory *resource.Quantity `json:"memory,omitempty"` -} - -// VirtualMachineResourceSpecApplyConfiguration constructs an declarative configuration of the VirtualMachineResourceSpec type for use with -// apply. -func VirtualMachineResourceSpec() *VirtualMachineResourceSpecApplyConfiguration { - return &VirtualMachineResourceSpecApplyConfiguration{} -} - -// WithCpu sets the Cpu field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Cpu field is set to the value of the last call. -func (b *VirtualMachineResourceSpecApplyConfiguration) WithCpu(value resource.Quantity) *VirtualMachineResourceSpecApplyConfiguration { - b.Cpu = &value - return b -} - -// WithMemory sets the Memory field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Memory field is set to the value of the last call. -func (b *VirtualMachineResourceSpecApplyConfiguration) WithMemory(value resource.Quantity) *VirtualMachineResourceSpecApplyConfiguration { - b.Memory = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineservice.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineservice.go deleted file mode 100644 index f1a5cb52e..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineservice.go +++ /dev/null @@ -1,219 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// VirtualMachineServiceApplyConfiguration represents an declarative configuration of the VirtualMachineService type for use -// with apply. -type VirtualMachineServiceApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *VirtualMachineServiceSpecApplyConfiguration `json:"spec,omitempty"` - Status *VirtualMachineServiceStatusApplyConfiguration `json:"status,omitempty"` -} - -// VirtualMachineService constructs an declarative configuration of the VirtualMachineService type for use with -// apply. -func VirtualMachineService(name, namespace string) *VirtualMachineServiceApplyConfiguration { - b := &VirtualMachineServiceApplyConfiguration{} - b.WithName(name) - b.WithNamespace(namespace) - b.WithKind("VirtualMachineService") - b.WithAPIVersion("vmoperator.vmware.com/v1alpha1") - return b -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *VirtualMachineServiceApplyConfiguration) WithKind(value string) *VirtualMachineServiceApplyConfiguration { - b.Kind = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *VirtualMachineServiceApplyConfiguration) WithAPIVersion(value string) *VirtualMachineServiceApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *VirtualMachineServiceApplyConfiguration) WithName(value string) *VirtualMachineServiceApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value - return b -} - -// WithGenerateName sets the GenerateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GenerateName field is set to the value of the last call. -func (b *VirtualMachineServiceApplyConfiguration) WithGenerateName(value string) *VirtualMachineServiceApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *VirtualMachineServiceApplyConfiguration) WithNamespace(value string) *VirtualMachineServiceApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value - return b -} - -// WithUID sets the UID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UID field is set to the value of the last call. -func (b *VirtualMachineServiceApplyConfiguration) WithUID(value types.UID) *VirtualMachineServiceApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value - return b -} - -// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *VirtualMachineServiceApplyConfiguration) WithResourceVersion(value string) *VirtualMachineServiceApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value - return b -} - -// WithGeneration sets the Generation field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Generation field is set to the value of the last call. -func (b *VirtualMachineServiceApplyConfiguration) WithGeneration(value int64) *VirtualMachineServiceApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value - return b -} - -// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *VirtualMachineServiceApplyConfiguration) WithCreationTimestamp(value metav1.Time) *VirtualMachineServiceApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value - return b -} - -// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *VirtualMachineServiceApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *VirtualMachineServiceApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value - return b -} - -// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *VirtualMachineServiceApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *VirtualMachineServiceApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value - return b -} - -// WithLabels puts the entries into the Labels field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Labels field, -// overwriting an existing map entries in Labels field with the same key. -func (b *VirtualMachineServiceApplyConfiguration) WithLabels(entries map[string]string) *VirtualMachineServiceApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Labels[k] = v - } - return b -} - -// WithAnnotations puts the entries into the Annotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Annotations field, -// overwriting an existing map entries in Annotations field with the same key. -func (b *VirtualMachineServiceApplyConfiguration) WithAnnotations(entries map[string]string) *VirtualMachineServiceApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - return b -} - -// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *VirtualMachineServiceApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *VirtualMachineServiceApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) - } - return b -} - -// WithFinalizers adds the given value to the Finalizers field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *VirtualMachineServiceApplyConfiguration) WithFinalizers(values ...string) *VirtualMachineServiceApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *VirtualMachineServiceApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { - if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} - } -} - -// WithSpec sets the Spec field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Spec field is set to the value of the last call. -func (b *VirtualMachineServiceApplyConfiguration) WithSpec(value *VirtualMachineServiceSpecApplyConfiguration) *VirtualMachineServiceApplyConfiguration { - b.Spec = value - return b -} - -// WithStatus sets the Status field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Status field is set to the value of the last call. -func (b *VirtualMachineServiceApplyConfiguration) WithStatus(value *VirtualMachineServiceStatusApplyConfiguration) *VirtualMachineServiceApplyConfiguration { - b.Status = value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineserviceport.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineserviceport.go deleted file mode 100644 index 6bb05ecd1..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineserviceport.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// VirtualMachineServicePortApplyConfiguration represents an declarative configuration of the VirtualMachineServicePort type for use -// with apply. -type VirtualMachineServicePortApplyConfiguration struct { - Name *string `json:"name,omitempty"` - Protocol *string `json:"protocol,omitempty"` - Port *int32 `json:"port,omitempty"` - TargetPort *int32 `json:"targetPort,omitempty"` -} - -// VirtualMachineServicePortApplyConfiguration constructs an declarative configuration of the VirtualMachineServicePort type for use with -// apply. -func VirtualMachineServicePort() *VirtualMachineServicePortApplyConfiguration { - return &VirtualMachineServicePortApplyConfiguration{} -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *VirtualMachineServicePortApplyConfiguration) WithName(value string) *VirtualMachineServicePortApplyConfiguration { - b.Name = &value - return b -} - -// WithProtocol sets the Protocol field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Protocol field is set to the value of the last call. -func (b *VirtualMachineServicePortApplyConfiguration) WithProtocol(value string) *VirtualMachineServicePortApplyConfiguration { - b.Protocol = &value - return b -} - -// WithPort sets the Port field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Port field is set to the value of the last call. -func (b *VirtualMachineServicePortApplyConfiguration) WithPort(value int32) *VirtualMachineServicePortApplyConfiguration { - b.Port = &value - return b -} - -// WithTargetPort sets the TargetPort field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the TargetPort field is set to the value of the last call. -func (b *VirtualMachineServicePortApplyConfiguration) WithTargetPort(value int32) *VirtualMachineServicePortApplyConfiguration { - b.TargetPort = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineservicespec.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineservicespec.go deleted file mode 100644 index f6e690e95..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineservicespec.go +++ /dev/null @@ -1,110 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" -) - -// VirtualMachineServiceSpecApplyConfiguration represents an declarative configuration of the VirtualMachineServiceSpec type for use -// with apply. -type VirtualMachineServiceSpecApplyConfiguration struct { - Type *v1alpha1.VirtualMachineServiceType `json:"type,omitempty"` - Ports []VirtualMachineServicePortApplyConfiguration `json:"ports,omitempty"` - Selector map[string]string `json:"selector,omitempty"` - LoadBalancerIP *string `json:"loadBalancerIP,omitempty"` - LoadBalancerSourceRanges []string `json:"loadBalancerSourceRanges,omitempty"` - ClusterIP *string `json:"clusterIp,omitempty"` - ExternalName *string `json:"externalName,omitempty"` -} - -// VirtualMachineServiceSpecApplyConfiguration constructs an declarative configuration of the VirtualMachineServiceSpec type for use with -// apply. -func VirtualMachineServiceSpec() *VirtualMachineServiceSpecApplyConfiguration { - return &VirtualMachineServiceSpecApplyConfiguration{} -} - -// WithType sets the Type field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Type field is set to the value of the last call. -func (b *VirtualMachineServiceSpecApplyConfiguration) WithType(value v1alpha1.VirtualMachineServiceType) *VirtualMachineServiceSpecApplyConfiguration { - b.Type = &value - return b -} - -// WithPorts adds the given value to the Ports field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Ports field. -func (b *VirtualMachineServiceSpecApplyConfiguration) WithPorts(values ...*VirtualMachineServicePortApplyConfiguration) *VirtualMachineServiceSpecApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithPorts") - } - b.Ports = append(b.Ports, *values[i]) - } - return b -} - -// WithSelector puts the entries into the Selector field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Selector field, -// overwriting an existing map entries in Selector field with the same key. -func (b *VirtualMachineServiceSpecApplyConfiguration) WithSelector(entries map[string]string) *VirtualMachineServiceSpecApplyConfiguration { - if b.Selector == nil && len(entries) > 0 { - b.Selector = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Selector[k] = v - } - return b -} - -// WithLoadBalancerIP sets the LoadBalancerIP field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the LoadBalancerIP field is set to the value of the last call. -func (b *VirtualMachineServiceSpecApplyConfiguration) WithLoadBalancerIP(value string) *VirtualMachineServiceSpecApplyConfiguration { - b.LoadBalancerIP = &value - return b -} - -// WithLoadBalancerSourceRanges adds the given value to the LoadBalancerSourceRanges field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the LoadBalancerSourceRanges field. -func (b *VirtualMachineServiceSpecApplyConfiguration) WithLoadBalancerSourceRanges(values ...string) *VirtualMachineServiceSpecApplyConfiguration { - for i := range values { - b.LoadBalancerSourceRanges = append(b.LoadBalancerSourceRanges, values[i]) - } - return b -} - -// WithClusterIP sets the ClusterIP field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ClusterIP field is set to the value of the last call. -func (b *VirtualMachineServiceSpecApplyConfiguration) WithClusterIP(value string) *VirtualMachineServiceSpecApplyConfiguration { - b.ClusterIP = &value - return b -} - -// WithExternalName sets the ExternalName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ExternalName field is set to the value of the last call. -func (b *VirtualMachineServiceSpecApplyConfiguration) WithExternalName(value string) *VirtualMachineServiceSpecApplyConfiguration { - b.ExternalName = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineservicestatus.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineservicestatus.go deleted file mode 100644 index fd56ca568..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineservicestatus.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// VirtualMachineServiceStatusApplyConfiguration represents an declarative configuration of the VirtualMachineServiceStatus type for use -// with apply. -type VirtualMachineServiceStatusApplyConfiguration struct { - LoadBalancer *LoadBalancerStatusApplyConfiguration `json:"loadBalancer,omitempty"` -} - -// VirtualMachineServiceStatusApplyConfiguration constructs an declarative configuration of the VirtualMachineServiceStatus type for use with -// apply. -func VirtualMachineServiceStatus() *VirtualMachineServiceStatusApplyConfiguration { - return &VirtualMachineServiceStatusApplyConfiguration{} -} - -// WithLoadBalancer sets the LoadBalancer field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the LoadBalancer field is set to the value of the last call. -func (b *VirtualMachineServiceStatusApplyConfiguration) WithLoadBalancer(value *LoadBalancerStatusApplyConfiguration) *VirtualMachineServiceStatusApplyConfiguration { - b.LoadBalancer = value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinesetresourcepolicy.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinesetresourcepolicy.go deleted file mode 100644 index 70a341a46..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinesetresourcepolicy.go +++ /dev/null @@ -1,219 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// VirtualMachineSetResourcePolicyApplyConfiguration represents an declarative configuration of the VirtualMachineSetResourcePolicy type for use -// with apply. -type VirtualMachineSetResourcePolicyApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - Spec *VirtualMachineSetResourcePolicySpecApplyConfiguration `json:"spec,omitempty"` - Status *VirtualMachineSetResourcePolicyStatusApplyConfiguration `json:"status,omitempty"` -} - -// VirtualMachineSetResourcePolicy constructs an declarative configuration of the VirtualMachineSetResourcePolicy type for use with -// apply. -func VirtualMachineSetResourcePolicy(name, namespace string) *VirtualMachineSetResourcePolicyApplyConfiguration { - b := &VirtualMachineSetResourcePolicyApplyConfiguration{} - b.WithName(name) - b.WithNamespace(namespace) - b.WithKind("VirtualMachineSetResourcePolicy") - b.WithAPIVersion("vmoperator.vmware.com/v1alpha1") - return b -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *VirtualMachineSetResourcePolicyApplyConfiguration) WithKind(value string) *VirtualMachineSetResourcePolicyApplyConfiguration { - b.Kind = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *VirtualMachineSetResourcePolicyApplyConfiguration) WithAPIVersion(value string) *VirtualMachineSetResourcePolicyApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *VirtualMachineSetResourcePolicyApplyConfiguration) WithName(value string) *VirtualMachineSetResourcePolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value - return b -} - -// WithGenerateName sets the GenerateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GenerateName field is set to the value of the last call. -func (b *VirtualMachineSetResourcePolicyApplyConfiguration) WithGenerateName(value string) *VirtualMachineSetResourcePolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *VirtualMachineSetResourcePolicyApplyConfiguration) WithNamespace(value string) *VirtualMachineSetResourcePolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value - return b -} - -// WithUID sets the UID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UID field is set to the value of the last call. -func (b *VirtualMachineSetResourcePolicyApplyConfiguration) WithUID(value types.UID) *VirtualMachineSetResourcePolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value - return b -} - -// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *VirtualMachineSetResourcePolicyApplyConfiguration) WithResourceVersion(value string) *VirtualMachineSetResourcePolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value - return b -} - -// WithGeneration sets the Generation field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Generation field is set to the value of the last call. -func (b *VirtualMachineSetResourcePolicyApplyConfiguration) WithGeneration(value int64) *VirtualMachineSetResourcePolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value - return b -} - -// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *VirtualMachineSetResourcePolicyApplyConfiguration) WithCreationTimestamp(value metav1.Time) *VirtualMachineSetResourcePolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value - return b -} - -// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *VirtualMachineSetResourcePolicyApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *VirtualMachineSetResourcePolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value - return b -} - -// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *VirtualMachineSetResourcePolicyApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *VirtualMachineSetResourcePolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value - return b -} - -// WithLabels puts the entries into the Labels field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Labels field, -// overwriting an existing map entries in Labels field with the same key. -func (b *VirtualMachineSetResourcePolicyApplyConfiguration) WithLabels(entries map[string]string) *VirtualMachineSetResourcePolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Labels[k] = v - } - return b -} - -// WithAnnotations puts the entries into the Annotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Annotations field, -// overwriting an existing map entries in Annotations field with the same key. -func (b *VirtualMachineSetResourcePolicyApplyConfiguration) WithAnnotations(entries map[string]string) *VirtualMachineSetResourcePolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - return b -} - -// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *VirtualMachineSetResourcePolicyApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *VirtualMachineSetResourcePolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) - } - return b -} - -// WithFinalizers adds the given value to the Finalizers field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *VirtualMachineSetResourcePolicyApplyConfiguration) WithFinalizers(values ...string) *VirtualMachineSetResourcePolicyApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *VirtualMachineSetResourcePolicyApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { - if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} - } -} - -// WithSpec sets the Spec field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Spec field is set to the value of the last call. -func (b *VirtualMachineSetResourcePolicyApplyConfiguration) WithSpec(value *VirtualMachineSetResourcePolicySpecApplyConfiguration) *VirtualMachineSetResourcePolicyApplyConfiguration { - b.Spec = value - return b -} - -// WithStatus sets the Status field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Status field is set to the value of the last call. -func (b *VirtualMachineSetResourcePolicyApplyConfiguration) WithStatus(value *VirtualMachineSetResourcePolicyStatusApplyConfiguration) *VirtualMachineSetResourcePolicyApplyConfiguration { - b.Status = value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinesetresourcepolicyspec.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinesetresourcepolicyspec.go deleted file mode 100644 index b526ddcf1..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinesetresourcepolicyspec.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// VirtualMachineSetResourcePolicySpecApplyConfiguration represents an declarative configuration of the VirtualMachineSetResourcePolicySpec type for use -// with apply. -type VirtualMachineSetResourcePolicySpecApplyConfiguration struct { - ResourcePool *ResourcePoolSpecApplyConfiguration `json:"resourcepool,omitempty"` - Folder *FolderSpecApplyConfiguration `json:"folder,omitempty"` - ClusterModules []ClusterModuleSpecApplyConfiguration `json:"clustermodules,omitempty"` -} - -// VirtualMachineSetResourcePolicySpecApplyConfiguration constructs an declarative configuration of the VirtualMachineSetResourcePolicySpec type for use with -// apply. -func VirtualMachineSetResourcePolicySpec() *VirtualMachineSetResourcePolicySpecApplyConfiguration { - return &VirtualMachineSetResourcePolicySpecApplyConfiguration{} -} - -// WithResourcePool sets the ResourcePool field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourcePool field is set to the value of the last call. -func (b *VirtualMachineSetResourcePolicySpecApplyConfiguration) WithResourcePool(value *ResourcePoolSpecApplyConfiguration) *VirtualMachineSetResourcePolicySpecApplyConfiguration { - b.ResourcePool = value - return b -} - -// WithFolder sets the Folder field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Folder field is set to the value of the last call. -func (b *VirtualMachineSetResourcePolicySpecApplyConfiguration) WithFolder(value *FolderSpecApplyConfiguration) *VirtualMachineSetResourcePolicySpecApplyConfiguration { - b.Folder = value - return b -} - -// WithClusterModules adds the given value to the ClusterModules field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the ClusterModules field. -func (b *VirtualMachineSetResourcePolicySpecApplyConfiguration) WithClusterModules(values ...*ClusterModuleSpecApplyConfiguration) *VirtualMachineSetResourcePolicySpecApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithClusterModules") - } - b.ClusterModules = append(b.ClusterModules, *values[i]) - } - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinesetresourcepolicystatus.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinesetresourcepolicystatus.go deleted file mode 100644 index 82f17e84a..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinesetresourcepolicystatus.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// VirtualMachineSetResourcePolicyStatusApplyConfiguration represents an declarative configuration of the VirtualMachineSetResourcePolicyStatus type for use -// with apply. -type VirtualMachineSetResourcePolicyStatusApplyConfiguration struct { - ClusterModules []ClusterModuleStatusApplyConfiguration `json:"clustermodules,omitempty"` -} - -// VirtualMachineSetResourcePolicyStatusApplyConfiguration constructs an declarative configuration of the VirtualMachineSetResourcePolicyStatus type for use with -// apply. -func VirtualMachineSetResourcePolicyStatus() *VirtualMachineSetResourcePolicyStatusApplyConfiguration { - return &VirtualMachineSetResourcePolicyStatusApplyConfiguration{} -} - -// WithClusterModules adds the given value to the ClusterModules field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the ClusterModules field. -func (b *VirtualMachineSetResourcePolicyStatusApplyConfiguration) WithClusterModules(values ...*ClusterModuleStatusApplyConfiguration) *VirtualMachineSetResourcePolicyStatusApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithClusterModules") - } - b.ClusterModules = append(b.ClusterModules, *values[i]) - } - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinespec.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinespec.go deleted file mode 100644 index 130c472cc..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinespec.go +++ /dev/null @@ -1,148 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" -) - -// VirtualMachineSpecApplyConfiguration represents an declarative configuration of the VirtualMachineSpec type for use -// with apply. -type VirtualMachineSpecApplyConfiguration struct { - ImageName *string `json:"imageName,omitempty"` - ClassName *string `json:"className,omitempty"` - PowerState *v1alpha1.VirtualMachinePowerState `json:"powerState,omitempty"` - Ports []VirtualMachinePortApplyConfiguration `json:"ports,omitempty"` - VmMetadata *VirtualMachineMetadataApplyConfiguration `json:"vmMetadata,omitempty"` - StorageClass *string `json:"storageClass,omitempty"` - NetworkInterfaces []VirtualMachineNetworkInterfaceApplyConfiguration `json:"networkInterfaces,omitempty"` - ResourcePolicyName *string `json:"resourcePolicyName,omitempty"` - Volumes []VirtualMachineVolumeApplyConfiguration `json:"volumes,omitempty"` - ReadinessProbe *ProbeApplyConfiguration `json:"readinessProbe,omitempty"` - AdvancedOptions *VirtualMachineAdvancedOptionsApplyConfiguration `json:"advancedOptions,omitempty"` -} - -// VirtualMachineSpecApplyConfiguration constructs an declarative configuration of the VirtualMachineSpec type for use with -// apply. -func VirtualMachineSpec() *VirtualMachineSpecApplyConfiguration { - return &VirtualMachineSpecApplyConfiguration{} -} - -// WithImageName sets the ImageName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ImageName field is set to the value of the last call. -func (b *VirtualMachineSpecApplyConfiguration) WithImageName(value string) *VirtualMachineSpecApplyConfiguration { - b.ImageName = &value - return b -} - -// WithClassName sets the ClassName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ClassName field is set to the value of the last call. -func (b *VirtualMachineSpecApplyConfiguration) WithClassName(value string) *VirtualMachineSpecApplyConfiguration { - b.ClassName = &value - return b -} - -// WithPowerState sets the PowerState field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the PowerState field is set to the value of the last call. -func (b *VirtualMachineSpecApplyConfiguration) WithPowerState(value v1alpha1.VirtualMachinePowerState) *VirtualMachineSpecApplyConfiguration { - b.PowerState = &value - return b -} - -// WithPorts adds the given value to the Ports field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Ports field. -func (b *VirtualMachineSpecApplyConfiguration) WithPorts(values ...*VirtualMachinePortApplyConfiguration) *VirtualMachineSpecApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithPorts") - } - b.Ports = append(b.Ports, *values[i]) - } - return b -} - -// WithVmMetadata sets the VmMetadata field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the VmMetadata field is set to the value of the last call. -func (b *VirtualMachineSpecApplyConfiguration) WithVmMetadata(value *VirtualMachineMetadataApplyConfiguration) *VirtualMachineSpecApplyConfiguration { - b.VmMetadata = value - return b -} - -// WithStorageClass sets the StorageClass field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the StorageClass field is set to the value of the last call. -func (b *VirtualMachineSpecApplyConfiguration) WithStorageClass(value string) *VirtualMachineSpecApplyConfiguration { - b.StorageClass = &value - return b -} - -// WithNetworkInterfaces adds the given value to the NetworkInterfaces field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the NetworkInterfaces field. -func (b *VirtualMachineSpecApplyConfiguration) WithNetworkInterfaces(values ...*VirtualMachineNetworkInterfaceApplyConfiguration) *VirtualMachineSpecApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithNetworkInterfaces") - } - b.NetworkInterfaces = append(b.NetworkInterfaces, *values[i]) - } - return b -} - -// WithResourcePolicyName sets the ResourcePolicyName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourcePolicyName field is set to the value of the last call. -func (b *VirtualMachineSpecApplyConfiguration) WithResourcePolicyName(value string) *VirtualMachineSpecApplyConfiguration { - b.ResourcePolicyName = &value - return b -} - -// WithVolumes adds the given value to the Volumes field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Volumes field. -func (b *VirtualMachineSpecApplyConfiguration) WithVolumes(values ...*VirtualMachineVolumeApplyConfiguration) *VirtualMachineSpecApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithVolumes") - } - b.Volumes = append(b.Volumes, *values[i]) - } - return b -} - -// WithReadinessProbe sets the ReadinessProbe field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ReadinessProbe field is set to the value of the last call. -func (b *VirtualMachineSpecApplyConfiguration) WithReadinessProbe(value *ProbeApplyConfiguration) *VirtualMachineSpecApplyConfiguration { - b.ReadinessProbe = value - return b -} - -// WithAdvancedOptions sets the AdvancedOptions field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the AdvancedOptions field is set to the value of the last call. -func (b *VirtualMachineSpecApplyConfiguration) WithAdvancedOptions(value *VirtualMachineAdvancedOptionsApplyConfiguration) *VirtualMachineSpecApplyConfiguration { - b.AdvancedOptions = value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinestatus.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinestatus.go deleted file mode 100644 index 08581951f..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinestatus.go +++ /dev/null @@ -1,134 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" -) - -// VirtualMachineStatusApplyConfiguration represents an declarative configuration of the VirtualMachineStatus type for use -// with apply. -type VirtualMachineStatusApplyConfiguration struct { - Host *string `json:"host,omitempty"` - PowerState *v1alpha1.VirtualMachinePowerState `json:"powerState,omitempty"` - Phase *v1alpha1.VMStatusPhase `json:"phase,omitempty"` - Conditions []VirtualMachineConditionApplyConfiguration `json:"conditions,omitempty"` - VmIp *string `json:"vmIp,omitempty"` - UniqueID *string `json:"uniqueID,omitempty"` - BiosUUID *string `json:"biosUUID,omitempty"` - InstanceUUID *string `json:"instanceUUID,omitempty"` - Volumes []VirtualMachineVolumeStatusApplyConfiguration `json:"volumes,omitempty"` - ChangeBlockTracking *bool `json:"changeBlockTracking,omitempty"` -} - -// VirtualMachineStatusApplyConfiguration constructs an declarative configuration of the VirtualMachineStatus type for use with -// apply. -func VirtualMachineStatus() *VirtualMachineStatusApplyConfiguration { - return &VirtualMachineStatusApplyConfiguration{} -} - -// WithHost sets the Host field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Host field is set to the value of the last call. -func (b *VirtualMachineStatusApplyConfiguration) WithHost(value string) *VirtualMachineStatusApplyConfiguration { - b.Host = &value - return b -} - -// WithPowerState sets the PowerState field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the PowerState field is set to the value of the last call. -func (b *VirtualMachineStatusApplyConfiguration) WithPowerState(value v1alpha1.VirtualMachinePowerState) *VirtualMachineStatusApplyConfiguration { - b.PowerState = &value - return b -} - -// WithPhase sets the Phase field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Phase field is set to the value of the last call. -func (b *VirtualMachineStatusApplyConfiguration) WithPhase(value v1alpha1.VMStatusPhase) *VirtualMachineStatusApplyConfiguration { - b.Phase = &value - return b -} - -// WithConditions adds the given value to the Conditions field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Conditions field. -func (b *VirtualMachineStatusApplyConfiguration) WithConditions(values ...*VirtualMachineConditionApplyConfiguration) *VirtualMachineStatusApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithConditions") - } - b.Conditions = append(b.Conditions, *values[i]) - } - return b -} - -// WithVmIp sets the VmIp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the VmIp field is set to the value of the last call. -func (b *VirtualMachineStatusApplyConfiguration) WithVmIp(value string) *VirtualMachineStatusApplyConfiguration { - b.VmIp = &value - return b -} - -// WithUniqueID sets the UniqueID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UniqueID field is set to the value of the last call. -func (b *VirtualMachineStatusApplyConfiguration) WithUniqueID(value string) *VirtualMachineStatusApplyConfiguration { - b.UniqueID = &value - return b -} - -// WithBiosUUID sets the BiosUUID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the BiosUUID field is set to the value of the last call. -func (b *VirtualMachineStatusApplyConfiguration) WithBiosUUID(value string) *VirtualMachineStatusApplyConfiguration { - b.BiosUUID = &value - return b -} - -// WithInstanceUUID sets the InstanceUUID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the InstanceUUID field is set to the value of the last call. -func (b *VirtualMachineStatusApplyConfiguration) WithInstanceUUID(value string) *VirtualMachineStatusApplyConfiguration { - b.InstanceUUID = &value - return b -} - -// WithVolumes adds the given value to the Volumes field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Volumes field. -func (b *VirtualMachineStatusApplyConfiguration) WithVolumes(values ...*VirtualMachineVolumeStatusApplyConfiguration) *VirtualMachineStatusApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithVolumes") - } - b.Volumes = append(b.Volumes, *values[i]) - } - return b -} - -// WithChangeBlockTracking sets the ChangeBlockTracking field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ChangeBlockTracking field is set to the value of the last call. -func (b *VirtualMachineStatusApplyConfiguration) WithChangeBlockTracking(value bool) *VirtualMachineStatusApplyConfiguration { - b.ChangeBlockTracking = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinevolume.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinevolume.go deleted file mode 100644 index e27d36415..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinevolume.go +++ /dev/null @@ -1,79 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1 "k8s.io/api/core/v1" -) - -// VirtualMachineVolumeApplyConfiguration represents an declarative configuration of the VirtualMachineVolume type for use -// with apply. -type VirtualMachineVolumeApplyConfiguration struct { - Name *string `json:"name,omitempty"` - StoragePolicyID *string `json:"storagePolicyID,omitempty"` - StoragePolicyName *string `json:"storagePolicyName,omitempty"` - PersistentVolumeClaim *v1.PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty"` - VsphereVolume *VsphereVolumeSourceApplyConfiguration `json:"vSphereVolume,omitempty"` -} - -// VirtualMachineVolumeApplyConfiguration constructs an declarative configuration of the VirtualMachineVolume type for use with -// apply. -func VirtualMachineVolume() *VirtualMachineVolumeApplyConfiguration { - return &VirtualMachineVolumeApplyConfiguration{} -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *VirtualMachineVolumeApplyConfiguration) WithName(value string) *VirtualMachineVolumeApplyConfiguration { - b.Name = &value - return b -} - -// WithStoragePolicyID sets the StoragePolicyID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the StoragePolicyID field is set to the value of the last call. -func (b *VirtualMachineVolumeApplyConfiguration) WithStoragePolicyID(value string) *VirtualMachineVolumeApplyConfiguration { - b.StoragePolicyID = &value - return b -} - -// WithStoragePolicyName sets the StoragePolicyName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the StoragePolicyName field is set to the value of the last call. -func (b *VirtualMachineVolumeApplyConfiguration) WithStoragePolicyName(value string) *VirtualMachineVolumeApplyConfiguration { - b.StoragePolicyName = &value - return b -} - -// WithPersistentVolumeClaim sets the PersistentVolumeClaim field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the PersistentVolumeClaim field is set to the value of the last call. -func (b *VirtualMachineVolumeApplyConfiguration) WithPersistentVolumeClaim(value v1.PersistentVolumeClaimVolumeSource) *VirtualMachineVolumeApplyConfiguration { - b.PersistentVolumeClaim = &value - return b -} - -// WithVsphereVolume sets the VsphereVolume field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the VsphereVolume field is set to the value of the last call. -func (b *VirtualMachineVolumeApplyConfiguration) WithVsphereVolume(value *VsphereVolumeSourceApplyConfiguration) *VirtualMachineVolumeApplyConfiguration { - b.VsphereVolume = value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinevolumeprovisioningoptions.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinevolumeprovisioningoptions.go deleted file mode 100644 index d56f9b571..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinevolumeprovisioningoptions.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// VirtualMachineVolumeProvisioningOptionsApplyConfiguration represents an declarative configuration of the VirtualMachineVolumeProvisioningOptions type for use -// with apply. -type VirtualMachineVolumeProvisioningOptionsApplyConfiguration struct { - ThinProvisioned *bool `json:"thinProvisioned,omitempty"` - EagerZeroed *bool `json:"eagerZeroed,omitempty"` -} - -// VirtualMachineVolumeProvisioningOptionsApplyConfiguration constructs an declarative configuration of the VirtualMachineVolumeProvisioningOptions type for use with -// apply. -func VirtualMachineVolumeProvisioningOptions() *VirtualMachineVolumeProvisioningOptionsApplyConfiguration { - return &VirtualMachineVolumeProvisioningOptionsApplyConfiguration{} -} - -// WithThinProvisioned sets the ThinProvisioned field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ThinProvisioned field is set to the value of the last call. -func (b *VirtualMachineVolumeProvisioningOptionsApplyConfiguration) WithThinProvisioned(value bool) *VirtualMachineVolumeProvisioningOptionsApplyConfiguration { - b.ThinProvisioned = &value - return b -} - -// WithEagerZeroed sets the EagerZeroed field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the EagerZeroed field is set to the value of the last call. -func (b *VirtualMachineVolumeProvisioningOptionsApplyConfiguration) WithEagerZeroed(value bool) *VirtualMachineVolumeProvisioningOptionsApplyConfiguration { - b.EagerZeroed = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinevolumestatus.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinevolumestatus.go deleted file mode 100644 index cce7ae174..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinevolumestatus.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -// VirtualMachineVolumeStatusApplyConfiguration represents an declarative configuration of the VirtualMachineVolumeStatus type for use -// with apply. -type VirtualMachineVolumeStatusApplyConfiguration struct { - Name *string `json:"name,omitempty"` - Attached *bool `json:"attached,omitempty"` - DiskUuid *string `json:"diskUUID,omitempty"` - Error *string `json:"error,omitempty"` -} - -// VirtualMachineVolumeStatusApplyConfiguration constructs an declarative configuration of the VirtualMachineVolumeStatus type for use with -// apply. -func VirtualMachineVolumeStatus() *VirtualMachineVolumeStatusApplyConfiguration { - return &VirtualMachineVolumeStatusApplyConfiguration{} -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *VirtualMachineVolumeStatusApplyConfiguration) WithName(value string) *VirtualMachineVolumeStatusApplyConfiguration { - b.Name = &value - return b -} - -// WithAttached sets the Attached field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Attached field is set to the value of the last call. -func (b *VirtualMachineVolumeStatusApplyConfiguration) WithAttached(value bool) *VirtualMachineVolumeStatusApplyConfiguration { - b.Attached = &value - return b -} - -// WithDiskUuid sets the DiskUuid field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DiskUuid field is set to the value of the last call. -func (b *VirtualMachineVolumeStatusApplyConfiguration) WithDiskUuid(value string) *VirtualMachineVolumeStatusApplyConfiguration { - b.DiskUuid = &value - return b -} - -// WithError sets the Error field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Error field is set to the value of the last call. -func (b *VirtualMachineVolumeStatusApplyConfiguration) WithError(value string) *VirtualMachineVolumeStatusApplyConfiguration { - b.Error = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/vspherevolumesource.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/vspherevolumesource.go deleted file mode 100644 index 2387c8977..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/vspherevolumesource.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1 "k8s.io/api/core/v1" -) - -// VsphereVolumeSourceApplyConfiguration represents an declarative configuration of the VsphereVolumeSource type for use -// with apply. -type VsphereVolumeSourceApplyConfiguration struct { - Capacity *v1.ResourceList `json:"capacity,omitempty"` - DeviceKey *int `json:"deviceKey,omitempty"` -} - -// VsphereVolumeSourceApplyConfiguration constructs an declarative configuration of the VsphereVolumeSource type for use with -// apply. -func VsphereVolumeSource() *VsphereVolumeSourceApplyConfiguration { - return &VsphereVolumeSourceApplyConfiguration{} -} - -// WithCapacity sets the Capacity field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Capacity field is set to the value of the last call. -func (b *VsphereVolumeSourceApplyConfiguration) WithCapacity(value v1.ResourceList) *VsphereVolumeSourceApplyConfiguration { - b.Capacity = &value - return b -} - -// WithDeviceKey sets the DeviceKey field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeviceKey field is set to the value of the last call. -func (b *VsphereVolumeSourceApplyConfiguration) WithDeviceKey(value int) *VsphereVolumeSourceApplyConfiguration { - b.DeviceKey = &value - return b -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/clientset.go b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/clientset.go deleted file mode 100644 index 9ed22ed76..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/clientset.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package versioned - -import ( - "fmt" - "net/http" - - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" - vmoperatorv1alpha1 "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1" -) - -type Interface interface { - Discovery() discovery.DiscoveryInterface - VmoperatorV1alpha1() vmoperatorv1alpha1.VmoperatorV1alpha1Interface -} - -// Clientset contains the clients for groups. -type Clientset struct { - *discovery.DiscoveryClient - vmoperatorV1alpha1 *vmoperatorv1alpha1.VmoperatorV1alpha1Client -} - -// VmoperatorV1alpha1 retrieves the VmoperatorV1alpha1Client -func (c *Clientset) VmoperatorV1alpha1() vmoperatorv1alpha1.VmoperatorV1alpha1Interface { - return c.vmoperatorV1alpha1 -} - -// Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - if c == nil { - return nil - } - return c.DiscoveryClient -} - -// NewForConfig creates a new Clientset for the given config. -// If config's RateLimiter is not set and QPS and Burst are acceptable, -// NewForConfig will generate a rate-limiter in configShallowCopy. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*Clientset, error) { - configShallowCopy := *c - - if configShallowCopy.UserAgent == "" { - configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() - } - - // share the transport between all clients - httpClient, err := rest.HTTPClientFor(&configShallowCopy) - if err != nil { - return nil, err - } - - return NewForConfigAndClient(&configShallowCopy, httpClient) -} - -// NewForConfigAndClient creates a new Clientset for the given config and http client. -// Note the http client provided takes precedence over the configured transport values. -// If config's RateLimiter is not set and QPS and Burst are acceptable, -// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. -func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - if configShallowCopy.Burst <= 0 { - return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") - } - configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) - } - - var cs Clientset - var err error - cs.vmoperatorV1alpha1, err = vmoperatorv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) - if err != nil { - return nil, err - } - - cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) - if err != nil { - return nil, err - } - return &cs, nil -} - -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *Clientset { - cs, err := NewForConfig(c) - if err != nil { - panic(err) - } - return cs -} - -// New creates a new Clientset for the given RESTClient. -func New(c rest.Interface) *Clientset { - var cs Clientset - cs.vmoperatorV1alpha1 = vmoperatorv1alpha1.New(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClient(c) - return &cs -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/fake/clientset_generated.go b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/fake/clientset_generated.go deleted file mode 100644 index 9c2ad0903..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/fake/clientset_generated.go +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/discovery" - fakediscovery "k8s.io/client-go/discovery/fake" - "k8s.io/client-go/testing" - clientset "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned" - vmoperatorv1alpha1 "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1" - fakevmoperatorv1alpha1 "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake" -) - -// NewSimpleClientset returns a clientset that will respond with the provided objects. -// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement -// for a real clientset and is mostly useful in simple unit tests. -func NewSimpleClientset(objects ...runtime.Object) *Clientset { - o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) - for _, obj := range objects { - if err := o.Add(obj); err != nil { - panic(err) - } - } - - cs := &Clientset{tracker: o} - cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} - cs.AddReactor("*", "*", testing.ObjectReaction(o)) - cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { - gvr := action.GetResource() - ns := action.GetNamespace() - watch, err := o.Watch(gvr, ns) - if err != nil { - return false, nil, err - } - return true, watch, nil - }) - - return cs -} - -// Clientset implements clientset.Interface. Meant to be embedded into a -// struct to get a default implementation. This makes faking out just the method -// you want to test easier. -type Clientset struct { - testing.Fake - discovery *fakediscovery.FakeDiscovery - tracker testing.ObjectTracker -} - -func (c *Clientset) Discovery() discovery.DiscoveryInterface { - return c.discovery -} - -func (c *Clientset) Tracker() testing.ObjectTracker { - return c.tracker -} - -var ( - _ clientset.Interface = &Clientset{} - _ testing.FakeClient = &Clientset{} -) - -// VmoperatorV1alpha1 retrieves the VmoperatorV1alpha1Client -func (c *Clientset) VmoperatorV1alpha1() vmoperatorv1alpha1.VmoperatorV1alpha1Interface { - return &fakevmoperatorv1alpha1.FakeVmoperatorV1alpha1{Fake: &c.Fake} -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/fake/doc.go b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/fake/doc.go deleted file mode 100644 index 4b91eb6a6..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated fake clientset. -package fake diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/fake/register.go b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/fake/register.go deleted file mode 100644 index 456b37ed8..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/fake/register.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - vmoperatorv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" -) - -var scheme = runtime.NewScheme() -var codecs = serializer.NewCodecFactory(scheme) - -var localSchemeBuilder = runtime.SchemeBuilder{ - vmoperatorv1alpha1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(scheme)) -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/scheme/doc.go b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/scheme/doc.go deleted file mode 100644 index 6dc5e6530..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/scheme/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package contains the scheme of the automatically generated clientset. -package scheme diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/scheme/register.go b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/scheme/register.go deleted file mode 100644 index 0efd72eb4..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/scheme/register.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package scheme - -import ( - vmoperatorv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" -) - -var Scheme = runtime.NewScheme() -var Codecs = serializer.NewCodecFactory(Scheme) -var ParameterCodec = runtime.NewParameterCodec(Scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - vmoperatorv1alpha1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(Scheme)) -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/doc.go b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/doc.go deleted file mode 100644 index be4e7e92b..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1alpha1 diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/doc.go b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/doc.go deleted file mode 100644 index 43eec078a..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_virtualmachine.go b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_virtualmachine.go deleted file mode 100644 index ca88f1a2b..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_virtualmachine.go +++ /dev/null @@ -1,189 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" - vmopv1alpha1 "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1" -) - -// FakeVirtualMachines implements VirtualMachineInterface -type FakeVirtualMachines struct { - Fake *FakeVmoperatorV1alpha1 - ns string -} - -var virtualmachinesResource = v1alpha1.SchemeGroupVersion.WithResource("virtualmachines") - -var virtualmachinesKind = v1alpha1.SchemeGroupVersion.WithKind("VirtualMachine") - -// Get takes name of the virtualMachine, and returns the corresponding virtualMachine object, and an error if there is any. -func (c *FakeVirtualMachines) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VirtualMachine, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(virtualmachinesResource, c.ns, name), &v1alpha1.VirtualMachine{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachine), err -} - -// List takes label and field selectors, and returns the list of VirtualMachines that match those selectors. -func (c *FakeVirtualMachines) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VirtualMachineList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(virtualmachinesResource, virtualmachinesKind, c.ns, opts), &v1alpha1.VirtualMachineList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.VirtualMachineList{ListMeta: obj.(*v1alpha1.VirtualMachineList).ListMeta} - for _, item := range obj.(*v1alpha1.VirtualMachineList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested virtualMachines. -func (c *FakeVirtualMachines) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(virtualmachinesResource, c.ns, opts)) - -} - -// Create takes the representation of a virtualMachine and creates it. Returns the server's representation of the virtualMachine, and an error, if there is any. -func (c *FakeVirtualMachines) Create(ctx context.Context, virtualMachine *v1alpha1.VirtualMachine, opts v1.CreateOptions) (result *v1alpha1.VirtualMachine, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(virtualmachinesResource, c.ns, virtualMachine), &v1alpha1.VirtualMachine{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachine), err -} - -// Update takes the representation of a virtualMachine and updates it. Returns the server's representation of the virtualMachine, and an error, if there is any. -func (c *FakeVirtualMachines) Update(ctx context.Context, virtualMachine *v1alpha1.VirtualMachine, opts v1.UpdateOptions) (result *v1alpha1.VirtualMachine, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(virtualmachinesResource, c.ns, virtualMachine), &v1alpha1.VirtualMachine{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachine), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeVirtualMachines) UpdateStatus(ctx context.Context, virtualMachine *v1alpha1.VirtualMachine, opts v1.UpdateOptions) (*v1alpha1.VirtualMachine, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(virtualmachinesResource, "status", c.ns, virtualMachine), &v1alpha1.VirtualMachine{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachine), err -} - -// Delete takes name of the virtualMachine and deletes it. Returns an error if one occurs. -func (c *FakeVirtualMachines) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(virtualmachinesResource, c.ns, name, opts), &v1alpha1.VirtualMachine{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeVirtualMachines) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(virtualmachinesResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.VirtualMachineList{}) - return err -} - -// Patch applies the patch and returns the patched virtualMachine. -func (c *FakeVirtualMachines) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VirtualMachine, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(virtualmachinesResource, c.ns, name, pt, data, subresources...), &v1alpha1.VirtualMachine{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachine), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied virtualMachine. -func (c *FakeVirtualMachines) Apply(ctx context.Context, virtualMachine *vmopv1alpha1.VirtualMachineApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachine, err error) { - if virtualMachine == nil { - return nil, fmt.Errorf("virtualMachine provided to Apply must not be nil") - } - data, err := json.Marshal(virtualMachine) - if err != nil { - return nil, err - } - name := virtualMachine.Name - if name == nil { - return nil, fmt.Errorf("virtualMachine.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(virtualmachinesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.VirtualMachine{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachine), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeVirtualMachines) ApplyStatus(ctx context.Context, virtualMachine *vmopv1alpha1.VirtualMachineApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachine, err error) { - if virtualMachine == nil { - return nil, fmt.Errorf("virtualMachine provided to Apply must not be nil") - } - data, err := json.Marshal(virtualMachine) - if err != nil { - return nil, err - } - name := virtualMachine.Name - if name == nil { - return nil, fmt.Errorf("virtualMachine.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(virtualmachinesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.VirtualMachine{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachine), err -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_virtualmachineclass.go b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_virtualmachineclass.go deleted file mode 100644 index 23eb14817..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_virtualmachineclass.go +++ /dev/null @@ -1,178 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" - vmopv1alpha1 "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1" -) - -// FakeVirtualMachineClasses implements VirtualMachineClassInterface -type FakeVirtualMachineClasses struct { - Fake *FakeVmoperatorV1alpha1 -} - -var virtualmachineclassesResource = v1alpha1.SchemeGroupVersion.WithResource("virtualmachineclasses") - -var virtualmachineclassesKind = v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineClass") - -// Get takes name of the virtualMachineClass, and returns the corresponding virtualMachineClass object, and an error if there is any. -func (c *FakeVirtualMachineClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VirtualMachineClass, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(virtualmachineclassesResource, name), &v1alpha1.VirtualMachineClass{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineClass), err -} - -// List takes label and field selectors, and returns the list of VirtualMachineClasses that match those selectors. -func (c *FakeVirtualMachineClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VirtualMachineClassList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(virtualmachineclassesResource, virtualmachineclassesKind, opts), &v1alpha1.VirtualMachineClassList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.VirtualMachineClassList{ListMeta: obj.(*v1alpha1.VirtualMachineClassList).ListMeta} - for _, item := range obj.(*v1alpha1.VirtualMachineClassList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested virtualMachineClasses. -func (c *FakeVirtualMachineClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(virtualmachineclassesResource, opts)) -} - -// Create takes the representation of a virtualMachineClass and creates it. Returns the server's representation of the virtualMachineClass, and an error, if there is any. -func (c *FakeVirtualMachineClasses) Create(ctx context.Context, virtualMachineClass *v1alpha1.VirtualMachineClass, opts v1.CreateOptions) (result *v1alpha1.VirtualMachineClass, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(virtualmachineclassesResource, virtualMachineClass), &v1alpha1.VirtualMachineClass{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineClass), err -} - -// Update takes the representation of a virtualMachineClass and updates it. Returns the server's representation of the virtualMachineClass, and an error, if there is any. -func (c *FakeVirtualMachineClasses) Update(ctx context.Context, virtualMachineClass *v1alpha1.VirtualMachineClass, opts v1.UpdateOptions) (result *v1alpha1.VirtualMachineClass, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(virtualmachineclassesResource, virtualMachineClass), &v1alpha1.VirtualMachineClass{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineClass), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeVirtualMachineClasses) UpdateStatus(ctx context.Context, virtualMachineClass *v1alpha1.VirtualMachineClass, opts v1.UpdateOptions) (*v1alpha1.VirtualMachineClass, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(virtualmachineclassesResource, "status", virtualMachineClass), &v1alpha1.VirtualMachineClass{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineClass), err -} - -// Delete takes name of the virtualMachineClass and deletes it. Returns an error if one occurs. -func (c *FakeVirtualMachineClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(virtualmachineclassesResource, name, opts), &v1alpha1.VirtualMachineClass{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeVirtualMachineClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(virtualmachineclassesResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.VirtualMachineClassList{}) - return err -} - -// Patch applies the patch and returns the patched virtualMachineClass. -func (c *FakeVirtualMachineClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VirtualMachineClass, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(virtualmachineclassesResource, name, pt, data, subresources...), &v1alpha1.VirtualMachineClass{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineClass), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied virtualMachineClass. -func (c *FakeVirtualMachineClasses) Apply(ctx context.Context, virtualMachineClass *vmopv1alpha1.VirtualMachineClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineClass, err error) { - if virtualMachineClass == nil { - return nil, fmt.Errorf("virtualMachineClass provided to Apply must not be nil") - } - data, err := json.Marshal(virtualMachineClass) - if err != nil { - return nil, err - } - name := virtualMachineClass.Name - if name == nil { - return nil, fmt.Errorf("virtualMachineClass.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(virtualmachineclassesResource, *name, types.ApplyPatchType, data), &v1alpha1.VirtualMachineClass{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineClass), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeVirtualMachineClasses) ApplyStatus(ctx context.Context, virtualMachineClass *vmopv1alpha1.VirtualMachineClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineClass, err error) { - if virtualMachineClass == nil { - return nil, fmt.Errorf("virtualMachineClass provided to Apply must not be nil") - } - data, err := json.Marshal(virtualMachineClass) - if err != nil { - return nil, err - } - name := virtualMachineClass.Name - if name == nil { - return nil, fmt.Errorf("virtualMachineClass.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(virtualmachineclassesResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.VirtualMachineClass{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineClass), err -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_virtualmachineimage.go b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_virtualmachineimage.go deleted file mode 100644 index 02863b1a3..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_virtualmachineimage.go +++ /dev/null @@ -1,178 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" - vmopv1alpha1 "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1" -) - -// FakeVirtualMachineImages implements VirtualMachineImageInterface -type FakeVirtualMachineImages struct { - Fake *FakeVmoperatorV1alpha1 -} - -var virtualmachineimagesResource = v1alpha1.SchemeGroupVersion.WithResource("virtualmachineimages") - -var virtualmachineimagesKind = v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineImage") - -// Get takes name of the virtualMachineImage, and returns the corresponding virtualMachineImage object, and an error if there is any. -func (c *FakeVirtualMachineImages) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VirtualMachineImage, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(virtualmachineimagesResource, name), &v1alpha1.VirtualMachineImage{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineImage), err -} - -// List takes label and field selectors, and returns the list of VirtualMachineImages that match those selectors. -func (c *FakeVirtualMachineImages) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VirtualMachineImageList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(virtualmachineimagesResource, virtualmachineimagesKind, opts), &v1alpha1.VirtualMachineImageList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.VirtualMachineImageList{ListMeta: obj.(*v1alpha1.VirtualMachineImageList).ListMeta} - for _, item := range obj.(*v1alpha1.VirtualMachineImageList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested virtualMachineImages. -func (c *FakeVirtualMachineImages) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(virtualmachineimagesResource, opts)) -} - -// Create takes the representation of a virtualMachineImage and creates it. Returns the server's representation of the virtualMachineImage, and an error, if there is any. -func (c *FakeVirtualMachineImages) Create(ctx context.Context, virtualMachineImage *v1alpha1.VirtualMachineImage, opts v1.CreateOptions) (result *v1alpha1.VirtualMachineImage, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(virtualmachineimagesResource, virtualMachineImage), &v1alpha1.VirtualMachineImage{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineImage), err -} - -// Update takes the representation of a virtualMachineImage and updates it. Returns the server's representation of the virtualMachineImage, and an error, if there is any. -func (c *FakeVirtualMachineImages) Update(ctx context.Context, virtualMachineImage *v1alpha1.VirtualMachineImage, opts v1.UpdateOptions) (result *v1alpha1.VirtualMachineImage, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(virtualmachineimagesResource, virtualMachineImage), &v1alpha1.VirtualMachineImage{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineImage), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeVirtualMachineImages) UpdateStatus(ctx context.Context, virtualMachineImage *v1alpha1.VirtualMachineImage, opts v1.UpdateOptions) (*v1alpha1.VirtualMachineImage, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(virtualmachineimagesResource, "status", virtualMachineImage), &v1alpha1.VirtualMachineImage{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineImage), err -} - -// Delete takes name of the virtualMachineImage and deletes it. Returns an error if one occurs. -func (c *FakeVirtualMachineImages) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(virtualmachineimagesResource, name, opts), &v1alpha1.VirtualMachineImage{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeVirtualMachineImages) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(virtualmachineimagesResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.VirtualMachineImageList{}) - return err -} - -// Patch applies the patch and returns the patched virtualMachineImage. -func (c *FakeVirtualMachineImages) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VirtualMachineImage, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(virtualmachineimagesResource, name, pt, data, subresources...), &v1alpha1.VirtualMachineImage{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineImage), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied virtualMachineImage. -func (c *FakeVirtualMachineImages) Apply(ctx context.Context, virtualMachineImage *vmopv1alpha1.VirtualMachineImageApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineImage, err error) { - if virtualMachineImage == nil { - return nil, fmt.Errorf("virtualMachineImage provided to Apply must not be nil") - } - data, err := json.Marshal(virtualMachineImage) - if err != nil { - return nil, err - } - name := virtualMachineImage.Name - if name == nil { - return nil, fmt.Errorf("virtualMachineImage.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(virtualmachineimagesResource, *name, types.ApplyPatchType, data), &v1alpha1.VirtualMachineImage{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineImage), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeVirtualMachineImages) ApplyStatus(ctx context.Context, virtualMachineImage *vmopv1alpha1.VirtualMachineImageApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineImage, err error) { - if virtualMachineImage == nil { - return nil, fmt.Errorf("virtualMachineImage provided to Apply must not be nil") - } - data, err := json.Marshal(virtualMachineImage) - if err != nil { - return nil, err - } - name := virtualMachineImage.Name - if name == nil { - return nil, fmt.Errorf("virtualMachineImage.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(virtualmachineimagesResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.VirtualMachineImage{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineImage), err -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_virtualmachineservice.go b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_virtualmachineservice.go deleted file mode 100644 index e519b4504..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_virtualmachineservice.go +++ /dev/null @@ -1,189 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" - vmopv1alpha1 "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1" -) - -// FakeVirtualMachineServices implements VirtualMachineServiceInterface -type FakeVirtualMachineServices struct { - Fake *FakeVmoperatorV1alpha1 - ns string -} - -var virtualmachineservicesResource = v1alpha1.SchemeGroupVersion.WithResource("virtualmachineservices") - -var virtualmachineservicesKind = v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineService") - -// Get takes name of the virtualMachineService, and returns the corresponding virtualMachineService object, and an error if there is any. -func (c *FakeVirtualMachineServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VirtualMachineService, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(virtualmachineservicesResource, c.ns, name), &v1alpha1.VirtualMachineService{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineService), err -} - -// List takes label and field selectors, and returns the list of VirtualMachineServices that match those selectors. -func (c *FakeVirtualMachineServices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VirtualMachineServiceList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(virtualmachineservicesResource, virtualmachineservicesKind, c.ns, opts), &v1alpha1.VirtualMachineServiceList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.VirtualMachineServiceList{ListMeta: obj.(*v1alpha1.VirtualMachineServiceList).ListMeta} - for _, item := range obj.(*v1alpha1.VirtualMachineServiceList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested virtualMachineServices. -func (c *FakeVirtualMachineServices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(virtualmachineservicesResource, c.ns, opts)) - -} - -// Create takes the representation of a virtualMachineService and creates it. Returns the server's representation of the virtualMachineService, and an error, if there is any. -func (c *FakeVirtualMachineServices) Create(ctx context.Context, virtualMachineService *v1alpha1.VirtualMachineService, opts v1.CreateOptions) (result *v1alpha1.VirtualMachineService, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(virtualmachineservicesResource, c.ns, virtualMachineService), &v1alpha1.VirtualMachineService{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineService), err -} - -// Update takes the representation of a virtualMachineService and updates it. Returns the server's representation of the virtualMachineService, and an error, if there is any. -func (c *FakeVirtualMachineServices) Update(ctx context.Context, virtualMachineService *v1alpha1.VirtualMachineService, opts v1.UpdateOptions) (result *v1alpha1.VirtualMachineService, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(virtualmachineservicesResource, c.ns, virtualMachineService), &v1alpha1.VirtualMachineService{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineService), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeVirtualMachineServices) UpdateStatus(ctx context.Context, virtualMachineService *v1alpha1.VirtualMachineService, opts v1.UpdateOptions) (*v1alpha1.VirtualMachineService, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(virtualmachineservicesResource, "status", c.ns, virtualMachineService), &v1alpha1.VirtualMachineService{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineService), err -} - -// Delete takes name of the virtualMachineService and deletes it. Returns an error if one occurs. -func (c *FakeVirtualMachineServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(virtualmachineservicesResource, c.ns, name, opts), &v1alpha1.VirtualMachineService{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeVirtualMachineServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(virtualmachineservicesResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.VirtualMachineServiceList{}) - return err -} - -// Patch applies the patch and returns the patched virtualMachineService. -func (c *FakeVirtualMachineServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VirtualMachineService, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(virtualmachineservicesResource, c.ns, name, pt, data, subresources...), &v1alpha1.VirtualMachineService{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineService), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied virtualMachineService. -func (c *FakeVirtualMachineServices) Apply(ctx context.Context, virtualMachineService *vmopv1alpha1.VirtualMachineServiceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineService, err error) { - if virtualMachineService == nil { - return nil, fmt.Errorf("virtualMachineService provided to Apply must not be nil") - } - data, err := json.Marshal(virtualMachineService) - if err != nil { - return nil, err - } - name := virtualMachineService.Name - if name == nil { - return nil, fmt.Errorf("virtualMachineService.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(virtualmachineservicesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.VirtualMachineService{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineService), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeVirtualMachineServices) ApplyStatus(ctx context.Context, virtualMachineService *vmopv1alpha1.VirtualMachineServiceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineService, err error) { - if virtualMachineService == nil { - return nil, fmt.Errorf("virtualMachineService provided to Apply must not be nil") - } - data, err := json.Marshal(virtualMachineService) - if err != nil { - return nil, err - } - name := virtualMachineService.Name - if name == nil { - return nil, fmt.Errorf("virtualMachineService.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(virtualmachineservicesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.VirtualMachineService{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineService), err -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_virtualmachinesetresourcepolicy.go b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_virtualmachinesetresourcepolicy.go deleted file mode 100644 index 4ec9ea282..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_virtualmachinesetresourcepolicy.go +++ /dev/null @@ -1,189 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" - vmopv1alpha1 "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1" -) - -// FakeVirtualMachineSetResourcePolicies implements VirtualMachineSetResourcePolicyInterface -type FakeVirtualMachineSetResourcePolicies struct { - Fake *FakeVmoperatorV1alpha1 - ns string -} - -var virtualmachinesetresourcepoliciesResource = v1alpha1.SchemeGroupVersion.WithResource("virtualmachinesetresourcepolicies") - -var virtualmachinesetresourcepoliciesKind = v1alpha1.SchemeGroupVersion.WithKind("VirtualMachineSetResourcePolicy") - -// Get takes name of the virtualMachineSetResourcePolicy, and returns the corresponding virtualMachineSetResourcePolicy object, and an error if there is any. -func (c *FakeVirtualMachineSetResourcePolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VirtualMachineSetResourcePolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(virtualmachinesetresourcepoliciesResource, c.ns, name), &v1alpha1.VirtualMachineSetResourcePolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineSetResourcePolicy), err -} - -// List takes label and field selectors, and returns the list of VirtualMachineSetResourcePolicies that match those selectors. -func (c *FakeVirtualMachineSetResourcePolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VirtualMachineSetResourcePolicyList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(virtualmachinesetresourcepoliciesResource, virtualmachinesetresourcepoliciesKind, c.ns, opts), &v1alpha1.VirtualMachineSetResourcePolicyList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.VirtualMachineSetResourcePolicyList{ListMeta: obj.(*v1alpha1.VirtualMachineSetResourcePolicyList).ListMeta} - for _, item := range obj.(*v1alpha1.VirtualMachineSetResourcePolicyList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested virtualMachineSetResourcePolicies. -func (c *FakeVirtualMachineSetResourcePolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(virtualmachinesetresourcepoliciesResource, c.ns, opts)) - -} - -// Create takes the representation of a virtualMachineSetResourcePolicy and creates it. Returns the server's representation of the virtualMachineSetResourcePolicy, and an error, if there is any. -func (c *FakeVirtualMachineSetResourcePolicies) Create(ctx context.Context, virtualMachineSetResourcePolicy *v1alpha1.VirtualMachineSetResourcePolicy, opts v1.CreateOptions) (result *v1alpha1.VirtualMachineSetResourcePolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(virtualmachinesetresourcepoliciesResource, c.ns, virtualMachineSetResourcePolicy), &v1alpha1.VirtualMachineSetResourcePolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineSetResourcePolicy), err -} - -// Update takes the representation of a virtualMachineSetResourcePolicy and updates it. Returns the server's representation of the virtualMachineSetResourcePolicy, and an error, if there is any. -func (c *FakeVirtualMachineSetResourcePolicies) Update(ctx context.Context, virtualMachineSetResourcePolicy *v1alpha1.VirtualMachineSetResourcePolicy, opts v1.UpdateOptions) (result *v1alpha1.VirtualMachineSetResourcePolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(virtualmachinesetresourcepoliciesResource, c.ns, virtualMachineSetResourcePolicy), &v1alpha1.VirtualMachineSetResourcePolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineSetResourcePolicy), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeVirtualMachineSetResourcePolicies) UpdateStatus(ctx context.Context, virtualMachineSetResourcePolicy *v1alpha1.VirtualMachineSetResourcePolicy, opts v1.UpdateOptions) (*v1alpha1.VirtualMachineSetResourcePolicy, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(virtualmachinesetresourcepoliciesResource, "status", c.ns, virtualMachineSetResourcePolicy), &v1alpha1.VirtualMachineSetResourcePolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineSetResourcePolicy), err -} - -// Delete takes name of the virtualMachineSetResourcePolicy and deletes it. Returns an error if one occurs. -func (c *FakeVirtualMachineSetResourcePolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(virtualmachinesetresourcepoliciesResource, c.ns, name, opts), &v1alpha1.VirtualMachineSetResourcePolicy{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeVirtualMachineSetResourcePolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(virtualmachinesetresourcepoliciesResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.VirtualMachineSetResourcePolicyList{}) - return err -} - -// Patch applies the patch and returns the patched virtualMachineSetResourcePolicy. -func (c *FakeVirtualMachineSetResourcePolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VirtualMachineSetResourcePolicy, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(virtualmachinesetresourcepoliciesResource, c.ns, name, pt, data, subresources...), &v1alpha1.VirtualMachineSetResourcePolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineSetResourcePolicy), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied virtualMachineSetResourcePolicy. -func (c *FakeVirtualMachineSetResourcePolicies) Apply(ctx context.Context, virtualMachineSetResourcePolicy *vmopv1alpha1.VirtualMachineSetResourcePolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineSetResourcePolicy, err error) { - if virtualMachineSetResourcePolicy == nil { - return nil, fmt.Errorf("virtualMachineSetResourcePolicy provided to Apply must not be nil") - } - data, err := json.Marshal(virtualMachineSetResourcePolicy) - if err != nil { - return nil, err - } - name := virtualMachineSetResourcePolicy.Name - if name == nil { - return nil, fmt.Errorf("virtualMachineSetResourcePolicy.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(virtualmachinesetresourcepoliciesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.VirtualMachineSetResourcePolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineSetResourcePolicy), err -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeVirtualMachineSetResourcePolicies) ApplyStatus(ctx context.Context, virtualMachineSetResourcePolicy *vmopv1alpha1.VirtualMachineSetResourcePolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineSetResourcePolicy, err error) { - if virtualMachineSetResourcePolicy == nil { - return nil, fmt.Errorf("virtualMachineSetResourcePolicy provided to Apply must not be nil") - } - data, err := json.Marshal(virtualMachineSetResourcePolicy) - if err != nil { - return nil, err - } - name := virtualMachineSetResourcePolicy.Name - if name == nil { - return nil, fmt.Errorf("virtualMachineSetResourcePolicy.Name must be provided to Apply") - } - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(virtualmachinesetresourcepoliciesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.VirtualMachineSetResourcePolicy{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.VirtualMachineSetResourcePolicy), err -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_vmop_client.go b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_vmop_client.go deleted file mode 100644 index 50f4bb34a..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_vmop_client.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" - v1alpha1 "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1" -) - -type FakeVmoperatorV1alpha1 struct { - *testing.Fake -} - -func (c *FakeVmoperatorV1alpha1) VirtualMachines(namespace string) v1alpha1.VirtualMachineInterface { - return &FakeVirtualMachines{c, namespace} -} - -func (c *FakeVmoperatorV1alpha1) VirtualMachineClasses() v1alpha1.VirtualMachineClassInterface { - return &FakeVirtualMachineClasses{c} -} - -func (c *FakeVmoperatorV1alpha1) VirtualMachineImages() v1alpha1.VirtualMachineImageInterface { - return &FakeVirtualMachineImages{c} -} - -func (c *FakeVmoperatorV1alpha1) VirtualMachineServices(namespace string) v1alpha1.VirtualMachineServiceInterface { - return &FakeVirtualMachineServices{c, namespace} -} - -func (c *FakeVmoperatorV1alpha1) VirtualMachineSetResourcePolicies(namespace string) v1alpha1.VirtualMachineSetResourcePolicyInterface { - return &FakeVirtualMachineSetResourcePolicies{c, namespace} -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeVmoperatorV1alpha1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/generated_expansion.go b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/generated_expansion.go deleted file mode 100644 index b0e5b1489..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/generated_expansion.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -type VirtualMachineExpansion interface{} - -type VirtualMachineClassExpansion interface{} - -type VirtualMachineImageExpansion interface{} - -type VirtualMachineServiceExpansion interface{} - -type VirtualMachineSetResourcePolicyExpansion interface{} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/virtualmachine.go b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/virtualmachine.go deleted file mode 100644 index d3bf04fe4..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/virtualmachine.go +++ /dev/null @@ -1,256 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - json "encoding/json" - "fmt" - "time" - - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - vmopv1alpha1 "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1" - scheme "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/scheme" -) - -// VirtualMachinesGetter has a method to return a VirtualMachineInterface. -// A group's client should implement this interface. -type VirtualMachinesGetter interface { - VirtualMachines(namespace string) VirtualMachineInterface -} - -// VirtualMachineInterface has methods to work with VirtualMachine resources. -type VirtualMachineInterface interface { - Create(ctx context.Context, virtualMachine *v1alpha1.VirtualMachine, opts v1.CreateOptions) (*v1alpha1.VirtualMachine, error) - Update(ctx context.Context, virtualMachine *v1alpha1.VirtualMachine, opts v1.UpdateOptions) (*v1alpha1.VirtualMachine, error) - UpdateStatus(ctx context.Context, virtualMachine *v1alpha1.VirtualMachine, opts v1.UpdateOptions) (*v1alpha1.VirtualMachine, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.VirtualMachine, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.VirtualMachineList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VirtualMachine, err error) - Apply(ctx context.Context, virtualMachine *vmopv1alpha1.VirtualMachineApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachine, err error) - ApplyStatus(ctx context.Context, virtualMachine *vmopv1alpha1.VirtualMachineApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachine, err error) - VirtualMachineExpansion -} - -// virtualMachines implements VirtualMachineInterface -type virtualMachines struct { - client rest.Interface - ns string -} - -// newVirtualMachines returns a VirtualMachines -func newVirtualMachines(c *VmoperatorV1alpha1Client, namespace string) *virtualMachines { - return &virtualMachines{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the virtualMachine, and returns the corresponding virtualMachine object, and an error if there is any. -func (c *virtualMachines) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VirtualMachine, err error) { - result = &v1alpha1.VirtualMachine{} - err = c.client.Get(). - Namespace(c.ns). - Resource("virtualmachines"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VirtualMachines that match those selectors. -func (c *virtualMachines) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VirtualMachineList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.VirtualMachineList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("virtualmachines"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested virtualMachines. -func (c *virtualMachines) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("virtualmachines"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a virtualMachine and creates it. Returns the server's representation of the virtualMachine, and an error, if there is any. -func (c *virtualMachines) Create(ctx context.Context, virtualMachine *v1alpha1.VirtualMachine, opts v1.CreateOptions) (result *v1alpha1.VirtualMachine, err error) { - result = &v1alpha1.VirtualMachine{} - err = c.client.Post(). - Namespace(c.ns). - Resource("virtualmachines"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualMachine). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a virtualMachine and updates it. Returns the server's representation of the virtualMachine, and an error, if there is any. -func (c *virtualMachines) Update(ctx context.Context, virtualMachine *v1alpha1.VirtualMachine, opts v1.UpdateOptions) (result *v1alpha1.VirtualMachine, err error) { - result = &v1alpha1.VirtualMachine{} - err = c.client.Put(). - Namespace(c.ns). - Resource("virtualmachines"). - Name(virtualMachine.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualMachine). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *virtualMachines) UpdateStatus(ctx context.Context, virtualMachine *v1alpha1.VirtualMachine, opts v1.UpdateOptions) (result *v1alpha1.VirtualMachine, err error) { - result = &v1alpha1.VirtualMachine{} - err = c.client.Put(). - Namespace(c.ns). - Resource("virtualmachines"). - Name(virtualMachine.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualMachine). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the virtualMachine and deletes it. Returns an error if one occurs. -func (c *virtualMachines) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("virtualmachines"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *virtualMachines) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("virtualmachines"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched virtualMachine. -func (c *virtualMachines) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VirtualMachine, err error) { - result = &v1alpha1.VirtualMachine{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("virtualmachines"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied virtualMachine. -func (c *virtualMachines) Apply(ctx context.Context, virtualMachine *vmopv1alpha1.VirtualMachineApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachine, err error) { - if virtualMachine == nil { - return nil, fmt.Errorf("virtualMachine provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(virtualMachine) - if err != nil { - return nil, err - } - name := virtualMachine.Name - if name == nil { - return nil, fmt.Errorf("virtualMachine.Name must be provided to Apply") - } - result = &v1alpha1.VirtualMachine{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("virtualmachines"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *virtualMachines) ApplyStatus(ctx context.Context, virtualMachine *vmopv1alpha1.VirtualMachineApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachine, err error) { - if virtualMachine == nil { - return nil, fmt.Errorf("virtualMachine provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(virtualMachine) - if err != nil { - return nil, err - } - - name := virtualMachine.Name - if name == nil { - return nil, fmt.Errorf("virtualMachine.Name must be provided to Apply") - } - - result = &v1alpha1.VirtualMachine{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("virtualmachines"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/virtualmachineclass.go b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/virtualmachineclass.go deleted file mode 100644 index 89df625a4..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/virtualmachineclass.go +++ /dev/null @@ -1,243 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - json "encoding/json" - "fmt" - "time" - - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - vmopv1alpha1 "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1" - scheme "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/scheme" -) - -// VirtualMachineClassesGetter has a method to return a VirtualMachineClassInterface. -// A group's client should implement this interface. -type VirtualMachineClassesGetter interface { - VirtualMachineClasses() VirtualMachineClassInterface -} - -// VirtualMachineClassInterface has methods to work with VirtualMachineClass resources. -type VirtualMachineClassInterface interface { - Create(ctx context.Context, virtualMachineClass *v1alpha1.VirtualMachineClass, opts v1.CreateOptions) (*v1alpha1.VirtualMachineClass, error) - Update(ctx context.Context, virtualMachineClass *v1alpha1.VirtualMachineClass, opts v1.UpdateOptions) (*v1alpha1.VirtualMachineClass, error) - UpdateStatus(ctx context.Context, virtualMachineClass *v1alpha1.VirtualMachineClass, opts v1.UpdateOptions) (*v1alpha1.VirtualMachineClass, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.VirtualMachineClass, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.VirtualMachineClassList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VirtualMachineClass, err error) - Apply(ctx context.Context, virtualMachineClass *vmopv1alpha1.VirtualMachineClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineClass, err error) - ApplyStatus(ctx context.Context, virtualMachineClass *vmopv1alpha1.VirtualMachineClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineClass, err error) - VirtualMachineClassExpansion -} - -// virtualMachineClasses implements VirtualMachineClassInterface -type virtualMachineClasses struct { - client rest.Interface -} - -// newVirtualMachineClasses returns a VirtualMachineClasses -func newVirtualMachineClasses(c *VmoperatorV1alpha1Client) *virtualMachineClasses { - return &virtualMachineClasses{ - client: c.RESTClient(), - } -} - -// Get takes name of the virtualMachineClass, and returns the corresponding virtualMachineClass object, and an error if there is any. -func (c *virtualMachineClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VirtualMachineClass, err error) { - result = &v1alpha1.VirtualMachineClass{} - err = c.client.Get(). - Resource("virtualmachineclasses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VirtualMachineClasses that match those selectors. -func (c *virtualMachineClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VirtualMachineClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.VirtualMachineClassList{} - err = c.client.Get(). - Resource("virtualmachineclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested virtualMachineClasses. -func (c *virtualMachineClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("virtualmachineclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a virtualMachineClass and creates it. Returns the server's representation of the virtualMachineClass, and an error, if there is any. -func (c *virtualMachineClasses) Create(ctx context.Context, virtualMachineClass *v1alpha1.VirtualMachineClass, opts v1.CreateOptions) (result *v1alpha1.VirtualMachineClass, err error) { - result = &v1alpha1.VirtualMachineClass{} - err = c.client.Post(). - Resource("virtualmachineclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualMachineClass). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a virtualMachineClass and updates it. Returns the server's representation of the virtualMachineClass, and an error, if there is any. -func (c *virtualMachineClasses) Update(ctx context.Context, virtualMachineClass *v1alpha1.VirtualMachineClass, opts v1.UpdateOptions) (result *v1alpha1.VirtualMachineClass, err error) { - result = &v1alpha1.VirtualMachineClass{} - err = c.client.Put(). - Resource("virtualmachineclasses"). - Name(virtualMachineClass.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualMachineClass). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *virtualMachineClasses) UpdateStatus(ctx context.Context, virtualMachineClass *v1alpha1.VirtualMachineClass, opts v1.UpdateOptions) (result *v1alpha1.VirtualMachineClass, err error) { - result = &v1alpha1.VirtualMachineClass{} - err = c.client.Put(). - Resource("virtualmachineclasses"). - Name(virtualMachineClass.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualMachineClass). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the virtualMachineClass and deletes it. Returns an error if one occurs. -func (c *virtualMachineClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("virtualmachineclasses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *virtualMachineClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("virtualmachineclasses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched virtualMachineClass. -func (c *virtualMachineClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VirtualMachineClass, err error) { - result = &v1alpha1.VirtualMachineClass{} - err = c.client.Patch(pt). - Resource("virtualmachineclasses"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied virtualMachineClass. -func (c *virtualMachineClasses) Apply(ctx context.Context, virtualMachineClass *vmopv1alpha1.VirtualMachineClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineClass, err error) { - if virtualMachineClass == nil { - return nil, fmt.Errorf("virtualMachineClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(virtualMachineClass) - if err != nil { - return nil, err - } - name := virtualMachineClass.Name - if name == nil { - return nil, fmt.Errorf("virtualMachineClass.Name must be provided to Apply") - } - result = &v1alpha1.VirtualMachineClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("virtualmachineclasses"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *virtualMachineClasses) ApplyStatus(ctx context.Context, virtualMachineClass *vmopv1alpha1.VirtualMachineClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineClass, err error) { - if virtualMachineClass == nil { - return nil, fmt.Errorf("virtualMachineClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(virtualMachineClass) - if err != nil { - return nil, err - } - - name := virtualMachineClass.Name - if name == nil { - return nil, fmt.Errorf("virtualMachineClass.Name must be provided to Apply") - } - - result = &v1alpha1.VirtualMachineClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("virtualmachineclasses"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/virtualmachineimage.go b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/virtualmachineimage.go deleted file mode 100644 index d5d03b8f1..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/virtualmachineimage.go +++ /dev/null @@ -1,243 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - json "encoding/json" - "fmt" - "time" - - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - vmopv1alpha1 "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1" - scheme "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/scheme" -) - -// VirtualMachineImagesGetter has a method to return a VirtualMachineImageInterface. -// A group's client should implement this interface. -type VirtualMachineImagesGetter interface { - VirtualMachineImages() VirtualMachineImageInterface -} - -// VirtualMachineImageInterface has methods to work with VirtualMachineImage resources. -type VirtualMachineImageInterface interface { - Create(ctx context.Context, virtualMachineImage *v1alpha1.VirtualMachineImage, opts v1.CreateOptions) (*v1alpha1.VirtualMachineImage, error) - Update(ctx context.Context, virtualMachineImage *v1alpha1.VirtualMachineImage, opts v1.UpdateOptions) (*v1alpha1.VirtualMachineImage, error) - UpdateStatus(ctx context.Context, virtualMachineImage *v1alpha1.VirtualMachineImage, opts v1.UpdateOptions) (*v1alpha1.VirtualMachineImage, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.VirtualMachineImage, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.VirtualMachineImageList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VirtualMachineImage, err error) - Apply(ctx context.Context, virtualMachineImage *vmopv1alpha1.VirtualMachineImageApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineImage, err error) - ApplyStatus(ctx context.Context, virtualMachineImage *vmopv1alpha1.VirtualMachineImageApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineImage, err error) - VirtualMachineImageExpansion -} - -// virtualMachineImages implements VirtualMachineImageInterface -type virtualMachineImages struct { - client rest.Interface -} - -// newVirtualMachineImages returns a VirtualMachineImages -func newVirtualMachineImages(c *VmoperatorV1alpha1Client) *virtualMachineImages { - return &virtualMachineImages{ - client: c.RESTClient(), - } -} - -// Get takes name of the virtualMachineImage, and returns the corresponding virtualMachineImage object, and an error if there is any. -func (c *virtualMachineImages) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VirtualMachineImage, err error) { - result = &v1alpha1.VirtualMachineImage{} - err = c.client.Get(). - Resource("virtualmachineimages"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VirtualMachineImages that match those selectors. -func (c *virtualMachineImages) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VirtualMachineImageList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.VirtualMachineImageList{} - err = c.client.Get(). - Resource("virtualmachineimages"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested virtualMachineImages. -func (c *virtualMachineImages) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("virtualmachineimages"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a virtualMachineImage and creates it. Returns the server's representation of the virtualMachineImage, and an error, if there is any. -func (c *virtualMachineImages) Create(ctx context.Context, virtualMachineImage *v1alpha1.VirtualMachineImage, opts v1.CreateOptions) (result *v1alpha1.VirtualMachineImage, err error) { - result = &v1alpha1.VirtualMachineImage{} - err = c.client.Post(). - Resource("virtualmachineimages"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualMachineImage). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a virtualMachineImage and updates it. Returns the server's representation of the virtualMachineImage, and an error, if there is any. -func (c *virtualMachineImages) Update(ctx context.Context, virtualMachineImage *v1alpha1.VirtualMachineImage, opts v1.UpdateOptions) (result *v1alpha1.VirtualMachineImage, err error) { - result = &v1alpha1.VirtualMachineImage{} - err = c.client.Put(). - Resource("virtualmachineimages"). - Name(virtualMachineImage.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualMachineImage). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *virtualMachineImages) UpdateStatus(ctx context.Context, virtualMachineImage *v1alpha1.VirtualMachineImage, opts v1.UpdateOptions) (result *v1alpha1.VirtualMachineImage, err error) { - result = &v1alpha1.VirtualMachineImage{} - err = c.client.Put(). - Resource("virtualmachineimages"). - Name(virtualMachineImage.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualMachineImage). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the virtualMachineImage and deletes it. Returns an error if one occurs. -func (c *virtualMachineImages) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("virtualmachineimages"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *virtualMachineImages) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("virtualmachineimages"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched virtualMachineImage. -func (c *virtualMachineImages) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VirtualMachineImage, err error) { - result = &v1alpha1.VirtualMachineImage{} - err = c.client.Patch(pt). - Resource("virtualmachineimages"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied virtualMachineImage. -func (c *virtualMachineImages) Apply(ctx context.Context, virtualMachineImage *vmopv1alpha1.VirtualMachineImageApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineImage, err error) { - if virtualMachineImage == nil { - return nil, fmt.Errorf("virtualMachineImage provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(virtualMachineImage) - if err != nil { - return nil, err - } - name := virtualMachineImage.Name - if name == nil { - return nil, fmt.Errorf("virtualMachineImage.Name must be provided to Apply") - } - result = &v1alpha1.VirtualMachineImage{} - err = c.client.Patch(types.ApplyPatchType). - Resource("virtualmachineimages"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *virtualMachineImages) ApplyStatus(ctx context.Context, virtualMachineImage *vmopv1alpha1.VirtualMachineImageApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineImage, err error) { - if virtualMachineImage == nil { - return nil, fmt.Errorf("virtualMachineImage provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(virtualMachineImage) - if err != nil { - return nil, err - } - - name := virtualMachineImage.Name - if name == nil { - return nil, fmt.Errorf("virtualMachineImage.Name must be provided to Apply") - } - - result = &v1alpha1.VirtualMachineImage{} - err = c.client.Patch(types.ApplyPatchType). - Resource("virtualmachineimages"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/virtualmachineservice.go b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/virtualmachineservice.go deleted file mode 100644 index c7690c2ef..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/virtualmachineservice.go +++ /dev/null @@ -1,256 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - json "encoding/json" - "fmt" - "time" - - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - vmopv1alpha1 "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1" - scheme "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/scheme" -) - -// VirtualMachineServicesGetter has a method to return a VirtualMachineServiceInterface. -// A group's client should implement this interface. -type VirtualMachineServicesGetter interface { - VirtualMachineServices(namespace string) VirtualMachineServiceInterface -} - -// VirtualMachineServiceInterface has methods to work with VirtualMachineService resources. -type VirtualMachineServiceInterface interface { - Create(ctx context.Context, virtualMachineService *v1alpha1.VirtualMachineService, opts v1.CreateOptions) (*v1alpha1.VirtualMachineService, error) - Update(ctx context.Context, virtualMachineService *v1alpha1.VirtualMachineService, opts v1.UpdateOptions) (*v1alpha1.VirtualMachineService, error) - UpdateStatus(ctx context.Context, virtualMachineService *v1alpha1.VirtualMachineService, opts v1.UpdateOptions) (*v1alpha1.VirtualMachineService, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.VirtualMachineService, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.VirtualMachineServiceList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VirtualMachineService, err error) - Apply(ctx context.Context, virtualMachineService *vmopv1alpha1.VirtualMachineServiceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineService, err error) - ApplyStatus(ctx context.Context, virtualMachineService *vmopv1alpha1.VirtualMachineServiceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineService, err error) - VirtualMachineServiceExpansion -} - -// virtualMachineServices implements VirtualMachineServiceInterface -type virtualMachineServices struct { - client rest.Interface - ns string -} - -// newVirtualMachineServices returns a VirtualMachineServices -func newVirtualMachineServices(c *VmoperatorV1alpha1Client, namespace string) *virtualMachineServices { - return &virtualMachineServices{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the virtualMachineService, and returns the corresponding virtualMachineService object, and an error if there is any. -func (c *virtualMachineServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VirtualMachineService, err error) { - result = &v1alpha1.VirtualMachineService{} - err = c.client.Get(). - Namespace(c.ns). - Resource("virtualmachineservices"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VirtualMachineServices that match those selectors. -func (c *virtualMachineServices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VirtualMachineServiceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.VirtualMachineServiceList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("virtualmachineservices"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested virtualMachineServices. -func (c *virtualMachineServices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("virtualmachineservices"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a virtualMachineService and creates it. Returns the server's representation of the virtualMachineService, and an error, if there is any. -func (c *virtualMachineServices) Create(ctx context.Context, virtualMachineService *v1alpha1.VirtualMachineService, opts v1.CreateOptions) (result *v1alpha1.VirtualMachineService, err error) { - result = &v1alpha1.VirtualMachineService{} - err = c.client.Post(). - Namespace(c.ns). - Resource("virtualmachineservices"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualMachineService). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a virtualMachineService and updates it. Returns the server's representation of the virtualMachineService, and an error, if there is any. -func (c *virtualMachineServices) Update(ctx context.Context, virtualMachineService *v1alpha1.VirtualMachineService, opts v1.UpdateOptions) (result *v1alpha1.VirtualMachineService, err error) { - result = &v1alpha1.VirtualMachineService{} - err = c.client.Put(). - Namespace(c.ns). - Resource("virtualmachineservices"). - Name(virtualMachineService.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualMachineService). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *virtualMachineServices) UpdateStatus(ctx context.Context, virtualMachineService *v1alpha1.VirtualMachineService, opts v1.UpdateOptions) (result *v1alpha1.VirtualMachineService, err error) { - result = &v1alpha1.VirtualMachineService{} - err = c.client.Put(). - Namespace(c.ns). - Resource("virtualmachineservices"). - Name(virtualMachineService.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualMachineService). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the virtualMachineService and deletes it. Returns an error if one occurs. -func (c *virtualMachineServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("virtualmachineservices"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *virtualMachineServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("virtualmachineservices"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched virtualMachineService. -func (c *virtualMachineServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VirtualMachineService, err error) { - result = &v1alpha1.VirtualMachineService{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("virtualmachineservices"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied virtualMachineService. -func (c *virtualMachineServices) Apply(ctx context.Context, virtualMachineService *vmopv1alpha1.VirtualMachineServiceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineService, err error) { - if virtualMachineService == nil { - return nil, fmt.Errorf("virtualMachineService provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(virtualMachineService) - if err != nil { - return nil, err - } - name := virtualMachineService.Name - if name == nil { - return nil, fmt.Errorf("virtualMachineService.Name must be provided to Apply") - } - result = &v1alpha1.VirtualMachineService{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("virtualmachineservices"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *virtualMachineServices) ApplyStatus(ctx context.Context, virtualMachineService *vmopv1alpha1.VirtualMachineServiceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineService, err error) { - if virtualMachineService == nil { - return nil, fmt.Errorf("virtualMachineService provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(virtualMachineService) - if err != nil { - return nil, err - } - - name := virtualMachineService.Name - if name == nil { - return nil, fmt.Errorf("virtualMachineService.Name must be provided to Apply") - } - - result = &v1alpha1.VirtualMachineService{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("virtualmachineservices"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/virtualmachinesetresourcepolicy.go b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/virtualmachinesetresourcepolicy.go deleted file mode 100644 index 7e54ac1be..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/virtualmachinesetresourcepolicy.go +++ /dev/null @@ -1,256 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - json "encoding/json" - "fmt" - "time" - - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - vmopv1alpha1 "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1" - scheme "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/scheme" -) - -// VirtualMachineSetResourcePoliciesGetter has a method to return a VirtualMachineSetResourcePolicyInterface. -// A group's client should implement this interface. -type VirtualMachineSetResourcePoliciesGetter interface { - VirtualMachineSetResourcePolicies(namespace string) VirtualMachineSetResourcePolicyInterface -} - -// VirtualMachineSetResourcePolicyInterface has methods to work with VirtualMachineSetResourcePolicy resources. -type VirtualMachineSetResourcePolicyInterface interface { - Create(ctx context.Context, virtualMachineSetResourcePolicy *v1alpha1.VirtualMachineSetResourcePolicy, opts v1.CreateOptions) (*v1alpha1.VirtualMachineSetResourcePolicy, error) - Update(ctx context.Context, virtualMachineSetResourcePolicy *v1alpha1.VirtualMachineSetResourcePolicy, opts v1.UpdateOptions) (*v1alpha1.VirtualMachineSetResourcePolicy, error) - UpdateStatus(ctx context.Context, virtualMachineSetResourcePolicy *v1alpha1.VirtualMachineSetResourcePolicy, opts v1.UpdateOptions) (*v1alpha1.VirtualMachineSetResourcePolicy, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.VirtualMachineSetResourcePolicy, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.VirtualMachineSetResourcePolicyList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VirtualMachineSetResourcePolicy, err error) - Apply(ctx context.Context, virtualMachineSetResourcePolicy *vmopv1alpha1.VirtualMachineSetResourcePolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineSetResourcePolicy, err error) - ApplyStatus(ctx context.Context, virtualMachineSetResourcePolicy *vmopv1alpha1.VirtualMachineSetResourcePolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineSetResourcePolicy, err error) - VirtualMachineSetResourcePolicyExpansion -} - -// virtualMachineSetResourcePolicies implements VirtualMachineSetResourcePolicyInterface -type virtualMachineSetResourcePolicies struct { - client rest.Interface - ns string -} - -// newVirtualMachineSetResourcePolicies returns a VirtualMachineSetResourcePolicies -func newVirtualMachineSetResourcePolicies(c *VmoperatorV1alpha1Client, namespace string) *virtualMachineSetResourcePolicies { - return &virtualMachineSetResourcePolicies{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the virtualMachineSetResourcePolicy, and returns the corresponding virtualMachineSetResourcePolicy object, and an error if there is any. -func (c *virtualMachineSetResourcePolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VirtualMachineSetResourcePolicy, err error) { - result = &v1alpha1.VirtualMachineSetResourcePolicy{} - err = c.client.Get(). - Namespace(c.ns). - Resource("virtualmachinesetresourcepolicies"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VirtualMachineSetResourcePolicies that match those selectors. -func (c *virtualMachineSetResourcePolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VirtualMachineSetResourcePolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.VirtualMachineSetResourcePolicyList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("virtualmachinesetresourcepolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested virtualMachineSetResourcePolicies. -func (c *virtualMachineSetResourcePolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("virtualmachinesetresourcepolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a virtualMachineSetResourcePolicy and creates it. Returns the server's representation of the virtualMachineSetResourcePolicy, and an error, if there is any. -func (c *virtualMachineSetResourcePolicies) Create(ctx context.Context, virtualMachineSetResourcePolicy *v1alpha1.VirtualMachineSetResourcePolicy, opts v1.CreateOptions) (result *v1alpha1.VirtualMachineSetResourcePolicy, err error) { - result = &v1alpha1.VirtualMachineSetResourcePolicy{} - err = c.client.Post(). - Namespace(c.ns). - Resource("virtualmachinesetresourcepolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualMachineSetResourcePolicy). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a virtualMachineSetResourcePolicy and updates it. Returns the server's representation of the virtualMachineSetResourcePolicy, and an error, if there is any. -func (c *virtualMachineSetResourcePolicies) Update(ctx context.Context, virtualMachineSetResourcePolicy *v1alpha1.VirtualMachineSetResourcePolicy, opts v1.UpdateOptions) (result *v1alpha1.VirtualMachineSetResourcePolicy, err error) { - result = &v1alpha1.VirtualMachineSetResourcePolicy{} - err = c.client.Put(). - Namespace(c.ns). - Resource("virtualmachinesetresourcepolicies"). - Name(virtualMachineSetResourcePolicy.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualMachineSetResourcePolicy). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *virtualMachineSetResourcePolicies) UpdateStatus(ctx context.Context, virtualMachineSetResourcePolicy *v1alpha1.VirtualMachineSetResourcePolicy, opts v1.UpdateOptions) (result *v1alpha1.VirtualMachineSetResourcePolicy, err error) { - result = &v1alpha1.VirtualMachineSetResourcePolicy{} - err = c.client.Put(). - Namespace(c.ns). - Resource("virtualmachinesetresourcepolicies"). - Name(virtualMachineSetResourcePolicy.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualMachineSetResourcePolicy). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the virtualMachineSetResourcePolicy and deletes it. Returns an error if one occurs. -func (c *virtualMachineSetResourcePolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("virtualmachinesetresourcepolicies"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *virtualMachineSetResourcePolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("virtualmachinesetresourcepolicies"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched virtualMachineSetResourcePolicy. -func (c *virtualMachineSetResourcePolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VirtualMachineSetResourcePolicy, err error) { - result = &v1alpha1.VirtualMachineSetResourcePolicy{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("virtualmachinesetresourcepolicies"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied virtualMachineSetResourcePolicy. -func (c *virtualMachineSetResourcePolicies) Apply(ctx context.Context, virtualMachineSetResourcePolicy *vmopv1alpha1.VirtualMachineSetResourcePolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineSetResourcePolicy, err error) { - if virtualMachineSetResourcePolicy == nil { - return nil, fmt.Errorf("virtualMachineSetResourcePolicy provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(virtualMachineSetResourcePolicy) - if err != nil { - return nil, err - } - name := virtualMachineSetResourcePolicy.Name - if name == nil { - return nil, fmt.Errorf("virtualMachineSetResourcePolicy.Name must be provided to Apply") - } - result = &v1alpha1.VirtualMachineSetResourcePolicy{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("virtualmachinesetresourcepolicies"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *virtualMachineSetResourcePolicies) ApplyStatus(ctx context.Context, virtualMachineSetResourcePolicy *vmopv1alpha1.VirtualMachineSetResourcePolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualMachineSetResourcePolicy, err error) { - if virtualMachineSetResourcePolicy == nil { - return nil, fmt.Errorf("virtualMachineSetResourcePolicy provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(virtualMachineSetResourcePolicy) - if err != nil { - return nil, err - } - - name := virtualMachineSetResourcePolicy.Name - if name == nil { - return nil, fmt.Errorf("virtualMachineSetResourcePolicy.Name must be provided to Apply") - } - - result = &v1alpha1.VirtualMachineSetResourcePolicy{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("virtualmachinesetresourcepolicies"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/vmop_client.go b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/vmop_client.go deleted file mode 100644 index 1fbf5a3f7..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/vmop_client.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "net/http" - - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - rest "k8s.io/client-go/rest" - "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/scheme" -) - -type VmoperatorV1alpha1Interface interface { - RESTClient() rest.Interface - VirtualMachinesGetter - VirtualMachineClassesGetter - VirtualMachineImagesGetter - VirtualMachineServicesGetter - VirtualMachineSetResourcePoliciesGetter -} - -// VmoperatorV1alpha1Client is used to interact with features provided by the vmoperator.vmware.com group. -type VmoperatorV1alpha1Client struct { - restClient rest.Interface -} - -func (c *VmoperatorV1alpha1Client) VirtualMachines(namespace string) VirtualMachineInterface { - return newVirtualMachines(c, namespace) -} - -func (c *VmoperatorV1alpha1Client) VirtualMachineClasses() VirtualMachineClassInterface { - return newVirtualMachineClasses(c) -} - -func (c *VmoperatorV1alpha1Client) VirtualMachineImages() VirtualMachineImageInterface { - return newVirtualMachineImages(c) -} - -func (c *VmoperatorV1alpha1Client) VirtualMachineServices(namespace string) VirtualMachineServiceInterface { - return newVirtualMachineServices(c, namespace) -} - -func (c *VmoperatorV1alpha1Client) VirtualMachineSetResourcePolicies(namespace string) VirtualMachineSetResourcePolicyInterface { - return newVirtualMachineSetResourcePolicies(c, namespace) -} - -// NewForConfig creates a new VmoperatorV1alpha1Client for the given config. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*VmoperatorV1alpha1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - httpClient, err := rest.HTTPClientFor(&config) - if err != nil { - return nil, err - } - return NewForConfigAndClient(&config, httpClient) -} - -// NewForConfigAndClient creates a new VmoperatorV1alpha1Client for the given config and http client. -// Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *rest.Config, h *http.Client) (*VmoperatorV1alpha1Client, error) { - config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } - client, err := rest.RESTClientForConfigAndClient(&config, h) - if err != nil { - return nil, err - } - return &VmoperatorV1alpha1Client{client}, nil -} - -// NewForConfigOrDie creates a new VmoperatorV1alpha1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *VmoperatorV1alpha1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new VmoperatorV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *VmoperatorV1alpha1Client { - return &VmoperatorV1alpha1Client{c} -} - -func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } - - return nil -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *VmoperatorV1alpha1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/factory.go b/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/factory.go deleted file mode 100644 index f89f24169..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/factory.go +++ /dev/null @@ -1,261 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package externalversions - -import ( - reflect "reflect" - sync "sync" - time "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - cache "k8s.io/client-go/tools/cache" - versioned "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned" - internalinterfaces "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/internalinterfaces" - vmop "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop" -) - -// SharedInformerOption defines the functional option type for SharedInformerFactory. -type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory - -type sharedInformerFactory struct { - client versioned.Interface - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc - lock sync.Mutex - defaultResync time.Duration - customResync map[reflect.Type]time.Duration - transform cache.TransformFunc - - informers map[reflect.Type]cache.SharedIndexInformer - // startedInformers is used for tracking which informers have been started. - // This allows Start() to be called multiple times safely. - startedInformers map[reflect.Type]bool - // wg tracks how many goroutines were started. - wg sync.WaitGroup - // shuttingDown is true when Shutdown has been called. It may still be running - // because it needs to wait for goroutines. - shuttingDown bool -} - -// WithCustomResyncConfig sets a custom resync period for the specified informer types. -func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - for k, v := range resyncConfig { - factory.customResync[reflect.TypeOf(k)] = v - } - return factory - } -} - -// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. -func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.tweakListOptions = tweakListOptions - return factory - } -} - -// WithNamespace limits the SharedInformerFactory to the specified namespace. -func WithNamespace(namespace string) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.namespace = namespace - return factory - } -} - -// WithTransform sets a transform on all informers. -func WithTransform(transform cache.TransformFunc) SharedInformerOption { - return func(factory *sharedInformerFactory) *sharedInformerFactory { - factory.transform = transform - return factory - } -} - -// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. -func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync) -} - -// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. -// Listers obtained via this SharedInformerFactory will be subject to the same filters -// as specified here. -// Deprecated: Please use NewSharedInformerFactoryWithOptions instead -func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { - return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) -} - -// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. -func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { - factory := &sharedInformerFactory{ - client: client, - namespace: v1.NamespaceAll, - defaultResync: defaultResync, - informers: make(map[reflect.Type]cache.SharedIndexInformer), - startedInformers: make(map[reflect.Type]bool), - customResync: make(map[reflect.Type]time.Duration), - } - - // Apply all options - for _, opt := range options { - factory = opt(factory) - } - - return factory -} - -func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { - f.lock.Lock() - defer f.lock.Unlock() - - if f.shuttingDown { - return - } - - for informerType, informer := range f.informers { - if !f.startedInformers[informerType] { - f.wg.Add(1) - // We need a new variable in each loop iteration, - // otherwise the goroutine would use the loop variable - // and that keeps changing. - informer := informer - go func() { - defer f.wg.Done() - informer.Run(stopCh) - }() - f.startedInformers[informerType] = true - } - } -} - -func (f *sharedInformerFactory) Shutdown() { - f.lock.Lock() - f.shuttingDown = true - f.lock.Unlock() - - // Will return immediately if there is nothing to wait for. - f.wg.Wait() -} - -func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { - informers := func() map[reflect.Type]cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informers := map[reflect.Type]cache.SharedIndexInformer{} - for informerType, informer := range f.informers { - if f.startedInformers[informerType] { - informers[informerType] = informer - } - } - return informers - }() - - res := map[reflect.Type]bool{} - for informType, informer := range informers { - res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) - } - return res -} - -// InformerFor returns the SharedIndexInformer for obj using an internal -// client. -func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { - f.lock.Lock() - defer f.lock.Unlock() - - informerType := reflect.TypeOf(obj) - informer, exists := f.informers[informerType] - if exists { - return informer - } - - resyncPeriod, exists := f.customResync[informerType] - if !exists { - resyncPeriod = f.defaultResync - } - - informer = newFunc(f.client, resyncPeriod) - informer.SetTransform(f.transform) - f.informers[informerType] = informer - - return informer -} - -// SharedInformerFactory provides shared informers for resources in all known -// API group versions. -// -// It is typically used like this: -// -// ctx, cancel := context.Background() -// defer cancel() -// factory := NewSharedInformerFactory(client, resyncPeriod) -// defer factory.WaitForStop() // Returns immediately if nothing was started. -// genericInformer := factory.ForResource(resource) -// typedInformer := factory.SomeAPIGroup().V1().SomeType() -// factory.Start(ctx.Done()) // Start processing these informers. -// synced := factory.WaitForCacheSync(ctx.Done()) -// for v, ok := range synced { -// if !ok { -// fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v) -// return -// } -// } -// -// // Creating informers can also be created after Start, but then -// // Start must be called again: -// anotherGenericInformer := factory.ForResource(resource) -// factory.Start(ctx.Done()) -type SharedInformerFactory interface { - internalinterfaces.SharedInformerFactory - - // Start initializes all requested informers. They are handled in goroutines - // which run until the stop channel gets closed. - Start(stopCh <-chan struct{}) - - // Shutdown marks a factory as shutting down. At that point no new - // informers can be started anymore and Start will return without - // doing anything. - // - // In addition, Shutdown blocks until all goroutines have terminated. For that - // to happen, the close channel(s) that they were started with must be closed, - // either before Shutdown gets called or while it is waiting. - // - // Shutdown may be called multiple times, even concurrently. All such calls will - // block until all goroutines have terminated. - Shutdown() - - // WaitForCacheSync blocks until all started informers' caches were synced - // or the stop channel gets closed. - WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - - // ForResource gives generic access to a shared informer of the matching type. - ForResource(resource schema.GroupVersionResource) (GenericInformer, error) - - // InformerFor returns the SharedIndexInformer for obj using an internal - // client. - InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer - - Vmoperator() vmop.Interface -} - -func (f *sharedInformerFactory) Vmoperator() vmop.Interface { - return vmop.New(f, f.namespace, f.tweakListOptions) -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/generic.go b/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/generic.go deleted file mode 100644 index a4b33ab37..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/generic.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package externalversions - -import ( - "fmt" - - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - schema "k8s.io/apimachinery/pkg/runtime/schema" - cache "k8s.io/client-go/tools/cache" -) - -// GenericInformer is type of SharedIndexInformer which will locate and delegate to other -// sharedInformers based on type -type GenericInformer interface { - Informer() cache.SharedIndexInformer - Lister() cache.GenericLister -} - -type genericInformer struct { - informer cache.SharedIndexInformer - resource schema.GroupResource -} - -// Informer returns the SharedIndexInformer. -func (f *genericInformer) Informer() cache.SharedIndexInformer { - return f.informer -} - -// Lister returns the GenericLister. -func (f *genericInformer) Lister() cache.GenericLister { - return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) -} - -// ForResource gives generic access to a shared informer of the matching type -// TODO extend this to unknown resources with a client pool -func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { - switch resource { - // Group=vmoperator.vmware.com, Version=v1alpha1 - case v1alpha1.SchemeGroupVersion.WithResource("virtualmachines"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Vmoperator().V1alpha1().VirtualMachines().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("virtualmachineclasses"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Vmoperator().V1alpha1().VirtualMachineClasses().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("virtualmachineimages"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Vmoperator().V1alpha1().VirtualMachineImages().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("virtualmachineservices"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Vmoperator().V1alpha1().VirtualMachineServices().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("virtualmachinesetresourcepolicies"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Vmoperator().V1alpha1().VirtualMachineSetResourcePolicies().Informer()}, nil - - } - - return nil, fmt.Errorf("no informer found for %v", resource) -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/internalinterfaces/factory_interfaces.go deleted file mode 100644 index 38baf81e2..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/internalinterfaces/factory_interfaces.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package internalinterfaces - -import ( - time "time" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - cache "k8s.io/client-go/tools/cache" - versioned "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned" -) - -// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. -type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer - -// SharedInformerFactory a small interface to allow for adding an informer without an import cycle -type SharedInformerFactory interface { - Start(stopCh <-chan struct{}) - InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer -} - -// TweakListOptionsFunc is a function that transforms a v1.ListOptions. -type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/interface.go b/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/interface.go deleted file mode 100644 index 3c7c0a15b..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/interface.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package vmop - -import ( - internalinterfaces "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/internalinterfaces" - v1alpha1 "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1" -) - -// Interface provides access to each of this group's versions. -type Interface interface { - // V1alpha1 provides access to shared informers for resources in V1alpha1. - V1alpha1() v1alpha1.Interface -} - -type group struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// V1alpha1 returns a new v1alpha1.Interface. -func (g *group) V1alpha1() v1alpha1.Interface { - return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/interface.go b/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/interface.go deleted file mode 100644 index c63350753..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/interface.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - internalinterfaces "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/internalinterfaces" -) - -// Interface provides access to all the informers in this group version. -type Interface interface { - // VirtualMachines returns a VirtualMachineInformer. - VirtualMachines() VirtualMachineInformer - // VirtualMachineClasses returns a VirtualMachineClassInformer. - VirtualMachineClasses() VirtualMachineClassInformer - // VirtualMachineImages returns a VirtualMachineImageInformer. - VirtualMachineImages() VirtualMachineImageInformer - // VirtualMachineServices returns a VirtualMachineServiceInformer. - VirtualMachineServices() VirtualMachineServiceInformer - // VirtualMachineSetResourcePolicies returns a VirtualMachineSetResourcePolicyInformer. - VirtualMachineSetResourcePolicies() VirtualMachineSetResourcePolicyInformer -} - -type version struct { - factory internalinterfaces.SharedInformerFactory - namespace string - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// New returns a new Interface. -func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { - return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} -} - -// VirtualMachines returns a VirtualMachineInformer. -func (v *version) VirtualMachines() VirtualMachineInformer { - return &virtualMachineInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - -// VirtualMachineClasses returns a VirtualMachineClassInformer. -func (v *version) VirtualMachineClasses() VirtualMachineClassInformer { - return &virtualMachineClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// VirtualMachineImages returns a VirtualMachineImageInformer. -func (v *version) VirtualMachineImages() VirtualMachineImageInformer { - return &virtualMachineImageInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// VirtualMachineServices returns a VirtualMachineServiceInformer. -func (v *version) VirtualMachineServices() VirtualMachineServiceInformer { - return &virtualMachineServiceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - -// VirtualMachineSetResourcePolicies returns a VirtualMachineSetResourcePolicyInformer. -func (v *version) VirtualMachineSetResourcePolicies() VirtualMachineSetResourcePolicyInformer { - return &virtualMachineSetResourcePolicyInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/virtualmachine.go b/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/virtualmachine.go deleted file mode 100644 index d53911942..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/virtualmachine.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - time "time" - - vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" - versioned "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned" - internalinterfaces "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/internalinterfaces" - v1alpha1 "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1" -) - -// VirtualMachineInformer provides access to a shared informer and lister for -// VirtualMachines. -type VirtualMachineInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha1.VirtualMachineLister -} - -type virtualMachineInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewVirtualMachineInformer constructs a new informer for VirtualMachine type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewVirtualMachineInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredVirtualMachineInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredVirtualMachineInformer constructs a new informer for VirtualMachine type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredVirtualMachineInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.VmoperatorV1alpha1().VirtualMachines(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.VmoperatorV1alpha1().VirtualMachines(namespace).Watch(context.TODO(), options) - }, - }, - &vmopv1alpha1.VirtualMachine{}, - resyncPeriod, - indexers, - ) -} - -func (f *virtualMachineInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredVirtualMachineInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *virtualMachineInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&vmopv1alpha1.VirtualMachine{}, f.defaultInformer) -} - -func (f *virtualMachineInformer) Lister() v1alpha1.VirtualMachineLister { - return v1alpha1.NewVirtualMachineLister(f.Informer().GetIndexer()) -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/virtualmachineclass.go b/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/virtualmachineclass.go deleted file mode 100644 index 4ee0066c5..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/virtualmachineclass.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - time "time" - - vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" - versioned "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned" - internalinterfaces "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/internalinterfaces" - v1alpha1 "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1" -) - -// VirtualMachineClassInformer provides access to a shared informer and lister for -// VirtualMachineClasses. -type VirtualMachineClassInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha1.VirtualMachineClassLister -} - -type virtualMachineClassInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewVirtualMachineClassInformer constructs a new informer for VirtualMachineClass type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewVirtualMachineClassInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredVirtualMachineClassInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredVirtualMachineClassInformer constructs a new informer for VirtualMachineClass type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredVirtualMachineClassInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.VmoperatorV1alpha1().VirtualMachineClasses().List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.VmoperatorV1alpha1().VirtualMachineClasses().Watch(context.TODO(), options) - }, - }, - &vmopv1alpha1.VirtualMachineClass{}, - resyncPeriod, - indexers, - ) -} - -func (f *virtualMachineClassInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredVirtualMachineClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *virtualMachineClassInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&vmopv1alpha1.VirtualMachineClass{}, f.defaultInformer) -} - -func (f *virtualMachineClassInformer) Lister() v1alpha1.VirtualMachineClassLister { - return v1alpha1.NewVirtualMachineClassLister(f.Informer().GetIndexer()) -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/virtualmachineimage.go b/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/virtualmachineimage.go deleted file mode 100644 index beda0e4fe..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/virtualmachineimage.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - time "time" - - vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" - versioned "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned" - internalinterfaces "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/internalinterfaces" - v1alpha1 "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1" -) - -// VirtualMachineImageInformer provides access to a shared informer and lister for -// VirtualMachineImages. -type VirtualMachineImageInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha1.VirtualMachineImageLister -} - -type virtualMachineImageInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewVirtualMachineImageInformer constructs a new informer for VirtualMachineImage type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewVirtualMachineImageInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredVirtualMachineImageInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredVirtualMachineImageInformer constructs a new informer for VirtualMachineImage type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredVirtualMachineImageInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.VmoperatorV1alpha1().VirtualMachineImages().List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.VmoperatorV1alpha1().VirtualMachineImages().Watch(context.TODO(), options) - }, - }, - &vmopv1alpha1.VirtualMachineImage{}, - resyncPeriod, - indexers, - ) -} - -func (f *virtualMachineImageInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredVirtualMachineImageInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *virtualMachineImageInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&vmopv1alpha1.VirtualMachineImage{}, f.defaultInformer) -} - -func (f *virtualMachineImageInformer) Lister() v1alpha1.VirtualMachineImageLister { - return v1alpha1.NewVirtualMachineImageLister(f.Informer().GetIndexer()) -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/virtualmachineservice.go b/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/virtualmachineservice.go deleted file mode 100644 index 4b51ff16e..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/virtualmachineservice.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - time "time" - - vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" - versioned "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned" - internalinterfaces "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/internalinterfaces" - v1alpha1 "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1" -) - -// VirtualMachineServiceInformer provides access to a shared informer and lister for -// VirtualMachineServices. -type VirtualMachineServiceInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha1.VirtualMachineServiceLister -} - -type virtualMachineServiceInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewVirtualMachineServiceInformer constructs a new informer for VirtualMachineService type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewVirtualMachineServiceInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredVirtualMachineServiceInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredVirtualMachineServiceInformer constructs a new informer for VirtualMachineService type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredVirtualMachineServiceInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.VmoperatorV1alpha1().VirtualMachineServices(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.VmoperatorV1alpha1().VirtualMachineServices(namespace).Watch(context.TODO(), options) - }, - }, - &vmopv1alpha1.VirtualMachineService{}, - resyncPeriod, - indexers, - ) -} - -func (f *virtualMachineServiceInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredVirtualMachineServiceInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *virtualMachineServiceInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&vmopv1alpha1.VirtualMachineService{}, f.defaultInformer) -} - -func (f *virtualMachineServiceInformer) Lister() v1alpha1.VirtualMachineServiceLister { - return v1alpha1.NewVirtualMachineServiceLister(f.Informer().GetIndexer()) -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/virtualmachinesetresourcepolicy.go b/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/virtualmachinesetresourcepolicy.go deleted file mode 100644 index d564924f1..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/virtualmachinesetresourcepolicy.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - "context" - time "time" - - vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" - versioned "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned" - internalinterfaces "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/internalinterfaces" - v1alpha1 "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1" -) - -// VirtualMachineSetResourcePolicyInformer provides access to a shared informer and lister for -// VirtualMachineSetResourcePolicies. -type VirtualMachineSetResourcePolicyInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha1.VirtualMachineSetResourcePolicyLister -} - -type virtualMachineSetResourcePolicyInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewVirtualMachineSetResourcePolicyInformer constructs a new informer for VirtualMachineSetResourcePolicy type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewVirtualMachineSetResourcePolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredVirtualMachineSetResourcePolicyInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredVirtualMachineSetResourcePolicyInformer constructs a new informer for VirtualMachineSetResourcePolicy type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredVirtualMachineSetResourcePolicyInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.VmoperatorV1alpha1().VirtualMachineSetResourcePolicies(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.VmoperatorV1alpha1().VirtualMachineSetResourcePolicies(namespace).Watch(context.TODO(), options) - }, - }, - &vmopv1alpha1.VirtualMachineSetResourcePolicy{}, - resyncPeriod, - indexers, - ) -} - -func (f *virtualMachineSetResourcePolicyInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredVirtualMachineSetResourcePolicyInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *virtualMachineSetResourcePolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&vmopv1alpha1.VirtualMachineSetResourcePolicy{}, f.defaultInformer) -} - -func (f *virtualMachineSetResourcePolicyInformer) Lister() v1alpha1.VirtualMachineSetResourcePolicyLister { - return v1alpha1.NewVirtualMachineSetResourcePolicyLister(f.Informer().GetIndexer()) -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/expansion_generated.go b/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/expansion_generated.go deleted file mode 100644 index b688353a7..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/expansion_generated.go +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha1 - -// VirtualMachineListerExpansion allows custom methods to be added to -// VirtualMachineLister. -type VirtualMachineListerExpansion interface{} - -// VirtualMachineNamespaceListerExpansion allows custom methods to be added to -// VirtualMachineNamespaceLister. -type VirtualMachineNamespaceListerExpansion interface{} - -// VirtualMachineClassListerExpansion allows custom methods to be added to -// VirtualMachineClassLister. -type VirtualMachineClassListerExpansion interface{} - -// VirtualMachineImageListerExpansion allows custom methods to be added to -// VirtualMachineImageLister. -type VirtualMachineImageListerExpansion interface{} - -// VirtualMachineServiceListerExpansion allows custom methods to be added to -// VirtualMachineServiceLister. -type VirtualMachineServiceListerExpansion interface{} - -// VirtualMachineServiceNamespaceListerExpansion allows custom methods to be added to -// VirtualMachineServiceNamespaceLister. -type VirtualMachineServiceNamespaceListerExpansion interface{} - -// VirtualMachineSetResourcePolicyListerExpansion allows custom methods to be added to -// VirtualMachineSetResourcePolicyLister. -type VirtualMachineSetResourcePolicyListerExpansion interface{} - -// VirtualMachineSetResourcePolicyNamespaceListerExpansion allows custom methods to be added to -// VirtualMachineSetResourcePolicyNamespaceLister. -type VirtualMachineSetResourcePolicyNamespaceListerExpansion interface{} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/virtualmachine.go b/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/virtualmachine.go deleted file mode 100644 index ebbed93fc..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/virtualmachine.go +++ /dev/null @@ -1,99 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// VirtualMachineLister helps list VirtualMachines. -// All objects returned here must be treated as read-only. -type VirtualMachineLister interface { - // List lists all VirtualMachines in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.VirtualMachine, err error) - // VirtualMachines returns an object that can list and get VirtualMachines. - VirtualMachines(namespace string) VirtualMachineNamespaceLister - VirtualMachineListerExpansion -} - -// virtualMachineLister implements the VirtualMachineLister interface. -type virtualMachineLister struct { - indexer cache.Indexer -} - -// NewVirtualMachineLister returns a new VirtualMachineLister. -func NewVirtualMachineLister(indexer cache.Indexer) VirtualMachineLister { - return &virtualMachineLister{indexer: indexer} -} - -// List lists all VirtualMachines in the indexer. -func (s *virtualMachineLister) List(selector labels.Selector) (ret []*v1alpha1.VirtualMachine, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.VirtualMachine)) - }) - return ret, err -} - -// VirtualMachines returns an object that can list and get VirtualMachines. -func (s *virtualMachineLister) VirtualMachines(namespace string) VirtualMachineNamespaceLister { - return virtualMachineNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// VirtualMachineNamespaceLister helps list and get VirtualMachines. -// All objects returned here must be treated as read-only. -type VirtualMachineNamespaceLister interface { - // List lists all VirtualMachines in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.VirtualMachine, err error) - // Get retrieves the VirtualMachine from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.VirtualMachine, error) - VirtualMachineNamespaceListerExpansion -} - -// virtualMachineNamespaceLister implements the VirtualMachineNamespaceLister -// interface. -type virtualMachineNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VirtualMachines in the indexer for a given namespace. -func (s virtualMachineNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.VirtualMachine, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.VirtualMachine)) - }) - return ret, err -} - -// Get retrieves the VirtualMachine from the indexer for a given namespace and name. -func (s virtualMachineNamespaceLister) Get(name string) (*v1alpha1.VirtualMachine, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("virtualmachine"), name) - } - return obj.(*v1alpha1.VirtualMachine), nil -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/virtualmachineclass.go b/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/virtualmachineclass.go deleted file mode 100644 index a189482e5..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/virtualmachineclass.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// VirtualMachineClassLister helps list VirtualMachineClasses. -// All objects returned here must be treated as read-only. -type VirtualMachineClassLister interface { - // List lists all VirtualMachineClasses in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.VirtualMachineClass, err error) - // Get retrieves the VirtualMachineClass from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.VirtualMachineClass, error) - VirtualMachineClassListerExpansion -} - -// virtualMachineClassLister implements the VirtualMachineClassLister interface. -type virtualMachineClassLister struct { - indexer cache.Indexer -} - -// NewVirtualMachineClassLister returns a new VirtualMachineClassLister. -func NewVirtualMachineClassLister(indexer cache.Indexer) VirtualMachineClassLister { - return &virtualMachineClassLister{indexer: indexer} -} - -// List lists all VirtualMachineClasses in the indexer. -func (s *virtualMachineClassLister) List(selector labels.Selector) (ret []*v1alpha1.VirtualMachineClass, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.VirtualMachineClass)) - }) - return ret, err -} - -// Get retrieves the VirtualMachineClass from the index for a given name. -func (s *virtualMachineClassLister) Get(name string) (*v1alpha1.VirtualMachineClass, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("virtualmachineclass"), name) - } - return obj.(*v1alpha1.VirtualMachineClass), nil -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/virtualmachineimage.go b/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/virtualmachineimage.go deleted file mode 100644 index fd1941b99..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/virtualmachineimage.go +++ /dev/null @@ -1,68 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// VirtualMachineImageLister helps list VirtualMachineImages. -// All objects returned here must be treated as read-only. -type VirtualMachineImageLister interface { - // List lists all VirtualMachineImages in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.VirtualMachineImage, err error) - // Get retrieves the VirtualMachineImage from the index for a given name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.VirtualMachineImage, error) - VirtualMachineImageListerExpansion -} - -// virtualMachineImageLister implements the VirtualMachineImageLister interface. -type virtualMachineImageLister struct { - indexer cache.Indexer -} - -// NewVirtualMachineImageLister returns a new VirtualMachineImageLister. -func NewVirtualMachineImageLister(indexer cache.Indexer) VirtualMachineImageLister { - return &virtualMachineImageLister{indexer: indexer} -} - -// List lists all VirtualMachineImages in the indexer. -func (s *virtualMachineImageLister) List(selector labels.Selector) (ret []*v1alpha1.VirtualMachineImage, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.VirtualMachineImage)) - }) - return ret, err -} - -// Get retrieves the VirtualMachineImage from the index for a given name. -func (s *virtualMachineImageLister) Get(name string) (*v1alpha1.VirtualMachineImage, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("virtualmachineimage"), name) - } - return obj.(*v1alpha1.VirtualMachineImage), nil -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/virtualmachineservice.go b/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/virtualmachineservice.go deleted file mode 100644 index f05e0af98..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/virtualmachineservice.go +++ /dev/null @@ -1,99 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// VirtualMachineServiceLister helps list VirtualMachineServices. -// All objects returned here must be treated as read-only. -type VirtualMachineServiceLister interface { - // List lists all VirtualMachineServices in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.VirtualMachineService, err error) - // VirtualMachineServices returns an object that can list and get VirtualMachineServices. - VirtualMachineServices(namespace string) VirtualMachineServiceNamespaceLister - VirtualMachineServiceListerExpansion -} - -// virtualMachineServiceLister implements the VirtualMachineServiceLister interface. -type virtualMachineServiceLister struct { - indexer cache.Indexer -} - -// NewVirtualMachineServiceLister returns a new VirtualMachineServiceLister. -func NewVirtualMachineServiceLister(indexer cache.Indexer) VirtualMachineServiceLister { - return &virtualMachineServiceLister{indexer: indexer} -} - -// List lists all VirtualMachineServices in the indexer. -func (s *virtualMachineServiceLister) List(selector labels.Selector) (ret []*v1alpha1.VirtualMachineService, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.VirtualMachineService)) - }) - return ret, err -} - -// VirtualMachineServices returns an object that can list and get VirtualMachineServices. -func (s *virtualMachineServiceLister) VirtualMachineServices(namespace string) VirtualMachineServiceNamespaceLister { - return virtualMachineServiceNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// VirtualMachineServiceNamespaceLister helps list and get VirtualMachineServices. -// All objects returned here must be treated as read-only. -type VirtualMachineServiceNamespaceLister interface { - // List lists all VirtualMachineServices in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.VirtualMachineService, err error) - // Get retrieves the VirtualMachineService from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.VirtualMachineService, error) - VirtualMachineServiceNamespaceListerExpansion -} - -// virtualMachineServiceNamespaceLister implements the VirtualMachineServiceNamespaceLister -// interface. -type virtualMachineServiceNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VirtualMachineServices in the indexer for a given namespace. -func (s virtualMachineServiceNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.VirtualMachineService, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.VirtualMachineService)) - }) - return ret, err -} - -// Get retrieves the VirtualMachineService from the indexer for a given namespace and name. -func (s virtualMachineServiceNamespaceLister) Get(name string) (*v1alpha1.VirtualMachineService, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("virtualmachineservice"), name) - } - return obj.(*v1alpha1.VirtualMachineService), nil -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/virtualmachinesetresourcepolicy.go b/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/virtualmachinesetresourcepolicy.go deleted file mode 100644 index d7288b287..000000000 --- a/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/virtualmachinesetresourcepolicy.go +++ /dev/null @@ -1,99 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// VirtualMachineSetResourcePolicyLister helps list VirtualMachineSetResourcePolicies. -// All objects returned here must be treated as read-only. -type VirtualMachineSetResourcePolicyLister interface { - // List lists all VirtualMachineSetResourcePolicies in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.VirtualMachineSetResourcePolicy, err error) - // VirtualMachineSetResourcePolicies returns an object that can list and get VirtualMachineSetResourcePolicies. - VirtualMachineSetResourcePolicies(namespace string) VirtualMachineSetResourcePolicyNamespaceLister - VirtualMachineSetResourcePolicyListerExpansion -} - -// virtualMachineSetResourcePolicyLister implements the VirtualMachineSetResourcePolicyLister interface. -type virtualMachineSetResourcePolicyLister struct { - indexer cache.Indexer -} - -// NewVirtualMachineSetResourcePolicyLister returns a new VirtualMachineSetResourcePolicyLister. -func NewVirtualMachineSetResourcePolicyLister(indexer cache.Indexer) VirtualMachineSetResourcePolicyLister { - return &virtualMachineSetResourcePolicyLister{indexer: indexer} -} - -// List lists all VirtualMachineSetResourcePolicies in the indexer. -func (s *virtualMachineSetResourcePolicyLister) List(selector labels.Selector) (ret []*v1alpha1.VirtualMachineSetResourcePolicy, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.VirtualMachineSetResourcePolicy)) - }) - return ret, err -} - -// VirtualMachineSetResourcePolicies returns an object that can list and get VirtualMachineSetResourcePolicies. -func (s *virtualMachineSetResourcePolicyLister) VirtualMachineSetResourcePolicies(namespace string) VirtualMachineSetResourcePolicyNamespaceLister { - return virtualMachineSetResourcePolicyNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// VirtualMachineSetResourcePolicyNamespaceLister helps list and get VirtualMachineSetResourcePolicies. -// All objects returned here must be treated as read-only. -type VirtualMachineSetResourcePolicyNamespaceLister interface { - // List lists all VirtualMachineSetResourcePolicies in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.VirtualMachineSetResourcePolicy, err error) - // Get retrieves the VirtualMachineSetResourcePolicy from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.VirtualMachineSetResourcePolicy, error) - VirtualMachineSetResourcePolicyNamespaceListerExpansion -} - -// virtualMachineSetResourcePolicyNamespaceLister implements the VirtualMachineSetResourcePolicyNamespaceLister -// interface. -type virtualMachineSetResourcePolicyNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VirtualMachineSetResourcePolicies in the indexer for a given namespace. -func (s virtualMachineSetResourcePolicyNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.VirtualMachineSetResourcePolicy, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.VirtualMachineSetResourcePolicy)) - }) - return ret, err -} - -// Get retrieves the VirtualMachineSetResourcePolicy from the indexer for a given namespace and name. -func (s virtualMachineSetResourcePolicyNamespaceLister) Get(name string) (*v1alpha1.VirtualMachineSetResourcePolicy, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("virtualmachinesetresourcepolicy"), name) - } - return obj.(*v1alpha1.VirtualMachineSetResourcePolicy), nil -} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmoperator.go b/pkg/cloudprovider/vsphereparavirtual/vmoperator.go index 5bc0fcb9e..e1b5a87ad 100644 --- a/pkg/cloudprovider/vsphereparavirtual/vmoperator.go +++ b/pkg/cloudprovider/vsphereparavirtual/vmoperator.go @@ -9,12 +9,12 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/cloud-provider-vsphere/pkg/util" - vmopclient "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned" + vmop "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmoperator" ) // discoverNodeByProviderID takes a ProviderID and returns a VirtualMachine if one exists, or nil otherwise // VirtualMachine not found is not an error -func discoverNodeByProviderID(ctx context.Context, providerID string, namespace string, vmClient vmopclient.Interface) (*vmopv1alpha1.VirtualMachine, error) { +func discoverNodeByProviderID(ctx context.Context, providerID string, namespace string, vmClient vmop.VmoperatorV1alpha1Interface) (*vmopv1alpha1.VirtualMachine, error) { var discoveredNode *vmopv1alpha1.VirtualMachine = nil // Adding Retry here because there is no retry in caller from node controller @@ -24,7 +24,7 @@ func discoverNodeByProviderID(ctx context.Context, providerID string, namespace checkError, func() error { uuid := GetUUIDFromProviderID(providerID) - vms, err := vmClient.VmoperatorV1alpha1().VirtualMachines(namespace).List(ctx, metav1.ListOptions{}) + vms, err := vmClient.VirtualMachines(namespace).List(ctx, metav1.ListOptions{}) if err != nil { return err } @@ -44,7 +44,7 @@ func discoverNodeByProviderID(ctx context.Context, providerID string, namespace // discoverNodeByName takes a node name and returns a VirtualMachine if one exists, or nil otherwise // VirtualMachine not found is not an error -func discoverNodeByName(ctx context.Context, name types.NodeName, namespace string, vmClient vmopclient.Interface) (*vmopv1alpha1.VirtualMachine, error) { +func discoverNodeByName(ctx context.Context, name types.NodeName, namespace string, vmClient vmop.VmoperatorV1alpha1Interface) (*vmopv1alpha1.VirtualMachine, error) { var discoveredNode *vmopv1alpha1.VirtualMachine = nil // Adding Retry here because there is no retry in caller from node controller @@ -53,7 +53,7 @@ func discoverNodeByName(ctx context.Context, name types.NodeName, namespace stri DiscoverNodeBackoff, checkError, func() error { - vm, err := vmClient.VmoperatorV1alpha1().VirtualMachines(namespace).Get(ctx, string(name), metav1.GetOptions{}) + vm, err := vmClient.VirtualMachines(namespace).Get(ctx, string(name), metav1.GetOptions{}) if err != nil { if apierrors.IsNotFound(err) { return nil diff --git a/pkg/cloudprovider/vsphereparavirtual/vmoperator/client/client.go b/pkg/cloudprovider/vsphereparavirtual/vmoperator/client/client.go new file mode 100644 index 000000000..d34e1901e --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmoperator/client/client.go @@ -0,0 +1,60 @@ +package client + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/client-go/dynamic" + "k8s.io/client-go/rest" + + vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" + + "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmoperator" +) + +var ( + VirtualMachineServiceGVR = schema.GroupVersionResource{ + Group: "vmoperator.vmware.com", + Version: "v1alpha1", + Resource: "virtualmachineservices", + } + + VirtualMachineGVR = schema.GroupVersionResource{ + Group: "vmoperator.vmware.com", + Version: "v1alpha1", + Resource: "virtualmachines", + } +) + +type VmoperatorV1alpha1Client struct { + dynamicClient *dynamic.DynamicClient +} + +func (c *VmoperatorV1alpha1Client) VirtualMachines(namespace string) vmoperator.VirtualMachineInterface { + return newVirtualMachines(c, namespace) +} + +func (c *VmoperatorV1alpha1Client) VirtualMachineServices(namespace string) vmoperator.VirtualMachineServiceInterface { + return newVirtualMachineServices(c, namespace) +} + +func (c *VmoperatorV1alpha1Client) Client() dynamic.Interface { + if c == nil { + return nil + } + return c.dynamicClient +} + +func NewForConfig(c *rest.Config) (*VmoperatorV1alpha1Client, error) { + scheme := runtime.NewScheme() + _ = vmopv1alpha1.AddToScheme(scheme) + + dynamicClient, err := dynamic.NewForConfig(c) + if err != nil { + return nil, err + } + + client := &VmoperatorV1alpha1Client{ + dynamicClient: dynamicClient, + } + return client, nil +} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmoperator/client/fake_client.go b/pkg/cloudprovider/vsphereparavirtual/vmoperator/client/fake_client.go new file mode 100644 index 000000000..16f33d4c8 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmoperator/client/fake_client.go @@ -0,0 +1,34 @@ +package client + +import ( + "k8s.io/client-go/dynamic" + dynamicfake "k8s.io/client-go/dynamic/fake" + + "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmoperator" +) + +type FakeClient struct { + DynamicClient *dynamicfake.FakeDynamicClient +} + +// NewFakeClientWrapper creates a FakeClientWrapper +func NewFakeClient(fakeClient *dynamicfake.FakeDynamicClient) *FakeClient { + fcw := FakeClient{} + fcw.DynamicClient = fakeClient + return &fcw +} + +func (c *FakeClient) VirtualMachines(namespace string) vmoperator.VirtualMachineInterface { + return newVirtualMachines(c, namespace) +} + +func (c *FakeClient) VirtualMachineServices(namespace string) vmoperator.VirtualMachineServiceInterface { + return newVirtualMachineServices(c, namespace) +} + +func (c *FakeClient) Client() dynamic.Interface { + if c == nil { + return nil + } + return c.DynamicClient +} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmoperator/client/virtualmachine_client.go b/pkg/cloudprovider/vsphereparavirtual/vmoperator/client/virtualmachine_client.go new file mode 100644 index 000000000..e6b89e2b7 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmoperator/client/virtualmachine_client.go @@ -0,0 +1,87 @@ +package client + +import ( + "context" + + vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/dynamic" + + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + + "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmoperator" +) + +// virtualMachines implements VirtualMachineInterface +type virtualMachines struct { + client dynamic.Interface + ns string +} + +func newVirtualMachines(c vmoperator.VmoperatorV1alpha1Interface, namespace string) *virtualMachines { + return &virtualMachines{ + client: c.Client(), + ns: namespace, + } +} + +func (v *virtualMachines) Create(ctx context.Context, virtualMachine *vmopv1alpha1.VirtualMachine, opts v1.CreateOptions) (*vmopv1alpha1.VirtualMachine, error) { + unstructuredObj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(virtualMachine) + if err != nil { + return nil, err + } + + obj, err := v.client.Resource(VirtualMachineGVR).Namespace(v.ns).Create(ctx, &unstructured.Unstructured{Object: unstructuredObj}, opts) + if err != nil { + return nil, err + } + + createdVirtualMachine := &vmopv1alpha1.VirtualMachine{} + if err = runtime.DefaultUnstructuredConverter.FromUnstructured(obj.UnstructuredContent(), createdVirtualMachine); err != nil { + return nil, err + } + return createdVirtualMachine, nil +} + +func (v *virtualMachines) Update(ctx context.Context, virtualMachine *vmopv1alpha1.VirtualMachine, opts v1.UpdateOptions) (*vmopv1alpha1.VirtualMachine, error) { + unstructuredObj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(virtualMachine) + if err != nil { + return nil, err + } + + obj, err := v.client.Resource(VirtualMachineGVR).Namespace(v.ns).Update(ctx, &unstructured.Unstructured{Object: unstructuredObj}, opts) + if err != nil { + return nil, err + } + + updatedVirtualMachine := &vmopv1alpha1.VirtualMachine{} + if err = runtime.DefaultUnstructuredConverter.FromUnstructured(obj.UnstructuredContent(), updatedVirtualMachine); err != nil { + return nil, err + } + return updatedVirtualMachine, nil +} + +func (v *virtualMachines) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return v.client.Resource(VirtualMachineGVR).Namespace(v.ns).Delete(ctx, name, opts) +} + +func (v *virtualMachines) Get(ctx context.Context, name string, opts v1.GetOptions) (*vmopv1alpha1.VirtualMachine, error) { + virtualMachine := &vmopv1alpha1.VirtualMachine{} + if obj, err := v.client.Resource(VirtualMachineGVR).Namespace(v.ns).Get(ctx, name, opts); err != nil { + return nil, err + } else if err = runtime.DefaultUnstructuredConverter.FromUnstructured(obj.UnstructuredContent(), virtualMachine); err != nil { + return nil, err + } + return virtualMachine, nil +} + +func (v *virtualMachines) List(ctx context.Context, opts v1.ListOptions) (*vmopv1alpha1.VirtualMachineList, error) { + virtualMachineList := &vmopv1alpha1.VirtualMachineList{} + if obj, err := v.client.Resource(VirtualMachineGVR).Namespace(v.ns).List(ctx, opts); err != nil { + return nil, err + } else if err = runtime.DefaultUnstructuredConverter.FromUnstructured(obj.UnstructuredContent(), virtualMachineList); err != nil { + return nil, err + } + return virtualMachineList, nil +} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmoperator/client/virtualmachineservice_client.go b/pkg/cloudprovider/vsphereparavirtual/vmoperator/client/virtualmachineservice_client.go new file mode 100644 index 000000000..76d5f48b7 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmoperator/client/virtualmachineservice_client.go @@ -0,0 +1,87 @@ +package client + +import ( + "context" + + vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/dynamic" + + "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmoperator" +) + +// virtualMachineServices implements VirtualMachineServiceInterface +type virtualMachineServices struct { + client dynamic.Interface + ns string +} + +// newVirtualMachineServices returns a VirtualMachineServices +func newVirtualMachineServices(c vmoperator.VmoperatorV1alpha1Interface, namespace string) *virtualMachineServices { + return &virtualMachineServices{ + client: c.Client(), + ns: namespace, + } +} + +func (v *virtualMachineServices) Create(ctx context.Context, virtualMachineService *vmopv1alpha1.VirtualMachineService, opts v1.CreateOptions) (*vmopv1alpha1.VirtualMachineService, error) { + unstructuredObj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(virtualMachineService) + if err != nil { + return nil, err + } + + obj, err := v.client.Resource(VirtualMachineServiceGVR).Namespace(v.ns).Create(ctx, &unstructured.Unstructured{Object: unstructuredObj}, opts) + if err != nil { + return nil, err + } + + createdVirtualMachineService := &vmopv1alpha1.VirtualMachineService{} + if err = runtime.DefaultUnstructuredConverter.FromUnstructured(obj.UnstructuredContent(), createdVirtualMachineService); err != nil { + return nil, err + } + return createdVirtualMachineService, nil +} + +func (v *virtualMachineServices) Update(ctx context.Context, virtualMachineService *vmopv1alpha1.VirtualMachineService, opts v1.UpdateOptions) (*vmopv1alpha1.VirtualMachineService, error) { + unstructuredObj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(virtualMachineService) + if err != nil { + return nil, err + } + + obj, err := v.client.Resource(VirtualMachineServiceGVR).Namespace(v.ns).Update(ctx, &unstructured.Unstructured{Object: unstructuredObj}, opts) + if err != nil { + return nil, err + } + + updatedVirtualMachineService := &vmopv1alpha1.VirtualMachineService{} + if err = runtime.DefaultUnstructuredConverter.FromUnstructured(obj.UnstructuredContent(), updatedVirtualMachineService); err != nil { + return nil, err + } + return updatedVirtualMachineService, nil +} + +func (v *virtualMachineServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return v.client.Resource(VirtualMachineServiceGVR).Namespace(v.ns).Delete(ctx, name, opts) +} + +func (v *virtualMachineServices) Get(ctx context.Context, name string, opts v1.GetOptions) (*vmopv1alpha1.VirtualMachineService, error) { + virtualMachineService := &vmopv1alpha1.VirtualMachineService{} + if obj, err := v.client.Resource(VirtualMachineServiceGVR).Namespace(v.ns).Get(ctx, name, opts); err != nil { + return nil, err + } else if err = runtime.DefaultUnstructuredConverter.FromUnstructured(obj.UnstructuredContent(), virtualMachineService); err != nil { + return nil, err + } + return virtualMachineService, nil +} + +func (v *virtualMachineServices) List(ctx context.Context, opts v1.ListOptions) (*vmopv1alpha1.VirtualMachineServiceList, error) { + virtualMachineServiceList := &vmopv1alpha1.VirtualMachineServiceList{} + if obj, err := v.client.Resource(VirtualMachineServiceGVR).Namespace(v.ns).List(ctx, opts); err != nil { + return nil, err + } else if err = runtime.DefaultUnstructuredConverter.FromUnstructured(obj.UnstructuredContent(), virtualMachineServiceList); err != nil { + return nil, err + } + return virtualMachineServiceList, nil +} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmoperator/interface.go b/pkg/cloudprovider/vsphereparavirtual/vmoperator/interface.go new file mode 100644 index 000000000..d122c7fcc --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmoperator/interface.go @@ -0,0 +1,35 @@ +package vmoperator + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/dynamic" + + vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" +) + +// VmoperatorV1alpha1Interface has methods to work with Vmoperator V1alpha1 resources. +type VmoperatorV1alpha1Interface interface { + Client() dynamic.Interface + VirtualMachines(namespace string) VirtualMachineInterface + VirtualMachineServices(namespace string) VirtualMachineServiceInterface +} + +// VirtualMachineInterface has methods to work with VirtualMachineService resources. +type VirtualMachineInterface interface { + Create(ctx context.Context, virtualMachine *vmopv1alpha1.VirtualMachine, opts v1.CreateOptions) (*vmopv1alpha1.VirtualMachine, error) + Update(ctx context.Context, virtualMachine *vmopv1alpha1.VirtualMachine, opts v1.UpdateOptions) (*vmopv1alpha1.VirtualMachine, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*vmopv1alpha1.VirtualMachine, error) + List(ctx context.Context, opts v1.ListOptions) (*vmopv1alpha1.VirtualMachineList, error) +} + +// VirtualMachineServiceInterface has methods to work with VirtualMachineService resources. +type VirtualMachineServiceInterface interface { + Create(ctx context.Context, virtualMachineService *vmopv1alpha1.VirtualMachineService, opts v1.CreateOptions) (*vmopv1alpha1.VirtualMachineService, error) + Update(ctx context.Context, virtualMachineService *vmopv1alpha1.VirtualMachineService, opts v1.UpdateOptions) (*vmopv1alpha1.VirtualMachineService, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*vmopv1alpha1.VirtualMachineService, error) + List(ctx context.Context, opts v1.ListOptions) (*vmopv1alpha1.VirtualMachineServiceList, error) +} diff --git a/pkg/cloudprovider/vsphereparavirtual/vmservice/types.go b/pkg/cloudprovider/vsphereparavirtual/vmservice/types.go index cd7726629..8755610dd 100644 --- a/pkg/cloudprovider/vsphereparavirtual/vmservice/types.go +++ b/pkg/cloudprovider/vsphereparavirtual/vmservice/types.go @@ -24,7 +24,7 @@ import ( "k8s.io/klog/v2/klogr" "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - vmopclient "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned" + vmop "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmoperator" ) var log = klogr.New().WithName("vmservice") @@ -41,7 +41,7 @@ type VMService interface { // vmService takes care of mapping of LB type of service to VM service in supervisor cluster type vmService struct { - vmClient vmopclient.Interface + vmClient vmop.VmoperatorV1alpha1Interface namespace string ownerReference *metav1.OwnerReference } diff --git a/pkg/cloudprovider/vsphereparavirtual/vmservice/vmservice.go b/pkg/cloudprovider/vsphereparavirtual/vmservice/vmservice.go index 267de3e7a..7027204b3 100644 --- a/pkg/cloudprovider/vsphereparavirtual/vmservice/vmservice.go +++ b/pkg/cloudprovider/vsphereparavirtual/vmservice/vmservice.go @@ -28,11 +28,11 @@ import ( v1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" rest "k8s.io/client-go/rest" vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - vmopclient "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned" + vmop "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmoperator" + vmopclient "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmoperator/client" ) const ( @@ -88,14 +88,12 @@ var ( // GetVmopClient gets a vm-operator-api client // This is separate from NewVMService so that a fake client can be injected for testing -func GetVmopClient(config *rest.Config) (vmopclient.Interface, error) { - scheme := runtime.NewScheme() - _ = vmopv1alpha1.AddToScheme(scheme) +func GetVmopClient(config *rest.Config) (vmop.VmoperatorV1alpha1Interface, error) { return vmopclient.NewForConfig(config) } // NewVMService creates a vmService object -func NewVMService(vmClient vmopclient.Interface, ns string, ownerRef *metav1.OwnerReference) VMService { +func NewVMService(vmClient vmop.VmoperatorV1alpha1Interface, ns string, ownerRef *metav1.OwnerReference) VMService { return &vmService{ vmClient: vmClient, namespace: ns, @@ -131,7 +129,7 @@ func (s *vmService) Get(ctx context.Context, service *v1.Service, clusterName st logger := log.WithValues("name", service.Name, "namespace", service.Namespace) logger.V(2).Info("Attempting to get VirtualMachineService") - vmService, err := s.vmClient.VmoperatorV1alpha1().VirtualMachineServices(s.namespace).Get(ctx, s.GetVMServiceName(service, clusterName), metav1.GetOptions{}) + vmService, err := s.vmClient.VirtualMachineServices(s.namespace).Get(ctx, s.GetVMServiceName(service, clusterName), metav1.GetOptions{}) if err != nil { if apierrors.IsNotFound(err) { return nil, nil @@ -154,7 +152,7 @@ func (s *vmService) Create(ctx context.Context, service *v1.Service, clusterName return nil, err } - vmService, err = s.vmClient.VmoperatorV1alpha1().VirtualMachineServices(s.namespace).Create(ctx, vmService, metav1.CreateOptions{}) + vmService, err = s.vmClient.VirtualMachineServices(s.namespace).Create(ctx, vmService, metav1.CreateOptions{}) if err != nil { logger.Error(ErrCreateVMService, fmt.Sprintf("%v", err)) return nil, err @@ -252,7 +250,7 @@ func (s *vmService) Update(ctx context.Context, service *v1.Service, clusterName } if needsUpdate { - newVMService, err = s.vmClient.VmoperatorV1alpha1().VirtualMachineServices(s.namespace).Update(ctx, newVMService, metav1.UpdateOptions{}) + newVMService, err = s.vmClient.VirtualMachineServices(s.namespace).Update(ctx, newVMService, metav1.UpdateOptions{}) if err != nil { logger.Error(ErrUpdateVMService, fmt.Sprintf("%v", err)) return nil, err @@ -270,7 +268,7 @@ func (s *vmService) Delete(ctx context.Context, service *v1.Service, clusterName logger := log.WithValues("name", service.Name, "namespace", service.Namespace) logger.V(2).Info("Attempting to delete VirtualMachineService") - err := s.vmClient.VmoperatorV1alpha1().VirtualMachineServices(s.namespace).Delete(ctx, s.GetVMServiceName(service, clusterName), metav1.DeleteOptions{}) + err := s.vmClient.VirtualMachineServices(s.namespace).Delete(ctx, s.GetVMServiceName(service, clusterName), metav1.DeleteOptions{}) if err != nil { logger.Error(ErrDeleteVMService, fmt.Sprintf("%v", err)) return err diff --git a/pkg/cloudprovider/vsphereparavirtual/vmservice/vmservice_test.go b/pkg/cloudprovider/vsphereparavirtual/vmservice/vmservice_test.go index 335c3d4b6..1f1c35237 100644 --- a/pkg/cloudprovider/vsphereparavirtual/vmservice/vmservice_test.go +++ b/pkg/cloudprovider/vsphereparavirtual/vmservice/vmservice_test.go @@ -34,7 +34,9 @@ import ( clientgotesting "k8s.io/client-go/testing" "k8s.io/apimachinery/pkg/util/intstr" - fakevmclient "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/fake" + dynamicfake "k8s.io/client-go/dynamic/fake" + + vmopclient "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmoperator/client" ) var ( @@ -52,7 +54,7 @@ var ( fakeLBIP = "1.1.1.1" ) -func initTest() (*v1.Service, VMService, *fakevmclient.Clientset) { +func initTest() (*v1.Service, VMService, *dynamicfake.FakeDynamicClient) { testK8sService := &v1.Service{ ObjectMeta: metav1.ObjectMeta{ Name: testK8sServiceName, @@ -73,9 +75,11 @@ func initTest() (*v1.Service, VMService, *fakevmclient.Clientset) { }, }, } - fc := fakevmclient.NewSimpleClientset() - vms = NewVMService(fc, testClusterNameSpace, &testOwnerReference) + scheme := runtime.NewScheme() + _ = vmopv1alpha1.AddToScheme(scheme) + fc := dynamicfake.NewSimpleDynamicClient(scheme) + vms = NewVMService(vmopclient.NewFakeClient(fc), testClusterNameSpace, &testOwnerReference) return testK8sService, vms, fc } @@ -141,7 +145,6 @@ func TestGetVMService(t *testing.T) { } // create a fake VMService createdVMService, _ := vms.Create(context.Background(), k8sService, testClustername) - vmService, err := vms.Get(context.Background(), k8sService, testClustername) assert.NoError(t, err) assert.Equal(t, (*vmService).Spec, (*createdVMService).Spec) diff --git a/pkg/cloudprovider/vsphereparavirtual/zone.go b/pkg/cloudprovider/vsphereparavirtual/zone.go index aff4816a0..2ce79f799 100644 --- a/pkg/cloudprovider/vsphereparavirtual/zone.go +++ b/pkg/cloudprovider/vsphereparavirtual/zone.go @@ -4,7 +4,7 @@ import ( "context" vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" - vmopclient "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned" + vmop "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmoperator" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/rest" @@ -14,7 +14,7 @@ import ( ) type zones struct { - vmClient vmopclient.Interface + vmClient vmop.VmoperatorV1alpha1Interface namespace string } diff --git a/pkg/cloudprovider/vsphereparavirtual/zone_test.go b/pkg/cloudprovider/vsphereparavirtual/zone_test.go index 610f629d6..831f99290 100644 --- a/pkg/cloudprovider/vsphereparavirtual/zone_test.go +++ b/pkg/cloudprovider/vsphereparavirtual/zone_test.go @@ -7,10 +7,13 @@ import ( "github.com/stretchr/testify/assert" vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" + dynamicfake "k8s.io/client-go/dynamic/fake" "k8s.io/client-go/rest" cloudprovider "k8s.io/cloud-provider" - fakevmclient "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/fake" + + vmopclient "k8s.io/cloud-provider-vsphere/pkg/cloudprovider/vsphereparavirtual/vmoperator/client" ) var ( @@ -128,13 +131,16 @@ func TestZonesByNodeName(t *testing.T) { } } -func initVMopClient(testVM *vmopv1alpha1.VirtualMachine) (zones, *fakevmclient.Clientset, error) { - fc := fakevmclient.NewSimpleClientset() +func initVMopClient(testVM *vmopv1alpha1.VirtualMachine) (zones, *dynamicfake.FakeDynamicClient, error) { + scheme := runtime.NewScheme() + _ = vmopv1alpha1.AddToScheme(scheme) + fc := dynamicfake.NewSimpleDynamicClient(scheme) + fcw := vmopclient.NewFakeClient(fc) zone := zones{ - vmClient: fc, + vmClient: fcw, namespace: testClusterNameSpace, } - _, err := fc.VmoperatorV1alpha1().VirtualMachines(testVM.Namespace).Create(context.TODO(), testVM, metav1.CreateOptions{}) + _, err := fcw.VirtualMachines(testVM.Namespace).Create(context.TODO(), testVM, metav1.CreateOptions{}) return zone, fc, err }