diff --git a/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/internal/internal.go b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/internal/internal.go new file mode 100644 index 000000000..eb6431c35 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/internal/internal.go @@ -0,0 +1,62 @@ +/* +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 new file mode 100644 index 000000000..611944add --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/utils.go @@ -0,0 +1,113 @@ +/* +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 ( + schema "k8s.io/apimachinery/pkg/runtime/schema" + v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" + 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 new file mode 100644 index 000000000..05f64e7fd --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/clustermodulespec.go @@ -0,0 +1,39 @@ +/* +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 new file mode 100644 index 000000000..50b933943 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/clustermodulestatus.go @@ -0,0 +1,48 @@ +/* +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 new file mode 100644 index 000000000..89a5f83df --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/folderspec.go @@ -0,0 +1,39 @@ +/* +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 new file mode 100644 index 000000000..5f33a9469 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/loadbalanceringress.go @@ -0,0 +1,48 @@ +/* +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 new file mode 100644 index 000000000..d2d6ae4c6 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/loadbalancerstatus.go @@ -0,0 +1,44 @@ +/* +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 new file mode 100644 index 000000000..18187b26c --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/networkinterfaceproviderreference.go @@ -0,0 +1,66 @@ +/* +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 new file mode 100644 index 000000000..e27555a53 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/probe.go @@ -0,0 +1,57 @@ +/* +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 new file mode 100644 index 000000000..2aad5744d --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/resourcepoolspec.go @@ -0,0 +1,57 @@ +/* +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 new file mode 100644 index 000000000..f755c5846 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/tcpsocketaction.go @@ -0,0 +1,52 @@ +/* +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 new file mode 100644 index 000000000..96358cbd5 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachine.go @@ -0,0 +1,219 @@ +/* +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 new file mode 100644 index 000000000..32e435a95 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineadvancedoptions.go @@ -0,0 +1,48 @@ +/* +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 new file mode 100644 index 000000000..2ee76a746 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineclass.go @@ -0,0 +1,219 @@ +/* +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" + vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" +) + +// 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 new file mode 100644 index 000000000..dd6a6191f --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineclasshardware.go @@ -0,0 +1,52 @@ +/* +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 new file mode 100644 index 000000000..afaf29102 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineclasspolicies.go @@ -0,0 +1,39 @@ +/* +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 new file mode 100644 index 000000000..0dcfb39e4 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineclassresources.go @@ -0,0 +1,48 @@ +/* +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 new file mode 100644 index 000000000..c66b0b9f7 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineclassspec.go @@ -0,0 +1,48 @@ +/* +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 new file mode 100644 index 000000000..24b9d3208 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinecondition.go @@ -0,0 +1,80 @@ +/* +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/apimachinery/pkg/apis/meta/v1" + v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" +) + +// 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 new file mode 100644 index 000000000..fc15d9bb8 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineimage.go @@ -0,0 +1,218 @@ +/* +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 new file mode 100644 index 000000000..ee3214ee0 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineimageosinfo.go @@ -0,0 +1,48 @@ +/* +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 new file mode 100644 index 000000000..23097beb3 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineimageproductinfo.go @@ -0,0 +1,66 @@ +/* +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 new file mode 100644 index 000000000..cc3ec6a11 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineimagespec.go @@ -0,0 +1,66 @@ +/* +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 new file mode 100644 index 000000000..a0c16cb76 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineimagestatus.go @@ -0,0 +1,66 @@ +/* +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 new file mode 100644 index 000000000..a61a0daca --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinemetadata.go @@ -0,0 +1,52 @@ +/* +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 new file mode 100644 index 000000000..98325e478 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinenetworkinterface.go @@ -0,0 +1,66 @@ +/* +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 new file mode 100644 index 000000000..ea1e78089 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineport.go @@ -0,0 +1,70 @@ +/* +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 new file mode 100644 index 000000000..cb9e19ba3 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineresourcespec.go @@ -0,0 +1,52 @@ +/* +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 new file mode 100644 index 000000000..f1a5cb52e --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineservice.go @@ -0,0 +1,219 @@ +/* +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 new file mode 100644 index 000000000..6bb05ecd1 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineserviceport.go @@ -0,0 +1,66 @@ +/* +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 new file mode 100644 index 000000000..f6e690e95 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineservicespec.go @@ -0,0 +1,110 @@ +/* +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 new file mode 100644 index 000000000..fd56ca568 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachineservicestatus.go @@ -0,0 +1,39 @@ +/* +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 new file mode 100644 index 000000000..70a341a46 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinesetresourcepolicy.go @@ -0,0 +1,219 @@ +/* +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 new file mode 100644 index 000000000..b526ddcf1 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinesetresourcepolicyspec.go @@ -0,0 +1,62 @@ +/* +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 new file mode 100644 index 000000000..82f17e84a --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinesetresourcepolicystatus.go @@ -0,0 +1,44 @@ +/* +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 new file mode 100644 index 000000000..130c472cc --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinespec.go @@ -0,0 +1,148 @@ +/* +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 new file mode 100644 index 000000000..08581951f --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinestatus.go @@ -0,0 +1,134 @@ +/* +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 new file mode 100644 index 000000000..e27d36415 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinevolume.go @@ -0,0 +1,79 @@ +/* +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 new file mode 100644 index 000000000..d56f9b571 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinevolumeprovisioningoptions.go @@ -0,0 +1,48 @@ +/* +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 new file mode 100644 index 000000000..cce7ae174 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/virtualmachinevolumestatus.go @@ -0,0 +1,66 @@ +/* +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 new file mode 100644 index 000000000..2387c8977 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/applyconfiguration/vmop/v1alpha1/vspherevolumesource.go @@ -0,0 +1,52 @@ +/* +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 new file mode 100644 index 000000000..9ed22ed76 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/clientset.go @@ -0,0 +1,120 @@ +/* +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 new file mode 100644 index 000000000..9c2ad0903 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,85 @@ +/* +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 new file mode 100644 index 000000000..4b91eb6a6 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/fake/doc.go @@ -0,0 +1,20 @@ +/* +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 new file mode 100644 index 000000000..9f62d8214 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/fake/register.go @@ -0,0 +1,56 @@ +/* +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 ( + 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" + vmoperatorv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" +) + +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 new file mode 100644 index 000000000..6dc5e6530 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/scheme/doc.go @@ -0,0 +1,20 @@ +/* +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 new file mode 100644 index 000000000..57cf15249 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/scheme/register.go @@ -0,0 +1,56 @@ +/* +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 ( + 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" + vmoperatorv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" +) + +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 new file mode 100644 index 000000000..be4e7e92b --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/doc.go @@ -0,0 +1,20 @@ +/* +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 new file mode 100644 index 000000000..43eec078a --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/doc.go @@ -0,0 +1,20 @@ +/* +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 new file mode 100644 index 000000000..df46d6d00 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_virtualmachine.go @@ -0,0 +1,189 @@ +/* +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" + + 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" + v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" + 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 new file mode 100644 index 000000000..ab6b0dd81 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_virtualmachineclass.go @@ -0,0 +1,178 @@ +/* +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" + + 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" + v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" + 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 new file mode 100644 index 000000000..b42257eb8 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_virtualmachineimage.go @@ -0,0 +1,178 @@ +/* +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" + + 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" + v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" + 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 new file mode 100644 index 000000000..fceca34d5 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_virtualmachineservice.go @@ -0,0 +1,189 @@ +/* +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" + + 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" + v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" + 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 new file mode 100644 index 000000000..bae95697d --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_virtualmachinesetresourcepolicy.go @@ -0,0 +1,189 @@ +/* +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" + + 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" + v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" + 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 new file mode 100644 index 000000000..50f4bb34a --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/fake/fake_vmop_client.go @@ -0,0 +1,56 @@ +/* +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 new file mode 100644 index 000000000..b0e5b1489 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/generated_expansion.go @@ -0,0 +1,29 @@ +/* +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 new file mode 100644 index 000000000..75ad3fa27 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/virtualmachine.go @@ -0,0 +1,256 @@ +/* +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" + + 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" + v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" + 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 new file mode 100644 index 000000000..bd20cdddc --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/virtualmachineclass.go @@ -0,0 +1,243 @@ +/* +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" + + 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" + v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" + 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 new file mode 100644 index 000000000..9a45ab855 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/virtualmachineimage.go @@ -0,0 +1,243 @@ +/* +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" + + 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" + v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" + 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 new file mode 100644 index 000000000..836ff0eed --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/virtualmachineservice.go @@ -0,0 +1,256 @@ +/* +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" + + 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" + v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" + 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 new file mode 100644 index 000000000..37253c97a --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/virtualmachinesetresourcepolicy.go @@ -0,0 +1,256 @@ +/* +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" + + 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" + v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" + 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 new file mode 100644 index 000000000..c3eabbb14 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/clientset/versioned/typed/vmop/v1alpha1/vmop_client.go @@ -0,0 +1,127 @@ +/* +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" + + rest "k8s.io/client-go/rest" + v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" + "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 new file mode 100644 index 000000000..f89f24169 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/factory.go @@ -0,0 +1,261 @@ +/* +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 new file mode 100644 index 000000000..c7386f2fd --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/generic.go @@ -0,0 +1,70 @@ +/* +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" + + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" + v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" +) + +// 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 new file mode 100644 index 000000000..38baf81e2 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -0,0 +1,40 @@ +/* +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 new file mode 100644 index 000000000..3c7c0a15b --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/interface.go @@ -0,0 +1,46 @@ +/* +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 new file mode 100644 index 000000000..c63350753 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/interface.go @@ -0,0 +1,73 @@ +/* +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 new file mode 100644 index 000000000..9e5836311 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/virtualmachine.go @@ -0,0 +1,90 @@ +/* +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" + + 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" + vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" + 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 new file mode 100644 index 000000000..c5771c8b0 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/virtualmachineclass.go @@ -0,0 +1,89 @@ +/* +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" + + 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" + vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" + 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 new file mode 100644 index 000000000..95c1d6e04 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/virtualmachineimage.go @@ -0,0 +1,89 @@ +/* +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" + + 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" + vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" + 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 new file mode 100644 index 000000000..e18388338 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/virtualmachineservice.go @@ -0,0 +1,90 @@ +/* +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" + + 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" + vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" + 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 new file mode 100644 index 000000000..8926bbcd6 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/informers/externalversions/vmop/v1alpha1/virtualmachinesetresourcepolicy.go @@ -0,0 +1,90 @@ +/* +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" + + 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" + vmopv1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" + 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 new file mode 100644 index 000000000..b688353a7 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/expansion_generated.go @@ -0,0 +1,51 @@ +/* +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 new file mode 100644 index 000000000..f973a0e24 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/virtualmachine.go @@ -0,0 +1,99 @@ +/* +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 ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" +) + +// 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 new file mode 100644 index 000000000..92881420a --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/virtualmachineclass.go @@ -0,0 +1,68 @@ +/* +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 ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" +) + +// 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 new file mode 100644 index 000000000..57ce5cdec --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/virtualmachineimage.go @@ -0,0 +1,68 @@ +/* +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 ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" +) + +// 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 new file mode 100644 index 000000000..ee88ca2f4 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/virtualmachineservice.go @@ -0,0 +1,99 @@ +/* +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 ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" +) + +// 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 new file mode 100644 index 000000000..6220ac1b5 --- /dev/null +++ b/pkg/cloudprovider/vsphereparavirtual/vmop/listers/vmop/v1alpha1/virtualmachinesetresourcepolicy.go @@ -0,0 +1,99 @@ +/* +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 ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1alpha1 "github.com/vmware-tanzu/vm-operator-api/api/v1alpha1" +) + +// 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 +}