diff --git a/Makefile b/Makefile index f0d8829cb..732cece14 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ BUCKETBROKER_IMG ?= bucketbroker:latest IRICTL_BUCKET_IMG ?= irictl-bucket:latest # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. -ENVTEST_K8S_VERSION = 1.30.3 +ENVTEST_K8S_VERSION = 1.31 # Docker image name for the mkdocs based local development setup IMAGE=ironcore/documentation @@ -145,7 +145,7 @@ clean-docs: ## Remove all local mkdocs Docker images (cleanup). docker container prune --force --filter "label=project=ironcore_documentation" .PHONY: test -test: manifests generate fmt vet test-only ## Run tests. +test: generate manifests fmt vet test-only ## Run tests. .PHONY: test-only test-only: envtest ## Run *only* the tests - no generation, linting etc. @@ -360,13 +360,14 @@ GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint ## Tool Versions KUSTOMIZE_VERSION ?= v5.1.1 VGOPATH_VERSION ?= v0.1.3 -CONTROLLER_TOOLS_VERSION ?= v0.15.0 +CONTROLLER_TOOLS_VERSION ?= v0.16.0 GEN_CRD_API_REFERENCE_DOCS_VERSION ?= v0.3.0 ADDLICENSE_VERSION ?= v1.1.1 PROTOC_GEN_GOGO_VERSION ?= v1.3.2 GOIMPORTS_VERSION ?= v0.26.0 GOLANGCI_LINT_VERSION ?= v1.62.2 OPENAPI_EXTRACTOR_VERSION ?= v0.1.9 +SETUP_ENVTEST_VERSION ?= release-0.19 KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" .PHONY: kustomize @@ -404,7 +405,7 @@ $(VGOPATH): $(LOCALBIN) .PHONY: envtest envtest: $(ENVTEST) ## Download envtest-setup locally if necessary. $(ENVTEST): $(LOCALBIN) - test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest + test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@$(SETUP_ENVTEST_VERSION) .PHONY: openapi-extractor openapi-extractor: $(OPENAPI_EXTRACTOR) ## Download openapi-extractor locally if necessary. diff --git a/broker/machinebroker/networks/networks.go b/broker/machinebroker/networks/networks.go index 790e0d988..1b88c984b 100644 --- a/broker/machinebroker/networks/networks.go +++ b/broker/machinebroker/networks/networks.go @@ -27,7 +27,7 @@ type Manager struct { cluster cluster.Cluster - queue workqueue.RateLimitingInterface + queue workqueue.TypedRateLimitingInterface[string] waitersByProviderIDMu sync.Mutex waitersByProviderID map[string]*waiter @@ -36,7 +36,7 @@ type Manager struct { func NewManager(cluster cluster.Cluster) *Manager { return &Manager{ cluster: cluster, - queue: workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()), + queue: workqueue.NewTypedRateLimitingQueue(workqueue.DefaultTypedControllerRateLimiter[string]()), waitersByProviderID: make(map[string]*waiter), } } @@ -144,13 +144,12 @@ func (e *Manager) doWork(ctx context.Context, providerID string) (*networkingv1a } func (e *Manager) processNextWorkItem(ctx context.Context) bool { - uncastProviderID, quit := e.queue.Get() + providerID, quit := e.queue.Get() if quit { return false } - defer e.queue.Done(uncastProviderID) + defer e.queue.Done(providerID) - providerID := uncastProviderID.(string) network, err := e.doWork(ctx, providerID) e.emit(providerID, network, err) e.queue.Forget(providerID) diff --git a/client-go/applyconfigurations/compute/v1alpha1/daemonendpoint.go b/client-go/applyconfigurations/compute/v1alpha1/daemonendpoint.go index 7535740c1..d71c51f2e 100644 --- a/client-go/applyconfigurations/compute/v1alpha1/daemonendpoint.go +++ b/client-go/applyconfigurations/compute/v1alpha1/daemonendpoint.go @@ -5,13 +5,13 @@ package v1alpha1 -// DaemonEndpointApplyConfiguration represents an declarative configuration of the DaemonEndpoint type for use +// DaemonEndpointApplyConfiguration represents a declarative configuration of the DaemonEndpoint type for use // with apply. type DaemonEndpointApplyConfiguration struct { Port *int32 `json:"port,omitempty"` } -// DaemonEndpointApplyConfiguration constructs an declarative configuration of the DaemonEndpoint type for use with +// DaemonEndpointApplyConfiguration constructs a declarative configuration of the DaemonEndpoint type for use with // apply. func DaemonEndpoint() *DaemonEndpointApplyConfiguration { return &DaemonEndpointApplyConfiguration{} diff --git a/client-go/applyconfigurations/compute/v1alpha1/efivar.go b/client-go/applyconfigurations/compute/v1alpha1/efivar.go index c9dc07b5d..e58a456d0 100644 --- a/client-go/applyconfigurations/compute/v1alpha1/efivar.go +++ b/client-go/applyconfigurations/compute/v1alpha1/efivar.go @@ -5,7 +5,7 @@ package v1alpha1 -// EFIVarApplyConfiguration represents an declarative configuration of the EFIVar type for use +// EFIVarApplyConfiguration represents a declarative configuration of the EFIVar type for use // with apply. type EFIVarApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -13,7 +13,7 @@ type EFIVarApplyConfiguration struct { Value *string `json:"value,omitempty"` } -// EFIVarApplyConfiguration constructs an declarative configuration of the EFIVar type for use with +// EFIVarApplyConfiguration constructs a declarative configuration of the EFIVar type for use with // apply. func EFIVar() *EFIVarApplyConfiguration { return &EFIVarApplyConfiguration{} diff --git a/client-go/applyconfigurations/compute/v1alpha1/emptydiskvolumesource.go b/client-go/applyconfigurations/compute/v1alpha1/emptydiskvolumesource.go index 91d9f3285..e133226d6 100644 --- a/client-go/applyconfigurations/compute/v1alpha1/emptydiskvolumesource.go +++ b/client-go/applyconfigurations/compute/v1alpha1/emptydiskvolumesource.go @@ -9,13 +9,13 @@ import ( resource "k8s.io/apimachinery/pkg/api/resource" ) -// EmptyDiskVolumeSourceApplyConfiguration represents an declarative configuration of the EmptyDiskVolumeSource type for use +// EmptyDiskVolumeSourceApplyConfiguration represents a declarative configuration of the EmptyDiskVolumeSource type for use // with apply. type EmptyDiskVolumeSourceApplyConfiguration struct { SizeLimit *resource.Quantity `json:"sizeLimit,omitempty"` } -// EmptyDiskVolumeSourceApplyConfiguration constructs an declarative configuration of the EmptyDiskVolumeSource type for use with +// EmptyDiskVolumeSourceApplyConfiguration constructs a declarative configuration of the EmptyDiskVolumeSource type for use with // apply. func EmptyDiskVolumeSource() *EmptyDiskVolumeSourceApplyConfiguration { return &EmptyDiskVolumeSourceApplyConfiguration{} diff --git a/client-go/applyconfigurations/compute/v1alpha1/ephemeralnetworkinterfacesource.go b/client-go/applyconfigurations/compute/v1alpha1/ephemeralnetworkinterfacesource.go index 95dbc1df7..4f51b72e9 100644 --- a/client-go/applyconfigurations/compute/v1alpha1/ephemeralnetworkinterfacesource.go +++ b/client-go/applyconfigurations/compute/v1alpha1/ephemeralnetworkinterfacesource.go @@ -9,13 +9,13 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/networking/v1alpha1" ) -// EphemeralNetworkInterfaceSourceApplyConfiguration represents an declarative configuration of the EphemeralNetworkInterfaceSource type for use +// EphemeralNetworkInterfaceSourceApplyConfiguration represents a declarative configuration of the EphemeralNetworkInterfaceSource type for use // with apply. type EphemeralNetworkInterfaceSourceApplyConfiguration struct { NetworkInterfaceTemplate *v1alpha1.NetworkInterfaceTemplateSpecApplyConfiguration `json:"networkInterfaceTemplate,omitempty"` } -// EphemeralNetworkInterfaceSourceApplyConfiguration constructs an declarative configuration of the EphemeralNetworkInterfaceSource type for use with +// EphemeralNetworkInterfaceSourceApplyConfiguration constructs a declarative configuration of the EphemeralNetworkInterfaceSource type for use with // apply. func EphemeralNetworkInterfaceSource() *EphemeralNetworkInterfaceSourceApplyConfiguration { return &EphemeralNetworkInterfaceSourceApplyConfiguration{} diff --git a/client-go/applyconfigurations/compute/v1alpha1/ephemeralvolumesource.go b/client-go/applyconfigurations/compute/v1alpha1/ephemeralvolumesource.go index 30f2ff538..f15b823ea 100644 --- a/client-go/applyconfigurations/compute/v1alpha1/ephemeralvolumesource.go +++ b/client-go/applyconfigurations/compute/v1alpha1/ephemeralvolumesource.go @@ -9,13 +9,13 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/storage/v1alpha1" ) -// EphemeralVolumeSourceApplyConfiguration represents an declarative configuration of the EphemeralVolumeSource type for use +// EphemeralVolumeSourceApplyConfiguration represents a declarative configuration of the EphemeralVolumeSource type for use // with apply. type EphemeralVolumeSourceApplyConfiguration struct { VolumeTemplate *v1alpha1.VolumeTemplateSpecApplyConfiguration `json:"volumeTemplate,omitempty"` } -// EphemeralVolumeSourceApplyConfiguration constructs an declarative configuration of the EphemeralVolumeSource type for use with +// EphemeralVolumeSourceApplyConfiguration constructs a declarative configuration of the EphemeralVolumeSource type for use with // apply. func EphemeralVolumeSource() *EphemeralVolumeSourceApplyConfiguration { return &EphemeralVolumeSourceApplyConfiguration{} diff --git a/client-go/applyconfigurations/compute/v1alpha1/machine.go b/client-go/applyconfigurations/compute/v1alpha1/machine.go index 0779dee63..327922849 100644 --- a/client-go/applyconfigurations/compute/v1alpha1/machine.go +++ b/client-go/applyconfigurations/compute/v1alpha1/machine.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// MachineApplyConfiguration represents an declarative configuration of the Machine type for use +// MachineApplyConfiguration represents a declarative configuration of the Machine type for use // with apply. type MachineApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -23,7 +23,7 @@ type MachineApplyConfiguration struct { Status *MachineStatusApplyConfiguration `json:"status,omitempty"` } -// Machine constructs an declarative configuration of the Machine type for use with +// Machine constructs a declarative configuration of the Machine type for use with // apply. func Machine(name, namespace string) *MachineApplyConfiguration { b := &MachineApplyConfiguration{} @@ -243,3 +243,9 @@ func (b *MachineApplyConfiguration) WithStatus(value *MachineStatusApplyConfigur b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *MachineApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/compute/v1alpha1/machineclass.go b/client-go/applyconfigurations/compute/v1alpha1/machineclass.go index 4084da298..6de5dcdc8 100644 --- a/client-go/applyconfigurations/compute/v1alpha1/machineclass.go +++ b/client-go/applyconfigurations/compute/v1alpha1/machineclass.go @@ -15,7 +15,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// MachineClassApplyConfiguration represents an declarative configuration of the MachineClass type for use +// MachineClassApplyConfiguration represents a declarative configuration of the MachineClass type for use // with apply. type MachineClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -23,7 +23,7 @@ type MachineClassApplyConfiguration struct { Capabilities *v1alpha1.ResourceList `json:"capabilities,omitempty"` } -// MachineClass constructs an declarative configuration of the MachineClass type for use with +// MachineClass constructs a declarative configuration of the MachineClass type for use with // apply. func MachineClass(name string) *MachineClassApplyConfiguration { b := &MachineClassApplyConfiguration{} @@ -233,3 +233,9 @@ func (b *MachineClassApplyConfiguration) WithCapabilities(value v1alpha1.Resourc b.Capabilities = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *MachineClassApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/compute/v1alpha1/machinepool.go b/client-go/applyconfigurations/compute/v1alpha1/machinepool.go index cff6ce701..5786e9755 100644 --- a/client-go/applyconfigurations/compute/v1alpha1/machinepool.go +++ b/client-go/applyconfigurations/compute/v1alpha1/machinepool.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// MachinePoolApplyConfiguration represents an declarative configuration of the MachinePool type for use +// MachinePoolApplyConfiguration represents a declarative configuration of the MachinePool type for use // with apply. type MachinePoolApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -23,7 +23,7 @@ type MachinePoolApplyConfiguration struct { Status *MachinePoolStatusApplyConfiguration `json:"status,omitempty"` } -// MachinePool constructs an declarative configuration of the MachinePool type for use with +// MachinePool constructs a declarative configuration of the MachinePool type for use with // apply. func MachinePool(name string) *MachinePoolApplyConfiguration { b := &MachinePoolApplyConfiguration{} @@ -241,3 +241,9 @@ func (b *MachinePoolApplyConfiguration) WithStatus(value *MachinePoolStatusApply b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *MachinePoolApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/compute/v1alpha1/machinepooladdress.go b/client-go/applyconfigurations/compute/v1alpha1/machinepooladdress.go index 3246ea4a9..8ee430b54 100644 --- a/client-go/applyconfigurations/compute/v1alpha1/machinepooladdress.go +++ b/client-go/applyconfigurations/compute/v1alpha1/machinepooladdress.go @@ -9,14 +9,14 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/compute/v1alpha1" ) -// MachinePoolAddressApplyConfiguration represents an declarative configuration of the MachinePoolAddress type for use +// MachinePoolAddressApplyConfiguration represents a declarative configuration of the MachinePoolAddress type for use // with apply. type MachinePoolAddressApplyConfiguration struct { Type *v1alpha1.MachinePoolAddressType `json:"type,omitempty"` Address *string `json:"address,omitempty"` } -// MachinePoolAddressApplyConfiguration constructs an declarative configuration of the MachinePoolAddress type for use with +// MachinePoolAddressApplyConfiguration constructs a declarative configuration of the MachinePoolAddress type for use with // apply. func MachinePoolAddress() *MachinePoolAddressApplyConfiguration { return &MachinePoolAddressApplyConfiguration{} diff --git a/client-go/applyconfigurations/compute/v1alpha1/machinepoolcondition.go b/client-go/applyconfigurations/compute/v1alpha1/machinepoolcondition.go index e0c2a6fed..605123c4c 100644 --- a/client-go/applyconfigurations/compute/v1alpha1/machinepoolcondition.go +++ b/client-go/applyconfigurations/compute/v1alpha1/machinepoolcondition.go @@ -11,7 +11,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// MachinePoolConditionApplyConfiguration represents an declarative configuration of the MachinePoolCondition type for use +// MachinePoolConditionApplyConfiguration represents a declarative configuration of the MachinePoolCondition type for use // with apply. type MachinePoolConditionApplyConfiguration struct { Type *v1alpha1.MachinePoolConditionType `json:"type,omitempty"` @@ -22,7 +22,7 @@ type MachinePoolConditionApplyConfiguration struct { LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` } -// MachinePoolConditionApplyConfiguration constructs an declarative configuration of the MachinePoolCondition type for use with +// MachinePoolConditionApplyConfiguration constructs a declarative configuration of the MachinePoolCondition type for use with // apply. func MachinePoolCondition() *MachinePoolConditionApplyConfiguration { return &MachinePoolConditionApplyConfiguration{} diff --git a/client-go/applyconfigurations/compute/v1alpha1/machinepooldaemonendpoints.go b/client-go/applyconfigurations/compute/v1alpha1/machinepooldaemonendpoints.go index 339969084..631757f8e 100644 --- a/client-go/applyconfigurations/compute/v1alpha1/machinepooldaemonendpoints.go +++ b/client-go/applyconfigurations/compute/v1alpha1/machinepooldaemonendpoints.go @@ -5,13 +5,13 @@ package v1alpha1 -// MachinePoolDaemonEndpointsApplyConfiguration represents an declarative configuration of the MachinePoolDaemonEndpoints type for use +// MachinePoolDaemonEndpointsApplyConfiguration represents a declarative configuration of the MachinePoolDaemonEndpoints type for use // with apply. type MachinePoolDaemonEndpointsApplyConfiguration struct { MachinepoolletEndpoint *DaemonEndpointApplyConfiguration `json:"machinepoolletEndpoint,omitempty"` } -// MachinePoolDaemonEndpointsApplyConfiguration constructs an declarative configuration of the MachinePoolDaemonEndpoints type for use with +// MachinePoolDaemonEndpointsApplyConfiguration constructs a declarative configuration of the MachinePoolDaemonEndpoints type for use with // apply. func MachinePoolDaemonEndpoints() *MachinePoolDaemonEndpointsApplyConfiguration { return &MachinePoolDaemonEndpointsApplyConfiguration{} diff --git a/client-go/applyconfigurations/compute/v1alpha1/machinepoolspec.go b/client-go/applyconfigurations/compute/v1alpha1/machinepoolspec.go index e690f4111..a97e1da1f 100644 --- a/client-go/applyconfigurations/compute/v1alpha1/machinepoolspec.go +++ b/client-go/applyconfigurations/compute/v1alpha1/machinepoolspec.go @@ -9,14 +9,14 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" ) -// MachinePoolSpecApplyConfiguration represents an declarative configuration of the MachinePoolSpec type for use +// MachinePoolSpecApplyConfiguration represents a declarative configuration of the MachinePoolSpec type for use // with apply. type MachinePoolSpecApplyConfiguration struct { ProviderID *string `json:"providerID,omitempty"` Taints []v1alpha1.Taint `json:"taints,omitempty"` } -// MachinePoolSpecApplyConfiguration constructs an declarative configuration of the MachinePoolSpec type for use with +// MachinePoolSpecApplyConfiguration constructs a declarative configuration of the MachinePoolSpec type for use with // apply. func MachinePoolSpec() *MachinePoolSpecApplyConfiguration { return &MachinePoolSpecApplyConfiguration{} diff --git a/client-go/applyconfigurations/compute/v1alpha1/machinepoolstatus.go b/client-go/applyconfigurations/compute/v1alpha1/machinepoolstatus.go index d7ca76d72..348c4326d 100644 --- a/client-go/applyconfigurations/compute/v1alpha1/machinepoolstatus.go +++ b/client-go/applyconfigurations/compute/v1alpha1/machinepoolstatus.go @@ -11,7 +11,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// MachinePoolStatusApplyConfiguration represents an declarative configuration of the MachinePoolStatus type for use +// MachinePoolStatusApplyConfiguration represents a declarative configuration of the MachinePoolStatus type for use // with apply. type MachinePoolStatusApplyConfiguration struct { State *v1alpha1.MachinePoolState `json:"state,omitempty"` @@ -23,7 +23,7 @@ type MachinePoolStatusApplyConfiguration struct { Allocatable *corev1alpha1.ResourceList `json:"allocatable,omitempty"` } -// MachinePoolStatusApplyConfiguration constructs an declarative configuration of the MachinePoolStatus type for use with +// MachinePoolStatusApplyConfiguration constructs a declarative configuration of the MachinePoolStatus type for use with // apply. func MachinePoolStatus() *MachinePoolStatusApplyConfiguration { return &MachinePoolStatusApplyConfiguration{} diff --git a/client-go/applyconfigurations/compute/v1alpha1/machinespec.go b/client-go/applyconfigurations/compute/v1alpha1/machinespec.go index 891ac0909..43dd7423d 100644 --- a/client-go/applyconfigurations/compute/v1alpha1/machinespec.go +++ b/client-go/applyconfigurations/compute/v1alpha1/machinespec.go @@ -11,7 +11,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// MachineSpecApplyConfiguration represents an declarative configuration of the MachineSpec type for use +// MachineSpecApplyConfiguration represents a declarative configuration of the MachineSpec type for use // with apply. type MachineSpecApplyConfiguration struct { MachineClassRef *v1.LocalObjectReference `json:"machineClassRef,omitempty"` @@ -27,7 +27,7 @@ type MachineSpecApplyConfiguration struct { Tolerations []commonv1alpha1.Toleration `json:"tolerations,omitempty"` } -// MachineSpecApplyConfiguration constructs an declarative configuration of the MachineSpec type for use with +// MachineSpecApplyConfiguration constructs a declarative configuration of the MachineSpec type for use with // apply. func MachineSpec() *MachineSpecApplyConfiguration { return &MachineSpecApplyConfiguration{} diff --git a/client-go/applyconfigurations/compute/v1alpha1/machinestatus.go b/client-go/applyconfigurations/compute/v1alpha1/machinestatus.go index fba766e10..16a1cc8ac 100644 --- a/client-go/applyconfigurations/compute/v1alpha1/machinestatus.go +++ b/client-go/applyconfigurations/compute/v1alpha1/machinestatus.go @@ -9,7 +9,7 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/compute/v1alpha1" ) -// MachineStatusApplyConfiguration represents an declarative configuration of the MachineStatus type for use +// MachineStatusApplyConfiguration represents a declarative configuration of the MachineStatus type for use // with apply. type MachineStatusApplyConfiguration struct { MachineID *string `json:"machineID,omitempty"` @@ -19,7 +19,7 @@ type MachineStatusApplyConfiguration struct { Volumes []VolumeStatusApplyConfiguration `json:"volumes,omitempty"` } -// MachineStatusApplyConfiguration constructs an declarative configuration of the MachineStatus type for use with +// MachineStatusApplyConfiguration constructs a declarative configuration of the MachineStatus type for use with // apply. func MachineStatus() *MachineStatusApplyConfiguration { return &MachineStatusApplyConfiguration{} diff --git a/client-go/applyconfigurations/compute/v1alpha1/networkinterface.go b/client-go/applyconfigurations/compute/v1alpha1/networkinterface.go index e87cb82a4..19c31bef0 100644 --- a/client-go/applyconfigurations/compute/v1alpha1/networkinterface.go +++ b/client-go/applyconfigurations/compute/v1alpha1/networkinterface.go @@ -9,14 +9,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// NetworkInterfaceApplyConfiguration represents an declarative configuration of the NetworkInterface type for use +// NetworkInterfaceApplyConfiguration represents a declarative configuration of the NetworkInterface type for use // with apply. type NetworkInterfaceApplyConfiguration struct { Name *string `json:"name,omitempty"` NetworkInterfaceSourceApplyConfiguration `json:",inline"` } -// NetworkInterfaceApplyConfiguration constructs an declarative configuration of the NetworkInterface type for use with +// NetworkInterfaceApplyConfiguration constructs a declarative configuration of the NetworkInterface type for use with // apply. func NetworkInterface() *NetworkInterfaceApplyConfiguration { return &NetworkInterfaceApplyConfiguration{} diff --git a/client-go/applyconfigurations/compute/v1alpha1/networkinterfacesource.go b/client-go/applyconfigurations/compute/v1alpha1/networkinterfacesource.go index 7493b954d..7c49f9ac2 100644 --- a/client-go/applyconfigurations/compute/v1alpha1/networkinterfacesource.go +++ b/client-go/applyconfigurations/compute/v1alpha1/networkinterfacesource.go @@ -9,14 +9,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// NetworkInterfaceSourceApplyConfiguration represents an declarative configuration of the NetworkInterfaceSource type for use +// NetworkInterfaceSourceApplyConfiguration represents a declarative configuration of the NetworkInterfaceSource type for use // with apply. type NetworkInterfaceSourceApplyConfiguration struct { NetworkInterfaceRef *v1.LocalObjectReference `json:"networkInterfaceRef,omitempty"` Ephemeral *EphemeralNetworkInterfaceSourceApplyConfiguration `json:"ephemeral,omitempty"` } -// NetworkInterfaceSourceApplyConfiguration constructs an declarative configuration of the NetworkInterfaceSource type for use with +// NetworkInterfaceSourceApplyConfiguration constructs a declarative configuration of the NetworkInterfaceSource type for use with // apply. func NetworkInterfaceSource() *NetworkInterfaceSourceApplyConfiguration { return &NetworkInterfaceSourceApplyConfiguration{} diff --git a/client-go/applyconfigurations/compute/v1alpha1/networkinterfacestatus.go b/client-go/applyconfigurations/compute/v1alpha1/networkinterfacestatus.go index 437f1c20c..9c9371879 100644 --- a/client-go/applyconfigurations/compute/v1alpha1/networkinterfacestatus.go +++ b/client-go/applyconfigurations/compute/v1alpha1/networkinterfacestatus.go @@ -11,7 +11,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// NetworkInterfaceStatusApplyConfiguration represents an declarative configuration of the NetworkInterfaceStatus type for use +// NetworkInterfaceStatusApplyConfiguration represents a declarative configuration of the NetworkInterfaceStatus type for use // with apply. type NetworkInterfaceStatusApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -21,7 +21,7 @@ type NetworkInterfaceStatusApplyConfiguration struct { LastStateTransitionTime *metav1.Time `json:"lastStateTransitionTime,omitempty"` } -// NetworkInterfaceStatusApplyConfiguration constructs an declarative configuration of the NetworkInterfaceStatus type for use with +// NetworkInterfaceStatusApplyConfiguration constructs a declarative configuration of the NetworkInterfaceStatus type for use with // apply. func NetworkInterfaceStatus() *NetworkInterfaceStatusApplyConfiguration { return &NetworkInterfaceStatusApplyConfiguration{} diff --git a/client-go/applyconfigurations/compute/v1alpha1/volume.go b/client-go/applyconfigurations/compute/v1alpha1/volume.go index 10fc5ffa7..1de1c7fc3 100644 --- a/client-go/applyconfigurations/compute/v1alpha1/volume.go +++ b/client-go/applyconfigurations/compute/v1alpha1/volume.go @@ -9,7 +9,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// VolumeApplyConfiguration represents an declarative configuration of the Volume type for use +// VolumeApplyConfiguration represents a declarative configuration of the Volume type for use // with apply. type VolumeApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -17,7 +17,7 @@ type VolumeApplyConfiguration struct { VolumeSourceApplyConfiguration `json:",inline"` } -// VolumeApplyConfiguration constructs an declarative configuration of the Volume type for use with +// VolumeApplyConfiguration constructs a declarative configuration of the Volume type for use with // apply. func Volume() *VolumeApplyConfiguration { return &VolumeApplyConfiguration{} diff --git a/client-go/applyconfigurations/compute/v1alpha1/volumesource.go b/client-go/applyconfigurations/compute/v1alpha1/volumesource.go index e33ec6324..d90248dd9 100644 --- a/client-go/applyconfigurations/compute/v1alpha1/volumesource.go +++ b/client-go/applyconfigurations/compute/v1alpha1/volumesource.go @@ -9,7 +9,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// VolumeSourceApplyConfiguration represents an declarative configuration of the VolumeSource type for use +// VolumeSourceApplyConfiguration represents a declarative configuration of the VolumeSource type for use // with apply. type VolumeSourceApplyConfiguration struct { VolumeRef *v1.LocalObjectReference `json:"volumeRef,omitempty"` @@ -17,7 +17,7 @@ type VolumeSourceApplyConfiguration struct { Ephemeral *EphemeralVolumeSourceApplyConfiguration `json:"ephemeral,omitempty"` } -// VolumeSourceApplyConfiguration constructs an declarative configuration of the VolumeSource type for use with +// VolumeSourceApplyConfiguration constructs a declarative configuration of the VolumeSource type for use with // apply. func VolumeSource() *VolumeSourceApplyConfiguration { return &VolumeSourceApplyConfiguration{} diff --git a/client-go/applyconfigurations/compute/v1alpha1/volumestatus.go b/client-go/applyconfigurations/compute/v1alpha1/volumestatus.go index 032b57d99..3997a0281 100644 --- a/client-go/applyconfigurations/compute/v1alpha1/volumestatus.go +++ b/client-go/applyconfigurations/compute/v1alpha1/volumestatus.go @@ -11,7 +11,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// VolumeStatusApplyConfiguration represents an declarative configuration of the VolumeStatus type for use +// VolumeStatusApplyConfiguration represents a declarative configuration of the VolumeStatus type for use // with apply. type VolumeStatusApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -21,7 +21,7 @@ type VolumeStatusApplyConfiguration struct { VolumeRef *corev1.LocalObjectReference `json:"volumeRef,omitempty"` } -// VolumeStatusApplyConfiguration constructs an declarative configuration of the VolumeStatus type for use with +// VolumeStatusApplyConfiguration constructs a declarative configuration of the VolumeStatus type for use with // apply. func VolumeStatus() *VolumeStatusApplyConfiguration { return &VolumeStatusApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/objectselector.go b/client-go/applyconfigurations/core/v1alpha1/objectselector.go index f8fa39595..258a1c23d 100644 --- a/client-go/applyconfigurations/core/v1alpha1/objectselector.go +++ b/client-go/applyconfigurations/core/v1alpha1/objectselector.go @@ -9,14 +9,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ObjectSelectorApplyConfiguration represents an declarative configuration of the ObjectSelector type for use +// ObjectSelectorApplyConfiguration represents a declarative configuration of the ObjectSelector type for use // with apply. type ObjectSelectorApplyConfiguration struct { Kind *string `json:"kind,omitempty"` v1.LabelSelectorApplyConfiguration `json:",inline"` } -// ObjectSelectorApplyConfiguration constructs an declarative configuration of the ObjectSelector type for use with +// ObjectSelectorApplyConfiguration constructs a declarative configuration of the ObjectSelector type for use with // apply. func ObjectSelector() *ObjectSelectorApplyConfiguration { return &ObjectSelectorApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/resourcequota.go b/client-go/applyconfigurations/core/v1alpha1/resourcequota.go index 3cd8af747..a5c9355c1 100644 --- a/client-go/applyconfigurations/core/v1alpha1/resourcequota.go +++ b/client-go/applyconfigurations/core/v1alpha1/resourcequota.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ResourceQuotaApplyConfiguration represents an declarative configuration of the ResourceQuota type for use +// ResourceQuotaApplyConfiguration represents a declarative configuration of the ResourceQuota type for use // with apply. type ResourceQuotaApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -23,7 +23,7 @@ type ResourceQuotaApplyConfiguration struct { Status *ResourceQuotaStatusApplyConfiguration `json:"status,omitempty"` } -// ResourceQuota constructs an declarative configuration of the ResourceQuota type for use with +// ResourceQuota constructs a declarative configuration of the ResourceQuota type for use with // apply. func ResourceQuota(name, namespace string) *ResourceQuotaApplyConfiguration { b := &ResourceQuotaApplyConfiguration{} @@ -243,3 +243,9 @@ func (b *ResourceQuotaApplyConfiguration) WithStatus(value *ResourceQuotaStatusA b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ResourceQuotaApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/core/v1alpha1/resourcequotaspec.go b/client-go/applyconfigurations/core/v1alpha1/resourcequotaspec.go index 675339509..d2a5054fb 100644 --- a/client-go/applyconfigurations/core/v1alpha1/resourcequotaspec.go +++ b/client-go/applyconfigurations/core/v1alpha1/resourcequotaspec.go @@ -9,14 +9,14 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/core/v1alpha1" ) -// ResourceQuotaSpecApplyConfiguration represents an declarative configuration of the ResourceQuotaSpec type for use +// ResourceQuotaSpecApplyConfiguration represents a declarative configuration of the ResourceQuotaSpec type for use // with apply. type ResourceQuotaSpecApplyConfiguration struct { Hard *v1alpha1.ResourceList `json:"hard,omitempty"` ScopeSelector *ResourceScopeSelectorApplyConfiguration `json:"scopeSelector,omitempty"` } -// ResourceQuotaSpecApplyConfiguration constructs an declarative configuration of the ResourceQuotaSpec type for use with +// ResourceQuotaSpecApplyConfiguration constructs a declarative configuration of the ResourceQuotaSpec type for use with // apply. func ResourceQuotaSpec() *ResourceQuotaSpecApplyConfiguration { return &ResourceQuotaSpecApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/resourcequotastatus.go b/client-go/applyconfigurations/core/v1alpha1/resourcequotastatus.go index fc15e7ea0..ec8d6073c 100644 --- a/client-go/applyconfigurations/core/v1alpha1/resourcequotastatus.go +++ b/client-go/applyconfigurations/core/v1alpha1/resourcequotastatus.go @@ -9,14 +9,14 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/core/v1alpha1" ) -// ResourceQuotaStatusApplyConfiguration represents an declarative configuration of the ResourceQuotaStatus type for use +// ResourceQuotaStatusApplyConfiguration represents a declarative configuration of the ResourceQuotaStatus type for use // with apply. type ResourceQuotaStatusApplyConfiguration struct { Hard *v1alpha1.ResourceList `json:"hard,omitempty"` Used *v1alpha1.ResourceList `json:"used,omitempty"` } -// ResourceQuotaStatusApplyConfiguration constructs an declarative configuration of the ResourceQuotaStatus type for use with +// ResourceQuotaStatusApplyConfiguration constructs a declarative configuration of the ResourceQuotaStatus type for use with // apply. func ResourceQuotaStatus() *ResourceQuotaStatusApplyConfiguration { return &ResourceQuotaStatusApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/resourcescopeselector.go b/client-go/applyconfigurations/core/v1alpha1/resourcescopeselector.go index 0d4d3dd3b..d3ff9a170 100644 --- a/client-go/applyconfigurations/core/v1alpha1/resourcescopeselector.go +++ b/client-go/applyconfigurations/core/v1alpha1/resourcescopeselector.go @@ -5,13 +5,13 @@ package v1alpha1 -// ResourceScopeSelectorApplyConfiguration represents an declarative configuration of the ResourceScopeSelector type for use +// ResourceScopeSelectorApplyConfiguration represents a declarative configuration of the ResourceScopeSelector type for use // with apply. type ResourceScopeSelectorApplyConfiguration struct { MatchExpressions []ResourceScopeSelectorRequirementApplyConfiguration `json:"matchExpressions,omitempty"` } -// ResourceScopeSelectorApplyConfiguration constructs an declarative configuration of the ResourceScopeSelector type for use with +// ResourceScopeSelectorApplyConfiguration constructs a declarative configuration of the ResourceScopeSelector type for use with // apply. func ResourceScopeSelector() *ResourceScopeSelectorApplyConfiguration { return &ResourceScopeSelectorApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/resourcescopeselectorrequirement.go b/client-go/applyconfigurations/core/v1alpha1/resourcescopeselectorrequirement.go index b18b31cb9..1f6a42dd5 100644 --- a/client-go/applyconfigurations/core/v1alpha1/resourcescopeselectorrequirement.go +++ b/client-go/applyconfigurations/core/v1alpha1/resourcescopeselectorrequirement.go @@ -9,7 +9,7 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/core/v1alpha1" ) -// ResourceScopeSelectorRequirementApplyConfiguration represents an declarative configuration of the ResourceScopeSelectorRequirement type for use +// ResourceScopeSelectorRequirementApplyConfiguration represents a declarative configuration of the ResourceScopeSelectorRequirement type for use // with apply. type ResourceScopeSelectorRequirementApplyConfiguration struct { ScopeName *v1alpha1.ResourceScope `json:"scopeName,omitempty"` @@ -17,7 +17,7 @@ type ResourceScopeSelectorRequirementApplyConfiguration struct { Values []string `json:"values,omitempty"` } -// ResourceScopeSelectorRequirementApplyConfiguration constructs an declarative configuration of the ResourceScopeSelectorRequirement type for use with +// ResourceScopeSelectorRequirementApplyConfiguration constructs a declarative configuration of the ResourceScopeSelectorRequirement type for use with // apply. func ResourceScopeSelectorRequirement() *ResourceScopeSelectorRequirementApplyConfiguration { return &ResourceScopeSelectorRequirementApplyConfiguration{} diff --git a/client-go/applyconfigurations/ipam/v1alpha1/prefix.go b/client-go/applyconfigurations/ipam/v1alpha1/prefix.go index 89706f75a..03ca677fa 100644 --- a/client-go/applyconfigurations/ipam/v1alpha1/prefix.go +++ b/client-go/applyconfigurations/ipam/v1alpha1/prefix.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PrefixApplyConfiguration represents an declarative configuration of the Prefix type for use +// PrefixApplyConfiguration represents a declarative configuration of the Prefix type for use // with apply. type PrefixApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -23,7 +23,7 @@ type PrefixApplyConfiguration struct { Status *PrefixStatusApplyConfiguration `json:"status,omitempty"` } -// Prefix constructs an declarative configuration of the Prefix type for use with +// Prefix constructs a declarative configuration of the Prefix type for use with // apply. func Prefix(name, namespace string) *PrefixApplyConfiguration { b := &PrefixApplyConfiguration{} @@ -243,3 +243,9 @@ func (b *PrefixApplyConfiguration) WithStatus(value *PrefixStatusApplyConfigurat b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PrefixApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/ipam/v1alpha1/prefixallocation.go b/client-go/applyconfigurations/ipam/v1alpha1/prefixallocation.go index 699c9dfc5..33a84bcfd 100644 --- a/client-go/applyconfigurations/ipam/v1alpha1/prefixallocation.go +++ b/client-go/applyconfigurations/ipam/v1alpha1/prefixallocation.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PrefixAllocationApplyConfiguration represents an declarative configuration of the PrefixAllocation type for use +// PrefixAllocationApplyConfiguration represents a declarative configuration of the PrefixAllocation type for use // with apply. type PrefixAllocationApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -23,7 +23,7 @@ type PrefixAllocationApplyConfiguration struct { Status *PrefixAllocationStatusApplyConfiguration `json:"status,omitempty"` } -// PrefixAllocation constructs an declarative configuration of the PrefixAllocation type for use with +// PrefixAllocation constructs a declarative configuration of the PrefixAllocation type for use with // apply. func PrefixAllocation(name, namespace string) *PrefixAllocationApplyConfiguration { b := &PrefixAllocationApplyConfiguration{} @@ -243,3 +243,9 @@ func (b *PrefixAllocationApplyConfiguration) WithStatus(value *PrefixAllocationS b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PrefixAllocationApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/ipam/v1alpha1/prefixallocationspec.go b/client-go/applyconfigurations/ipam/v1alpha1/prefixallocationspec.go index 674d3f758..8ac616964 100644 --- a/client-go/applyconfigurations/ipam/v1alpha1/prefixallocationspec.go +++ b/client-go/applyconfigurations/ipam/v1alpha1/prefixallocationspec.go @@ -11,7 +11,7 @@ import ( metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PrefixAllocationSpecApplyConfiguration represents an declarative configuration of the PrefixAllocationSpec type for use +// PrefixAllocationSpecApplyConfiguration represents a declarative configuration of the PrefixAllocationSpec type for use // with apply. type PrefixAllocationSpecApplyConfiguration struct { IPFamily *v1.IPFamily `json:"ipFamily,omitempty"` @@ -21,7 +21,7 @@ type PrefixAllocationSpecApplyConfiguration struct { PrefixSelector *metav1.LabelSelectorApplyConfiguration `json:"prefixSelector,omitempty"` } -// PrefixAllocationSpecApplyConfiguration constructs an declarative configuration of the PrefixAllocationSpec type for use with +// PrefixAllocationSpecApplyConfiguration constructs a declarative configuration of the PrefixAllocationSpec type for use with // apply. func PrefixAllocationSpec() *PrefixAllocationSpecApplyConfiguration { return &PrefixAllocationSpecApplyConfiguration{} diff --git a/client-go/applyconfigurations/ipam/v1alpha1/prefixallocationstatus.go b/client-go/applyconfigurations/ipam/v1alpha1/prefixallocationstatus.go index 00636030c..208bbd41d 100644 --- a/client-go/applyconfigurations/ipam/v1alpha1/prefixallocationstatus.go +++ b/client-go/applyconfigurations/ipam/v1alpha1/prefixallocationstatus.go @@ -11,7 +11,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// PrefixAllocationStatusApplyConfiguration represents an declarative configuration of the PrefixAllocationStatus type for use +// PrefixAllocationStatusApplyConfiguration represents a declarative configuration of the PrefixAllocationStatus type for use // with apply. type PrefixAllocationStatusApplyConfiguration struct { Prefix *v1alpha1.IPPrefix `json:"prefix,omitempty"` @@ -19,7 +19,7 @@ type PrefixAllocationStatusApplyConfiguration struct { LastPhaseTransitionTime *v1.Time `json:"lastPhaseTransitionTime,omitempty"` } -// PrefixAllocationStatusApplyConfiguration constructs an declarative configuration of the PrefixAllocationStatus type for use with +// PrefixAllocationStatusApplyConfiguration constructs a declarative configuration of the PrefixAllocationStatus type for use with // apply. func PrefixAllocationStatus() *PrefixAllocationStatusApplyConfiguration { return &PrefixAllocationStatusApplyConfiguration{} diff --git a/client-go/applyconfigurations/ipam/v1alpha1/prefixspec.go b/client-go/applyconfigurations/ipam/v1alpha1/prefixspec.go index 2314b2b40..ce370b79c 100644 --- a/client-go/applyconfigurations/ipam/v1alpha1/prefixspec.go +++ b/client-go/applyconfigurations/ipam/v1alpha1/prefixspec.go @@ -11,7 +11,7 @@ import ( metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PrefixSpecApplyConfiguration represents an declarative configuration of the PrefixSpec type for use +// PrefixSpecApplyConfiguration represents a declarative configuration of the PrefixSpec type for use // with apply. type PrefixSpecApplyConfiguration struct { IPFamily *v1.IPFamily `json:"ipFamily,omitempty"` @@ -21,7 +21,7 @@ type PrefixSpecApplyConfiguration struct { ParentSelector *metav1.LabelSelectorApplyConfiguration `json:"parentSelector,omitempty"` } -// PrefixSpecApplyConfiguration constructs an declarative configuration of the PrefixSpec type for use with +// PrefixSpecApplyConfiguration constructs a declarative configuration of the PrefixSpec type for use with // apply. func PrefixSpec() *PrefixSpecApplyConfiguration { return &PrefixSpecApplyConfiguration{} diff --git a/client-go/applyconfigurations/ipam/v1alpha1/prefixstatus.go b/client-go/applyconfigurations/ipam/v1alpha1/prefixstatus.go index c91fef235..4f0956836 100644 --- a/client-go/applyconfigurations/ipam/v1alpha1/prefixstatus.go +++ b/client-go/applyconfigurations/ipam/v1alpha1/prefixstatus.go @@ -11,7 +11,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// PrefixStatusApplyConfiguration represents an declarative configuration of the PrefixStatus type for use +// PrefixStatusApplyConfiguration represents a declarative configuration of the PrefixStatus type for use // with apply. type PrefixStatusApplyConfiguration struct { Phase *v1alpha1.PrefixPhase `json:"phase,omitempty"` @@ -19,7 +19,7 @@ type PrefixStatusApplyConfiguration struct { Used []commonv1alpha1.IPPrefix `json:"used,omitempty"` } -// PrefixStatusApplyConfiguration constructs an declarative configuration of the PrefixStatus type for use with +// PrefixStatusApplyConfiguration constructs a declarative configuration of the PrefixStatus type for use with // apply. func PrefixStatus() *PrefixStatusApplyConfiguration { return &PrefixStatusApplyConfiguration{} diff --git a/client-go/applyconfigurations/ipam/v1alpha1/prefixtemplatespec.go b/client-go/applyconfigurations/ipam/v1alpha1/prefixtemplatespec.go index e9e289df6..5b044e709 100644 --- a/client-go/applyconfigurations/ipam/v1alpha1/prefixtemplatespec.go +++ b/client-go/applyconfigurations/ipam/v1alpha1/prefixtemplatespec.go @@ -11,14 +11,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PrefixTemplateSpecApplyConfiguration represents an declarative configuration of the PrefixTemplateSpec type for use +// PrefixTemplateSpecApplyConfiguration represents a declarative configuration of the PrefixTemplateSpec type for use // with apply. type PrefixTemplateSpecApplyConfiguration struct { *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *PrefixSpecApplyConfiguration `json:"spec,omitempty"` } -// PrefixTemplateSpecApplyConfiguration constructs an declarative configuration of the PrefixTemplateSpec type for use with +// PrefixTemplateSpecApplyConfiguration constructs a declarative configuration of the PrefixTemplateSpec type for use with // apply. func PrefixTemplateSpec() *PrefixTemplateSpecApplyConfiguration { return &PrefixTemplateSpecApplyConfiguration{} @@ -173,3 +173,9 @@ func (b *PrefixTemplateSpecApplyConfiguration) WithSpec(value *PrefixSpecApplyCo b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PrefixTemplateSpecApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/networking/v1alpha1/ephemeralprefixsource.go b/client-go/applyconfigurations/networking/v1alpha1/ephemeralprefixsource.go index e7881c1be..bb63a4475 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/ephemeralprefixsource.go +++ b/client-go/applyconfigurations/networking/v1alpha1/ephemeralprefixsource.go @@ -9,13 +9,13 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/ipam/v1alpha1" ) -// EphemeralPrefixSourceApplyConfiguration represents an declarative configuration of the EphemeralPrefixSource type for use +// EphemeralPrefixSourceApplyConfiguration represents a declarative configuration of the EphemeralPrefixSource type for use // with apply. type EphemeralPrefixSourceApplyConfiguration struct { PrefixTemplate *v1alpha1.PrefixTemplateSpecApplyConfiguration `json:"prefixTemplate,omitempty"` } -// EphemeralPrefixSourceApplyConfiguration constructs an declarative configuration of the EphemeralPrefixSource type for use with +// EphemeralPrefixSourceApplyConfiguration constructs a declarative configuration of the EphemeralPrefixSource type for use with // apply. func EphemeralPrefixSource() *EphemeralPrefixSourceApplyConfiguration { return &EphemeralPrefixSourceApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/ephemeralvirtualipsource.go b/client-go/applyconfigurations/networking/v1alpha1/ephemeralvirtualipsource.go index 1cd236b52..2d6c70508 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/ephemeralvirtualipsource.go +++ b/client-go/applyconfigurations/networking/v1alpha1/ephemeralvirtualipsource.go @@ -5,13 +5,13 @@ package v1alpha1 -// EphemeralVirtualIPSourceApplyConfiguration represents an declarative configuration of the EphemeralVirtualIPSource type for use +// EphemeralVirtualIPSourceApplyConfiguration represents a declarative configuration of the EphemeralVirtualIPSource type for use // with apply. type EphemeralVirtualIPSourceApplyConfiguration struct { VirtualIPTemplate *VirtualIPTemplateSpecApplyConfiguration `json:"virtualIPTemplate,omitempty"` } -// EphemeralVirtualIPSourceApplyConfiguration constructs an declarative configuration of the EphemeralVirtualIPSource type for use with +// EphemeralVirtualIPSourceApplyConfiguration constructs a declarative configuration of the EphemeralVirtualIPSource type for use with // apply. func EphemeralVirtualIPSource() *EphemeralVirtualIPSourceApplyConfiguration { return &EphemeralVirtualIPSourceApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/ipblock.go b/client-go/applyconfigurations/networking/v1alpha1/ipblock.go index e7cb5358c..080df3b0a 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/ipblock.go +++ b/client-go/applyconfigurations/networking/v1alpha1/ipblock.go @@ -9,14 +9,14 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" ) -// IPBlockApplyConfiguration represents an declarative configuration of the IPBlock type for use +// IPBlockApplyConfiguration represents a declarative configuration of the IPBlock type for use // with apply. type IPBlockApplyConfiguration struct { CIDR *v1alpha1.IPPrefix `json:"cidr,omitempty"` Except []v1alpha1.IPPrefix `json:"except,omitempty"` } -// IPBlockApplyConfiguration constructs an declarative configuration of the IPBlock type for use with +// IPBlockApplyConfiguration constructs a declarative configuration of the IPBlock type for use with // apply. func IPBlock() *IPBlockApplyConfiguration { return &IPBlockApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/ipsource.go b/client-go/applyconfigurations/networking/v1alpha1/ipsource.go index 935bb047a..ea48fadb9 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/ipsource.go +++ b/client-go/applyconfigurations/networking/v1alpha1/ipsource.go @@ -9,14 +9,14 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" ) -// IPSourceApplyConfiguration represents an declarative configuration of the IPSource type for use +// IPSourceApplyConfiguration represents a declarative configuration of the IPSource type for use // with apply. type IPSourceApplyConfiguration struct { Value *v1alpha1.IP `json:"value,omitempty"` Ephemeral *EphemeralPrefixSourceApplyConfiguration `json:"ephemeral,omitempty"` } -// IPSourceApplyConfiguration constructs an declarative configuration of the IPSource type for use with +// IPSourceApplyConfiguration constructs a declarative configuration of the IPSource type for use with // apply. func IPSource() *IPSourceApplyConfiguration { return &IPSourceApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/loadbalancer.go b/client-go/applyconfigurations/networking/v1alpha1/loadbalancer.go index 264eeda4f..957943151 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/loadbalancer.go +++ b/client-go/applyconfigurations/networking/v1alpha1/loadbalancer.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// LoadBalancerApplyConfiguration represents an declarative configuration of the LoadBalancer type for use +// LoadBalancerApplyConfiguration represents a declarative configuration of the LoadBalancer type for use // with apply. type LoadBalancerApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -23,7 +23,7 @@ type LoadBalancerApplyConfiguration struct { Status *LoadBalancerStatusApplyConfiguration `json:"status,omitempty"` } -// LoadBalancer constructs an declarative configuration of the LoadBalancer type for use with +// LoadBalancer constructs a declarative configuration of the LoadBalancer type for use with // apply. func LoadBalancer(name, namespace string) *LoadBalancerApplyConfiguration { b := &LoadBalancerApplyConfiguration{} @@ -243,3 +243,9 @@ func (b *LoadBalancerApplyConfiguration) WithStatus(value *LoadBalancerStatusApp b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *LoadBalancerApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/networking/v1alpha1/loadbalancerdestination.go b/client-go/applyconfigurations/networking/v1alpha1/loadbalancerdestination.go index 91dc94c12..01786d5cd 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/loadbalancerdestination.go +++ b/client-go/applyconfigurations/networking/v1alpha1/loadbalancerdestination.go @@ -9,14 +9,14 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" ) -// LoadBalancerDestinationApplyConfiguration represents an declarative configuration of the LoadBalancerDestination type for use +// LoadBalancerDestinationApplyConfiguration represents a declarative configuration of the LoadBalancerDestination type for use // with apply. type LoadBalancerDestinationApplyConfiguration struct { IP *v1alpha1.IP `json:"ip,omitempty"` TargetRef *LoadBalancerTargetRefApplyConfiguration `json:"targetRef,omitempty"` } -// LoadBalancerDestinationApplyConfiguration constructs an declarative configuration of the LoadBalancerDestination type for use with +// LoadBalancerDestinationApplyConfiguration constructs a declarative configuration of the LoadBalancerDestination type for use with // apply. func LoadBalancerDestination() *LoadBalancerDestinationApplyConfiguration { return &LoadBalancerDestinationApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/loadbalancerport.go b/client-go/applyconfigurations/networking/v1alpha1/loadbalancerport.go index e31d793fc..84b386582 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/loadbalancerport.go +++ b/client-go/applyconfigurations/networking/v1alpha1/loadbalancerport.go @@ -9,7 +9,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// LoadBalancerPortApplyConfiguration represents an declarative configuration of the LoadBalancerPort type for use +// LoadBalancerPortApplyConfiguration represents a declarative configuration of the LoadBalancerPort type for use // with apply. type LoadBalancerPortApplyConfiguration struct { Protocol *v1.Protocol `json:"protocol,omitempty"` @@ -17,7 +17,7 @@ type LoadBalancerPortApplyConfiguration struct { EndPort *int32 `json:"endPort,omitempty"` } -// LoadBalancerPortApplyConfiguration constructs an declarative configuration of the LoadBalancerPort type for use with +// LoadBalancerPortApplyConfiguration constructs a declarative configuration of the LoadBalancerPort type for use with // apply. func LoadBalancerPort() *LoadBalancerPortApplyConfiguration { return &LoadBalancerPortApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/loadbalancerrouting.go b/client-go/applyconfigurations/networking/v1alpha1/loadbalancerrouting.go index 8457f177e..b94071efa 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/loadbalancerrouting.go +++ b/client-go/applyconfigurations/networking/v1alpha1/loadbalancerrouting.go @@ -15,7 +15,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// LoadBalancerRoutingApplyConfiguration represents an declarative configuration of the LoadBalancerRouting type for use +// LoadBalancerRoutingApplyConfiguration represents a declarative configuration of the LoadBalancerRouting type for use // with apply. type LoadBalancerRoutingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -24,7 +24,7 @@ type LoadBalancerRoutingApplyConfiguration struct { Destinations []LoadBalancerDestinationApplyConfiguration `json:"destinations,omitempty"` } -// LoadBalancerRouting constructs an declarative configuration of the LoadBalancerRouting type for use with +// LoadBalancerRouting constructs a declarative configuration of the LoadBalancerRouting type for use with // apply. func LoadBalancerRouting(name, namespace string) *LoadBalancerRoutingApplyConfiguration { b := &LoadBalancerRoutingApplyConfiguration{} @@ -249,3 +249,9 @@ func (b *LoadBalancerRoutingApplyConfiguration) WithDestinations(values ...*Load } return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *LoadBalancerRoutingApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/networking/v1alpha1/loadbalancerspec.go b/client-go/applyconfigurations/networking/v1alpha1/loadbalancerspec.go index f29e26dcf..22ce94110 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/loadbalancerspec.go +++ b/client-go/applyconfigurations/networking/v1alpha1/loadbalancerspec.go @@ -11,7 +11,7 @@ import ( metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// LoadBalancerSpecApplyConfiguration represents an declarative configuration of the LoadBalancerSpec type for use +// LoadBalancerSpecApplyConfiguration represents a declarative configuration of the LoadBalancerSpec type for use // with apply. type LoadBalancerSpecApplyConfiguration struct { Type *v1alpha1.LoadBalancerType `json:"type,omitempty"` @@ -22,7 +22,7 @@ type LoadBalancerSpecApplyConfiguration struct { Ports []LoadBalancerPortApplyConfiguration `json:"ports,omitempty"` } -// LoadBalancerSpecApplyConfiguration constructs an declarative configuration of the LoadBalancerSpec type for use with +// LoadBalancerSpecApplyConfiguration constructs a declarative configuration of the LoadBalancerSpec type for use with // apply. func LoadBalancerSpec() *LoadBalancerSpecApplyConfiguration { return &LoadBalancerSpecApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/loadbalancerstatus.go b/client-go/applyconfigurations/networking/v1alpha1/loadbalancerstatus.go index 38d3febdd..eafce7fb5 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/loadbalancerstatus.go +++ b/client-go/applyconfigurations/networking/v1alpha1/loadbalancerstatus.go @@ -9,13 +9,13 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" ) -// LoadBalancerStatusApplyConfiguration represents an declarative configuration of the LoadBalancerStatus type for use +// LoadBalancerStatusApplyConfiguration represents a declarative configuration of the LoadBalancerStatus type for use // with apply. type LoadBalancerStatusApplyConfiguration struct { IPs []v1alpha1.IP `json:"ips,omitempty"` } -// LoadBalancerStatusApplyConfiguration constructs an declarative configuration of the LoadBalancerStatus type for use with +// LoadBalancerStatusApplyConfiguration constructs a declarative configuration of the LoadBalancerStatus type for use with // apply. func LoadBalancerStatus() *LoadBalancerStatusApplyConfiguration { return &LoadBalancerStatusApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/loadbalancertargetref.go b/client-go/applyconfigurations/networking/v1alpha1/loadbalancertargetref.go index f97d556ba..ff9286c61 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/loadbalancertargetref.go +++ b/client-go/applyconfigurations/networking/v1alpha1/loadbalancertargetref.go @@ -9,7 +9,7 @@ import ( types "k8s.io/apimachinery/pkg/types" ) -// LoadBalancerTargetRefApplyConfiguration represents an declarative configuration of the LoadBalancerTargetRef type for use +// LoadBalancerTargetRefApplyConfiguration represents a declarative configuration of the LoadBalancerTargetRef type for use // with apply. type LoadBalancerTargetRefApplyConfiguration struct { UID *types.UID `json:"uid,omitempty"` @@ -17,7 +17,7 @@ type LoadBalancerTargetRefApplyConfiguration struct { ProviderID *string `json:"providerID,omitempty"` } -// LoadBalancerTargetRefApplyConfiguration constructs an declarative configuration of the LoadBalancerTargetRef type for use with +// LoadBalancerTargetRefApplyConfiguration constructs a declarative configuration of the LoadBalancerTargetRef type for use with // apply. func LoadBalancerTargetRef() *LoadBalancerTargetRefApplyConfiguration { return &LoadBalancerTargetRefApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/natgateway.go b/client-go/applyconfigurations/networking/v1alpha1/natgateway.go index 5cf809b2c..835d43b11 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/natgateway.go +++ b/client-go/applyconfigurations/networking/v1alpha1/natgateway.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// NATGatewayApplyConfiguration represents an declarative configuration of the NATGateway type for use +// NATGatewayApplyConfiguration represents a declarative configuration of the NATGateway type for use // with apply. type NATGatewayApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -23,7 +23,7 @@ type NATGatewayApplyConfiguration struct { Status *NATGatewayStatusApplyConfiguration `json:"status,omitempty"` } -// NATGateway constructs an declarative configuration of the NATGateway type for use with +// NATGateway constructs a declarative configuration of the NATGateway type for use with // apply. func NATGateway(name, namespace string) *NATGatewayApplyConfiguration { b := &NATGatewayApplyConfiguration{} @@ -243,3 +243,9 @@ func (b *NATGatewayApplyConfiguration) WithStatus(value *NATGatewayStatusApplyCo b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *NATGatewayApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/networking/v1alpha1/natgatewayspec.go b/client-go/applyconfigurations/networking/v1alpha1/natgatewayspec.go index 150cb7e12..b882c2946 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/natgatewayspec.go +++ b/client-go/applyconfigurations/networking/v1alpha1/natgatewayspec.go @@ -10,7 +10,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// NATGatewaySpecApplyConfiguration represents an declarative configuration of the NATGatewaySpec type for use +// NATGatewaySpecApplyConfiguration represents a declarative configuration of the NATGatewaySpec type for use // with apply. type NATGatewaySpecApplyConfiguration struct { Type *v1alpha1.NATGatewayType `json:"type,omitempty"` @@ -19,7 +19,7 @@ type NATGatewaySpecApplyConfiguration struct { PortsPerNetworkInterface *int32 `json:"portsPerNetworkInterface,omitempty"` } -// NATGatewaySpecApplyConfiguration constructs an declarative configuration of the NATGatewaySpec type for use with +// NATGatewaySpecApplyConfiguration constructs a declarative configuration of the NATGatewaySpec type for use with // apply. func NATGatewaySpec() *NATGatewaySpecApplyConfiguration { return &NATGatewaySpecApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/natgatewaystatus.go b/client-go/applyconfigurations/networking/v1alpha1/natgatewaystatus.go index 39c04e148..775e73d83 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/natgatewaystatus.go +++ b/client-go/applyconfigurations/networking/v1alpha1/natgatewaystatus.go @@ -9,13 +9,13 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" ) -// NATGatewayStatusApplyConfiguration represents an declarative configuration of the NATGatewayStatus type for use +// NATGatewayStatusApplyConfiguration represents a declarative configuration of the NATGatewayStatus type for use // with apply. type NATGatewayStatusApplyConfiguration struct { IPs []v1alpha1.IP `json:"ips,omitempty"` } -// NATGatewayStatusApplyConfiguration constructs an declarative configuration of the NATGatewayStatus type for use with +// NATGatewayStatusApplyConfiguration constructs a declarative configuration of the NATGatewayStatus type for use with // apply. func NATGatewayStatus() *NATGatewayStatusApplyConfiguration { return &NATGatewayStatusApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/network.go b/client-go/applyconfigurations/networking/v1alpha1/network.go index f29ef5827..4ccfe585b 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/network.go +++ b/client-go/applyconfigurations/networking/v1alpha1/network.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// NetworkApplyConfiguration represents an declarative configuration of the Network type for use +// NetworkApplyConfiguration represents a declarative configuration of the Network type for use // with apply. type NetworkApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -23,7 +23,7 @@ type NetworkApplyConfiguration struct { Status *NetworkStatusApplyConfiguration `json:"status,omitempty"` } -// Network constructs an declarative configuration of the Network type for use with +// Network constructs a declarative configuration of the Network type for use with // apply. func Network(name, namespace string) *NetworkApplyConfiguration { b := &NetworkApplyConfiguration{} @@ -243,3 +243,9 @@ func (b *NetworkApplyConfiguration) WithStatus(value *NetworkStatusApplyConfigur b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *NetworkApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/networking/v1alpha1/networkinterface.go b/client-go/applyconfigurations/networking/v1alpha1/networkinterface.go index 0e56e4967..c00ddfc27 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/networkinterface.go +++ b/client-go/applyconfigurations/networking/v1alpha1/networkinterface.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// NetworkInterfaceApplyConfiguration represents an declarative configuration of the NetworkInterface type for use +// NetworkInterfaceApplyConfiguration represents a declarative configuration of the NetworkInterface type for use // with apply. type NetworkInterfaceApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -23,7 +23,7 @@ type NetworkInterfaceApplyConfiguration struct { Status *NetworkInterfaceStatusApplyConfiguration `json:"status,omitempty"` } -// NetworkInterface constructs an declarative configuration of the NetworkInterface type for use with +// NetworkInterface constructs a declarative configuration of the NetworkInterface type for use with // apply. func NetworkInterface(name, namespace string) *NetworkInterfaceApplyConfiguration { b := &NetworkInterfaceApplyConfiguration{} @@ -243,3 +243,9 @@ func (b *NetworkInterfaceApplyConfiguration) WithStatus(value *NetworkInterfaceS b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *NetworkInterfaceApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/networking/v1alpha1/networkinterfacespec.go b/client-go/applyconfigurations/networking/v1alpha1/networkinterfacespec.go index bc8fb7327..01321bde2 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/networkinterfacespec.go +++ b/client-go/applyconfigurations/networking/v1alpha1/networkinterfacespec.go @@ -10,7 +10,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// NetworkInterfaceSpecApplyConfiguration represents an declarative configuration of the NetworkInterfaceSpec type for use +// NetworkInterfaceSpecApplyConfiguration represents a declarative configuration of the NetworkInterfaceSpec type for use // with apply. type NetworkInterfaceSpecApplyConfiguration struct { ProviderID *string `json:"providerID,omitempty"` @@ -23,7 +23,7 @@ type NetworkInterfaceSpecApplyConfiguration struct { Attributes map[string]string `json:"attributes,omitempty"` } -// NetworkInterfaceSpecApplyConfiguration constructs an declarative configuration of the NetworkInterfaceSpec type for use with +// NetworkInterfaceSpecApplyConfiguration constructs a declarative configuration of the NetworkInterfaceSpec type for use with // apply. func NetworkInterfaceSpec() *NetworkInterfaceSpecApplyConfiguration { return &NetworkInterfaceSpecApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/networkinterfacestatus.go b/client-go/applyconfigurations/networking/v1alpha1/networkinterfacestatus.go index 02d9ab179..9ec5e05d5 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/networkinterfacestatus.go +++ b/client-go/applyconfigurations/networking/v1alpha1/networkinterfacestatus.go @@ -11,7 +11,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// NetworkInterfaceStatusApplyConfiguration represents an declarative configuration of the NetworkInterfaceStatus type for use +// NetworkInterfaceStatusApplyConfiguration represents a declarative configuration of the NetworkInterfaceStatus type for use // with apply. type NetworkInterfaceStatusApplyConfiguration struct { State *v1alpha1.NetworkInterfaceState `json:"state,omitempty"` @@ -21,7 +21,7 @@ type NetworkInterfaceStatusApplyConfiguration struct { VirtualIP *commonv1alpha1.IP `json:"virtualIP,omitempty"` } -// NetworkInterfaceStatusApplyConfiguration constructs an declarative configuration of the NetworkInterfaceStatus type for use with +// NetworkInterfaceStatusApplyConfiguration constructs a declarative configuration of the NetworkInterfaceStatus type for use with // apply. func NetworkInterfaceStatus() *NetworkInterfaceStatusApplyConfiguration { return &NetworkInterfaceStatusApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/networkinterfacetemplatespec.go b/client-go/applyconfigurations/networking/v1alpha1/networkinterfacetemplatespec.go index 22cfa5105..858a7175e 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/networkinterfacetemplatespec.go +++ b/client-go/applyconfigurations/networking/v1alpha1/networkinterfacetemplatespec.go @@ -11,14 +11,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// NetworkInterfaceTemplateSpecApplyConfiguration represents an declarative configuration of the NetworkInterfaceTemplateSpec type for use +// NetworkInterfaceTemplateSpecApplyConfiguration represents a declarative configuration of the NetworkInterfaceTemplateSpec type for use // with apply. type NetworkInterfaceTemplateSpecApplyConfiguration struct { *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *NetworkInterfaceSpecApplyConfiguration `json:"spec,omitempty"` } -// NetworkInterfaceTemplateSpecApplyConfiguration constructs an declarative configuration of the NetworkInterfaceTemplateSpec type for use with +// NetworkInterfaceTemplateSpecApplyConfiguration constructs a declarative configuration of the NetworkInterfaceTemplateSpec type for use with // apply. func NetworkInterfaceTemplateSpec() *NetworkInterfaceTemplateSpecApplyConfiguration { return &NetworkInterfaceTemplateSpecApplyConfiguration{} @@ -173,3 +173,9 @@ func (b *NetworkInterfaceTemplateSpecApplyConfiguration) WithSpec(value *Network b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *NetworkInterfaceTemplateSpecApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/networking/v1alpha1/networkpeering.go b/client-go/applyconfigurations/networking/v1alpha1/networkpeering.go index 261e69e94..9bee4eaf2 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/networkpeering.go +++ b/client-go/applyconfigurations/networking/v1alpha1/networkpeering.go @@ -5,7 +5,7 @@ package v1alpha1 -// NetworkPeeringApplyConfiguration represents an declarative configuration of the NetworkPeering type for use +// NetworkPeeringApplyConfiguration represents a declarative configuration of the NetworkPeering type for use // with apply. type NetworkPeeringApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -13,7 +13,7 @@ type NetworkPeeringApplyConfiguration struct { Prefixes []PeeringPrefixApplyConfiguration `json:"prefixes,omitempty"` } -// NetworkPeeringApplyConfiguration constructs an declarative configuration of the NetworkPeering type for use with +// NetworkPeeringApplyConfiguration constructs a declarative configuration of the NetworkPeering type for use with // apply. func NetworkPeering() *NetworkPeeringApplyConfiguration { return &NetworkPeeringApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/networkpeeringclaimref.go b/client-go/applyconfigurations/networking/v1alpha1/networkpeeringclaimref.go index c79f4650d..bc4dbc864 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/networkpeeringclaimref.go +++ b/client-go/applyconfigurations/networking/v1alpha1/networkpeeringclaimref.go @@ -9,7 +9,7 @@ import ( types "k8s.io/apimachinery/pkg/types" ) -// NetworkPeeringClaimRefApplyConfiguration represents an declarative configuration of the NetworkPeeringClaimRef type for use +// NetworkPeeringClaimRefApplyConfiguration represents a declarative configuration of the NetworkPeeringClaimRef type for use // with apply. type NetworkPeeringClaimRefApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` @@ -17,7 +17,7 @@ type NetworkPeeringClaimRefApplyConfiguration struct { UID *types.UID `json:"uid,omitempty"` } -// NetworkPeeringClaimRefApplyConfiguration constructs an declarative configuration of the NetworkPeeringClaimRef type for use with +// NetworkPeeringClaimRefApplyConfiguration constructs a declarative configuration of the NetworkPeeringClaimRef type for use with // apply. func NetworkPeeringClaimRef() *NetworkPeeringClaimRefApplyConfiguration { return &NetworkPeeringClaimRefApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/networkpeeringnetworkref.go b/client-go/applyconfigurations/networking/v1alpha1/networkpeeringnetworkref.go index 019e0dcc5..73017063e 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/networkpeeringnetworkref.go +++ b/client-go/applyconfigurations/networking/v1alpha1/networkpeeringnetworkref.go @@ -5,14 +5,14 @@ package v1alpha1 -// NetworkPeeringNetworkRefApplyConfiguration represents an declarative configuration of the NetworkPeeringNetworkRef type for use +// NetworkPeeringNetworkRefApplyConfiguration represents a declarative configuration of the NetworkPeeringNetworkRef type for use // with apply. type NetworkPeeringNetworkRefApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` Name *string `json:"name,omitempty"` } -// NetworkPeeringNetworkRefApplyConfiguration constructs an declarative configuration of the NetworkPeeringNetworkRef type for use with +// NetworkPeeringNetworkRefApplyConfiguration constructs a declarative configuration of the NetworkPeeringNetworkRef type for use with // apply. func NetworkPeeringNetworkRef() *NetworkPeeringNetworkRefApplyConfiguration { return &NetworkPeeringNetworkRefApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/networkpeeringstatus.go b/client-go/applyconfigurations/networking/v1alpha1/networkpeeringstatus.go index 1433e3d42..aa8205715 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/networkpeeringstatus.go +++ b/client-go/applyconfigurations/networking/v1alpha1/networkpeeringstatus.go @@ -9,7 +9,7 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" ) -// NetworkPeeringStatusApplyConfiguration represents an declarative configuration of the NetworkPeeringStatus type for use +// NetworkPeeringStatusApplyConfiguration represents a declarative configuration of the NetworkPeeringStatus type for use // with apply. type NetworkPeeringStatusApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -17,7 +17,7 @@ type NetworkPeeringStatusApplyConfiguration struct { Prefixes []PeeringPrefixStatusApplyConfiguration `json:"prefixes,omitempty"` } -// NetworkPeeringStatusApplyConfiguration constructs an declarative configuration of the NetworkPeeringStatus type for use with +// NetworkPeeringStatusApplyConfiguration constructs a declarative configuration of the NetworkPeeringStatus type for use with // apply. func NetworkPeeringStatus() *NetworkPeeringStatusApplyConfiguration { return &NetworkPeeringStatusApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/networkpolicy.go b/client-go/applyconfigurations/networking/v1alpha1/networkpolicy.go index be4539058..d869a9d77 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/networkpolicy.go +++ b/client-go/applyconfigurations/networking/v1alpha1/networkpolicy.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// NetworkPolicyApplyConfiguration represents an declarative configuration of the NetworkPolicy type for use +// NetworkPolicyApplyConfiguration represents a declarative configuration of the NetworkPolicy type for use // with apply. type NetworkPolicyApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -23,7 +23,7 @@ type NetworkPolicyApplyConfiguration struct { Status *NetworkPolicyStatusApplyConfiguration `json:"status,omitempty"` } -// NetworkPolicy constructs an declarative configuration of the NetworkPolicy type for use with +// NetworkPolicy constructs a declarative configuration of the NetworkPolicy type for use with // apply. func NetworkPolicy(name, namespace string) *NetworkPolicyApplyConfiguration { b := &NetworkPolicyApplyConfiguration{} @@ -243,3 +243,9 @@ func (b *NetworkPolicyApplyConfiguration) WithStatus(value *NetworkPolicyStatusA b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *NetworkPolicyApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/networking/v1alpha1/networkpolicycondition.go b/client-go/applyconfigurations/networking/v1alpha1/networkpolicycondition.go index f41ca18d3..a320cf9b5 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/networkpolicycondition.go +++ b/client-go/applyconfigurations/networking/v1alpha1/networkpolicycondition.go @@ -11,7 +11,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// NetworkPolicyConditionApplyConfiguration represents an declarative configuration of the NetworkPolicyCondition type for use +// NetworkPolicyConditionApplyConfiguration represents a declarative configuration of the NetworkPolicyCondition type for use // with apply. type NetworkPolicyConditionApplyConfiguration struct { Type *v1alpha1.NetworkPolicyConditionType `json:"type,omitempty"` @@ -22,7 +22,7 @@ type NetworkPolicyConditionApplyConfiguration struct { LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` } -// NetworkPolicyConditionApplyConfiguration constructs an declarative configuration of the NetworkPolicyCondition type for use with +// NetworkPolicyConditionApplyConfiguration constructs a declarative configuration of the NetworkPolicyCondition type for use with // apply. func NetworkPolicyCondition() *NetworkPolicyConditionApplyConfiguration { return &NetworkPolicyConditionApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/networkpolicyegressrule.go b/client-go/applyconfigurations/networking/v1alpha1/networkpolicyegressrule.go index ec41ef37d..ce4e442ef 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/networkpolicyegressrule.go +++ b/client-go/applyconfigurations/networking/v1alpha1/networkpolicyegressrule.go @@ -5,14 +5,14 @@ package v1alpha1 -// NetworkPolicyEgressRuleApplyConfiguration represents an declarative configuration of the NetworkPolicyEgressRule type for use +// NetworkPolicyEgressRuleApplyConfiguration represents a declarative configuration of the NetworkPolicyEgressRule type for use // with apply. type NetworkPolicyEgressRuleApplyConfiguration struct { Ports []NetworkPolicyPortApplyConfiguration `json:"ports,omitempty"` To []NetworkPolicyPeerApplyConfiguration `json:"to,omitempty"` } -// NetworkPolicyEgressRuleApplyConfiguration constructs an declarative configuration of the NetworkPolicyEgressRule type for use with +// NetworkPolicyEgressRuleApplyConfiguration constructs a declarative configuration of the NetworkPolicyEgressRule type for use with // apply. func NetworkPolicyEgressRule() *NetworkPolicyEgressRuleApplyConfiguration { return &NetworkPolicyEgressRuleApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/networkpolicyingressrule.go b/client-go/applyconfigurations/networking/v1alpha1/networkpolicyingressrule.go index 0ed44a11f..3a9f6eca1 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/networkpolicyingressrule.go +++ b/client-go/applyconfigurations/networking/v1alpha1/networkpolicyingressrule.go @@ -5,14 +5,14 @@ package v1alpha1 -// NetworkPolicyIngressRuleApplyConfiguration represents an declarative configuration of the NetworkPolicyIngressRule type for use +// NetworkPolicyIngressRuleApplyConfiguration represents a declarative configuration of the NetworkPolicyIngressRule type for use // with apply. type NetworkPolicyIngressRuleApplyConfiguration struct { Ports []NetworkPolicyPortApplyConfiguration `json:"ports,omitempty"` From []NetworkPolicyPeerApplyConfiguration `json:"from,omitempty"` } -// NetworkPolicyIngressRuleApplyConfiguration constructs an declarative configuration of the NetworkPolicyIngressRule type for use with +// NetworkPolicyIngressRuleApplyConfiguration constructs a declarative configuration of the NetworkPolicyIngressRule type for use with // apply. func NetworkPolicyIngressRule() *NetworkPolicyIngressRuleApplyConfiguration { return &NetworkPolicyIngressRuleApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/networkpolicypeer.go b/client-go/applyconfigurations/networking/v1alpha1/networkpolicypeer.go index 742db1286..ce6050d89 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/networkpolicypeer.go +++ b/client-go/applyconfigurations/networking/v1alpha1/networkpolicypeer.go @@ -9,14 +9,14 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/core/v1alpha1" ) -// NetworkPolicyPeerApplyConfiguration represents an declarative configuration of the NetworkPolicyPeer type for use +// NetworkPolicyPeerApplyConfiguration represents a declarative configuration of the NetworkPolicyPeer type for use // with apply. type NetworkPolicyPeerApplyConfiguration struct { ObjectSelector *v1alpha1.ObjectSelectorApplyConfiguration `json:"objectSelector,omitempty"` IPBlock *IPBlockApplyConfiguration `json:"ipBlock,omitempty"` } -// NetworkPolicyPeerApplyConfiguration constructs an declarative configuration of the NetworkPolicyPeer type for use with +// NetworkPolicyPeerApplyConfiguration constructs a declarative configuration of the NetworkPolicyPeer type for use with // apply. func NetworkPolicyPeer() *NetworkPolicyPeerApplyConfiguration { return &NetworkPolicyPeerApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/networkpolicyport.go b/client-go/applyconfigurations/networking/v1alpha1/networkpolicyport.go index d49b41852..eb3b743e6 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/networkpolicyport.go +++ b/client-go/applyconfigurations/networking/v1alpha1/networkpolicyport.go @@ -9,7 +9,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// NetworkPolicyPortApplyConfiguration represents an declarative configuration of the NetworkPolicyPort type for use +// NetworkPolicyPortApplyConfiguration represents a declarative configuration of the NetworkPolicyPort type for use // with apply. type NetworkPolicyPortApplyConfiguration struct { Protocol *v1.Protocol `json:"protocol,omitempty"` @@ -17,7 +17,7 @@ type NetworkPolicyPortApplyConfiguration struct { EndPort *int32 `json:"endPort,omitempty"` } -// NetworkPolicyPortApplyConfiguration constructs an declarative configuration of the NetworkPolicyPort type for use with +// NetworkPolicyPortApplyConfiguration constructs a declarative configuration of the NetworkPolicyPort type for use with // apply. func NetworkPolicyPort() *NetworkPolicyPortApplyConfiguration { return &NetworkPolicyPortApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/networkpolicyspec.go b/client-go/applyconfigurations/networking/v1alpha1/networkpolicyspec.go index 78e8feb12..2a4a9b6b9 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/networkpolicyspec.go +++ b/client-go/applyconfigurations/networking/v1alpha1/networkpolicyspec.go @@ -11,7 +11,7 @@ import ( metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// NetworkPolicySpecApplyConfiguration represents an declarative configuration of the NetworkPolicySpec type for use +// NetworkPolicySpecApplyConfiguration represents a declarative configuration of the NetworkPolicySpec type for use // with apply. type NetworkPolicySpecApplyConfiguration struct { NetworkRef *v1.LocalObjectReference `json:"networkRef,omitempty"` @@ -21,7 +21,7 @@ type NetworkPolicySpecApplyConfiguration struct { PolicyTypes []networkingv1alpha1.PolicyType `json:"policyTypes,omitempty"` } -// NetworkPolicySpecApplyConfiguration constructs an declarative configuration of the NetworkPolicySpec type for use with +// NetworkPolicySpecApplyConfiguration constructs a declarative configuration of the NetworkPolicySpec type for use with // apply. func NetworkPolicySpec() *NetworkPolicySpecApplyConfiguration { return &NetworkPolicySpecApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/networkpolicystatus.go b/client-go/applyconfigurations/networking/v1alpha1/networkpolicystatus.go index aad7b1f2c..e90324e49 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/networkpolicystatus.go +++ b/client-go/applyconfigurations/networking/v1alpha1/networkpolicystatus.go @@ -5,13 +5,13 @@ package v1alpha1 -// NetworkPolicyStatusApplyConfiguration represents an declarative configuration of the NetworkPolicyStatus type for use +// NetworkPolicyStatusApplyConfiguration represents a declarative configuration of the NetworkPolicyStatus type for use // with apply. type NetworkPolicyStatusApplyConfiguration struct { Conditions []NetworkPolicyConditionApplyConfiguration `json:"conditions,omitempty"` } -// NetworkPolicyStatusApplyConfiguration constructs an declarative configuration of the NetworkPolicyStatus type for use with +// NetworkPolicyStatusApplyConfiguration constructs a declarative configuration of the NetworkPolicyStatus type for use with // apply. func NetworkPolicyStatus() *NetworkPolicyStatusApplyConfiguration { return &NetworkPolicyStatusApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/networkspec.go b/client-go/applyconfigurations/networking/v1alpha1/networkspec.go index 786c7c696..0c03c6478 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/networkspec.go +++ b/client-go/applyconfigurations/networking/v1alpha1/networkspec.go @@ -5,7 +5,7 @@ package v1alpha1 -// NetworkSpecApplyConfiguration represents an declarative configuration of the NetworkSpec type for use +// NetworkSpecApplyConfiguration represents a declarative configuration of the NetworkSpec type for use // with apply. type NetworkSpecApplyConfiguration struct { ProviderID *string `json:"providerID,omitempty"` @@ -13,7 +13,7 @@ type NetworkSpecApplyConfiguration struct { PeeringClaimRefs []NetworkPeeringClaimRefApplyConfiguration `json:"incomingPeerings,omitempty"` } -// NetworkSpecApplyConfiguration constructs an declarative configuration of the NetworkSpec type for use with +// NetworkSpecApplyConfiguration constructs a declarative configuration of the NetworkSpec type for use with // apply. func NetworkSpec() *NetworkSpecApplyConfiguration { return &NetworkSpecApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/networkstatus.go b/client-go/applyconfigurations/networking/v1alpha1/networkstatus.go index 77560a6a6..1c83c4ff4 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/networkstatus.go +++ b/client-go/applyconfigurations/networking/v1alpha1/networkstatus.go @@ -9,14 +9,14 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" ) -// NetworkStatusApplyConfiguration represents an declarative configuration of the NetworkStatus type for use +// NetworkStatusApplyConfiguration represents a declarative configuration of the NetworkStatus type for use // with apply. type NetworkStatusApplyConfiguration struct { State *v1alpha1.NetworkState `json:"state,omitempty"` Peerings []NetworkPeeringStatusApplyConfiguration `json:"peerings,omitempty"` } -// NetworkStatusApplyConfiguration constructs an declarative configuration of the NetworkStatus type for use with +// NetworkStatusApplyConfiguration constructs a declarative configuration of the NetworkStatus type for use with // apply. func NetworkStatus() *NetworkStatusApplyConfiguration { return &NetworkStatusApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/peeringprefix.go b/client-go/applyconfigurations/networking/v1alpha1/peeringprefix.go index 5c25772fb..de5cb913c 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/peeringprefix.go +++ b/client-go/applyconfigurations/networking/v1alpha1/peeringprefix.go @@ -10,7 +10,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// PeeringPrefixApplyConfiguration represents an declarative configuration of the PeeringPrefix type for use +// PeeringPrefixApplyConfiguration represents a declarative configuration of the PeeringPrefix type for use // with apply. type PeeringPrefixApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -18,7 +18,7 @@ type PeeringPrefixApplyConfiguration struct { PrefixRef *v1.LocalObjectReference `json:"prefixRef,omitempty"` } -// PeeringPrefixApplyConfiguration constructs an declarative configuration of the PeeringPrefix type for use with +// PeeringPrefixApplyConfiguration constructs a declarative configuration of the PeeringPrefix type for use with // apply. func PeeringPrefix() *PeeringPrefixApplyConfiguration { return &PeeringPrefixApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/peeringprefixstatus.go b/client-go/applyconfigurations/networking/v1alpha1/peeringprefixstatus.go index 0629b942a..2ff51c903 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/peeringprefixstatus.go +++ b/client-go/applyconfigurations/networking/v1alpha1/peeringprefixstatus.go @@ -9,14 +9,14 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" ) -// PeeringPrefixStatusApplyConfiguration represents an declarative configuration of the PeeringPrefixStatus type for use +// PeeringPrefixStatusApplyConfiguration represents a declarative configuration of the PeeringPrefixStatus type for use // with apply. type PeeringPrefixStatusApplyConfiguration struct { Name *string `json:"name,omitempty"` Prefix *v1alpha1.IPPrefix `json:"prefix,omitempty"` } -// PeeringPrefixStatusApplyConfiguration constructs an declarative configuration of the PeeringPrefixStatus type for use with +// PeeringPrefixStatusApplyConfiguration constructs a declarative configuration of the PeeringPrefixStatus type for use with // apply. func PeeringPrefixStatus() *PeeringPrefixStatusApplyConfiguration { return &PeeringPrefixStatusApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/prefixsource.go b/client-go/applyconfigurations/networking/v1alpha1/prefixsource.go index b61b2175c..c6e08a66e 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/prefixsource.go +++ b/client-go/applyconfigurations/networking/v1alpha1/prefixsource.go @@ -9,14 +9,14 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" ) -// PrefixSourceApplyConfiguration represents an declarative configuration of the PrefixSource type for use +// PrefixSourceApplyConfiguration represents a declarative configuration of the PrefixSource type for use // with apply. type PrefixSourceApplyConfiguration struct { Value *v1alpha1.IPPrefix `json:"value,omitempty"` Ephemeral *EphemeralPrefixSourceApplyConfiguration `json:"ephemeral,omitempty"` } -// PrefixSourceApplyConfiguration constructs an declarative configuration of the PrefixSource type for use with +// PrefixSourceApplyConfiguration constructs a declarative configuration of the PrefixSource type for use with // apply. func PrefixSource() *PrefixSourceApplyConfiguration { return &PrefixSourceApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/virtualip.go b/client-go/applyconfigurations/networking/v1alpha1/virtualip.go index ae52d8df1..ad1a426fd 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/virtualip.go +++ b/client-go/applyconfigurations/networking/v1alpha1/virtualip.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// VirtualIPApplyConfiguration represents an declarative configuration of the VirtualIP type for use +// VirtualIPApplyConfiguration represents a declarative configuration of the VirtualIP type for use // with apply. type VirtualIPApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -23,7 +23,7 @@ type VirtualIPApplyConfiguration struct { Status *VirtualIPStatusApplyConfiguration `json:"status,omitempty"` } -// VirtualIP constructs an declarative configuration of the VirtualIP type for use with +// VirtualIP constructs a declarative configuration of the VirtualIP type for use with // apply. func VirtualIP(name, namespace string) *VirtualIPApplyConfiguration { b := &VirtualIPApplyConfiguration{} @@ -243,3 +243,9 @@ func (b *VirtualIPApplyConfiguration) WithStatus(value *VirtualIPStatusApplyConf b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *VirtualIPApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/networking/v1alpha1/virtualipsource.go b/client-go/applyconfigurations/networking/v1alpha1/virtualipsource.go index 9e4b1fbef..6e7ad26b2 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/virtualipsource.go +++ b/client-go/applyconfigurations/networking/v1alpha1/virtualipsource.go @@ -9,14 +9,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// VirtualIPSourceApplyConfiguration represents an declarative configuration of the VirtualIPSource type for use +// VirtualIPSourceApplyConfiguration represents a declarative configuration of the VirtualIPSource type for use // with apply. type VirtualIPSourceApplyConfiguration struct { VirtualIPRef *v1.LocalObjectReference `json:"virtualIPRef,omitempty"` Ephemeral *EphemeralVirtualIPSourceApplyConfiguration `json:"ephemeral,omitempty"` } -// VirtualIPSourceApplyConfiguration constructs an declarative configuration of the VirtualIPSource type for use with +// VirtualIPSourceApplyConfiguration constructs a declarative configuration of the VirtualIPSource type for use with // apply. func VirtualIPSource() *VirtualIPSourceApplyConfiguration { return &VirtualIPSourceApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/virtualipspec.go b/client-go/applyconfigurations/networking/v1alpha1/virtualipspec.go index 011a81d27..8e0d4f229 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/virtualipspec.go +++ b/client-go/applyconfigurations/networking/v1alpha1/virtualipspec.go @@ -11,7 +11,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// VirtualIPSpecApplyConfiguration represents an declarative configuration of the VirtualIPSpec type for use +// VirtualIPSpecApplyConfiguration represents a declarative configuration of the VirtualIPSpec type for use // with apply. type VirtualIPSpecApplyConfiguration struct { Type *v1alpha1.VirtualIPType `json:"type,omitempty"` @@ -19,7 +19,7 @@ type VirtualIPSpecApplyConfiguration struct { TargetRef *commonv1alpha1.LocalUIDReference `json:"targetRef,omitempty"` } -// VirtualIPSpecApplyConfiguration constructs an declarative configuration of the VirtualIPSpec type for use with +// VirtualIPSpecApplyConfiguration constructs a declarative configuration of the VirtualIPSpec type for use with // apply. func VirtualIPSpec() *VirtualIPSpecApplyConfiguration { return &VirtualIPSpecApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/virtualipstatus.go b/client-go/applyconfigurations/networking/v1alpha1/virtualipstatus.go index ebe22fa06..baf69a63e 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/virtualipstatus.go +++ b/client-go/applyconfigurations/networking/v1alpha1/virtualipstatus.go @@ -9,13 +9,13 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" ) -// VirtualIPStatusApplyConfiguration represents an declarative configuration of the VirtualIPStatus type for use +// VirtualIPStatusApplyConfiguration represents a declarative configuration of the VirtualIPStatus type for use // with apply. type VirtualIPStatusApplyConfiguration struct { IP *v1alpha1.IP `json:"ip,omitempty"` } -// VirtualIPStatusApplyConfiguration constructs an declarative configuration of the VirtualIPStatus type for use with +// VirtualIPStatusApplyConfiguration constructs a declarative configuration of the VirtualIPStatus type for use with // apply. func VirtualIPStatus() *VirtualIPStatusApplyConfiguration { return &VirtualIPStatusApplyConfiguration{} diff --git a/client-go/applyconfigurations/networking/v1alpha1/virtualiptemplatespec.go b/client-go/applyconfigurations/networking/v1alpha1/virtualiptemplatespec.go index 19df598ee..8dfe2e2f4 100644 --- a/client-go/applyconfigurations/networking/v1alpha1/virtualiptemplatespec.go +++ b/client-go/applyconfigurations/networking/v1alpha1/virtualiptemplatespec.go @@ -11,14 +11,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// VirtualIPTemplateSpecApplyConfiguration represents an declarative configuration of the VirtualIPTemplateSpec type for use +// VirtualIPTemplateSpecApplyConfiguration represents a declarative configuration of the VirtualIPTemplateSpec type for use // with apply. type VirtualIPTemplateSpecApplyConfiguration struct { *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *VirtualIPSpecApplyConfiguration `json:"spec,omitempty"` } -// VirtualIPTemplateSpecApplyConfiguration constructs an declarative configuration of the VirtualIPTemplateSpec type for use with +// VirtualIPTemplateSpecApplyConfiguration constructs a declarative configuration of the VirtualIPTemplateSpec type for use with // apply. func VirtualIPTemplateSpec() *VirtualIPTemplateSpecApplyConfiguration { return &VirtualIPTemplateSpecApplyConfiguration{} @@ -173,3 +173,9 @@ func (b *VirtualIPTemplateSpecApplyConfiguration) WithSpec(value *VirtualIPSpecA b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *VirtualIPTemplateSpecApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/storage/v1alpha1/bucket.go b/client-go/applyconfigurations/storage/v1alpha1/bucket.go index 6b7342209..61929a744 100644 --- a/client-go/applyconfigurations/storage/v1alpha1/bucket.go +++ b/client-go/applyconfigurations/storage/v1alpha1/bucket.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// BucketApplyConfiguration represents an declarative configuration of the Bucket type for use +// BucketApplyConfiguration represents a declarative configuration of the Bucket type for use // with apply. type BucketApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -23,7 +23,7 @@ type BucketApplyConfiguration struct { Status *BucketStatusApplyConfiguration `json:"status,omitempty"` } -// Bucket constructs an declarative configuration of the Bucket type for use with +// Bucket constructs a declarative configuration of the Bucket type for use with // apply. func Bucket(name, namespace string) *BucketApplyConfiguration { b := &BucketApplyConfiguration{} @@ -243,3 +243,9 @@ func (b *BucketApplyConfiguration) WithStatus(value *BucketStatusApplyConfigurat b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *BucketApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/storage/v1alpha1/bucketaccess.go b/client-go/applyconfigurations/storage/v1alpha1/bucketaccess.go index 3e7a07e9c..b377cfa1d 100644 --- a/client-go/applyconfigurations/storage/v1alpha1/bucketaccess.go +++ b/client-go/applyconfigurations/storage/v1alpha1/bucketaccess.go @@ -9,14 +9,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// BucketAccessApplyConfiguration represents an declarative configuration of the BucketAccess type for use +// BucketAccessApplyConfiguration represents a declarative configuration of the BucketAccess type for use // with apply. type BucketAccessApplyConfiguration struct { SecretRef *v1.LocalObjectReference `json:"secretRef,omitempty"` Endpoint *string `json:"endpoint,omitempty"` } -// BucketAccessApplyConfiguration constructs an declarative configuration of the BucketAccess type for use with +// BucketAccessApplyConfiguration constructs a declarative configuration of the BucketAccess type for use with // apply. func BucketAccess() *BucketAccessApplyConfiguration { return &BucketAccessApplyConfiguration{} diff --git a/client-go/applyconfigurations/storage/v1alpha1/bucketclass.go b/client-go/applyconfigurations/storage/v1alpha1/bucketclass.go index 738bcc512..7f3f06fcd 100644 --- a/client-go/applyconfigurations/storage/v1alpha1/bucketclass.go +++ b/client-go/applyconfigurations/storage/v1alpha1/bucketclass.go @@ -15,7 +15,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// BucketClassApplyConfiguration represents an declarative configuration of the BucketClass type for use +// BucketClassApplyConfiguration represents a declarative configuration of the BucketClass type for use // with apply. type BucketClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -23,7 +23,7 @@ type BucketClassApplyConfiguration struct { Capabilities *v1alpha1.ResourceList `json:"capabilities,omitempty"` } -// BucketClass constructs an declarative configuration of the BucketClass type for use with +// BucketClass constructs a declarative configuration of the BucketClass type for use with // apply. func BucketClass(name string) *BucketClassApplyConfiguration { b := &BucketClassApplyConfiguration{} @@ -233,3 +233,9 @@ func (b *BucketClassApplyConfiguration) WithCapabilities(value v1alpha1.Resource b.Capabilities = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *BucketClassApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/storage/v1alpha1/bucketcondition.go b/client-go/applyconfigurations/storage/v1alpha1/bucketcondition.go index 77f711b53..d1b9bfc68 100644 --- a/client-go/applyconfigurations/storage/v1alpha1/bucketcondition.go +++ b/client-go/applyconfigurations/storage/v1alpha1/bucketcondition.go @@ -11,7 +11,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// BucketConditionApplyConfiguration represents an declarative configuration of the BucketCondition type for use +// BucketConditionApplyConfiguration represents a declarative configuration of the BucketCondition type for use // with apply. type BucketConditionApplyConfiguration struct { Type *v1alpha1.BucketConditionType `json:"type,omitempty"` @@ -22,7 +22,7 @@ type BucketConditionApplyConfiguration struct { LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` } -// BucketConditionApplyConfiguration constructs an declarative configuration of the BucketCondition type for use with +// BucketConditionApplyConfiguration constructs a declarative configuration of the BucketCondition type for use with // apply. func BucketCondition() *BucketConditionApplyConfiguration { return &BucketConditionApplyConfiguration{} diff --git a/client-go/applyconfigurations/storage/v1alpha1/bucketpool.go b/client-go/applyconfigurations/storage/v1alpha1/bucketpool.go index 7e7ec7c39..f4688e353 100644 --- a/client-go/applyconfigurations/storage/v1alpha1/bucketpool.go +++ b/client-go/applyconfigurations/storage/v1alpha1/bucketpool.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// BucketPoolApplyConfiguration represents an declarative configuration of the BucketPool type for use +// BucketPoolApplyConfiguration represents a declarative configuration of the BucketPool type for use // with apply. type BucketPoolApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -23,7 +23,7 @@ type BucketPoolApplyConfiguration struct { Status *BucketPoolStatusApplyConfiguration `json:"status,omitempty"` } -// BucketPool constructs an declarative configuration of the BucketPool type for use with +// BucketPool constructs a declarative configuration of the BucketPool type for use with // apply. func BucketPool(name string) *BucketPoolApplyConfiguration { b := &BucketPoolApplyConfiguration{} @@ -241,3 +241,9 @@ func (b *BucketPoolApplyConfiguration) WithStatus(value *BucketPoolStatusApplyCo b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *BucketPoolApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/storage/v1alpha1/bucketpoolspec.go b/client-go/applyconfigurations/storage/v1alpha1/bucketpoolspec.go index 1229fca09..2a4342d8e 100644 --- a/client-go/applyconfigurations/storage/v1alpha1/bucketpoolspec.go +++ b/client-go/applyconfigurations/storage/v1alpha1/bucketpoolspec.go @@ -9,14 +9,14 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" ) -// BucketPoolSpecApplyConfiguration represents an declarative configuration of the BucketPoolSpec type for use +// BucketPoolSpecApplyConfiguration represents a declarative configuration of the BucketPoolSpec type for use // with apply. type BucketPoolSpecApplyConfiguration struct { ProviderID *string `json:"providerID,omitempty"` Taints []v1alpha1.Taint `json:"taints,omitempty"` } -// BucketPoolSpecApplyConfiguration constructs an declarative configuration of the BucketPoolSpec type for use with +// BucketPoolSpecApplyConfiguration constructs a declarative configuration of the BucketPoolSpec type for use with // apply. func BucketPoolSpec() *BucketPoolSpecApplyConfiguration { return &BucketPoolSpecApplyConfiguration{} diff --git a/client-go/applyconfigurations/storage/v1alpha1/bucketpoolstatus.go b/client-go/applyconfigurations/storage/v1alpha1/bucketpoolstatus.go index 5b16079d0..f06576bf7 100644 --- a/client-go/applyconfigurations/storage/v1alpha1/bucketpoolstatus.go +++ b/client-go/applyconfigurations/storage/v1alpha1/bucketpoolstatus.go @@ -10,14 +10,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// BucketPoolStatusApplyConfiguration represents an declarative configuration of the BucketPoolStatus type for use +// BucketPoolStatusApplyConfiguration represents a declarative configuration of the BucketPoolStatus type for use // with apply. type BucketPoolStatusApplyConfiguration struct { State *v1alpha1.BucketPoolState `json:"state,omitempty"` AvailableBucketClasses []v1.LocalObjectReference `json:"availableBucketClasses,omitempty"` } -// BucketPoolStatusApplyConfiguration constructs an declarative configuration of the BucketPoolStatus type for use with +// BucketPoolStatusApplyConfiguration constructs a declarative configuration of the BucketPoolStatus type for use with // apply. func BucketPoolStatus() *BucketPoolStatusApplyConfiguration { return &BucketPoolStatusApplyConfiguration{} diff --git a/client-go/applyconfigurations/storage/v1alpha1/bucketspec.go b/client-go/applyconfigurations/storage/v1alpha1/bucketspec.go index 42934bd4f..24bb94334 100644 --- a/client-go/applyconfigurations/storage/v1alpha1/bucketspec.go +++ b/client-go/applyconfigurations/storage/v1alpha1/bucketspec.go @@ -10,7 +10,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// BucketSpecApplyConfiguration represents an declarative configuration of the BucketSpec type for use +// BucketSpecApplyConfiguration represents a declarative configuration of the BucketSpec type for use // with apply. type BucketSpecApplyConfiguration struct { BucketClassRef *v1.LocalObjectReference `json:"bucketClassRef,omitempty"` @@ -19,7 +19,7 @@ type BucketSpecApplyConfiguration struct { Tolerations []v1alpha1.Toleration `json:"tolerations,omitempty"` } -// BucketSpecApplyConfiguration constructs an declarative configuration of the BucketSpec type for use with +// BucketSpecApplyConfiguration constructs a declarative configuration of the BucketSpec type for use with // apply. func BucketSpec() *BucketSpecApplyConfiguration { return &BucketSpecApplyConfiguration{} diff --git a/client-go/applyconfigurations/storage/v1alpha1/bucketstatus.go b/client-go/applyconfigurations/storage/v1alpha1/bucketstatus.go index dd34441d4..0a68c7e04 100644 --- a/client-go/applyconfigurations/storage/v1alpha1/bucketstatus.go +++ b/client-go/applyconfigurations/storage/v1alpha1/bucketstatus.go @@ -10,7 +10,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// BucketStatusApplyConfiguration represents an declarative configuration of the BucketStatus type for use +// BucketStatusApplyConfiguration represents a declarative configuration of the BucketStatus type for use // with apply. type BucketStatusApplyConfiguration struct { State *v1alpha1.BucketState `json:"state,omitempty"` @@ -19,7 +19,7 @@ type BucketStatusApplyConfiguration struct { Conditions []BucketConditionApplyConfiguration `json:"conditions,omitempty"` } -// BucketStatusApplyConfiguration constructs an declarative configuration of the BucketStatus type for use with +// BucketStatusApplyConfiguration constructs a declarative configuration of the BucketStatus type for use with // apply. func BucketStatus() *BucketStatusApplyConfiguration { return &BucketStatusApplyConfiguration{} diff --git a/client-go/applyconfigurations/storage/v1alpha1/volume.go b/client-go/applyconfigurations/storage/v1alpha1/volume.go index 34ab8628d..6f0d9a4ac 100644 --- a/client-go/applyconfigurations/storage/v1alpha1/volume.go +++ b/client-go/applyconfigurations/storage/v1alpha1/volume.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// VolumeApplyConfiguration represents an declarative configuration of the Volume type for use +// VolumeApplyConfiguration represents a declarative configuration of the Volume type for use // with apply. type VolumeApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -23,7 +23,7 @@ type VolumeApplyConfiguration struct { Status *VolumeStatusApplyConfiguration `json:"status,omitempty"` } -// Volume constructs an declarative configuration of the Volume type for use with +// Volume constructs a declarative configuration of the Volume type for use with // apply. func Volume(name, namespace string) *VolumeApplyConfiguration { b := &VolumeApplyConfiguration{} @@ -243,3 +243,9 @@ func (b *VolumeApplyConfiguration) WithStatus(value *VolumeStatusApplyConfigurat b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *VolumeApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/storage/v1alpha1/volumeaccess.go b/client-go/applyconfigurations/storage/v1alpha1/volumeaccess.go index a744f2e30..057fe32b3 100644 --- a/client-go/applyconfigurations/storage/v1alpha1/volumeaccess.go +++ b/client-go/applyconfigurations/storage/v1alpha1/volumeaccess.go @@ -9,7 +9,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// VolumeAccessApplyConfiguration represents an declarative configuration of the VolumeAccess type for use +// VolumeAccessApplyConfiguration represents a declarative configuration of the VolumeAccess type for use // with apply. type VolumeAccessApplyConfiguration struct { SecretRef *v1.LocalObjectReference `json:"secretRef,omitempty"` @@ -18,7 +18,7 @@ type VolumeAccessApplyConfiguration struct { VolumeAttributes map[string]string `json:"volumeAttributes,omitempty"` } -// VolumeAccessApplyConfiguration constructs an declarative configuration of the VolumeAccess type for use with +// VolumeAccessApplyConfiguration constructs a declarative configuration of the VolumeAccess type for use with // apply. func VolumeAccess() *VolumeAccessApplyConfiguration { return &VolumeAccessApplyConfiguration{} diff --git a/client-go/applyconfigurations/storage/v1alpha1/volumeclass.go b/client-go/applyconfigurations/storage/v1alpha1/volumeclass.go index 6d3810366..b408dd69e 100644 --- a/client-go/applyconfigurations/storage/v1alpha1/volumeclass.go +++ b/client-go/applyconfigurations/storage/v1alpha1/volumeclass.go @@ -15,7 +15,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// VolumeClassApplyConfiguration represents an declarative configuration of the VolumeClass type for use +// VolumeClassApplyConfiguration represents a declarative configuration of the VolumeClass type for use // with apply. type VolumeClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -24,7 +24,7 @@ type VolumeClassApplyConfiguration struct { ResizePolicy *storagev1alpha1.ResizePolicy `json:"resizePolicy,omitempty"` } -// VolumeClass constructs an declarative configuration of the VolumeClass type for use with +// VolumeClass constructs a declarative configuration of the VolumeClass type for use with // apply. func VolumeClass(name string) *VolumeClassApplyConfiguration { b := &VolumeClassApplyConfiguration{} @@ -242,3 +242,9 @@ func (b *VolumeClassApplyConfiguration) WithResizePolicy(value storagev1alpha1.R b.ResizePolicy = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *VolumeClassApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/storage/v1alpha1/volumecondition.go b/client-go/applyconfigurations/storage/v1alpha1/volumecondition.go index c44bda226..b75b66c8c 100644 --- a/client-go/applyconfigurations/storage/v1alpha1/volumecondition.go +++ b/client-go/applyconfigurations/storage/v1alpha1/volumecondition.go @@ -11,7 +11,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// VolumeConditionApplyConfiguration represents an declarative configuration of the VolumeCondition type for use +// VolumeConditionApplyConfiguration represents a declarative configuration of the VolumeCondition type for use // with apply. type VolumeConditionApplyConfiguration struct { Type *v1alpha1.VolumeConditionType `json:"type,omitempty"` @@ -22,7 +22,7 @@ type VolumeConditionApplyConfiguration struct { LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` } -// VolumeConditionApplyConfiguration constructs an declarative configuration of the VolumeCondition type for use with +// VolumeConditionApplyConfiguration constructs a declarative configuration of the VolumeCondition type for use with // apply. func VolumeCondition() *VolumeConditionApplyConfiguration { return &VolumeConditionApplyConfiguration{} diff --git a/client-go/applyconfigurations/storage/v1alpha1/volumeencryption.go b/client-go/applyconfigurations/storage/v1alpha1/volumeencryption.go index 6df8e931a..1117cd72e 100644 --- a/client-go/applyconfigurations/storage/v1alpha1/volumeencryption.go +++ b/client-go/applyconfigurations/storage/v1alpha1/volumeencryption.go @@ -9,13 +9,13 @@ import ( v1 "k8s.io/api/core/v1" ) -// VolumeEncryptionApplyConfiguration represents an declarative configuration of the VolumeEncryption type for use +// VolumeEncryptionApplyConfiguration represents a declarative configuration of the VolumeEncryption type for use // with apply. type VolumeEncryptionApplyConfiguration struct { SecretRef *v1.LocalObjectReference `json:"secretRef,omitempty"` } -// VolumeEncryptionApplyConfiguration constructs an declarative configuration of the VolumeEncryption type for use with +// VolumeEncryptionApplyConfiguration constructs a declarative configuration of the VolumeEncryption type for use with // apply. func VolumeEncryption() *VolumeEncryptionApplyConfiguration { return &VolumeEncryptionApplyConfiguration{} diff --git a/client-go/applyconfigurations/storage/v1alpha1/volumepool.go b/client-go/applyconfigurations/storage/v1alpha1/volumepool.go index 7cfcfffc3..7dab9ac24 100644 --- a/client-go/applyconfigurations/storage/v1alpha1/volumepool.go +++ b/client-go/applyconfigurations/storage/v1alpha1/volumepool.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// VolumePoolApplyConfiguration represents an declarative configuration of the VolumePool type for use +// VolumePoolApplyConfiguration represents a declarative configuration of the VolumePool type for use // with apply. type VolumePoolApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -23,7 +23,7 @@ type VolumePoolApplyConfiguration struct { Status *VolumePoolStatusApplyConfiguration `json:"status,omitempty"` } -// VolumePool constructs an declarative configuration of the VolumePool type for use with +// VolumePool constructs a declarative configuration of the VolumePool type for use with // apply. func VolumePool(name string) *VolumePoolApplyConfiguration { b := &VolumePoolApplyConfiguration{} @@ -241,3 +241,9 @@ func (b *VolumePoolApplyConfiguration) WithStatus(value *VolumePoolStatusApplyCo b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *VolumePoolApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/storage/v1alpha1/volumepoolcondition.go b/client-go/applyconfigurations/storage/v1alpha1/volumepoolcondition.go index 79791eba7..14c8aee0f 100644 --- a/client-go/applyconfigurations/storage/v1alpha1/volumepoolcondition.go +++ b/client-go/applyconfigurations/storage/v1alpha1/volumepoolcondition.go @@ -11,7 +11,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// VolumePoolConditionApplyConfiguration represents an declarative configuration of the VolumePoolCondition type for use +// VolumePoolConditionApplyConfiguration represents a declarative configuration of the VolumePoolCondition type for use // with apply. type VolumePoolConditionApplyConfiguration struct { Type *v1alpha1.VolumePoolConditionType `json:"type,omitempty"` @@ -22,7 +22,7 @@ type VolumePoolConditionApplyConfiguration struct { LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` } -// VolumePoolConditionApplyConfiguration constructs an declarative configuration of the VolumePoolCondition type for use with +// VolumePoolConditionApplyConfiguration constructs a declarative configuration of the VolumePoolCondition type for use with // apply. func VolumePoolCondition() *VolumePoolConditionApplyConfiguration { return &VolumePoolConditionApplyConfiguration{} diff --git a/client-go/applyconfigurations/storage/v1alpha1/volumepoolspec.go b/client-go/applyconfigurations/storage/v1alpha1/volumepoolspec.go index 4b637d925..fb5578053 100644 --- a/client-go/applyconfigurations/storage/v1alpha1/volumepoolspec.go +++ b/client-go/applyconfigurations/storage/v1alpha1/volumepoolspec.go @@ -9,14 +9,14 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" ) -// VolumePoolSpecApplyConfiguration represents an declarative configuration of the VolumePoolSpec type for use +// VolumePoolSpecApplyConfiguration represents a declarative configuration of the VolumePoolSpec type for use // with apply. type VolumePoolSpecApplyConfiguration struct { ProviderID *string `json:"providerID,omitempty"` Taints []v1alpha1.Taint `json:"taints,omitempty"` } -// VolumePoolSpecApplyConfiguration constructs an declarative configuration of the VolumePoolSpec type for use with +// VolumePoolSpecApplyConfiguration constructs a declarative configuration of the VolumePoolSpec type for use with // apply. func VolumePoolSpec() *VolumePoolSpecApplyConfiguration { return &VolumePoolSpecApplyConfiguration{} diff --git a/client-go/applyconfigurations/storage/v1alpha1/volumepoolstatus.go b/client-go/applyconfigurations/storage/v1alpha1/volumepoolstatus.go index a791b16f8..e7470f5f1 100644 --- a/client-go/applyconfigurations/storage/v1alpha1/volumepoolstatus.go +++ b/client-go/applyconfigurations/storage/v1alpha1/volumepoolstatus.go @@ -11,7 +11,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// VolumePoolStatusApplyConfiguration represents an declarative configuration of the VolumePoolStatus type for use +// VolumePoolStatusApplyConfiguration represents a declarative configuration of the VolumePoolStatus type for use // with apply. type VolumePoolStatusApplyConfiguration struct { State *v1alpha1.VolumePoolState `json:"state,omitempty"` @@ -21,7 +21,7 @@ type VolumePoolStatusApplyConfiguration struct { Allocatable *corev1alpha1.ResourceList `json:"allocatable,omitempty"` } -// VolumePoolStatusApplyConfiguration constructs an declarative configuration of the VolumePoolStatus type for use with +// VolumePoolStatusApplyConfiguration constructs a declarative configuration of the VolumePoolStatus type for use with // apply. func VolumePoolStatus() *VolumePoolStatusApplyConfiguration { return &VolumePoolStatusApplyConfiguration{} diff --git a/client-go/applyconfigurations/storage/v1alpha1/volumespec.go b/client-go/applyconfigurations/storage/v1alpha1/volumespec.go index a4081685f..d04888014 100644 --- a/client-go/applyconfigurations/storage/v1alpha1/volumespec.go +++ b/client-go/applyconfigurations/storage/v1alpha1/volumespec.go @@ -11,7 +11,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// VolumeSpecApplyConfiguration represents an declarative configuration of the VolumeSpec type for use +// VolumeSpecApplyConfiguration represents a declarative configuration of the VolumeSpec type for use // with apply. type VolumeSpecApplyConfiguration struct { VolumeClassRef *v1.LocalObjectReference `json:"volumeClassRef,omitempty"` @@ -26,7 +26,7 @@ type VolumeSpecApplyConfiguration struct { Encryption *VolumeEncryptionApplyConfiguration `json:"encryption,omitempty"` } -// VolumeSpecApplyConfiguration constructs an declarative configuration of the VolumeSpec type for use with +// VolumeSpecApplyConfiguration constructs a declarative configuration of the VolumeSpec type for use with // apply. func VolumeSpec() *VolumeSpecApplyConfiguration { return &VolumeSpecApplyConfiguration{} diff --git a/client-go/applyconfigurations/storage/v1alpha1/volumestatus.go b/client-go/applyconfigurations/storage/v1alpha1/volumestatus.go index b50d5fff1..b74b2c0b0 100644 --- a/client-go/applyconfigurations/storage/v1alpha1/volumestatus.go +++ b/client-go/applyconfigurations/storage/v1alpha1/volumestatus.go @@ -10,7 +10,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// VolumeStatusApplyConfiguration represents an declarative configuration of the VolumeStatus type for use +// VolumeStatusApplyConfiguration represents a declarative configuration of the VolumeStatus type for use // with apply. type VolumeStatusApplyConfiguration struct { State *v1alpha1.VolumeState `json:"state,omitempty"` @@ -19,7 +19,7 @@ type VolumeStatusApplyConfiguration struct { Conditions []VolumeConditionApplyConfiguration `json:"conditions,omitempty"` } -// VolumeStatusApplyConfiguration constructs an declarative configuration of the VolumeStatus type for use with +// VolumeStatusApplyConfiguration constructs a declarative configuration of the VolumeStatus type for use with // apply. func VolumeStatus() *VolumeStatusApplyConfiguration { return &VolumeStatusApplyConfiguration{} diff --git a/client-go/applyconfigurations/storage/v1alpha1/volumetemplatespec.go b/client-go/applyconfigurations/storage/v1alpha1/volumetemplatespec.go index 324150023..37ce970aa 100644 --- a/client-go/applyconfigurations/storage/v1alpha1/volumetemplatespec.go +++ b/client-go/applyconfigurations/storage/v1alpha1/volumetemplatespec.go @@ -11,14 +11,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// VolumeTemplateSpecApplyConfiguration represents an declarative configuration of the VolumeTemplateSpec type for use +// VolumeTemplateSpecApplyConfiguration represents a declarative configuration of the VolumeTemplateSpec type for use // with apply. type VolumeTemplateSpecApplyConfiguration struct { *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *VolumeSpecApplyConfiguration `json:"spec,omitempty"` } -// VolumeTemplateSpecApplyConfiguration constructs an declarative configuration of the VolumeTemplateSpec type for use with +// VolumeTemplateSpecApplyConfiguration constructs a declarative configuration of the VolumeTemplateSpec type for use with // apply. func VolumeTemplateSpec() *VolumeTemplateSpecApplyConfiguration { return &VolumeTemplateSpecApplyConfiguration{} @@ -173,3 +173,9 @@ func (b *VolumeTemplateSpecApplyConfiguration) WithSpec(value *VolumeSpecApplyCo b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *VolumeTemplateSpecApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/utils.go b/client-go/applyconfigurations/utils.go index 3384fc3b6..7e6fbc3e8 100644 --- a/client-go/applyconfigurations/utils.go +++ b/client-go/applyconfigurations/utils.go @@ -13,10 +13,13 @@ import ( storagev1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" computev1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/compute/v1alpha1" applyconfigurationscorev1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/core/v1alpha1" + internal "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/internal" applyconfigurationsipamv1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/ipam/v1alpha1" applyconfigurationsnetworkingv1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/networking/v1alpha1" applyconfigurationsstoragev1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/storage/v1alpha1" + runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" + testing "k8s.io/client-go/testing" ) // ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no @@ -228,3 +231,7 @@ func ForKind(kind schema.GroupVersionKind) interface{} { } return nil } + +func NewTypeConverter(scheme *runtime.Scheme) *testing.TypeConverter { + return &testing.TypeConverter{Scheme: scheme, TypeResolver: internal.Parser()} +} diff --git a/client-go/informers/externalversions/factory.go b/client-go/informers/externalversions/factory.go index 6aeec3cd8..1e0eaa409 100644 --- a/client-go/informers/externalversions/factory.go +++ b/client-go/informers/externalversions/factory.go @@ -219,6 +219,7 @@ type SharedInformerFactory interface { // Start initializes all requested informers. They are handled in goroutines // which run until the stop channel gets closed. + // Warning: Start does not block. When run in a go-routine, it will race with a later WaitForCacheSync. Start(stopCh <-chan struct{}) // Shutdown marks a factory as shutting down. At that point no new diff --git a/client-go/ironcore/versioned/fake/clientset_generated.go b/client-go/ironcore/versioned/fake/clientset_generated.go index 0d92cabab..58a54dfc5 100644 --- a/client-go/ironcore/versioned/fake/clientset_generated.go +++ b/client-go/ironcore/versioned/fake/clientset_generated.go @@ -6,6 +6,7 @@ package fake import ( + applyconfigurations "github.com/ironcore-dev/ironcore/client-go/applyconfigurations" clientset "github.com/ironcore-dev/ironcore/client-go/ironcore/versioned" computev1alpha1 "github.com/ironcore-dev/ironcore/client-go/ironcore/versioned/typed/compute/v1alpha1" fakecomputev1alpha1 "github.com/ironcore-dev/ironcore/client-go/ironcore/versioned/typed/compute/v1alpha1/fake" @@ -26,8 +27,12 @@ import ( // 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 +// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement // for a real clientset and is mostly useful in simple unit tests. +// +// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves +// server side apply testing. NewClientset is only available when apply configurations are generated (e.g. +// via --with-applyconfig). func NewSimpleClientset(objects ...runtime.Object) *Clientset { o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) for _, obj := range objects { @@ -69,6 +74,38 @@ func (c *Clientset) Tracker() testing.ObjectTracker { return c.tracker } +// NewClientset 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 NewClientset(objects ...runtime.Object) *Clientset { + o := testing.NewFieldManagedObjectTracker( + scheme, + codecs.UniversalDecoder(), + applyconfigurations.NewTypeConverter(scheme), + ) + 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 +} + var ( _ clientset.Interface = &Clientset{} _ testing.FakeClient = &Clientset{} diff --git a/client-go/ironcore/versioned/typed/compute/v1alpha1/fake/fake_machine.go b/client-go/ironcore/versioned/typed/compute/v1alpha1/fake/fake_machine.go index 758f15864..f1f034483 100644 --- a/client-go/ironcore/versioned/typed/compute/v1alpha1/fake/fake_machine.go +++ b/client-go/ironcore/versioned/typed/compute/v1alpha1/fake/fake_machine.go @@ -31,22 +31,24 @@ var machinesKind = v1alpha1.SchemeGroupVersion.WithKind("Machine") // Get takes name of the machine, and returns the corresponding machine object, and an error if there is any. func (c *FakeMachines) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Machine, err error) { + emptyResult := &v1alpha1.Machine{} obj, err := c.Fake. - Invokes(testing.NewGetAction(machinesResource, c.ns, name), &v1alpha1.Machine{}) + Invokes(testing.NewGetActionWithOptions(machinesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Machine), err } // List takes label and field selectors, and returns the list of Machines that match those selectors. func (c *FakeMachines) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.MachineList, err error) { + emptyResult := &v1alpha1.MachineList{} obj, err := c.Fake. - Invokes(testing.NewListAction(machinesResource, machinesKind, c.ns, opts), &v1alpha1.MachineList{}) + Invokes(testing.NewListActionWithOptions(machinesResource, machinesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -65,40 +67,43 @@ func (c *FakeMachines) List(ctx context.Context, opts v1.ListOptions) (result *v // Watch returns a watch.Interface that watches the requested machines. func (c *FakeMachines) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(machinesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(machinesResource, c.ns, opts)) } // Create takes the representation of a machine and creates it. Returns the server's representation of the machine, and an error, if there is any. func (c *FakeMachines) Create(ctx context.Context, machine *v1alpha1.Machine, opts v1.CreateOptions) (result *v1alpha1.Machine, err error) { + emptyResult := &v1alpha1.Machine{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(machinesResource, c.ns, machine), &v1alpha1.Machine{}) + Invokes(testing.NewCreateActionWithOptions(machinesResource, c.ns, machine, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Machine), err } // Update takes the representation of a machine and updates it. Returns the server's representation of the machine, and an error, if there is any. func (c *FakeMachines) Update(ctx context.Context, machine *v1alpha1.Machine, opts v1.UpdateOptions) (result *v1alpha1.Machine, err error) { + emptyResult := &v1alpha1.Machine{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(machinesResource, c.ns, machine), &v1alpha1.Machine{}) + Invokes(testing.NewUpdateActionWithOptions(machinesResource, c.ns, machine, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Machine), 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 *FakeMachines) UpdateStatus(ctx context.Context, machine *v1alpha1.Machine, opts v1.UpdateOptions) (*v1alpha1.Machine, error) { +func (c *FakeMachines) UpdateStatus(ctx context.Context, machine *v1alpha1.Machine, opts v1.UpdateOptions) (result *v1alpha1.Machine, err error) { + emptyResult := &v1alpha1.Machine{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(machinesResource, "status", c.ns, machine), &v1alpha1.Machine{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(machinesResource, "status", c.ns, machine, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Machine), err } @@ -113,7 +118,7 @@ func (c *FakeMachines) Delete(ctx context.Context, name string, opts v1.DeleteOp // DeleteCollection deletes a collection of objects. func (c *FakeMachines) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(machinesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(machinesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.MachineList{}) return err @@ -121,11 +126,12 @@ func (c *FakeMachines) DeleteCollection(ctx context.Context, opts v1.DeleteOptio // Patch applies the patch and returns the patched machine. func (c *FakeMachines) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Machine, err error) { + emptyResult := &v1alpha1.Machine{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(machinesResource, c.ns, name, pt, data, subresources...), &v1alpha1.Machine{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(machinesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Machine), err } @@ -143,11 +149,12 @@ func (c *FakeMachines) Apply(ctx context.Context, machine *computev1alpha1.Machi if name == nil { return nil, fmt.Errorf("machine.Name must be provided to Apply") } + emptyResult := &v1alpha1.Machine{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(machinesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.Machine{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(machinesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Machine), err } @@ -166,11 +173,12 @@ func (c *FakeMachines) ApplyStatus(ctx context.Context, machine *computev1alpha1 if name == nil { return nil, fmt.Errorf("machine.Name must be provided to Apply") } + emptyResult := &v1alpha1.Machine{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(machinesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.Machine{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(machinesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Machine), err } diff --git a/client-go/ironcore/versioned/typed/compute/v1alpha1/fake/fake_machineclass.go b/client-go/ironcore/versioned/typed/compute/v1alpha1/fake/fake_machineclass.go index 110f35681..c204c3269 100644 --- a/client-go/ironcore/versioned/typed/compute/v1alpha1/fake/fake_machineclass.go +++ b/client-go/ironcore/versioned/typed/compute/v1alpha1/fake/fake_machineclass.go @@ -30,20 +30,22 @@ var machineclassesKind = v1alpha1.SchemeGroupVersion.WithKind("MachineClass") // Get takes name of the machineClass, and returns the corresponding machineClass object, and an error if there is any. func (c *FakeMachineClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.MachineClass, err error) { + emptyResult := &v1alpha1.MachineClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(machineclassesResource, name), &v1alpha1.MachineClass{}) + Invokes(testing.NewRootGetActionWithOptions(machineclassesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.MachineClass), err } // List takes label and field selectors, and returns the list of MachineClasses that match those selectors. func (c *FakeMachineClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.MachineClassList, err error) { + emptyResult := &v1alpha1.MachineClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(machineclassesResource, machineclassesKind, opts), &v1alpha1.MachineClassList{}) + Invokes(testing.NewRootListActionWithOptions(machineclassesResource, machineclassesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -62,25 +64,27 @@ func (c *FakeMachineClasses) List(ctx context.Context, opts v1.ListOptions) (res // Watch returns a watch.Interface that watches the requested machineClasses. func (c *FakeMachineClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(machineclassesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(machineclassesResource, opts)) } // Create takes the representation of a machineClass and creates it. Returns the server's representation of the machineClass, and an error, if there is any. func (c *FakeMachineClasses) Create(ctx context.Context, machineClass *v1alpha1.MachineClass, opts v1.CreateOptions) (result *v1alpha1.MachineClass, err error) { + emptyResult := &v1alpha1.MachineClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(machineclassesResource, machineClass), &v1alpha1.MachineClass{}) + Invokes(testing.NewRootCreateActionWithOptions(machineclassesResource, machineClass, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.MachineClass), err } // Update takes the representation of a machineClass and updates it. Returns the server's representation of the machineClass, and an error, if there is any. func (c *FakeMachineClasses) Update(ctx context.Context, machineClass *v1alpha1.MachineClass, opts v1.UpdateOptions) (result *v1alpha1.MachineClass, err error) { + emptyResult := &v1alpha1.MachineClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(machineclassesResource, machineClass), &v1alpha1.MachineClass{}) + Invokes(testing.NewRootUpdateActionWithOptions(machineclassesResource, machineClass, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.MachineClass), err } @@ -94,7 +98,7 @@ func (c *FakeMachineClasses) Delete(ctx context.Context, name string, opts v1.De // DeleteCollection deletes a collection of objects. func (c *FakeMachineClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(machineclassesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(machineclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.MachineClassList{}) return err @@ -102,10 +106,11 @@ func (c *FakeMachineClasses) DeleteCollection(ctx context.Context, opts v1.Delet // Patch applies the patch and returns the patched machineClass. func (c *FakeMachineClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.MachineClass, err error) { + emptyResult := &v1alpha1.MachineClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(machineclassesResource, name, pt, data, subresources...), &v1alpha1.MachineClass{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(machineclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.MachineClass), err } @@ -123,10 +128,11 @@ func (c *FakeMachineClasses) Apply(ctx context.Context, machineClass *computev1a if name == nil { return nil, fmt.Errorf("machineClass.Name must be provided to Apply") } + emptyResult := &v1alpha1.MachineClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(machineclassesResource, *name, types.ApplyPatchType, data), &v1alpha1.MachineClass{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(machineclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.MachineClass), err } diff --git a/client-go/ironcore/versioned/typed/compute/v1alpha1/fake/fake_machinepool.go b/client-go/ironcore/versioned/typed/compute/v1alpha1/fake/fake_machinepool.go index 6ea8e6f95..beda79422 100644 --- a/client-go/ironcore/versioned/typed/compute/v1alpha1/fake/fake_machinepool.go +++ b/client-go/ironcore/versioned/typed/compute/v1alpha1/fake/fake_machinepool.go @@ -30,20 +30,22 @@ var machinepoolsKind = v1alpha1.SchemeGroupVersion.WithKind("MachinePool") // Get takes name of the machinePool, and returns the corresponding machinePool object, and an error if there is any. func (c *FakeMachinePools) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.MachinePool, err error) { + emptyResult := &v1alpha1.MachinePool{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(machinepoolsResource, name), &v1alpha1.MachinePool{}) + Invokes(testing.NewRootGetActionWithOptions(machinepoolsResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.MachinePool), err } // List takes label and field selectors, and returns the list of MachinePools that match those selectors. func (c *FakeMachinePools) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.MachinePoolList, err error) { + emptyResult := &v1alpha1.MachinePoolList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(machinepoolsResource, machinepoolsKind, opts), &v1alpha1.MachinePoolList{}) + Invokes(testing.NewRootListActionWithOptions(machinepoolsResource, machinepoolsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -62,36 +64,39 @@ func (c *FakeMachinePools) List(ctx context.Context, opts v1.ListOptions) (resul // Watch returns a watch.Interface that watches the requested machinePools. func (c *FakeMachinePools) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(machinepoolsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(machinepoolsResource, opts)) } // Create takes the representation of a machinePool and creates it. Returns the server's representation of the machinePool, and an error, if there is any. func (c *FakeMachinePools) Create(ctx context.Context, machinePool *v1alpha1.MachinePool, opts v1.CreateOptions) (result *v1alpha1.MachinePool, err error) { + emptyResult := &v1alpha1.MachinePool{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(machinepoolsResource, machinePool), &v1alpha1.MachinePool{}) + Invokes(testing.NewRootCreateActionWithOptions(machinepoolsResource, machinePool, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.MachinePool), err } // Update takes the representation of a machinePool and updates it. Returns the server's representation of the machinePool, and an error, if there is any. func (c *FakeMachinePools) Update(ctx context.Context, machinePool *v1alpha1.MachinePool, opts v1.UpdateOptions) (result *v1alpha1.MachinePool, err error) { + emptyResult := &v1alpha1.MachinePool{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(machinepoolsResource, machinePool), &v1alpha1.MachinePool{}) + Invokes(testing.NewRootUpdateActionWithOptions(machinepoolsResource, machinePool, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.MachinePool), 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 *FakeMachinePools) UpdateStatus(ctx context.Context, machinePool *v1alpha1.MachinePool, opts v1.UpdateOptions) (*v1alpha1.MachinePool, error) { +func (c *FakeMachinePools) UpdateStatus(ctx context.Context, machinePool *v1alpha1.MachinePool, opts v1.UpdateOptions) (result *v1alpha1.MachinePool, err error) { + emptyResult := &v1alpha1.MachinePool{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(machinepoolsResource, "status", machinePool), &v1alpha1.MachinePool{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(machinepoolsResource, "status", machinePool, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.MachinePool), err } @@ -105,7 +110,7 @@ func (c *FakeMachinePools) Delete(ctx context.Context, name string, opts v1.Dele // DeleteCollection deletes a collection of objects. func (c *FakeMachinePools) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(machinepoolsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(machinepoolsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.MachinePoolList{}) return err @@ -113,10 +118,11 @@ func (c *FakeMachinePools) DeleteCollection(ctx context.Context, opts v1.DeleteO // Patch applies the patch and returns the patched machinePool. func (c *FakeMachinePools) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.MachinePool, err error) { + emptyResult := &v1alpha1.MachinePool{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(machinepoolsResource, name, pt, data, subresources...), &v1alpha1.MachinePool{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(machinepoolsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.MachinePool), err } @@ -134,10 +140,11 @@ func (c *FakeMachinePools) Apply(ctx context.Context, machinePool *computev1alph if name == nil { return nil, fmt.Errorf("machinePool.Name must be provided to Apply") } + emptyResult := &v1alpha1.MachinePool{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(machinepoolsResource, *name, types.ApplyPatchType, data), &v1alpha1.MachinePool{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(machinepoolsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.MachinePool), err } @@ -156,10 +163,11 @@ func (c *FakeMachinePools) ApplyStatus(ctx context.Context, machinePool *compute if name == nil { return nil, fmt.Errorf("machinePool.Name must be provided to Apply") } + emptyResult := &v1alpha1.MachinePool{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(machinepoolsResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.MachinePool{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(machinepoolsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.MachinePool), err } diff --git a/client-go/ironcore/versioned/typed/compute/v1alpha1/machine.go b/client-go/ironcore/versioned/typed/compute/v1alpha1/machine.go index 910d773d6..f29fe4cf7 100644 --- a/client-go/ironcore/versioned/typed/compute/v1alpha1/machine.go +++ b/client-go/ironcore/versioned/typed/compute/v1alpha1/machine.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore/api/compute/v1alpha1" computev1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/compute/v1alpha1" @@ -17,7 +14,7 @@ import ( 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" + gentype "k8s.io/client-go/gentype" ) // MachinesGetter has a method to return a MachineInterface. @@ -30,6 +27,7 @@ type MachinesGetter interface { type MachineInterface interface { Create(ctx context.Context, machine *v1alpha1.Machine, opts v1.CreateOptions) (*v1alpha1.Machine, error) Update(ctx context.Context, machine *v1alpha1.Machine, opts v1.UpdateOptions) (*v1alpha1.Machine, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, machine *v1alpha1.Machine, opts v1.UpdateOptions) (*v1alpha1.Machine, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -38,206 +36,25 @@ type MachineInterface interface { 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.Machine, err error) Apply(ctx context.Context, machine *computev1alpha1.MachineApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Machine, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, machine *computev1alpha1.MachineApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Machine, err error) MachineExpansion } // machines implements MachineInterface type machines struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.Machine, *v1alpha1.MachineList, *computev1alpha1.MachineApplyConfiguration] } // newMachines returns a Machines func newMachines(c *ComputeV1alpha1Client, namespace string) *machines { return &machines{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.Machine, *v1alpha1.MachineList, *computev1alpha1.MachineApplyConfiguration]( + "machines", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.Machine { return &v1alpha1.Machine{} }, + func() *v1alpha1.MachineList { return &v1alpha1.MachineList{} }), } } - -// Get takes name of the machine, and returns the corresponding machine object, and an error if there is any. -func (c *machines) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Machine, err error) { - result = &v1alpha1.Machine{} - err = c.client.Get(). - Namespace(c.ns). - Resource("machines"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Machines that match those selectors. -func (c *machines) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.MachineList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.MachineList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("machines"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested machines. -func (c *machines) 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("machines"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a machine and creates it. Returns the server's representation of the machine, and an error, if there is any. -func (c *machines) Create(ctx context.Context, machine *v1alpha1.Machine, opts v1.CreateOptions) (result *v1alpha1.Machine, err error) { - result = &v1alpha1.Machine{} - err = c.client.Post(). - Namespace(c.ns). - Resource("machines"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(machine). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a machine and updates it. Returns the server's representation of the machine, and an error, if there is any. -func (c *machines) Update(ctx context.Context, machine *v1alpha1.Machine, opts v1.UpdateOptions) (result *v1alpha1.Machine, err error) { - result = &v1alpha1.Machine{} - err = c.client.Put(). - Namespace(c.ns). - Resource("machines"). - Name(machine.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(machine). - 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 *machines) UpdateStatus(ctx context.Context, machine *v1alpha1.Machine, opts v1.UpdateOptions) (result *v1alpha1.Machine, err error) { - result = &v1alpha1.Machine{} - err = c.client.Put(). - Namespace(c.ns). - Resource("machines"). - Name(machine.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(machine). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the machine and deletes it. Returns an error if one occurs. -func (c *machines) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("machines"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *machines) 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("machines"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched machine. -func (c *machines) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Machine, err error) { - result = &v1alpha1.Machine{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("machines"). - 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 machine. -func (c *machines) Apply(ctx context.Context, machine *computev1alpha1.MachineApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Machine, err error) { - if machine == nil { - return nil, fmt.Errorf("machine provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(machine) - if err != nil { - return nil, err - } - name := machine.Name - if name == nil { - return nil, fmt.Errorf("machine.Name must be provided to Apply") - } - result = &v1alpha1.Machine{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("machines"). - 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 *machines) ApplyStatus(ctx context.Context, machine *computev1alpha1.MachineApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Machine, err error) { - if machine == nil { - return nil, fmt.Errorf("machine provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(machine) - if err != nil { - return nil, err - } - - name := machine.Name - if name == nil { - return nil, fmt.Errorf("machine.Name must be provided to Apply") - } - - result = &v1alpha1.Machine{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("machines"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcore/versioned/typed/compute/v1alpha1/machineclass.go b/client-go/ironcore/versioned/typed/compute/v1alpha1/machineclass.go index 2b9516b90..c5e13becb 100644 --- a/client-go/ironcore/versioned/typed/compute/v1alpha1/machineclass.go +++ b/client-go/ironcore/versioned/typed/compute/v1alpha1/machineclass.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore/api/compute/v1alpha1" computev1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/compute/v1alpha1" @@ -17,7 +14,7 @@ import ( 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" + gentype "k8s.io/client-go/gentype" ) // MachineClassesGetter has a method to return a MachineClassInterface. @@ -42,143 +39,18 @@ type MachineClassInterface interface { // machineClasses implements MachineClassInterface type machineClasses struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.MachineClass, *v1alpha1.MachineClassList, *computev1alpha1.MachineClassApplyConfiguration] } // newMachineClasses returns a MachineClasses func newMachineClasses(c *ComputeV1alpha1Client) *machineClasses { return &machineClasses{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.MachineClass, *v1alpha1.MachineClassList, *computev1alpha1.MachineClassApplyConfiguration]( + "machineclasses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.MachineClass { return &v1alpha1.MachineClass{} }, + func() *v1alpha1.MachineClassList { return &v1alpha1.MachineClassList{} }), } } - -// Get takes name of the machineClass, and returns the corresponding machineClass object, and an error if there is any. -func (c *machineClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.MachineClass, err error) { - result = &v1alpha1.MachineClass{} - err = c.client.Get(). - Resource("machineclasses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of MachineClasses that match those selectors. -func (c *machineClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.MachineClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.MachineClassList{} - err = c.client.Get(). - Resource("machineclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested machineClasses. -func (c *machineClasses) 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("machineclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a machineClass and creates it. Returns the server's representation of the machineClass, and an error, if there is any. -func (c *machineClasses) Create(ctx context.Context, machineClass *v1alpha1.MachineClass, opts v1.CreateOptions) (result *v1alpha1.MachineClass, err error) { - result = &v1alpha1.MachineClass{} - err = c.client.Post(). - Resource("machineclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(machineClass). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a machineClass and updates it. Returns the server's representation of the machineClass, and an error, if there is any. -func (c *machineClasses) Update(ctx context.Context, machineClass *v1alpha1.MachineClass, opts v1.UpdateOptions) (result *v1alpha1.MachineClass, err error) { - result = &v1alpha1.MachineClass{} - err = c.client.Put(). - Resource("machineclasses"). - Name(machineClass.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(machineClass). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the machineClass and deletes it. Returns an error if one occurs. -func (c *machineClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("machineclasses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *machineClasses) 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("machineclasses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched machineClass. -func (c *machineClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.MachineClass, err error) { - result = &v1alpha1.MachineClass{} - err = c.client.Patch(pt). - Resource("machineclasses"). - 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 machineClass. -func (c *machineClasses) Apply(ctx context.Context, machineClass *computev1alpha1.MachineClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.MachineClass, err error) { - if machineClass == nil { - return nil, fmt.Errorf("machineClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(machineClass) - if err != nil { - return nil, err - } - name := machineClass.Name - if name == nil { - return nil, fmt.Errorf("machineClass.Name must be provided to Apply") - } - result = &v1alpha1.MachineClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("machineclasses"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcore/versioned/typed/compute/v1alpha1/machinepool.go b/client-go/ironcore/versioned/typed/compute/v1alpha1/machinepool.go index 15f503544..01d6be01c 100644 --- a/client-go/ironcore/versioned/typed/compute/v1alpha1/machinepool.go +++ b/client-go/ironcore/versioned/typed/compute/v1alpha1/machinepool.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore/api/compute/v1alpha1" computev1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/compute/v1alpha1" @@ -17,7 +14,7 @@ import ( 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" + gentype "k8s.io/client-go/gentype" ) // MachinePoolsGetter has a method to return a MachinePoolInterface. @@ -30,6 +27,7 @@ type MachinePoolsGetter interface { type MachinePoolInterface interface { Create(ctx context.Context, machinePool *v1alpha1.MachinePool, opts v1.CreateOptions) (*v1alpha1.MachinePool, error) Update(ctx context.Context, machinePool *v1alpha1.MachinePool, opts v1.UpdateOptions) (*v1alpha1.MachinePool, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, machinePool *v1alpha1.MachinePool, opts v1.UpdateOptions) (*v1alpha1.MachinePool, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -38,193 +36,25 @@ type MachinePoolInterface interface { 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.MachinePool, err error) Apply(ctx context.Context, machinePool *computev1alpha1.MachinePoolApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.MachinePool, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, machinePool *computev1alpha1.MachinePoolApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.MachinePool, err error) MachinePoolExpansion } // machinePools implements MachinePoolInterface type machinePools struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.MachinePool, *v1alpha1.MachinePoolList, *computev1alpha1.MachinePoolApplyConfiguration] } // newMachinePools returns a MachinePools func newMachinePools(c *ComputeV1alpha1Client) *machinePools { return &machinePools{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.MachinePool, *v1alpha1.MachinePoolList, *computev1alpha1.MachinePoolApplyConfiguration]( + "machinepools", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.MachinePool { return &v1alpha1.MachinePool{} }, + func() *v1alpha1.MachinePoolList { return &v1alpha1.MachinePoolList{} }), } } - -// Get takes name of the machinePool, and returns the corresponding machinePool object, and an error if there is any. -func (c *machinePools) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.MachinePool, err error) { - result = &v1alpha1.MachinePool{} - err = c.client.Get(). - Resource("machinepools"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of MachinePools that match those selectors. -func (c *machinePools) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.MachinePoolList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.MachinePoolList{} - err = c.client.Get(). - Resource("machinepools"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested machinePools. -func (c *machinePools) 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("machinepools"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a machinePool and creates it. Returns the server's representation of the machinePool, and an error, if there is any. -func (c *machinePools) Create(ctx context.Context, machinePool *v1alpha1.MachinePool, opts v1.CreateOptions) (result *v1alpha1.MachinePool, err error) { - result = &v1alpha1.MachinePool{} - err = c.client.Post(). - Resource("machinepools"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(machinePool). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a machinePool and updates it. Returns the server's representation of the machinePool, and an error, if there is any. -func (c *machinePools) Update(ctx context.Context, machinePool *v1alpha1.MachinePool, opts v1.UpdateOptions) (result *v1alpha1.MachinePool, err error) { - result = &v1alpha1.MachinePool{} - err = c.client.Put(). - Resource("machinepools"). - Name(machinePool.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(machinePool). - 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 *machinePools) UpdateStatus(ctx context.Context, machinePool *v1alpha1.MachinePool, opts v1.UpdateOptions) (result *v1alpha1.MachinePool, err error) { - result = &v1alpha1.MachinePool{} - err = c.client.Put(). - Resource("machinepools"). - Name(machinePool.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(machinePool). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the machinePool and deletes it. Returns an error if one occurs. -func (c *machinePools) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("machinepools"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *machinePools) 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("machinepools"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched machinePool. -func (c *machinePools) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.MachinePool, err error) { - result = &v1alpha1.MachinePool{} - err = c.client.Patch(pt). - Resource("machinepools"). - 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 machinePool. -func (c *machinePools) Apply(ctx context.Context, machinePool *computev1alpha1.MachinePoolApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.MachinePool, err error) { - if machinePool == nil { - return nil, fmt.Errorf("machinePool provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(machinePool) - if err != nil { - return nil, err - } - name := machinePool.Name - if name == nil { - return nil, fmt.Errorf("machinePool.Name must be provided to Apply") - } - result = &v1alpha1.MachinePool{} - err = c.client.Patch(types.ApplyPatchType). - Resource("machinepools"). - 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 *machinePools) ApplyStatus(ctx context.Context, machinePool *computev1alpha1.MachinePoolApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.MachinePool, err error) { - if machinePool == nil { - return nil, fmt.Errorf("machinePool provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(machinePool) - if err != nil { - return nil, err - } - - name := machinePool.Name - if name == nil { - return nil, fmt.Errorf("machinePool.Name must be provided to Apply") - } - - result = &v1alpha1.MachinePool{} - err = c.client.Patch(types.ApplyPatchType). - Resource("machinepools"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcore/versioned/typed/core/v1alpha1/fake/fake_resourcequota.go b/client-go/ironcore/versioned/typed/core/v1alpha1/fake/fake_resourcequota.go index e21085a23..beec1c525 100644 --- a/client-go/ironcore/versioned/typed/core/v1alpha1/fake/fake_resourcequota.go +++ b/client-go/ironcore/versioned/typed/core/v1alpha1/fake/fake_resourcequota.go @@ -31,22 +31,24 @@ var resourcequotasKind = v1alpha1.SchemeGroupVersion.WithKind("ResourceQuota") // Get takes name of the resourceQuota, and returns the corresponding resourceQuota object, and an error if there is any. func (c *FakeResourceQuotas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceQuota, err error) { + emptyResult := &v1alpha1.ResourceQuota{} obj, err := c.Fake. - Invokes(testing.NewGetAction(resourcequotasResource, c.ns, name), &v1alpha1.ResourceQuota{}) + Invokes(testing.NewGetActionWithOptions(resourcequotasResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ResourceQuota), err } // List takes label and field selectors, and returns the list of ResourceQuotas that match those selectors. func (c *FakeResourceQuotas) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ResourceQuotaList, err error) { + emptyResult := &v1alpha1.ResourceQuotaList{} obj, err := c.Fake. - Invokes(testing.NewListAction(resourcequotasResource, resourcequotasKind, c.ns, opts), &v1alpha1.ResourceQuotaList{}) + Invokes(testing.NewListActionWithOptions(resourcequotasResource, resourcequotasKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -65,40 +67,43 @@ func (c *FakeResourceQuotas) List(ctx context.Context, opts v1.ListOptions) (res // Watch returns a watch.Interface that watches the requested resourceQuotas. func (c *FakeResourceQuotas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(resourcequotasResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(resourcequotasResource, c.ns, opts)) } // Create takes the representation of a resourceQuota and creates it. Returns the server's representation of the resourceQuota, and an error, if there is any. func (c *FakeResourceQuotas) Create(ctx context.Context, resourceQuota *v1alpha1.ResourceQuota, opts v1.CreateOptions) (result *v1alpha1.ResourceQuota, err error) { + emptyResult := &v1alpha1.ResourceQuota{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(resourcequotasResource, c.ns, resourceQuota), &v1alpha1.ResourceQuota{}) + Invokes(testing.NewCreateActionWithOptions(resourcequotasResource, c.ns, resourceQuota, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ResourceQuota), err } // Update takes the representation of a resourceQuota and updates it. Returns the server's representation of the resourceQuota, and an error, if there is any. func (c *FakeResourceQuotas) Update(ctx context.Context, resourceQuota *v1alpha1.ResourceQuota, opts v1.UpdateOptions) (result *v1alpha1.ResourceQuota, err error) { + emptyResult := &v1alpha1.ResourceQuota{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(resourcequotasResource, c.ns, resourceQuota), &v1alpha1.ResourceQuota{}) + Invokes(testing.NewUpdateActionWithOptions(resourcequotasResource, c.ns, resourceQuota, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ResourceQuota), 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 *FakeResourceQuotas) UpdateStatus(ctx context.Context, resourceQuota *v1alpha1.ResourceQuota, opts v1.UpdateOptions) (*v1alpha1.ResourceQuota, error) { +func (c *FakeResourceQuotas) UpdateStatus(ctx context.Context, resourceQuota *v1alpha1.ResourceQuota, opts v1.UpdateOptions) (result *v1alpha1.ResourceQuota, err error) { + emptyResult := &v1alpha1.ResourceQuota{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(resourcequotasResource, "status", c.ns, resourceQuota), &v1alpha1.ResourceQuota{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(resourcequotasResource, "status", c.ns, resourceQuota, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ResourceQuota), err } @@ -113,7 +118,7 @@ func (c *FakeResourceQuotas) Delete(ctx context.Context, name string, opts v1.De // DeleteCollection deletes a collection of objects. func (c *FakeResourceQuotas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(resourcequotasResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(resourcequotasResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.ResourceQuotaList{}) return err @@ -121,11 +126,12 @@ func (c *FakeResourceQuotas) DeleteCollection(ctx context.Context, opts v1.Delet // Patch applies the patch and returns the patched resourceQuota. func (c *FakeResourceQuotas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ResourceQuota, err error) { + emptyResult := &v1alpha1.ResourceQuota{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourcequotasResource, c.ns, name, pt, data, subresources...), &v1alpha1.ResourceQuota{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(resourcequotasResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ResourceQuota), err } @@ -143,11 +149,12 @@ func (c *FakeResourceQuotas) Apply(ctx context.Context, resourceQuota *corev1alp if name == nil { return nil, fmt.Errorf("resourceQuota.Name must be provided to Apply") } + emptyResult := &v1alpha1.ResourceQuota{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourcequotasResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.ResourceQuota{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(resourcequotasResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ResourceQuota), err } @@ -166,11 +173,12 @@ func (c *FakeResourceQuotas) ApplyStatus(ctx context.Context, resourceQuota *cor if name == nil { return nil, fmt.Errorf("resourceQuota.Name must be provided to Apply") } + emptyResult := &v1alpha1.ResourceQuota{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourcequotasResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.ResourceQuota{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(resourcequotasResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ResourceQuota), err } diff --git a/client-go/ironcore/versioned/typed/core/v1alpha1/resourcequota.go b/client-go/ironcore/versioned/typed/core/v1alpha1/resourcequota.go index ab71578d0..b1dce3f2d 100644 --- a/client-go/ironcore/versioned/typed/core/v1alpha1/resourcequota.go +++ b/client-go/ironcore/versioned/typed/core/v1alpha1/resourcequota.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore/api/core/v1alpha1" corev1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/core/v1alpha1" @@ -17,7 +14,7 @@ import ( 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" + gentype "k8s.io/client-go/gentype" ) // ResourceQuotasGetter has a method to return a ResourceQuotaInterface. @@ -30,6 +27,7 @@ type ResourceQuotasGetter interface { type ResourceQuotaInterface interface { Create(ctx context.Context, resourceQuota *v1alpha1.ResourceQuota, opts v1.CreateOptions) (*v1alpha1.ResourceQuota, error) Update(ctx context.Context, resourceQuota *v1alpha1.ResourceQuota, opts v1.UpdateOptions) (*v1alpha1.ResourceQuota, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, resourceQuota *v1alpha1.ResourceQuota, opts v1.UpdateOptions) (*v1alpha1.ResourceQuota, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -38,206 +36,25 @@ type ResourceQuotaInterface interface { 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.ResourceQuota, err error) Apply(ctx context.Context, resourceQuota *corev1alpha1.ResourceQuotaApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ResourceQuota, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, resourceQuota *corev1alpha1.ResourceQuotaApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ResourceQuota, err error) ResourceQuotaExpansion } // resourceQuotas implements ResourceQuotaInterface type resourceQuotas struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.ResourceQuota, *v1alpha1.ResourceQuotaList, *corev1alpha1.ResourceQuotaApplyConfiguration] } // newResourceQuotas returns a ResourceQuotas func newResourceQuotas(c *CoreV1alpha1Client, namespace string) *resourceQuotas { return &resourceQuotas{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.ResourceQuota, *v1alpha1.ResourceQuotaList, *corev1alpha1.ResourceQuotaApplyConfiguration]( + "resourcequotas", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.ResourceQuota { return &v1alpha1.ResourceQuota{} }, + func() *v1alpha1.ResourceQuotaList { return &v1alpha1.ResourceQuotaList{} }), } } - -// Get takes name of the resourceQuota, and returns the corresponding resourceQuota object, and an error if there is any. -func (c *resourceQuotas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceQuota, err error) { - result = &v1alpha1.ResourceQuota{} - err = c.client.Get(). - Namespace(c.ns). - Resource("resourcequotas"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ResourceQuotas that match those selectors. -func (c *resourceQuotas) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ResourceQuotaList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ResourceQuotaList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("resourcequotas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested resourceQuotas. -func (c *resourceQuotas) 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("resourcequotas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a resourceQuota and creates it. Returns the server's representation of the resourceQuota, and an error, if there is any. -func (c *resourceQuotas) Create(ctx context.Context, resourceQuota *v1alpha1.ResourceQuota, opts v1.CreateOptions) (result *v1alpha1.ResourceQuota, err error) { - result = &v1alpha1.ResourceQuota{} - err = c.client.Post(). - Namespace(c.ns). - Resource("resourcequotas"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceQuota). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a resourceQuota and updates it. Returns the server's representation of the resourceQuota, and an error, if there is any. -func (c *resourceQuotas) Update(ctx context.Context, resourceQuota *v1alpha1.ResourceQuota, opts v1.UpdateOptions) (result *v1alpha1.ResourceQuota, err error) { - result = &v1alpha1.ResourceQuota{} - err = c.client.Put(). - Namespace(c.ns). - Resource("resourcequotas"). - Name(resourceQuota.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceQuota). - 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 *resourceQuotas) UpdateStatus(ctx context.Context, resourceQuota *v1alpha1.ResourceQuota, opts v1.UpdateOptions) (result *v1alpha1.ResourceQuota, err error) { - result = &v1alpha1.ResourceQuota{} - err = c.client.Put(). - Namespace(c.ns). - Resource("resourcequotas"). - Name(resourceQuota.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceQuota). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the resourceQuota and deletes it. Returns an error if one occurs. -func (c *resourceQuotas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("resourcequotas"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *resourceQuotas) 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("resourcequotas"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched resourceQuota. -func (c *resourceQuotas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ResourceQuota, err error) { - result = &v1alpha1.ResourceQuota{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("resourcequotas"). - 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 resourceQuota. -func (c *resourceQuotas) Apply(ctx context.Context, resourceQuota *corev1alpha1.ResourceQuotaApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ResourceQuota, err error) { - if resourceQuota == nil { - return nil, fmt.Errorf("resourceQuota provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(resourceQuota) - if err != nil { - return nil, err - } - name := resourceQuota.Name - if name == nil { - return nil, fmt.Errorf("resourceQuota.Name must be provided to Apply") - } - result = &v1alpha1.ResourceQuota{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("resourcequotas"). - 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 *resourceQuotas) ApplyStatus(ctx context.Context, resourceQuota *corev1alpha1.ResourceQuotaApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ResourceQuota, err error) { - if resourceQuota == nil { - return nil, fmt.Errorf("resourceQuota provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(resourceQuota) - if err != nil { - return nil, err - } - - name := resourceQuota.Name - if name == nil { - return nil, fmt.Errorf("resourceQuota.Name must be provided to Apply") - } - - result = &v1alpha1.ResourceQuota{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("resourcequotas"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcore/versioned/typed/ipam/v1alpha1/fake/fake_prefix.go b/client-go/ironcore/versioned/typed/ipam/v1alpha1/fake/fake_prefix.go index 5f2c2cd2c..57b77c317 100644 --- a/client-go/ironcore/versioned/typed/ipam/v1alpha1/fake/fake_prefix.go +++ b/client-go/ironcore/versioned/typed/ipam/v1alpha1/fake/fake_prefix.go @@ -31,22 +31,24 @@ var prefixesKind = v1alpha1.SchemeGroupVersion.WithKind("Prefix") // Get takes name of the prefix, and returns the corresponding prefix object, and an error if there is any. func (c *FakePrefixes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Prefix, err error) { + emptyResult := &v1alpha1.Prefix{} obj, err := c.Fake. - Invokes(testing.NewGetAction(prefixesResource, c.ns, name), &v1alpha1.Prefix{}) + Invokes(testing.NewGetActionWithOptions(prefixesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Prefix), err } // List takes label and field selectors, and returns the list of Prefixes that match those selectors. func (c *FakePrefixes) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PrefixList, err error) { + emptyResult := &v1alpha1.PrefixList{} obj, err := c.Fake. - Invokes(testing.NewListAction(prefixesResource, prefixesKind, c.ns, opts), &v1alpha1.PrefixList{}) + Invokes(testing.NewListActionWithOptions(prefixesResource, prefixesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -65,40 +67,43 @@ func (c *FakePrefixes) List(ctx context.Context, opts v1.ListOptions) (result *v // Watch returns a watch.Interface that watches the requested prefixes. func (c *FakePrefixes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(prefixesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(prefixesResource, c.ns, opts)) } // Create takes the representation of a prefix and creates it. Returns the server's representation of the prefix, and an error, if there is any. func (c *FakePrefixes) Create(ctx context.Context, prefix *v1alpha1.Prefix, opts v1.CreateOptions) (result *v1alpha1.Prefix, err error) { + emptyResult := &v1alpha1.Prefix{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(prefixesResource, c.ns, prefix), &v1alpha1.Prefix{}) + Invokes(testing.NewCreateActionWithOptions(prefixesResource, c.ns, prefix, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Prefix), err } // Update takes the representation of a prefix and updates it. Returns the server's representation of the prefix, and an error, if there is any. func (c *FakePrefixes) Update(ctx context.Context, prefix *v1alpha1.Prefix, opts v1.UpdateOptions) (result *v1alpha1.Prefix, err error) { + emptyResult := &v1alpha1.Prefix{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(prefixesResource, c.ns, prefix), &v1alpha1.Prefix{}) + Invokes(testing.NewUpdateActionWithOptions(prefixesResource, c.ns, prefix, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Prefix), 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 *FakePrefixes) UpdateStatus(ctx context.Context, prefix *v1alpha1.Prefix, opts v1.UpdateOptions) (*v1alpha1.Prefix, error) { +func (c *FakePrefixes) UpdateStatus(ctx context.Context, prefix *v1alpha1.Prefix, opts v1.UpdateOptions) (result *v1alpha1.Prefix, err error) { + emptyResult := &v1alpha1.Prefix{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(prefixesResource, "status", c.ns, prefix), &v1alpha1.Prefix{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(prefixesResource, "status", c.ns, prefix, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Prefix), err } @@ -113,7 +118,7 @@ func (c *FakePrefixes) Delete(ctx context.Context, name string, opts v1.DeleteOp // DeleteCollection deletes a collection of objects. func (c *FakePrefixes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(prefixesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(prefixesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.PrefixList{}) return err @@ -121,11 +126,12 @@ func (c *FakePrefixes) DeleteCollection(ctx context.Context, opts v1.DeleteOptio // Patch applies the patch and returns the patched prefix. func (c *FakePrefixes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Prefix, err error) { + emptyResult := &v1alpha1.Prefix{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(prefixesResource, c.ns, name, pt, data, subresources...), &v1alpha1.Prefix{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(prefixesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Prefix), err } @@ -143,11 +149,12 @@ func (c *FakePrefixes) Apply(ctx context.Context, prefix *ipamv1alpha1.PrefixApp if name == nil { return nil, fmt.Errorf("prefix.Name must be provided to Apply") } + emptyResult := &v1alpha1.Prefix{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(prefixesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.Prefix{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(prefixesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Prefix), err } @@ -166,11 +173,12 @@ func (c *FakePrefixes) ApplyStatus(ctx context.Context, prefix *ipamv1alpha1.Pre if name == nil { return nil, fmt.Errorf("prefix.Name must be provided to Apply") } + emptyResult := &v1alpha1.Prefix{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(prefixesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.Prefix{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(prefixesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Prefix), err } diff --git a/client-go/ironcore/versioned/typed/ipam/v1alpha1/fake/fake_prefixallocation.go b/client-go/ironcore/versioned/typed/ipam/v1alpha1/fake/fake_prefixallocation.go index dca49ccd6..97653df05 100644 --- a/client-go/ironcore/versioned/typed/ipam/v1alpha1/fake/fake_prefixallocation.go +++ b/client-go/ironcore/versioned/typed/ipam/v1alpha1/fake/fake_prefixallocation.go @@ -31,22 +31,24 @@ var prefixallocationsKind = v1alpha1.SchemeGroupVersion.WithKind("PrefixAllocati // Get takes name of the prefixAllocation, and returns the corresponding prefixAllocation object, and an error if there is any. func (c *FakePrefixAllocations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PrefixAllocation, err error) { + emptyResult := &v1alpha1.PrefixAllocation{} obj, err := c.Fake. - Invokes(testing.NewGetAction(prefixallocationsResource, c.ns, name), &v1alpha1.PrefixAllocation{}) + Invokes(testing.NewGetActionWithOptions(prefixallocationsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.PrefixAllocation), err } // List takes label and field selectors, and returns the list of PrefixAllocations that match those selectors. func (c *FakePrefixAllocations) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PrefixAllocationList, err error) { + emptyResult := &v1alpha1.PrefixAllocationList{} obj, err := c.Fake. - Invokes(testing.NewListAction(prefixallocationsResource, prefixallocationsKind, c.ns, opts), &v1alpha1.PrefixAllocationList{}) + Invokes(testing.NewListActionWithOptions(prefixallocationsResource, prefixallocationsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -65,40 +67,43 @@ func (c *FakePrefixAllocations) List(ctx context.Context, opts v1.ListOptions) ( // Watch returns a watch.Interface that watches the requested prefixAllocations. func (c *FakePrefixAllocations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(prefixallocationsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(prefixallocationsResource, c.ns, opts)) } // Create takes the representation of a prefixAllocation and creates it. Returns the server's representation of the prefixAllocation, and an error, if there is any. func (c *FakePrefixAllocations) Create(ctx context.Context, prefixAllocation *v1alpha1.PrefixAllocation, opts v1.CreateOptions) (result *v1alpha1.PrefixAllocation, err error) { + emptyResult := &v1alpha1.PrefixAllocation{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(prefixallocationsResource, c.ns, prefixAllocation), &v1alpha1.PrefixAllocation{}) + Invokes(testing.NewCreateActionWithOptions(prefixallocationsResource, c.ns, prefixAllocation, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.PrefixAllocation), err } // Update takes the representation of a prefixAllocation and updates it. Returns the server's representation of the prefixAllocation, and an error, if there is any. func (c *FakePrefixAllocations) Update(ctx context.Context, prefixAllocation *v1alpha1.PrefixAllocation, opts v1.UpdateOptions) (result *v1alpha1.PrefixAllocation, err error) { + emptyResult := &v1alpha1.PrefixAllocation{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(prefixallocationsResource, c.ns, prefixAllocation), &v1alpha1.PrefixAllocation{}) + Invokes(testing.NewUpdateActionWithOptions(prefixallocationsResource, c.ns, prefixAllocation, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.PrefixAllocation), 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 *FakePrefixAllocations) UpdateStatus(ctx context.Context, prefixAllocation *v1alpha1.PrefixAllocation, opts v1.UpdateOptions) (*v1alpha1.PrefixAllocation, error) { +func (c *FakePrefixAllocations) UpdateStatus(ctx context.Context, prefixAllocation *v1alpha1.PrefixAllocation, opts v1.UpdateOptions) (result *v1alpha1.PrefixAllocation, err error) { + emptyResult := &v1alpha1.PrefixAllocation{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(prefixallocationsResource, "status", c.ns, prefixAllocation), &v1alpha1.PrefixAllocation{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(prefixallocationsResource, "status", c.ns, prefixAllocation, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.PrefixAllocation), err } @@ -113,7 +118,7 @@ func (c *FakePrefixAllocations) Delete(ctx context.Context, name string, opts v1 // DeleteCollection deletes a collection of objects. func (c *FakePrefixAllocations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(prefixallocationsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(prefixallocationsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.PrefixAllocationList{}) return err @@ -121,11 +126,12 @@ func (c *FakePrefixAllocations) DeleteCollection(ctx context.Context, opts v1.De // Patch applies the patch and returns the patched prefixAllocation. func (c *FakePrefixAllocations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PrefixAllocation, err error) { + emptyResult := &v1alpha1.PrefixAllocation{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(prefixallocationsResource, c.ns, name, pt, data, subresources...), &v1alpha1.PrefixAllocation{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(prefixallocationsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.PrefixAllocation), err } @@ -143,11 +149,12 @@ func (c *FakePrefixAllocations) Apply(ctx context.Context, prefixAllocation *ipa if name == nil { return nil, fmt.Errorf("prefixAllocation.Name must be provided to Apply") } + emptyResult := &v1alpha1.PrefixAllocation{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(prefixallocationsResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.PrefixAllocation{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(prefixallocationsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.PrefixAllocation), err } @@ -166,11 +173,12 @@ func (c *FakePrefixAllocations) ApplyStatus(ctx context.Context, prefixAllocatio if name == nil { return nil, fmt.Errorf("prefixAllocation.Name must be provided to Apply") } + emptyResult := &v1alpha1.PrefixAllocation{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(prefixallocationsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.PrefixAllocation{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(prefixallocationsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.PrefixAllocation), err } diff --git a/client-go/ironcore/versioned/typed/ipam/v1alpha1/prefix.go b/client-go/ironcore/versioned/typed/ipam/v1alpha1/prefix.go index c16aa477d..ea5d5323b 100644 --- a/client-go/ironcore/versioned/typed/ipam/v1alpha1/prefix.go +++ b/client-go/ironcore/versioned/typed/ipam/v1alpha1/prefix.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore/api/ipam/v1alpha1" ipamv1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/ipam/v1alpha1" @@ -17,7 +14,7 @@ import ( 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" + gentype "k8s.io/client-go/gentype" ) // PrefixesGetter has a method to return a PrefixInterface. @@ -30,6 +27,7 @@ type PrefixesGetter interface { type PrefixInterface interface { Create(ctx context.Context, prefix *v1alpha1.Prefix, opts v1.CreateOptions) (*v1alpha1.Prefix, error) Update(ctx context.Context, prefix *v1alpha1.Prefix, opts v1.UpdateOptions) (*v1alpha1.Prefix, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, prefix *v1alpha1.Prefix, opts v1.UpdateOptions) (*v1alpha1.Prefix, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -38,206 +36,25 @@ type PrefixInterface interface { 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.Prefix, err error) Apply(ctx context.Context, prefix *ipamv1alpha1.PrefixApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Prefix, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, prefix *ipamv1alpha1.PrefixApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Prefix, err error) PrefixExpansion } // prefixes implements PrefixInterface type prefixes struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.Prefix, *v1alpha1.PrefixList, *ipamv1alpha1.PrefixApplyConfiguration] } // newPrefixes returns a Prefixes func newPrefixes(c *IpamV1alpha1Client, namespace string) *prefixes { return &prefixes{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.Prefix, *v1alpha1.PrefixList, *ipamv1alpha1.PrefixApplyConfiguration]( + "prefixes", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.Prefix { return &v1alpha1.Prefix{} }, + func() *v1alpha1.PrefixList { return &v1alpha1.PrefixList{} }), } } - -// Get takes name of the prefix, and returns the corresponding prefix object, and an error if there is any. -func (c *prefixes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Prefix, err error) { - result = &v1alpha1.Prefix{} - err = c.client.Get(). - Namespace(c.ns). - Resource("prefixes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Prefixes that match those selectors. -func (c *prefixes) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PrefixList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.PrefixList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("prefixes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested prefixes. -func (c *prefixes) 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("prefixes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a prefix and creates it. Returns the server's representation of the prefix, and an error, if there is any. -func (c *prefixes) Create(ctx context.Context, prefix *v1alpha1.Prefix, opts v1.CreateOptions) (result *v1alpha1.Prefix, err error) { - result = &v1alpha1.Prefix{} - err = c.client.Post(). - Namespace(c.ns). - Resource("prefixes"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(prefix). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a prefix and updates it. Returns the server's representation of the prefix, and an error, if there is any. -func (c *prefixes) Update(ctx context.Context, prefix *v1alpha1.Prefix, opts v1.UpdateOptions) (result *v1alpha1.Prefix, err error) { - result = &v1alpha1.Prefix{} - err = c.client.Put(). - Namespace(c.ns). - Resource("prefixes"). - Name(prefix.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(prefix). - 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 *prefixes) UpdateStatus(ctx context.Context, prefix *v1alpha1.Prefix, opts v1.UpdateOptions) (result *v1alpha1.Prefix, err error) { - result = &v1alpha1.Prefix{} - err = c.client.Put(). - Namespace(c.ns). - Resource("prefixes"). - Name(prefix.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(prefix). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the prefix and deletes it. Returns an error if one occurs. -func (c *prefixes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("prefixes"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *prefixes) 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("prefixes"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched prefix. -func (c *prefixes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Prefix, err error) { - result = &v1alpha1.Prefix{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("prefixes"). - 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 prefix. -func (c *prefixes) Apply(ctx context.Context, prefix *ipamv1alpha1.PrefixApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Prefix, err error) { - if prefix == nil { - return nil, fmt.Errorf("prefix provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(prefix) - if err != nil { - return nil, err - } - name := prefix.Name - if name == nil { - return nil, fmt.Errorf("prefix.Name must be provided to Apply") - } - result = &v1alpha1.Prefix{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("prefixes"). - 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 *prefixes) ApplyStatus(ctx context.Context, prefix *ipamv1alpha1.PrefixApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Prefix, err error) { - if prefix == nil { - return nil, fmt.Errorf("prefix provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(prefix) - if err != nil { - return nil, err - } - - name := prefix.Name - if name == nil { - return nil, fmt.Errorf("prefix.Name must be provided to Apply") - } - - result = &v1alpha1.Prefix{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("prefixes"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcore/versioned/typed/ipam/v1alpha1/prefixallocation.go b/client-go/ironcore/versioned/typed/ipam/v1alpha1/prefixallocation.go index 9c24fb8ca..28fb948e3 100644 --- a/client-go/ironcore/versioned/typed/ipam/v1alpha1/prefixallocation.go +++ b/client-go/ironcore/versioned/typed/ipam/v1alpha1/prefixallocation.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore/api/ipam/v1alpha1" ipamv1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/ipam/v1alpha1" @@ -17,7 +14,7 @@ import ( 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" + gentype "k8s.io/client-go/gentype" ) // PrefixAllocationsGetter has a method to return a PrefixAllocationInterface. @@ -30,6 +27,7 @@ type PrefixAllocationsGetter interface { type PrefixAllocationInterface interface { Create(ctx context.Context, prefixAllocation *v1alpha1.PrefixAllocation, opts v1.CreateOptions) (*v1alpha1.PrefixAllocation, error) Update(ctx context.Context, prefixAllocation *v1alpha1.PrefixAllocation, opts v1.UpdateOptions) (*v1alpha1.PrefixAllocation, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, prefixAllocation *v1alpha1.PrefixAllocation, opts v1.UpdateOptions) (*v1alpha1.PrefixAllocation, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -38,206 +36,25 @@ type PrefixAllocationInterface interface { 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.PrefixAllocation, err error) Apply(ctx context.Context, prefixAllocation *ipamv1alpha1.PrefixAllocationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PrefixAllocation, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, prefixAllocation *ipamv1alpha1.PrefixAllocationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PrefixAllocation, err error) PrefixAllocationExpansion } // prefixAllocations implements PrefixAllocationInterface type prefixAllocations struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.PrefixAllocation, *v1alpha1.PrefixAllocationList, *ipamv1alpha1.PrefixAllocationApplyConfiguration] } // newPrefixAllocations returns a PrefixAllocations func newPrefixAllocations(c *IpamV1alpha1Client, namespace string) *prefixAllocations { return &prefixAllocations{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.PrefixAllocation, *v1alpha1.PrefixAllocationList, *ipamv1alpha1.PrefixAllocationApplyConfiguration]( + "prefixallocations", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.PrefixAllocation { return &v1alpha1.PrefixAllocation{} }, + func() *v1alpha1.PrefixAllocationList { return &v1alpha1.PrefixAllocationList{} }), } } - -// Get takes name of the prefixAllocation, and returns the corresponding prefixAllocation object, and an error if there is any. -func (c *prefixAllocations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PrefixAllocation, err error) { - result = &v1alpha1.PrefixAllocation{} - err = c.client.Get(). - Namespace(c.ns). - Resource("prefixallocations"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PrefixAllocations that match those selectors. -func (c *prefixAllocations) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PrefixAllocationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.PrefixAllocationList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("prefixallocations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested prefixAllocations. -func (c *prefixAllocations) 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("prefixallocations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a prefixAllocation and creates it. Returns the server's representation of the prefixAllocation, and an error, if there is any. -func (c *prefixAllocations) Create(ctx context.Context, prefixAllocation *v1alpha1.PrefixAllocation, opts v1.CreateOptions) (result *v1alpha1.PrefixAllocation, err error) { - result = &v1alpha1.PrefixAllocation{} - err = c.client.Post(). - Namespace(c.ns). - Resource("prefixallocations"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(prefixAllocation). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a prefixAllocation and updates it. Returns the server's representation of the prefixAllocation, and an error, if there is any. -func (c *prefixAllocations) Update(ctx context.Context, prefixAllocation *v1alpha1.PrefixAllocation, opts v1.UpdateOptions) (result *v1alpha1.PrefixAllocation, err error) { - result = &v1alpha1.PrefixAllocation{} - err = c.client.Put(). - Namespace(c.ns). - Resource("prefixallocations"). - Name(prefixAllocation.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(prefixAllocation). - 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 *prefixAllocations) UpdateStatus(ctx context.Context, prefixAllocation *v1alpha1.PrefixAllocation, opts v1.UpdateOptions) (result *v1alpha1.PrefixAllocation, err error) { - result = &v1alpha1.PrefixAllocation{} - err = c.client.Put(). - Namespace(c.ns). - Resource("prefixallocations"). - Name(prefixAllocation.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(prefixAllocation). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the prefixAllocation and deletes it. Returns an error if one occurs. -func (c *prefixAllocations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("prefixallocations"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *prefixAllocations) 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("prefixallocations"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched prefixAllocation. -func (c *prefixAllocations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PrefixAllocation, err error) { - result = &v1alpha1.PrefixAllocation{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("prefixallocations"). - 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 prefixAllocation. -func (c *prefixAllocations) Apply(ctx context.Context, prefixAllocation *ipamv1alpha1.PrefixAllocationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PrefixAllocation, err error) { - if prefixAllocation == nil { - return nil, fmt.Errorf("prefixAllocation provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(prefixAllocation) - if err != nil { - return nil, err - } - name := prefixAllocation.Name - if name == nil { - return nil, fmt.Errorf("prefixAllocation.Name must be provided to Apply") - } - result = &v1alpha1.PrefixAllocation{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("prefixallocations"). - 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 *prefixAllocations) ApplyStatus(ctx context.Context, prefixAllocation *ipamv1alpha1.PrefixAllocationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PrefixAllocation, err error) { - if prefixAllocation == nil { - return nil, fmt.Errorf("prefixAllocation provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(prefixAllocation) - if err != nil { - return nil, err - } - - name := prefixAllocation.Name - if name == nil { - return nil, fmt.Errorf("prefixAllocation.Name must be provided to Apply") - } - - result = &v1alpha1.PrefixAllocation{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("prefixallocations"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_loadbalancer.go b/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_loadbalancer.go index 4d8cb8f11..ca0015c34 100644 --- a/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_loadbalancer.go +++ b/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_loadbalancer.go @@ -31,22 +31,24 @@ var loadbalancersKind = v1alpha1.SchemeGroupVersion.WithKind("LoadBalancer") // Get takes name of the loadBalancer, and returns the corresponding loadBalancer object, and an error if there is any. func (c *FakeLoadBalancers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.LoadBalancer, err error) { + emptyResult := &v1alpha1.LoadBalancer{} obj, err := c.Fake. - Invokes(testing.NewGetAction(loadbalancersResource, c.ns, name), &v1alpha1.LoadBalancer{}) + Invokes(testing.NewGetActionWithOptions(loadbalancersResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.LoadBalancer), err } // List takes label and field selectors, and returns the list of LoadBalancers that match those selectors. func (c *FakeLoadBalancers) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.LoadBalancerList, err error) { + emptyResult := &v1alpha1.LoadBalancerList{} obj, err := c.Fake. - Invokes(testing.NewListAction(loadbalancersResource, loadbalancersKind, c.ns, opts), &v1alpha1.LoadBalancerList{}) + Invokes(testing.NewListActionWithOptions(loadbalancersResource, loadbalancersKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -65,40 +67,43 @@ func (c *FakeLoadBalancers) List(ctx context.Context, opts v1.ListOptions) (resu // Watch returns a watch.Interface that watches the requested loadBalancers. func (c *FakeLoadBalancers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(loadbalancersResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(loadbalancersResource, c.ns, opts)) } // Create takes the representation of a loadBalancer and creates it. Returns the server's representation of the loadBalancer, and an error, if there is any. func (c *FakeLoadBalancers) Create(ctx context.Context, loadBalancer *v1alpha1.LoadBalancer, opts v1.CreateOptions) (result *v1alpha1.LoadBalancer, err error) { + emptyResult := &v1alpha1.LoadBalancer{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(loadbalancersResource, c.ns, loadBalancer), &v1alpha1.LoadBalancer{}) + Invokes(testing.NewCreateActionWithOptions(loadbalancersResource, c.ns, loadBalancer, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.LoadBalancer), err } // Update takes the representation of a loadBalancer and updates it. Returns the server's representation of the loadBalancer, and an error, if there is any. func (c *FakeLoadBalancers) Update(ctx context.Context, loadBalancer *v1alpha1.LoadBalancer, opts v1.UpdateOptions) (result *v1alpha1.LoadBalancer, err error) { + emptyResult := &v1alpha1.LoadBalancer{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(loadbalancersResource, c.ns, loadBalancer), &v1alpha1.LoadBalancer{}) + Invokes(testing.NewUpdateActionWithOptions(loadbalancersResource, c.ns, loadBalancer, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.LoadBalancer), 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 *FakeLoadBalancers) UpdateStatus(ctx context.Context, loadBalancer *v1alpha1.LoadBalancer, opts v1.UpdateOptions) (*v1alpha1.LoadBalancer, error) { +func (c *FakeLoadBalancers) UpdateStatus(ctx context.Context, loadBalancer *v1alpha1.LoadBalancer, opts v1.UpdateOptions) (result *v1alpha1.LoadBalancer, err error) { + emptyResult := &v1alpha1.LoadBalancer{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(loadbalancersResource, "status", c.ns, loadBalancer), &v1alpha1.LoadBalancer{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(loadbalancersResource, "status", c.ns, loadBalancer, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.LoadBalancer), err } @@ -113,7 +118,7 @@ func (c *FakeLoadBalancers) Delete(ctx context.Context, name string, opts v1.Del // DeleteCollection deletes a collection of objects. func (c *FakeLoadBalancers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(loadbalancersResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(loadbalancersResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.LoadBalancerList{}) return err @@ -121,11 +126,12 @@ func (c *FakeLoadBalancers) DeleteCollection(ctx context.Context, opts v1.Delete // Patch applies the patch and returns the patched loadBalancer. func (c *FakeLoadBalancers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LoadBalancer, err error) { + emptyResult := &v1alpha1.LoadBalancer{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(loadbalancersResource, c.ns, name, pt, data, subresources...), &v1alpha1.LoadBalancer{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(loadbalancersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.LoadBalancer), err } @@ -143,11 +149,12 @@ func (c *FakeLoadBalancers) Apply(ctx context.Context, loadBalancer *networkingv if name == nil { return nil, fmt.Errorf("loadBalancer.Name must be provided to Apply") } + emptyResult := &v1alpha1.LoadBalancer{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(loadbalancersResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.LoadBalancer{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(loadbalancersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.LoadBalancer), err } @@ -166,11 +173,12 @@ func (c *FakeLoadBalancers) ApplyStatus(ctx context.Context, loadBalancer *netwo if name == nil { return nil, fmt.Errorf("loadBalancer.Name must be provided to Apply") } + emptyResult := &v1alpha1.LoadBalancer{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(loadbalancersResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.LoadBalancer{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(loadbalancersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.LoadBalancer), err } diff --git a/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_loadbalancerrouting.go b/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_loadbalancerrouting.go index 71e15d66a..14094e4f9 100644 --- a/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_loadbalancerrouting.go +++ b/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_loadbalancerrouting.go @@ -31,22 +31,24 @@ var loadbalancerroutingsKind = v1alpha1.SchemeGroupVersion.WithKind("LoadBalance // Get takes name of the loadBalancerRouting, and returns the corresponding loadBalancerRouting object, and an error if there is any. func (c *FakeLoadBalancerRoutings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.LoadBalancerRouting, err error) { + emptyResult := &v1alpha1.LoadBalancerRouting{} obj, err := c.Fake. - Invokes(testing.NewGetAction(loadbalancerroutingsResource, c.ns, name), &v1alpha1.LoadBalancerRouting{}) + Invokes(testing.NewGetActionWithOptions(loadbalancerroutingsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.LoadBalancerRouting), err } // List takes label and field selectors, and returns the list of LoadBalancerRoutings that match those selectors. func (c *FakeLoadBalancerRoutings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.LoadBalancerRoutingList, err error) { + emptyResult := &v1alpha1.LoadBalancerRoutingList{} obj, err := c.Fake. - Invokes(testing.NewListAction(loadbalancerroutingsResource, loadbalancerroutingsKind, c.ns, opts), &v1alpha1.LoadBalancerRoutingList{}) + Invokes(testing.NewListActionWithOptions(loadbalancerroutingsResource, loadbalancerroutingsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -65,28 +67,30 @@ func (c *FakeLoadBalancerRoutings) List(ctx context.Context, opts v1.ListOptions // Watch returns a watch.Interface that watches the requested loadBalancerRoutings. func (c *FakeLoadBalancerRoutings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(loadbalancerroutingsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(loadbalancerroutingsResource, c.ns, opts)) } // Create takes the representation of a loadBalancerRouting and creates it. Returns the server's representation of the loadBalancerRouting, and an error, if there is any. func (c *FakeLoadBalancerRoutings) Create(ctx context.Context, loadBalancerRouting *v1alpha1.LoadBalancerRouting, opts v1.CreateOptions) (result *v1alpha1.LoadBalancerRouting, err error) { + emptyResult := &v1alpha1.LoadBalancerRouting{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(loadbalancerroutingsResource, c.ns, loadBalancerRouting), &v1alpha1.LoadBalancerRouting{}) + Invokes(testing.NewCreateActionWithOptions(loadbalancerroutingsResource, c.ns, loadBalancerRouting, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.LoadBalancerRouting), err } // Update takes the representation of a loadBalancerRouting and updates it. Returns the server's representation of the loadBalancerRouting, and an error, if there is any. func (c *FakeLoadBalancerRoutings) Update(ctx context.Context, loadBalancerRouting *v1alpha1.LoadBalancerRouting, opts v1.UpdateOptions) (result *v1alpha1.LoadBalancerRouting, err error) { + emptyResult := &v1alpha1.LoadBalancerRouting{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(loadbalancerroutingsResource, c.ns, loadBalancerRouting), &v1alpha1.LoadBalancerRouting{}) + Invokes(testing.NewUpdateActionWithOptions(loadbalancerroutingsResource, c.ns, loadBalancerRouting, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.LoadBalancerRouting), err } @@ -101,7 +105,7 @@ func (c *FakeLoadBalancerRoutings) Delete(ctx context.Context, name string, opts // DeleteCollection deletes a collection of objects. func (c *FakeLoadBalancerRoutings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(loadbalancerroutingsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(loadbalancerroutingsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.LoadBalancerRoutingList{}) return err @@ -109,11 +113,12 @@ func (c *FakeLoadBalancerRoutings) DeleteCollection(ctx context.Context, opts v1 // Patch applies the patch and returns the patched loadBalancerRouting. func (c *FakeLoadBalancerRoutings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LoadBalancerRouting, err error) { + emptyResult := &v1alpha1.LoadBalancerRouting{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(loadbalancerroutingsResource, c.ns, name, pt, data, subresources...), &v1alpha1.LoadBalancerRouting{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(loadbalancerroutingsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.LoadBalancerRouting), err } @@ -131,11 +136,12 @@ func (c *FakeLoadBalancerRoutings) Apply(ctx context.Context, loadBalancerRoutin if name == nil { return nil, fmt.Errorf("loadBalancerRouting.Name must be provided to Apply") } + emptyResult := &v1alpha1.LoadBalancerRouting{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(loadbalancerroutingsResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.LoadBalancerRouting{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(loadbalancerroutingsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.LoadBalancerRouting), err } diff --git a/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_natgateway.go b/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_natgateway.go index d6cb6b851..94eccc1bc 100644 --- a/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_natgateway.go +++ b/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_natgateway.go @@ -31,22 +31,24 @@ var natgatewaysKind = v1alpha1.SchemeGroupVersion.WithKind("NATGateway") // Get takes name of the nATGateway, and returns the corresponding nATGateway object, and an error if there is any. func (c *FakeNATGateways) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NATGateway, err error) { + emptyResult := &v1alpha1.NATGateway{} obj, err := c.Fake. - Invokes(testing.NewGetAction(natgatewaysResource, c.ns, name), &v1alpha1.NATGateway{}) + Invokes(testing.NewGetActionWithOptions(natgatewaysResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NATGateway), err } // List takes label and field selectors, and returns the list of NATGateways that match those selectors. func (c *FakeNATGateways) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NATGatewayList, err error) { + emptyResult := &v1alpha1.NATGatewayList{} obj, err := c.Fake. - Invokes(testing.NewListAction(natgatewaysResource, natgatewaysKind, c.ns, opts), &v1alpha1.NATGatewayList{}) + Invokes(testing.NewListActionWithOptions(natgatewaysResource, natgatewaysKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -65,40 +67,43 @@ func (c *FakeNATGateways) List(ctx context.Context, opts v1.ListOptions) (result // Watch returns a watch.Interface that watches the requested nATGateways. func (c *FakeNATGateways) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(natgatewaysResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(natgatewaysResource, c.ns, opts)) } // Create takes the representation of a nATGateway and creates it. Returns the server's representation of the nATGateway, and an error, if there is any. func (c *FakeNATGateways) Create(ctx context.Context, nATGateway *v1alpha1.NATGateway, opts v1.CreateOptions) (result *v1alpha1.NATGateway, err error) { + emptyResult := &v1alpha1.NATGateway{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(natgatewaysResource, c.ns, nATGateway), &v1alpha1.NATGateway{}) + Invokes(testing.NewCreateActionWithOptions(natgatewaysResource, c.ns, nATGateway, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NATGateway), err } // Update takes the representation of a nATGateway and updates it. Returns the server's representation of the nATGateway, and an error, if there is any. func (c *FakeNATGateways) Update(ctx context.Context, nATGateway *v1alpha1.NATGateway, opts v1.UpdateOptions) (result *v1alpha1.NATGateway, err error) { + emptyResult := &v1alpha1.NATGateway{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(natgatewaysResource, c.ns, nATGateway), &v1alpha1.NATGateway{}) + Invokes(testing.NewUpdateActionWithOptions(natgatewaysResource, c.ns, nATGateway, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NATGateway), 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 *FakeNATGateways) UpdateStatus(ctx context.Context, nATGateway *v1alpha1.NATGateway, opts v1.UpdateOptions) (*v1alpha1.NATGateway, error) { +func (c *FakeNATGateways) UpdateStatus(ctx context.Context, nATGateway *v1alpha1.NATGateway, opts v1.UpdateOptions) (result *v1alpha1.NATGateway, err error) { + emptyResult := &v1alpha1.NATGateway{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(natgatewaysResource, "status", c.ns, nATGateway), &v1alpha1.NATGateway{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(natgatewaysResource, "status", c.ns, nATGateway, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NATGateway), err } @@ -113,7 +118,7 @@ func (c *FakeNATGateways) Delete(ctx context.Context, name string, opts v1.Delet // DeleteCollection deletes a collection of objects. func (c *FakeNATGateways) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(natgatewaysResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(natgatewaysResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.NATGatewayList{}) return err @@ -121,11 +126,12 @@ func (c *FakeNATGateways) DeleteCollection(ctx context.Context, opts v1.DeleteOp // Patch applies the patch and returns the patched nATGateway. func (c *FakeNATGateways) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NATGateway, err error) { + emptyResult := &v1alpha1.NATGateway{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(natgatewaysResource, c.ns, name, pt, data, subresources...), &v1alpha1.NATGateway{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(natgatewaysResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NATGateway), err } @@ -143,11 +149,12 @@ func (c *FakeNATGateways) Apply(ctx context.Context, nATGateway *networkingv1alp if name == nil { return nil, fmt.Errorf("nATGateway.Name must be provided to Apply") } + emptyResult := &v1alpha1.NATGateway{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(natgatewaysResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.NATGateway{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(natgatewaysResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NATGateway), err } @@ -166,11 +173,12 @@ func (c *FakeNATGateways) ApplyStatus(ctx context.Context, nATGateway *networkin if name == nil { return nil, fmt.Errorf("nATGateway.Name must be provided to Apply") } + emptyResult := &v1alpha1.NATGateway{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(natgatewaysResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.NATGateway{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(natgatewaysResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NATGateway), err } diff --git a/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_network.go b/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_network.go index bd8e0969f..205d1f73f 100644 --- a/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_network.go +++ b/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_network.go @@ -31,22 +31,24 @@ var networksKind = v1alpha1.SchemeGroupVersion.WithKind("Network") // Get takes name of the network, and returns the corresponding network object, and an error if there is any. func (c *FakeNetworks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Network, err error) { + emptyResult := &v1alpha1.Network{} obj, err := c.Fake. - Invokes(testing.NewGetAction(networksResource, c.ns, name), &v1alpha1.Network{}) + Invokes(testing.NewGetActionWithOptions(networksResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Network), err } // List takes label and field selectors, and returns the list of Networks that match those selectors. func (c *FakeNetworks) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NetworkList, err error) { + emptyResult := &v1alpha1.NetworkList{} obj, err := c.Fake. - Invokes(testing.NewListAction(networksResource, networksKind, c.ns, opts), &v1alpha1.NetworkList{}) + Invokes(testing.NewListActionWithOptions(networksResource, networksKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -65,40 +67,43 @@ func (c *FakeNetworks) List(ctx context.Context, opts v1.ListOptions) (result *v // Watch returns a watch.Interface that watches the requested networks. func (c *FakeNetworks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(networksResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(networksResource, c.ns, opts)) } // Create takes the representation of a network and creates it. Returns the server's representation of the network, and an error, if there is any. func (c *FakeNetworks) Create(ctx context.Context, network *v1alpha1.Network, opts v1.CreateOptions) (result *v1alpha1.Network, err error) { + emptyResult := &v1alpha1.Network{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(networksResource, c.ns, network), &v1alpha1.Network{}) + Invokes(testing.NewCreateActionWithOptions(networksResource, c.ns, network, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Network), err } // Update takes the representation of a network and updates it. Returns the server's representation of the network, and an error, if there is any. func (c *FakeNetworks) Update(ctx context.Context, network *v1alpha1.Network, opts v1.UpdateOptions) (result *v1alpha1.Network, err error) { + emptyResult := &v1alpha1.Network{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(networksResource, c.ns, network), &v1alpha1.Network{}) + Invokes(testing.NewUpdateActionWithOptions(networksResource, c.ns, network, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Network), 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 *FakeNetworks) UpdateStatus(ctx context.Context, network *v1alpha1.Network, opts v1.UpdateOptions) (*v1alpha1.Network, error) { +func (c *FakeNetworks) UpdateStatus(ctx context.Context, network *v1alpha1.Network, opts v1.UpdateOptions) (result *v1alpha1.Network, err error) { + emptyResult := &v1alpha1.Network{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(networksResource, "status", c.ns, network), &v1alpha1.Network{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(networksResource, "status", c.ns, network, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Network), err } @@ -113,7 +118,7 @@ func (c *FakeNetworks) Delete(ctx context.Context, name string, opts v1.DeleteOp // DeleteCollection deletes a collection of objects. func (c *FakeNetworks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(networksResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(networksResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.NetworkList{}) return err @@ -121,11 +126,12 @@ func (c *FakeNetworks) DeleteCollection(ctx context.Context, opts v1.DeleteOptio // Patch applies the patch and returns the patched network. func (c *FakeNetworks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Network, err error) { + emptyResult := &v1alpha1.Network{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(networksResource, c.ns, name, pt, data, subresources...), &v1alpha1.Network{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(networksResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Network), err } @@ -143,11 +149,12 @@ func (c *FakeNetworks) Apply(ctx context.Context, network *networkingv1alpha1.Ne if name == nil { return nil, fmt.Errorf("network.Name must be provided to Apply") } + emptyResult := &v1alpha1.Network{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(networksResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.Network{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(networksResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Network), err } @@ -166,11 +173,12 @@ func (c *FakeNetworks) ApplyStatus(ctx context.Context, network *networkingv1alp if name == nil { return nil, fmt.Errorf("network.Name must be provided to Apply") } + emptyResult := &v1alpha1.Network{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(networksResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.Network{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(networksResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Network), err } diff --git a/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_networkinterface.go b/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_networkinterface.go index 0e519c428..69f20fd1f 100644 --- a/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_networkinterface.go +++ b/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_networkinterface.go @@ -31,22 +31,24 @@ var networkinterfacesKind = v1alpha1.SchemeGroupVersion.WithKind("NetworkInterfa // Get takes name of the networkInterface, and returns the corresponding networkInterface object, and an error if there is any. func (c *FakeNetworkInterfaces) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NetworkInterface, err error) { + emptyResult := &v1alpha1.NetworkInterface{} obj, err := c.Fake. - Invokes(testing.NewGetAction(networkinterfacesResource, c.ns, name), &v1alpha1.NetworkInterface{}) + Invokes(testing.NewGetActionWithOptions(networkinterfacesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkInterface), err } // List takes label and field selectors, and returns the list of NetworkInterfaces that match those selectors. func (c *FakeNetworkInterfaces) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NetworkInterfaceList, err error) { + emptyResult := &v1alpha1.NetworkInterfaceList{} obj, err := c.Fake. - Invokes(testing.NewListAction(networkinterfacesResource, networkinterfacesKind, c.ns, opts), &v1alpha1.NetworkInterfaceList{}) + Invokes(testing.NewListActionWithOptions(networkinterfacesResource, networkinterfacesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -65,40 +67,43 @@ func (c *FakeNetworkInterfaces) List(ctx context.Context, opts v1.ListOptions) ( // Watch returns a watch.Interface that watches the requested networkInterfaces. func (c *FakeNetworkInterfaces) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(networkinterfacesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(networkinterfacesResource, c.ns, opts)) } // Create takes the representation of a networkInterface and creates it. Returns the server's representation of the networkInterface, and an error, if there is any. func (c *FakeNetworkInterfaces) Create(ctx context.Context, networkInterface *v1alpha1.NetworkInterface, opts v1.CreateOptions) (result *v1alpha1.NetworkInterface, err error) { + emptyResult := &v1alpha1.NetworkInterface{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(networkinterfacesResource, c.ns, networkInterface), &v1alpha1.NetworkInterface{}) + Invokes(testing.NewCreateActionWithOptions(networkinterfacesResource, c.ns, networkInterface, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkInterface), err } // Update takes the representation of a networkInterface and updates it. Returns the server's representation of the networkInterface, and an error, if there is any. func (c *FakeNetworkInterfaces) Update(ctx context.Context, networkInterface *v1alpha1.NetworkInterface, opts v1.UpdateOptions) (result *v1alpha1.NetworkInterface, err error) { + emptyResult := &v1alpha1.NetworkInterface{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(networkinterfacesResource, c.ns, networkInterface), &v1alpha1.NetworkInterface{}) + Invokes(testing.NewUpdateActionWithOptions(networkinterfacesResource, c.ns, networkInterface, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkInterface), 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 *FakeNetworkInterfaces) UpdateStatus(ctx context.Context, networkInterface *v1alpha1.NetworkInterface, opts v1.UpdateOptions) (*v1alpha1.NetworkInterface, error) { +func (c *FakeNetworkInterfaces) UpdateStatus(ctx context.Context, networkInterface *v1alpha1.NetworkInterface, opts v1.UpdateOptions) (result *v1alpha1.NetworkInterface, err error) { + emptyResult := &v1alpha1.NetworkInterface{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(networkinterfacesResource, "status", c.ns, networkInterface), &v1alpha1.NetworkInterface{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(networkinterfacesResource, "status", c.ns, networkInterface, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkInterface), err } @@ -113,7 +118,7 @@ func (c *FakeNetworkInterfaces) Delete(ctx context.Context, name string, opts v1 // DeleteCollection deletes a collection of objects. func (c *FakeNetworkInterfaces) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(networkinterfacesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(networkinterfacesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.NetworkInterfaceList{}) return err @@ -121,11 +126,12 @@ func (c *FakeNetworkInterfaces) DeleteCollection(ctx context.Context, opts v1.De // Patch applies the patch and returns the patched networkInterface. func (c *FakeNetworkInterfaces) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NetworkInterface, err error) { + emptyResult := &v1alpha1.NetworkInterface{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(networkinterfacesResource, c.ns, name, pt, data, subresources...), &v1alpha1.NetworkInterface{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(networkinterfacesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkInterface), err } @@ -143,11 +149,12 @@ func (c *FakeNetworkInterfaces) Apply(ctx context.Context, networkInterface *net if name == nil { return nil, fmt.Errorf("networkInterface.Name must be provided to Apply") } + emptyResult := &v1alpha1.NetworkInterface{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(networkinterfacesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.NetworkInterface{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(networkinterfacesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkInterface), err } @@ -166,11 +173,12 @@ func (c *FakeNetworkInterfaces) ApplyStatus(ctx context.Context, networkInterfac if name == nil { return nil, fmt.Errorf("networkInterface.Name must be provided to Apply") } + emptyResult := &v1alpha1.NetworkInterface{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(networkinterfacesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.NetworkInterface{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(networkinterfacesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkInterface), err } diff --git a/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_networkpolicy.go b/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_networkpolicy.go index 1ede063cd..3877d7ff5 100644 --- a/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_networkpolicy.go +++ b/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_networkpolicy.go @@ -31,22 +31,24 @@ var networkpoliciesKind = v1alpha1.SchemeGroupVersion.WithKind("NetworkPolicy") // Get takes name of the networkPolicy, and returns the corresponding networkPolicy object, and an error if there is any. func (c *FakeNetworkPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NetworkPolicy, err error) { + emptyResult := &v1alpha1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewGetAction(networkpoliciesResource, c.ns, name), &v1alpha1.NetworkPolicy{}) + Invokes(testing.NewGetActionWithOptions(networkpoliciesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkPolicy), err } // List takes label and field selectors, and returns the list of NetworkPolicies that match those selectors. func (c *FakeNetworkPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NetworkPolicyList, err error) { + emptyResult := &v1alpha1.NetworkPolicyList{} obj, err := c.Fake. - Invokes(testing.NewListAction(networkpoliciesResource, networkpoliciesKind, c.ns, opts), &v1alpha1.NetworkPolicyList{}) + Invokes(testing.NewListActionWithOptions(networkpoliciesResource, networkpoliciesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -65,40 +67,43 @@ func (c *FakeNetworkPolicies) List(ctx context.Context, opts v1.ListOptions) (re // Watch returns a watch.Interface that watches the requested networkPolicies. func (c *FakeNetworkPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(networkpoliciesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(networkpoliciesResource, c.ns, opts)) } // Create takes the representation of a networkPolicy and creates it. Returns the server's representation of the networkPolicy, and an error, if there is any. func (c *FakeNetworkPolicies) Create(ctx context.Context, networkPolicy *v1alpha1.NetworkPolicy, opts v1.CreateOptions) (result *v1alpha1.NetworkPolicy, err error) { + emptyResult := &v1alpha1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(networkpoliciesResource, c.ns, networkPolicy), &v1alpha1.NetworkPolicy{}) + Invokes(testing.NewCreateActionWithOptions(networkpoliciesResource, c.ns, networkPolicy, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkPolicy), err } // Update takes the representation of a networkPolicy and updates it. Returns the server's representation of the networkPolicy, and an error, if there is any. func (c *FakeNetworkPolicies) Update(ctx context.Context, networkPolicy *v1alpha1.NetworkPolicy, opts v1.UpdateOptions) (result *v1alpha1.NetworkPolicy, err error) { + emptyResult := &v1alpha1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(networkpoliciesResource, c.ns, networkPolicy), &v1alpha1.NetworkPolicy{}) + Invokes(testing.NewUpdateActionWithOptions(networkpoliciesResource, c.ns, networkPolicy, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkPolicy), 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 *FakeNetworkPolicies) UpdateStatus(ctx context.Context, networkPolicy *v1alpha1.NetworkPolicy, opts v1.UpdateOptions) (*v1alpha1.NetworkPolicy, error) { +func (c *FakeNetworkPolicies) UpdateStatus(ctx context.Context, networkPolicy *v1alpha1.NetworkPolicy, opts v1.UpdateOptions) (result *v1alpha1.NetworkPolicy, err error) { + emptyResult := &v1alpha1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(networkpoliciesResource, "status", c.ns, networkPolicy), &v1alpha1.NetworkPolicy{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(networkpoliciesResource, "status", c.ns, networkPolicy, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkPolicy), err } @@ -113,7 +118,7 @@ func (c *FakeNetworkPolicies) Delete(ctx context.Context, name string, opts v1.D // DeleteCollection deletes a collection of objects. func (c *FakeNetworkPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(networkpoliciesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(networkpoliciesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.NetworkPolicyList{}) return err @@ -121,11 +126,12 @@ func (c *FakeNetworkPolicies) DeleteCollection(ctx context.Context, opts v1.Dele // Patch applies the patch and returns the patched networkPolicy. func (c *FakeNetworkPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NetworkPolicy, err error) { + emptyResult := &v1alpha1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(networkpoliciesResource, c.ns, name, pt, data, subresources...), &v1alpha1.NetworkPolicy{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(networkpoliciesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkPolicy), err } @@ -143,11 +149,12 @@ func (c *FakeNetworkPolicies) Apply(ctx context.Context, networkPolicy *networki if name == nil { return nil, fmt.Errorf("networkPolicy.Name must be provided to Apply") } + emptyResult := &v1alpha1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(networkpoliciesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.NetworkPolicy{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(networkpoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkPolicy), err } @@ -166,11 +173,12 @@ func (c *FakeNetworkPolicies) ApplyStatus(ctx context.Context, networkPolicy *ne if name == nil { return nil, fmt.Errorf("networkPolicy.Name must be provided to Apply") } + emptyResult := &v1alpha1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(networkpoliciesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.NetworkPolicy{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(networkpoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkPolicy), err } diff --git a/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_virtualip.go b/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_virtualip.go index 81b7892f3..87147381b 100644 --- a/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_virtualip.go +++ b/client-go/ironcore/versioned/typed/networking/v1alpha1/fake/fake_virtualip.go @@ -31,22 +31,24 @@ var virtualipsKind = v1alpha1.SchemeGroupVersion.WithKind("VirtualIP") // Get takes name of the virtualIP, and returns the corresponding virtualIP object, and an error if there is any. func (c *FakeVirtualIPs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VirtualIP, err error) { + emptyResult := &v1alpha1.VirtualIP{} obj, err := c.Fake. - Invokes(testing.NewGetAction(virtualipsResource, c.ns, name), &v1alpha1.VirtualIP{}) + Invokes(testing.NewGetActionWithOptions(virtualipsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VirtualIP), err } // List takes label and field selectors, and returns the list of VirtualIPs that match those selectors. func (c *FakeVirtualIPs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VirtualIPList, err error) { + emptyResult := &v1alpha1.VirtualIPList{} obj, err := c.Fake. - Invokes(testing.NewListAction(virtualipsResource, virtualipsKind, c.ns, opts), &v1alpha1.VirtualIPList{}) + Invokes(testing.NewListActionWithOptions(virtualipsResource, virtualipsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -65,40 +67,43 @@ func (c *FakeVirtualIPs) List(ctx context.Context, opts v1.ListOptions) (result // Watch returns a watch.Interface that watches the requested virtualIPs. func (c *FakeVirtualIPs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(virtualipsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(virtualipsResource, c.ns, opts)) } // Create takes the representation of a virtualIP and creates it. Returns the server's representation of the virtualIP, and an error, if there is any. func (c *FakeVirtualIPs) Create(ctx context.Context, virtualIP *v1alpha1.VirtualIP, opts v1.CreateOptions) (result *v1alpha1.VirtualIP, err error) { + emptyResult := &v1alpha1.VirtualIP{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(virtualipsResource, c.ns, virtualIP), &v1alpha1.VirtualIP{}) + Invokes(testing.NewCreateActionWithOptions(virtualipsResource, c.ns, virtualIP, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VirtualIP), err } // Update takes the representation of a virtualIP and updates it. Returns the server's representation of the virtualIP, and an error, if there is any. func (c *FakeVirtualIPs) Update(ctx context.Context, virtualIP *v1alpha1.VirtualIP, opts v1.UpdateOptions) (result *v1alpha1.VirtualIP, err error) { + emptyResult := &v1alpha1.VirtualIP{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(virtualipsResource, c.ns, virtualIP), &v1alpha1.VirtualIP{}) + Invokes(testing.NewUpdateActionWithOptions(virtualipsResource, c.ns, virtualIP, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VirtualIP), 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 *FakeVirtualIPs) UpdateStatus(ctx context.Context, virtualIP *v1alpha1.VirtualIP, opts v1.UpdateOptions) (*v1alpha1.VirtualIP, error) { +func (c *FakeVirtualIPs) UpdateStatus(ctx context.Context, virtualIP *v1alpha1.VirtualIP, opts v1.UpdateOptions) (result *v1alpha1.VirtualIP, err error) { + emptyResult := &v1alpha1.VirtualIP{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(virtualipsResource, "status", c.ns, virtualIP), &v1alpha1.VirtualIP{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(virtualipsResource, "status", c.ns, virtualIP, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VirtualIP), err } @@ -113,7 +118,7 @@ func (c *FakeVirtualIPs) Delete(ctx context.Context, name string, opts v1.Delete // DeleteCollection deletes a collection of objects. func (c *FakeVirtualIPs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(virtualipsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(virtualipsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.VirtualIPList{}) return err @@ -121,11 +126,12 @@ func (c *FakeVirtualIPs) DeleteCollection(ctx context.Context, opts v1.DeleteOpt // Patch applies the patch and returns the patched virtualIP. func (c *FakeVirtualIPs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VirtualIP, err error) { + emptyResult := &v1alpha1.VirtualIP{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(virtualipsResource, c.ns, name, pt, data, subresources...), &v1alpha1.VirtualIP{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(virtualipsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VirtualIP), err } @@ -143,11 +149,12 @@ func (c *FakeVirtualIPs) Apply(ctx context.Context, virtualIP *networkingv1alpha if name == nil { return nil, fmt.Errorf("virtualIP.Name must be provided to Apply") } + emptyResult := &v1alpha1.VirtualIP{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(virtualipsResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.VirtualIP{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(virtualipsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VirtualIP), err } @@ -166,11 +173,12 @@ func (c *FakeVirtualIPs) ApplyStatus(ctx context.Context, virtualIP *networkingv if name == nil { return nil, fmt.Errorf("virtualIP.Name must be provided to Apply") } + emptyResult := &v1alpha1.VirtualIP{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(virtualipsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.VirtualIP{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(virtualipsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VirtualIP), err } diff --git a/client-go/ironcore/versioned/typed/networking/v1alpha1/loadbalancer.go b/client-go/ironcore/versioned/typed/networking/v1alpha1/loadbalancer.go index a5545c621..b93da350d 100644 --- a/client-go/ironcore/versioned/typed/networking/v1alpha1/loadbalancer.go +++ b/client-go/ironcore/versioned/typed/networking/v1alpha1/loadbalancer.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" networkingv1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/networking/v1alpha1" @@ -17,7 +14,7 @@ import ( 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" + gentype "k8s.io/client-go/gentype" ) // LoadBalancersGetter has a method to return a LoadBalancerInterface. @@ -30,6 +27,7 @@ type LoadBalancersGetter interface { type LoadBalancerInterface interface { Create(ctx context.Context, loadBalancer *v1alpha1.LoadBalancer, opts v1.CreateOptions) (*v1alpha1.LoadBalancer, error) Update(ctx context.Context, loadBalancer *v1alpha1.LoadBalancer, opts v1.UpdateOptions) (*v1alpha1.LoadBalancer, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, loadBalancer *v1alpha1.LoadBalancer, opts v1.UpdateOptions) (*v1alpha1.LoadBalancer, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -38,206 +36,25 @@ type LoadBalancerInterface interface { 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.LoadBalancer, err error) Apply(ctx context.Context, loadBalancer *networkingv1alpha1.LoadBalancerApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.LoadBalancer, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, loadBalancer *networkingv1alpha1.LoadBalancerApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.LoadBalancer, err error) LoadBalancerExpansion } // loadBalancers implements LoadBalancerInterface type loadBalancers struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.LoadBalancer, *v1alpha1.LoadBalancerList, *networkingv1alpha1.LoadBalancerApplyConfiguration] } // newLoadBalancers returns a LoadBalancers func newLoadBalancers(c *NetworkingV1alpha1Client, namespace string) *loadBalancers { return &loadBalancers{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.LoadBalancer, *v1alpha1.LoadBalancerList, *networkingv1alpha1.LoadBalancerApplyConfiguration]( + "loadbalancers", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.LoadBalancer { return &v1alpha1.LoadBalancer{} }, + func() *v1alpha1.LoadBalancerList { return &v1alpha1.LoadBalancerList{} }), } } - -// Get takes name of the loadBalancer, and returns the corresponding loadBalancer object, and an error if there is any. -func (c *loadBalancers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.LoadBalancer, err error) { - result = &v1alpha1.LoadBalancer{} - err = c.client.Get(). - Namespace(c.ns). - Resource("loadbalancers"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of LoadBalancers that match those selectors. -func (c *loadBalancers) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.LoadBalancerList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.LoadBalancerList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("loadbalancers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested loadBalancers. -func (c *loadBalancers) 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("loadbalancers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a loadBalancer and creates it. Returns the server's representation of the loadBalancer, and an error, if there is any. -func (c *loadBalancers) Create(ctx context.Context, loadBalancer *v1alpha1.LoadBalancer, opts v1.CreateOptions) (result *v1alpha1.LoadBalancer, err error) { - result = &v1alpha1.LoadBalancer{} - err = c.client.Post(). - Namespace(c.ns). - Resource("loadbalancers"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(loadBalancer). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a loadBalancer and updates it. Returns the server's representation of the loadBalancer, and an error, if there is any. -func (c *loadBalancers) Update(ctx context.Context, loadBalancer *v1alpha1.LoadBalancer, opts v1.UpdateOptions) (result *v1alpha1.LoadBalancer, err error) { - result = &v1alpha1.LoadBalancer{} - err = c.client.Put(). - Namespace(c.ns). - Resource("loadbalancers"). - Name(loadBalancer.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(loadBalancer). - 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 *loadBalancers) UpdateStatus(ctx context.Context, loadBalancer *v1alpha1.LoadBalancer, opts v1.UpdateOptions) (result *v1alpha1.LoadBalancer, err error) { - result = &v1alpha1.LoadBalancer{} - err = c.client.Put(). - Namespace(c.ns). - Resource("loadbalancers"). - Name(loadBalancer.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(loadBalancer). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the loadBalancer and deletes it. Returns an error if one occurs. -func (c *loadBalancers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("loadbalancers"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *loadBalancers) 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("loadbalancers"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched loadBalancer. -func (c *loadBalancers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LoadBalancer, err error) { - result = &v1alpha1.LoadBalancer{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("loadbalancers"). - 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 loadBalancer. -func (c *loadBalancers) Apply(ctx context.Context, loadBalancer *networkingv1alpha1.LoadBalancerApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.LoadBalancer, err error) { - if loadBalancer == nil { - return nil, fmt.Errorf("loadBalancer provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(loadBalancer) - if err != nil { - return nil, err - } - name := loadBalancer.Name - if name == nil { - return nil, fmt.Errorf("loadBalancer.Name must be provided to Apply") - } - result = &v1alpha1.LoadBalancer{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("loadbalancers"). - 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 *loadBalancers) ApplyStatus(ctx context.Context, loadBalancer *networkingv1alpha1.LoadBalancerApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.LoadBalancer, err error) { - if loadBalancer == nil { - return nil, fmt.Errorf("loadBalancer provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(loadBalancer) - if err != nil { - return nil, err - } - - name := loadBalancer.Name - if name == nil { - return nil, fmt.Errorf("loadBalancer.Name must be provided to Apply") - } - - result = &v1alpha1.LoadBalancer{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("loadbalancers"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcore/versioned/typed/networking/v1alpha1/loadbalancerrouting.go b/client-go/ironcore/versioned/typed/networking/v1alpha1/loadbalancerrouting.go index 40ac60c2c..ecc0092ac 100644 --- a/client-go/ironcore/versioned/typed/networking/v1alpha1/loadbalancerrouting.go +++ b/client-go/ironcore/versioned/typed/networking/v1alpha1/loadbalancerrouting.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" networkingv1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/networking/v1alpha1" @@ -17,7 +14,7 @@ import ( 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" + gentype "k8s.io/client-go/gentype" ) // LoadBalancerRoutingsGetter has a method to return a LoadBalancerRoutingInterface. @@ -42,154 +39,18 @@ type LoadBalancerRoutingInterface interface { // loadBalancerRoutings implements LoadBalancerRoutingInterface type loadBalancerRoutings struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.LoadBalancerRouting, *v1alpha1.LoadBalancerRoutingList, *networkingv1alpha1.LoadBalancerRoutingApplyConfiguration] } // newLoadBalancerRoutings returns a LoadBalancerRoutings func newLoadBalancerRoutings(c *NetworkingV1alpha1Client, namespace string) *loadBalancerRoutings { return &loadBalancerRoutings{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.LoadBalancerRouting, *v1alpha1.LoadBalancerRoutingList, *networkingv1alpha1.LoadBalancerRoutingApplyConfiguration]( + "loadbalancerroutings", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.LoadBalancerRouting { return &v1alpha1.LoadBalancerRouting{} }, + func() *v1alpha1.LoadBalancerRoutingList { return &v1alpha1.LoadBalancerRoutingList{} }), } } - -// Get takes name of the loadBalancerRouting, and returns the corresponding loadBalancerRouting object, and an error if there is any. -func (c *loadBalancerRoutings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.LoadBalancerRouting, err error) { - result = &v1alpha1.LoadBalancerRouting{} - err = c.client.Get(). - Namespace(c.ns). - Resource("loadbalancerroutings"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of LoadBalancerRoutings that match those selectors. -func (c *loadBalancerRoutings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.LoadBalancerRoutingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.LoadBalancerRoutingList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("loadbalancerroutings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested loadBalancerRoutings. -func (c *loadBalancerRoutings) 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("loadbalancerroutings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a loadBalancerRouting and creates it. Returns the server's representation of the loadBalancerRouting, and an error, if there is any. -func (c *loadBalancerRoutings) Create(ctx context.Context, loadBalancerRouting *v1alpha1.LoadBalancerRouting, opts v1.CreateOptions) (result *v1alpha1.LoadBalancerRouting, err error) { - result = &v1alpha1.LoadBalancerRouting{} - err = c.client.Post(). - Namespace(c.ns). - Resource("loadbalancerroutings"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(loadBalancerRouting). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a loadBalancerRouting and updates it. Returns the server's representation of the loadBalancerRouting, and an error, if there is any. -func (c *loadBalancerRoutings) Update(ctx context.Context, loadBalancerRouting *v1alpha1.LoadBalancerRouting, opts v1.UpdateOptions) (result *v1alpha1.LoadBalancerRouting, err error) { - result = &v1alpha1.LoadBalancerRouting{} - err = c.client.Put(). - Namespace(c.ns). - Resource("loadbalancerroutings"). - Name(loadBalancerRouting.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(loadBalancerRouting). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the loadBalancerRouting and deletes it. Returns an error if one occurs. -func (c *loadBalancerRoutings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("loadbalancerroutings"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *loadBalancerRoutings) 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("loadbalancerroutings"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched loadBalancerRouting. -func (c *loadBalancerRoutings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LoadBalancerRouting, err error) { - result = &v1alpha1.LoadBalancerRouting{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("loadbalancerroutings"). - 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 loadBalancerRouting. -func (c *loadBalancerRoutings) Apply(ctx context.Context, loadBalancerRouting *networkingv1alpha1.LoadBalancerRoutingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.LoadBalancerRouting, err error) { - if loadBalancerRouting == nil { - return nil, fmt.Errorf("loadBalancerRouting provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(loadBalancerRouting) - if err != nil { - return nil, err - } - name := loadBalancerRouting.Name - if name == nil { - return nil, fmt.Errorf("loadBalancerRouting.Name must be provided to Apply") - } - result = &v1alpha1.LoadBalancerRouting{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("loadbalancerroutings"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcore/versioned/typed/networking/v1alpha1/natgateway.go b/client-go/ironcore/versioned/typed/networking/v1alpha1/natgateway.go index 35929c3b2..411e306d1 100644 --- a/client-go/ironcore/versioned/typed/networking/v1alpha1/natgateway.go +++ b/client-go/ironcore/versioned/typed/networking/v1alpha1/natgateway.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" networkingv1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/networking/v1alpha1" @@ -17,7 +14,7 @@ import ( 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" + gentype "k8s.io/client-go/gentype" ) // NATGatewaysGetter has a method to return a NATGatewayInterface. @@ -30,6 +27,7 @@ type NATGatewaysGetter interface { type NATGatewayInterface interface { Create(ctx context.Context, nATGateway *v1alpha1.NATGateway, opts v1.CreateOptions) (*v1alpha1.NATGateway, error) Update(ctx context.Context, nATGateway *v1alpha1.NATGateway, opts v1.UpdateOptions) (*v1alpha1.NATGateway, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, nATGateway *v1alpha1.NATGateway, opts v1.UpdateOptions) (*v1alpha1.NATGateway, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -38,206 +36,25 @@ type NATGatewayInterface interface { 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.NATGateway, err error) Apply(ctx context.Context, nATGateway *networkingv1alpha1.NATGatewayApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.NATGateway, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, nATGateway *networkingv1alpha1.NATGatewayApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.NATGateway, err error) NATGatewayExpansion } // nATGateways implements NATGatewayInterface type nATGateways struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.NATGateway, *v1alpha1.NATGatewayList, *networkingv1alpha1.NATGatewayApplyConfiguration] } // newNATGateways returns a NATGateways func newNATGateways(c *NetworkingV1alpha1Client, namespace string) *nATGateways { return &nATGateways{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.NATGateway, *v1alpha1.NATGatewayList, *networkingv1alpha1.NATGatewayApplyConfiguration]( + "natgateways", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.NATGateway { return &v1alpha1.NATGateway{} }, + func() *v1alpha1.NATGatewayList { return &v1alpha1.NATGatewayList{} }), } } - -// Get takes name of the nATGateway, and returns the corresponding nATGateway object, and an error if there is any. -func (c *nATGateways) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NATGateway, err error) { - result = &v1alpha1.NATGateway{} - err = c.client.Get(). - Namespace(c.ns). - Resource("natgateways"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of NATGateways that match those selectors. -func (c *nATGateways) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NATGatewayList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.NATGatewayList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("natgateways"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested nATGateways. -func (c *nATGateways) 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("natgateways"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a nATGateway and creates it. Returns the server's representation of the nATGateway, and an error, if there is any. -func (c *nATGateways) Create(ctx context.Context, nATGateway *v1alpha1.NATGateway, opts v1.CreateOptions) (result *v1alpha1.NATGateway, err error) { - result = &v1alpha1.NATGateway{} - err = c.client.Post(). - Namespace(c.ns). - Resource("natgateways"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(nATGateway). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a nATGateway and updates it. Returns the server's representation of the nATGateway, and an error, if there is any. -func (c *nATGateways) Update(ctx context.Context, nATGateway *v1alpha1.NATGateway, opts v1.UpdateOptions) (result *v1alpha1.NATGateway, err error) { - result = &v1alpha1.NATGateway{} - err = c.client.Put(). - Namespace(c.ns). - Resource("natgateways"). - Name(nATGateway.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(nATGateway). - 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 *nATGateways) UpdateStatus(ctx context.Context, nATGateway *v1alpha1.NATGateway, opts v1.UpdateOptions) (result *v1alpha1.NATGateway, err error) { - result = &v1alpha1.NATGateway{} - err = c.client.Put(). - Namespace(c.ns). - Resource("natgateways"). - Name(nATGateway.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(nATGateway). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the nATGateway and deletes it. Returns an error if one occurs. -func (c *nATGateways) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("natgateways"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *nATGateways) 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("natgateways"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched nATGateway. -func (c *nATGateways) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NATGateway, err error) { - result = &v1alpha1.NATGateway{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("natgateways"). - 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 nATGateway. -func (c *nATGateways) Apply(ctx context.Context, nATGateway *networkingv1alpha1.NATGatewayApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.NATGateway, err error) { - if nATGateway == nil { - return nil, fmt.Errorf("nATGateway provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(nATGateway) - if err != nil { - return nil, err - } - name := nATGateway.Name - if name == nil { - return nil, fmt.Errorf("nATGateway.Name must be provided to Apply") - } - result = &v1alpha1.NATGateway{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("natgateways"). - 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 *nATGateways) ApplyStatus(ctx context.Context, nATGateway *networkingv1alpha1.NATGatewayApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.NATGateway, err error) { - if nATGateway == nil { - return nil, fmt.Errorf("nATGateway provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(nATGateway) - if err != nil { - return nil, err - } - - name := nATGateway.Name - if name == nil { - return nil, fmt.Errorf("nATGateway.Name must be provided to Apply") - } - - result = &v1alpha1.NATGateway{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("natgateways"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcore/versioned/typed/networking/v1alpha1/network.go b/client-go/ironcore/versioned/typed/networking/v1alpha1/network.go index e5090ea77..dfca1905c 100644 --- a/client-go/ironcore/versioned/typed/networking/v1alpha1/network.go +++ b/client-go/ironcore/versioned/typed/networking/v1alpha1/network.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" networkingv1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/networking/v1alpha1" @@ -17,7 +14,7 @@ import ( 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" + gentype "k8s.io/client-go/gentype" ) // NetworksGetter has a method to return a NetworkInterface. @@ -30,6 +27,7 @@ type NetworksGetter interface { type NetworkInterface interface { Create(ctx context.Context, network *v1alpha1.Network, opts v1.CreateOptions) (*v1alpha1.Network, error) Update(ctx context.Context, network *v1alpha1.Network, opts v1.UpdateOptions) (*v1alpha1.Network, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, network *v1alpha1.Network, opts v1.UpdateOptions) (*v1alpha1.Network, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -38,206 +36,25 @@ type NetworkInterface interface { 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.Network, err error) Apply(ctx context.Context, network *networkingv1alpha1.NetworkApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Network, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, network *networkingv1alpha1.NetworkApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Network, err error) NetworkExpansion } // networks implements NetworkInterface type networks struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.Network, *v1alpha1.NetworkList, *networkingv1alpha1.NetworkApplyConfiguration] } // newNetworks returns a Networks func newNetworks(c *NetworkingV1alpha1Client, namespace string) *networks { return &networks{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.Network, *v1alpha1.NetworkList, *networkingv1alpha1.NetworkApplyConfiguration]( + "networks", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.Network { return &v1alpha1.Network{} }, + func() *v1alpha1.NetworkList { return &v1alpha1.NetworkList{} }), } } - -// Get takes name of the network, and returns the corresponding network object, and an error if there is any. -func (c *networks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Network, err error) { - result = &v1alpha1.Network{} - err = c.client.Get(). - Namespace(c.ns). - Resource("networks"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Networks that match those selectors. -func (c *networks) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NetworkList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.NetworkList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("networks"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested networks. -func (c *networks) 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("networks"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a network and creates it. Returns the server's representation of the network, and an error, if there is any. -func (c *networks) Create(ctx context.Context, network *v1alpha1.Network, opts v1.CreateOptions) (result *v1alpha1.Network, err error) { - result = &v1alpha1.Network{} - err = c.client.Post(). - Namespace(c.ns). - Resource("networks"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(network). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a network and updates it. Returns the server's representation of the network, and an error, if there is any. -func (c *networks) Update(ctx context.Context, network *v1alpha1.Network, opts v1.UpdateOptions) (result *v1alpha1.Network, err error) { - result = &v1alpha1.Network{} - err = c.client.Put(). - Namespace(c.ns). - Resource("networks"). - Name(network.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(network). - 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 *networks) UpdateStatus(ctx context.Context, network *v1alpha1.Network, opts v1.UpdateOptions) (result *v1alpha1.Network, err error) { - result = &v1alpha1.Network{} - err = c.client.Put(). - Namespace(c.ns). - Resource("networks"). - Name(network.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(network). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the network and deletes it. Returns an error if one occurs. -func (c *networks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("networks"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *networks) 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("networks"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched network. -func (c *networks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Network, err error) { - result = &v1alpha1.Network{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("networks"). - 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 network. -func (c *networks) Apply(ctx context.Context, network *networkingv1alpha1.NetworkApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Network, err error) { - if network == nil { - return nil, fmt.Errorf("network provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(network) - if err != nil { - return nil, err - } - name := network.Name - if name == nil { - return nil, fmt.Errorf("network.Name must be provided to Apply") - } - result = &v1alpha1.Network{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("networks"). - 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 *networks) ApplyStatus(ctx context.Context, network *networkingv1alpha1.NetworkApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Network, err error) { - if network == nil { - return nil, fmt.Errorf("network provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(network) - if err != nil { - return nil, err - } - - name := network.Name - if name == nil { - return nil, fmt.Errorf("network.Name must be provided to Apply") - } - - result = &v1alpha1.Network{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("networks"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcore/versioned/typed/networking/v1alpha1/networkinterface.go b/client-go/ironcore/versioned/typed/networking/v1alpha1/networkinterface.go index dcb018fc9..226db67a5 100644 --- a/client-go/ironcore/versioned/typed/networking/v1alpha1/networkinterface.go +++ b/client-go/ironcore/versioned/typed/networking/v1alpha1/networkinterface.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" networkingv1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/networking/v1alpha1" @@ -17,7 +14,7 @@ import ( 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" + gentype "k8s.io/client-go/gentype" ) // NetworkInterfacesGetter has a method to return a NetworkInterfaceInterface. @@ -30,6 +27,7 @@ type NetworkInterfacesGetter interface { type NetworkInterfaceInterface interface { Create(ctx context.Context, networkInterface *v1alpha1.NetworkInterface, opts v1.CreateOptions) (*v1alpha1.NetworkInterface, error) Update(ctx context.Context, networkInterface *v1alpha1.NetworkInterface, opts v1.UpdateOptions) (*v1alpha1.NetworkInterface, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, networkInterface *v1alpha1.NetworkInterface, opts v1.UpdateOptions) (*v1alpha1.NetworkInterface, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -38,206 +36,25 @@ type NetworkInterfaceInterface interface { 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.NetworkInterface, err error) Apply(ctx context.Context, networkInterface *networkingv1alpha1.NetworkInterfaceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.NetworkInterface, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, networkInterface *networkingv1alpha1.NetworkInterfaceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.NetworkInterface, err error) NetworkInterfaceExpansion } // networkInterfaces implements NetworkInterfaceInterface type networkInterfaces struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.NetworkInterface, *v1alpha1.NetworkInterfaceList, *networkingv1alpha1.NetworkInterfaceApplyConfiguration] } // newNetworkInterfaces returns a NetworkInterfaces func newNetworkInterfaces(c *NetworkingV1alpha1Client, namespace string) *networkInterfaces { return &networkInterfaces{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.NetworkInterface, *v1alpha1.NetworkInterfaceList, *networkingv1alpha1.NetworkInterfaceApplyConfiguration]( + "networkinterfaces", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.NetworkInterface { return &v1alpha1.NetworkInterface{} }, + func() *v1alpha1.NetworkInterfaceList { return &v1alpha1.NetworkInterfaceList{} }), } } - -// Get takes name of the networkInterface, and returns the corresponding networkInterface object, and an error if there is any. -func (c *networkInterfaces) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NetworkInterface, err error) { - result = &v1alpha1.NetworkInterface{} - err = c.client.Get(). - Namespace(c.ns). - Resource("networkinterfaces"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of NetworkInterfaces that match those selectors. -func (c *networkInterfaces) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NetworkInterfaceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.NetworkInterfaceList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("networkinterfaces"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested networkInterfaces. -func (c *networkInterfaces) 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("networkinterfaces"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a networkInterface and creates it. Returns the server's representation of the networkInterface, and an error, if there is any. -func (c *networkInterfaces) Create(ctx context.Context, networkInterface *v1alpha1.NetworkInterface, opts v1.CreateOptions) (result *v1alpha1.NetworkInterface, err error) { - result = &v1alpha1.NetworkInterface{} - err = c.client.Post(). - Namespace(c.ns). - Resource("networkinterfaces"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(networkInterface). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a networkInterface and updates it. Returns the server's representation of the networkInterface, and an error, if there is any. -func (c *networkInterfaces) Update(ctx context.Context, networkInterface *v1alpha1.NetworkInterface, opts v1.UpdateOptions) (result *v1alpha1.NetworkInterface, err error) { - result = &v1alpha1.NetworkInterface{} - err = c.client.Put(). - Namespace(c.ns). - Resource("networkinterfaces"). - Name(networkInterface.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(networkInterface). - 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 *networkInterfaces) UpdateStatus(ctx context.Context, networkInterface *v1alpha1.NetworkInterface, opts v1.UpdateOptions) (result *v1alpha1.NetworkInterface, err error) { - result = &v1alpha1.NetworkInterface{} - err = c.client.Put(). - Namespace(c.ns). - Resource("networkinterfaces"). - Name(networkInterface.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(networkInterface). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the networkInterface and deletes it. Returns an error if one occurs. -func (c *networkInterfaces) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("networkinterfaces"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *networkInterfaces) 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("networkinterfaces"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched networkInterface. -func (c *networkInterfaces) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NetworkInterface, err error) { - result = &v1alpha1.NetworkInterface{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("networkinterfaces"). - 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 networkInterface. -func (c *networkInterfaces) Apply(ctx context.Context, networkInterface *networkingv1alpha1.NetworkInterfaceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.NetworkInterface, err error) { - if networkInterface == nil { - return nil, fmt.Errorf("networkInterface provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(networkInterface) - if err != nil { - return nil, err - } - name := networkInterface.Name - if name == nil { - return nil, fmt.Errorf("networkInterface.Name must be provided to Apply") - } - result = &v1alpha1.NetworkInterface{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("networkinterfaces"). - 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 *networkInterfaces) ApplyStatus(ctx context.Context, networkInterface *networkingv1alpha1.NetworkInterfaceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.NetworkInterface, err error) { - if networkInterface == nil { - return nil, fmt.Errorf("networkInterface provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(networkInterface) - if err != nil { - return nil, err - } - - name := networkInterface.Name - if name == nil { - return nil, fmt.Errorf("networkInterface.Name must be provided to Apply") - } - - result = &v1alpha1.NetworkInterface{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("networkinterfaces"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcore/versioned/typed/networking/v1alpha1/networkpolicy.go b/client-go/ironcore/versioned/typed/networking/v1alpha1/networkpolicy.go index 4ac7090aa..2c8e6d1d4 100644 --- a/client-go/ironcore/versioned/typed/networking/v1alpha1/networkpolicy.go +++ b/client-go/ironcore/versioned/typed/networking/v1alpha1/networkpolicy.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" networkingv1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/networking/v1alpha1" @@ -17,7 +14,7 @@ import ( 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" + gentype "k8s.io/client-go/gentype" ) // NetworkPoliciesGetter has a method to return a NetworkPolicyInterface. @@ -30,6 +27,7 @@ type NetworkPoliciesGetter interface { type NetworkPolicyInterface interface { Create(ctx context.Context, networkPolicy *v1alpha1.NetworkPolicy, opts v1.CreateOptions) (*v1alpha1.NetworkPolicy, error) Update(ctx context.Context, networkPolicy *v1alpha1.NetworkPolicy, opts v1.UpdateOptions) (*v1alpha1.NetworkPolicy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, networkPolicy *v1alpha1.NetworkPolicy, opts v1.UpdateOptions) (*v1alpha1.NetworkPolicy, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -38,206 +36,25 @@ type NetworkPolicyInterface interface { 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.NetworkPolicy, err error) Apply(ctx context.Context, networkPolicy *networkingv1alpha1.NetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.NetworkPolicy, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, networkPolicy *networkingv1alpha1.NetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.NetworkPolicy, err error) NetworkPolicyExpansion } // networkPolicies implements NetworkPolicyInterface type networkPolicies struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.NetworkPolicy, *v1alpha1.NetworkPolicyList, *networkingv1alpha1.NetworkPolicyApplyConfiguration] } // newNetworkPolicies returns a NetworkPolicies func newNetworkPolicies(c *NetworkingV1alpha1Client, namespace string) *networkPolicies { return &networkPolicies{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.NetworkPolicy, *v1alpha1.NetworkPolicyList, *networkingv1alpha1.NetworkPolicyApplyConfiguration]( + "networkpolicies", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.NetworkPolicy { return &v1alpha1.NetworkPolicy{} }, + func() *v1alpha1.NetworkPolicyList { return &v1alpha1.NetworkPolicyList{} }), } } - -// Get takes name of the networkPolicy, and returns the corresponding networkPolicy object, and an error if there is any. -func (c *networkPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NetworkPolicy, err error) { - result = &v1alpha1.NetworkPolicy{} - err = c.client.Get(). - Namespace(c.ns). - Resource("networkpolicies"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of NetworkPolicies that match those selectors. -func (c *networkPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NetworkPolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.NetworkPolicyList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("networkpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested networkPolicies. -func (c *networkPolicies) 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("networkpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a networkPolicy and creates it. Returns the server's representation of the networkPolicy, and an error, if there is any. -func (c *networkPolicies) Create(ctx context.Context, networkPolicy *v1alpha1.NetworkPolicy, opts v1.CreateOptions) (result *v1alpha1.NetworkPolicy, err error) { - result = &v1alpha1.NetworkPolicy{} - err = c.client.Post(). - Namespace(c.ns). - Resource("networkpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(networkPolicy). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a networkPolicy and updates it. Returns the server's representation of the networkPolicy, and an error, if there is any. -func (c *networkPolicies) Update(ctx context.Context, networkPolicy *v1alpha1.NetworkPolicy, opts v1.UpdateOptions) (result *v1alpha1.NetworkPolicy, err error) { - result = &v1alpha1.NetworkPolicy{} - err = c.client.Put(). - Namespace(c.ns). - Resource("networkpolicies"). - Name(networkPolicy.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(networkPolicy). - 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 *networkPolicies) UpdateStatus(ctx context.Context, networkPolicy *v1alpha1.NetworkPolicy, opts v1.UpdateOptions) (result *v1alpha1.NetworkPolicy, err error) { - result = &v1alpha1.NetworkPolicy{} - err = c.client.Put(). - Namespace(c.ns). - Resource("networkpolicies"). - Name(networkPolicy.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(networkPolicy). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the networkPolicy and deletes it. Returns an error if one occurs. -func (c *networkPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("networkpolicies"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *networkPolicies) 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("networkpolicies"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched networkPolicy. -func (c *networkPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NetworkPolicy, err error) { - result = &v1alpha1.NetworkPolicy{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("networkpolicies"). - 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 networkPolicy. -func (c *networkPolicies) Apply(ctx context.Context, networkPolicy *networkingv1alpha1.NetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.NetworkPolicy, err error) { - if networkPolicy == nil { - return nil, fmt.Errorf("networkPolicy provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(networkPolicy) - if err != nil { - return nil, err - } - name := networkPolicy.Name - if name == nil { - return nil, fmt.Errorf("networkPolicy.Name must be provided to Apply") - } - result = &v1alpha1.NetworkPolicy{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("networkpolicies"). - 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 *networkPolicies) ApplyStatus(ctx context.Context, networkPolicy *networkingv1alpha1.NetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.NetworkPolicy, err error) { - if networkPolicy == nil { - return nil, fmt.Errorf("networkPolicy provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(networkPolicy) - if err != nil { - return nil, err - } - - name := networkPolicy.Name - if name == nil { - return nil, fmt.Errorf("networkPolicy.Name must be provided to Apply") - } - - result = &v1alpha1.NetworkPolicy{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("networkpolicies"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcore/versioned/typed/networking/v1alpha1/virtualip.go b/client-go/ironcore/versioned/typed/networking/v1alpha1/virtualip.go index 5dcb2dbdd..723055c6d 100644 --- a/client-go/ironcore/versioned/typed/networking/v1alpha1/virtualip.go +++ b/client-go/ironcore/versioned/typed/networking/v1alpha1/virtualip.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" networkingv1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/networking/v1alpha1" @@ -17,7 +14,7 @@ import ( 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" + gentype "k8s.io/client-go/gentype" ) // VirtualIPsGetter has a method to return a VirtualIPInterface. @@ -30,6 +27,7 @@ type VirtualIPsGetter interface { type VirtualIPInterface interface { Create(ctx context.Context, virtualIP *v1alpha1.VirtualIP, opts v1.CreateOptions) (*v1alpha1.VirtualIP, error) Update(ctx context.Context, virtualIP *v1alpha1.VirtualIP, opts v1.UpdateOptions) (*v1alpha1.VirtualIP, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, virtualIP *v1alpha1.VirtualIP, opts v1.UpdateOptions) (*v1alpha1.VirtualIP, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -38,206 +36,25 @@ type VirtualIPInterface interface { 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.VirtualIP, err error) Apply(ctx context.Context, virtualIP *networkingv1alpha1.VirtualIPApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualIP, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, virtualIP *networkingv1alpha1.VirtualIPApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualIP, err error) VirtualIPExpansion } // virtualIPs implements VirtualIPInterface type virtualIPs struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.VirtualIP, *v1alpha1.VirtualIPList, *networkingv1alpha1.VirtualIPApplyConfiguration] } // newVirtualIPs returns a VirtualIPs func newVirtualIPs(c *NetworkingV1alpha1Client, namespace string) *virtualIPs { return &virtualIPs{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.VirtualIP, *v1alpha1.VirtualIPList, *networkingv1alpha1.VirtualIPApplyConfiguration]( + "virtualips", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.VirtualIP { return &v1alpha1.VirtualIP{} }, + func() *v1alpha1.VirtualIPList { return &v1alpha1.VirtualIPList{} }), } } - -// Get takes name of the virtualIP, and returns the corresponding virtualIP object, and an error if there is any. -func (c *virtualIPs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VirtualIP, err error) { - result = &v1alpha1.VirtualIP{} - err = c.client.Get(). - Namespace(c.ns). - Resource("virtualips"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VirtualIPs that match those selectors. -func (c *virtualIPs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VirtualIPList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.VirtualIPList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("virtualips"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested virtualIPs. -func (c *virtualIPs) 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("virtualips"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a virtualIP and creates it. Returns the server's representation of the virtualIP, and an error, if there is any. -func (c *virtualIPs) Create(ctx context.Context, virtualIP *v1alpha1.VirtualIP, opts v1.CreateOptions) (result *v1alpha1.VirtualIP, err error) { - result = &v1alpha1.VirtualIP{} - err = c.client.Post(). - Namespace(c.ns). - Resource("virtualips"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualIP). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a virtualIP and updates it. Returns the server's representation of the virtualIP, and an error, if there is any. -func (c *virtualIPs) Update(ctx context.Context, virtualIP *v1alpha1.VirtualIP, opts v1.UpdateOptions) (result *v1alpha1.VirtualIP, err error) { - result = &v1alpha1.VirtualIP{} - err = c.client.Put(). - Namespace(c.ns). - Resource("virtualips"). - Name(virtualIP.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualIP). - 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 *virtualIPs) UpdateStatus(ctx context.Context, virtualIP *v1alpha1.VirtualIP, opts v1.UpdateOptions) (result *v1alpha1.VirtualIP, err error) { - result = &v1alpha1.VirtualIP{} - err = c.client.Put(). - Namespace(c.ns). - Resource("virtualips"). - Name(virtualIP.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(virtualIP). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the virtualIP and deletes it. Returns an error if one occurs. -func (c *virtualIPs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("virtualips"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *virtualIPs) 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("virtualips"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched virtualIP. -func (c *virtualIPs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VirtualIP, err error) { - result = &v1alpha1.VirtualIP{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("virtualips"). - 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 virtualIP. -func (c *virtualIPs) Apply(ctx context.Context, virtualIP *networkingv1alpha1.VirtualIPApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualIP, err error) { - if virtualIP == nil { - return nil, fmt.Errorf("virtualIP provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(virtualIP) - if err != nil { - return nil, err - } - name := virtualIP.Name - if name == nil { - return nil, fmt.Errorf("virtualIP.Name must be provided to Apply") - } - result = &v1alpha1.VirtualIP{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("virtualips"). - 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 *virtualIPs) ApplyStatus(ctx context.Context, virtualIP *networkingv1alpha1.VirtualIPApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VirtualIP, err error) { - if virtualIP == nil { - return nil, fmt.Errorf("virtualIP provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(virtualIP) - if err != nil { - return nil, err - } - - name := virtualIP.Name - if name == nil { - return nil, fmt.Errorf("virtualIP.Name must be provided to Apply") - } - - result = &v1alpha1.VirtualIP{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("virtualips"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcore/versioned/typed/storage/v1alpha1/bucket.go b/client-go/ironcore/versioned/typed/storage/v1alpha1/bucket.go index 6aca9a786..4d0b87551 100644 --- a/client-go/ironcore/versioned/typed/storage/v1alpha1/bucket.go +++ b/client-go/ironcore/versioned/typed/storage/v1alpha1/bucket.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" storagev1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/storage/v1alpha1" @@ -17,7 +14,7 @@ import ( 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" + gentype "k8s.io/client-go/gentype" ) // BucketsGetter has a method to return a BucketInterface. @@ -30,6 +27,7 @@ type BucketsGetter interface { type BucketInterface interface { Create(ctx context.Context, bucket *v1alpha1.Bucket, opts v1.CreateOptions) (*v1alpha1.Bucket, error) Update(ctx context.Context, bucket *v1alpha1.Bucket, opts v1.UpdateOptions) (*v1alpha1.Bucket, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, bucket *v1alpha1.Bucket, opts v1.UpdateOptions) (*v1alpha1.Bucket, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -38,206 +36,25 @@ type BucketInterface interface { 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.Bucket, err error) Apply(ctx context.Context, bucket *storagev1alpha1.BucketApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Bucket, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, bucket *storagev1alpha1.BucketApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Bucket, err error) BucketExpansion } // buckets implements BucketInterface type buckets struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.Bucket, *v1alpha1.BucketList, *storagev1alpha1.BucketApplyConfiguration] } // newBuckets returns a Buckets func newBuckets(c *StorageV1alpha1Client, namespace string) *buckets { return &buckets{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.Bucket, *v1alpha1.BucketList, *storagev1alpha1.BucketApplyConfiguration]( + "buckets", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.Bucket { return &v1alpha1.Bucket{} }, + func() *v1alpha1.BucketList { return &v1alpha1.BucketList{} }), } } - -// Get takes name of the bucket, and returns the corresponding bucket object, and an error if there is any. -func (c *buckets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Bucket, err error) { - result = &v1alpha1.Bucket{} - err = c.client.Get(). - Namespace(c.ns). - Resource("buckets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Buckets that match those selectors. -func (c *buckets) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BucketList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.BucketList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("buckets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested buckets. -func (c *buckets) 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("buckets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a bucket and creates it. Returns the server's representation of the bucket, and an error, if there is any. -func (c *buckets) Create(ctx context.Context, bucket *v1alpha1.Bucket, opts v1.CreateOptions) (result *v1alpha1.Bucket, err error) { - result = &v1alpha1.Bucket{} - err = c.client.Post(). - Namespace(c.ns). - Resource("buckets"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(bucket). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a bucket and updates it. Returns the server's representation of the bucket, and an error, if there is any. -func (c *buckets) Update(ctx context.Context, bucket *v1alpha1.Bucket, opts v1.UpdateOptions) (result *v1alpha1.Bucket, err error) { - result = &v1alpha1.Bucket{} - err = c.client.Put(). - Namespace(c.ns). - Resource("buckets"). - Name(bucket.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(bucket). - 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 *buckets) UpdateStatus(ctx context.Context, bucket *v1alpha1.Bucket, opts v1.UpdateOptions) (result *v1alpha1.Bucket, err error) { - result = &v1alpha1.Bucket{} - err = c.client.Put(). - Namespace(c.ns). - Resource("buckets"). - Name(bucket.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(bucket). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the bucket and deletes it. Returns an error if one occurs. -func (c *buckets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("buckets"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *buckets) 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("buckets"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched bucket. -func (c *buckets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Bucket, err error) { - result = &v1alpha1.Bucket{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("buckets"). - 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 bucket. -func (c *buckets) Apply(ctx context.Context, bucket *storagev1alpha1.BucketApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Bucket, err error) { - if bucket == nil { - return nil, fmt.Errorf("bucket provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(bucket) - if err != nil { - return nil, err - } - name := bucket.Name - if name == nil { - return nil, fmt.Errorf("bucket.Name must be provided to Apply") - } - result = &v1alpha1.Bucket{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("buckets"). - 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 *buckets) ApplyStatus(ctx context.Context, bucket *storagev1alpha1.BucketApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Bucket, err error) { - if bucket == nil { - return nil, fmt.Errorf("bucket provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(bucket) - if err != nil { - return nil, err - } - - name := bucket.Name - if name == nil { - return nil, fmt.Errorf("bucket.Name must be provided to Apply") - } - - result = &v1alpha1.Bucket{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("buckets"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcore/versioned/typed/storage/v1alpha1/bucketclass.go b/client-go/ironcore/versioned/typed/storage/v1alpha1/bucketclass.go index 605206c5a..5474a220f 100644 --- a/client-go/ironcore/versioned/typed/storage/v1alpha1/bucketclass.go +++ b/client-go/ironcore/versioned/typed/storage/v1alpha1/bucketclass.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" storagev1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/storage/v1alpha1" @@ -17,7 +14,7 @@ import ( 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" + gentype "k8s.io/client-go/gentype" ) // BucketClassesGetter has a method to return a BucketClassInterface. @@ -42,143 +39,18 @@ type BucketClassInterface interface { // bucketClasses implements BucketClassInterface type bucketClasses struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.BucketClass, *v1alpha1.BucketClassList, *storagev1alpha1.BucketClassApplyConfiguration] } // newBucketClasses returns a BucketClasses func newBucketClasses(c *StorageV1alpha1Client) *bucketClasses { return &bucketClasses{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.BucketClass, *v1alpha1.BucketClassList, *storagev1alpha1.BucketClassApplyConfiguration]( + "bucketclasses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.BucketClass { return &v1alpha1.BucketClass{} }, + func() *v1alpha1.BucketClassList { return &v1alpha1.BucketClassList{} }), } } - -// Get takes name of the bucketClass, and returns the corresponding bucketClass object, and an error if there is any. -func (c *bucketClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BucketClass, err error) { - result = &v1alpha1.BucketClass{} - err = c.client.Get(). - Resource("bucketclasses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of BucketClasses that match those selectors. -func (c *bucketClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BucketClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.BucketClassList{} - err = c.client.Get(). - Resource("bucketclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested bucketClasses. -func (c *bucketClasses) 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("bucketclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a bucketClass and creates it. Returns the server's representation of the bucketClass, and an error, if there is any. -func (c *bucketClasses) Create(ctx context.Context, bucketClass *v1alpha1.BucketClass, opts v1.CreateOptions) (result *v1alpha1.BucketClass, err error) { - result = &v1alpha1.BucketClass{} - err = c.client.Post(). - Resource("bucketclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(bucketClass). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a bucketClass and updates it. Returns the server's representation of the bucketClass, and an error, if there is any. -func (c *bucketClasses) Update(ctx context.Context, bucketClass *v1alpha1.BucketClass, opts v1.UpdateOptions) (result *v1alpha1.BucketClass, err error) { - result = &v1alpha1.BucketClass{} - err = c.client.Put(). - Resource("bucketclasses"). - Name(bucketClass.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(bucketClass). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the bucketClass and deletes it. Returns an error if one occurs. -func (c *bucketClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("bucketclasses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *bucketClasses) 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("bucketclasses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched bucketClass. -func (c *bucketClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BucketClass, err error) { - result = &v1alpha1.BucketClass{} - err = c.client.Patch(pt). - Resource("bucketclasses"). - 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 bucketClass. -func (c *bucketClasses) Apply(ctx context.Context, bucketClass *storagev1alpha1.BucketClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.BucketClass, err error) { - if bucketClass == nil { - return nil, fmt.Errorf("bucketClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(bucketClass) - if err != nil { - return nil, err - } - name := bucketClass.Name - if name == nil { - return nil, fmt.Errorf("bucketClass.Name must be provided to Apply") - } - result = &v1alpha1.BucketClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("bucketclasses"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcore/versioned/typed/storage/v1alpha1/bucketpool.go b/client-go/ironcore/versioned/typed/storage/v1alpha1/bucketpool.go index 4fdb32be1..f967d4f81 100644 --- a/client-go/ironcore/versioned/typed/storage/v1alpha1/bucketpool.go +++ b/client-go/ironcore/versioned/typed/storage/v1alpha1/bucketpool.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" storagev1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/storage/v1alpha1" @@ -17,7 +14,7 @@ import ( 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" + gentype "k8s.io/client-go/gentype" ) // BucketPoolsGetter has a method to return a BucketPoolInterface. @@ -30,6 +27,7 @@ type BucketPoolsGetter interface { type BucketPoolInterface interface { Create(ctx context.Context, bucketPool *v1alpha1.BucketPool, opts v1.CreateOptions) (*v1alpha1.BucketPool, error) Update(ctx context.Context, bucketPool *v1alpha1.BucketPool, opts v1.UpdateOptions) (*v1alpha1.BucketPool, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, bucketPool *v1alpha1.BucketPool, opts v1.UpdateOptions) (*v1alpha1.BucketPool, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -38,193 +36,25 @@ type BucketPoolInterface interface { 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.BucketPool, err error) Apply(ctx context.Context, bucketPool *storagev1alpha1.BucketPoolApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.BucketPool, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, bucketPool *storagev1alpha1.BucketPoolApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.BucketPool, err error) BucketPoolExpansion } // bucketPools implements BucketPoolInterface type bucketPools struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.BucketPool, *v1alpha1.BucketPoolList, *storagev1alpha1.BucketPoolApplyConfiguration] } // newBucketPools returns a BucketPools func newBucketPools(c *StorageV1alpha1Client) *bucketPools { return &bucketPools{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.BucketPool, *v1alpha1.BucketPoolList, *storagev1alpha1.BucketPoolApplyConfiguration]( + "bucketpools", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.BucketPool { return &v1alpha1.BucketPool{} }, + func() *v1alpha1.BucketPoolList { return &v1alpha1.BucketPoolList{} }), } } - -// Get takes name of the bucketPool, and returns the corresponding bucketPool object, and an error if there is any. -func (c *bucketPools) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BucketPool, err error) { - result = &v1alpha1.BucketPool{} - err = c.client.Get(). - Resource("bucketpools"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of BucketPools that match those selectors. -func (c *bucketPools) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BucketPoolList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.BucketPoolList{} - err = c.client.Get(). - Resource("bucketpools"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested bucketPools. -func (c *bucketPools) 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("bucketpools"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a bucketPool and creates it. Returns the server's representation of the bucketPool, and an error, if there is any. -func (c *bucketPools) Create(ctx context.Context, bucketPool *v1alpha1.BucketPool, opts v1.CreateOptions) (result *v1alpha1.BucketPool, err error) { - result = &v1alpha1.BucketPool{} - err = c.client.Post(). - Resource("bucketpools"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(bucketPool). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a bucketPool and updates it. Returns the server's representation of the bucketPool, and an error, if there is any. -func (c *bucketPools) Update(ctx context.Context, bucketPool *v1alpha1.BucketPool, opts v1.UpdateOptions) (result *v1alpha1.BucketPool, err error) { - result = &v1alpha1.BucketPool{} - err = c.client.Put(). - Resource("bucketpools"). - Name(bucketPool.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(bucketPool). - 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 *bucketPools) UpdateStatus(ctx context.Context, bucketPool *v1alpha1.BucketPool, opts v1.UpdateOptions) (result *v1alpha1.BucketPool, err error) { - result = &v1alpha1.BucketPool{} - err = c.client.Put(). - Resource("bucketpools"). - Name(bucketPool.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(bucketPool). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the bucketPool and deletes it. Returns an error if one occurs. -func (c *bucketPools) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("bucketpools"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *bucketPools) 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("bucketpools"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched bucketPool. -func (c *bucketPools) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BucketPool, err error) { - result = &v1alpha1.BucketPool{} - err = c.client.Patch(pt). - Resource("bucketpools"). - 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 bucketPool. -func (c *bucketPools) Apply(ctx context.Context, bucketPool *storagev1alpha1.BucketPoolApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.BucketPool, err error) { - if bucketPool == nil { - return nil, fmt.Errorf("bucketPool provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(bucketPool) - if err != nil { - return nil, err - } - name := bucketPool.Name - if name == nil { - return nil, fmt.Errorf("bucketPool.Name must be provided to Apply") - } - result = &v1alpha1.BucketPool{} - err = c.client.Patch(types.ApplyPatchType). - Resource("bucketpools"). - 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 *bucketPools) ApplyStatus(ctx context.Context, bucketPool *storagev1alpha1.BucketPoolApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.BucketPool, err error) { - if bucketPool == nil { - return nil, fmt.Errorf("bucketPool provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(bucketPool) - if err != nil { - return nil, err - } - - name := bucketPool.Name - if name == nil { - return nil, fmt.Errorf("bucketPool.Name must be provided to Apply") - } - - result = &v1alpha1.BucketPool{} - err = c.client.Patch(types.ApplyPatchType). - Resource("bucketpools"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_bucket.go b/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_bucket.go index c8ac72325..c88f072cd 100644 --- a/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_bucket.go +++ b/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_bucket.go @@ -31,22 +31,24 @@ var bucketsKind = v1alpha1.SchemeGroupVersion.WithKind("Bucket") // Get takes name of the bucket, and returns the corresponding bucket object, and an error if there is any. func (c *FakeBuckets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Bucket, err error) { + emptyResult := &v1alpha1.Bucket{} obj, err := c.Fake. - Invokes(testing.NewGetAction(bucketsResource, c.ns, name), &v1alpha1.Bucket{}) + Invokes(testing.NewGetActionWithOptions(bucketsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Bucket), err } // List takes label and field selectors, and returns the list of Buckets that match those selectors. func (c *FakeBuckets) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BucketList, err error) { + emptyResult := &v1alpha1.BucketList{} obj, err := c.Fake. - Invokes(testing.NewListAction(bucketsResource, bucketsKind, c.ns, opts), &v1alpha1.BucketList{}) + Invokes(testing.NewListActionWithOptions(bucketsResource, bucketsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -65,40 +67,43 @@ func (c *FakeBuckets) List(ctx context.Context, opts v1.ListOptions) (result *v1 // Watch returns a watch.Interface that watches the requested buckets. func (c *FakeBuckets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(bucketsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(bucketsResource, c.ns, opts)) } // Create takes the representation of a bucket and creates it. Returns the server's representation of the bucket, and an error, if there is any. func (c *FakeBuckets) Create(ctx context.Context, bucket *v1alpha1.Bucket, opts v1.CreateOptions) (result *v1alpha1.Bucket, err error) { + emptyResult := &v1alpha1.Bucket{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(bucketsResource, c.ns, bucket), &v1alpha1.Bucket{}) + Invokes(testing.NewCreateActionWithOptions(bucketsResource, c.ns, bucket, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Bucket), err } // Update takes the representation of a bucket and updates it. Returns the server's representation of the bucket, and an error, if there is any. func (c *FakeBuckets) Update(ctx context.Context, bucket *v1alpha1.Bucket, opts v1.UpdateOptions) (result *v1alpha1.Bucket, err error) { + emptyResult := &v1alpha1.Bucket{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(bucketsResource, c.ns, bucket), &v1alpha1.Bucket{}) + Invokes(testing.NewUpdateActionWithOptions(bucketsResource, c.ns, bucket, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Bucket), 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 *FakeBuckets) UpdateStatus(ctx context.Context, bucket *v1alpha1.Bucket, opts v1.UpdateOptions) (*v1alpha1.Bucket, error) { +func (c *FakeBuckets) UpdateStatus(ctx context.Context, bucket *v1alpha1.Bucket, opts v1.UpdateOptions) (result *v1alpha1.Bucket, err error) { + emptyResult := &v1alpha1.Bucket{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(bucketsResource, "status", c.ns, bucket), &v1alpha1.Bucket{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(bucketsResource, "status", c.ns, bucket, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Bucket), err } @@ -113,7 +118,7 @@ func (c *FakeBuckets) Delete(ctx context.Context, name string, opts v1.DeleteOpt // DeleteCollection deletes a collection of objects. func (c *FakeBuckets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(bucketsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(bucketsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.BucketList{}) return err @@ -121,11 +126,12 @@ func (c *FakeBuckets) DeleteCollection(ctx context.Context, opts v1.DeleteOption // Patch applies the patch and returns the patched bucket. func (c *FakeBuckets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Bucket, err error) { + emptyResult := &v1alpha1.Bucket{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(bucketsResource, c.ns, name, pt, data, subresources...), &v1alpha1.Bucket{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(bucketsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Bucket), err } @@ -143,11 +149,12 @@ func (c *FakeBuckets) Apply(ctx context.Context, bucket *storagev1alpha1.BucketA if name == nil { return nil, fmt.Errorf("bucket.Name must be provided to Apply") } + emptyResult := &v1alpha1.Bucket{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(bucketsResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.Bucket{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(bucketsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Bucket), err } @@ -166,11 +173,12 @@ func (c *FakeBuckets) ApplyStatus(ctx context.Context, bucket *storagev1alpha1.B if name == nil { return nil, fmt.Errorf("bucket.Name must be provided to Apply") } + emptyResult := &v1alpha1.Bucket{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(bucketsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.Bucket{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(bucketsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Bucket), err } diff --git a/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_bucketclass.go b/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_bucketclass.go index d16b63566..f8feb05fb 100644 --- a/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_bucketclass.go +++ b/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_bucketclass.go @@ -30,20 +30,22 @@ var bucketclassesKind = v1alpha1.SchemeGroupVersion.WithKind("BucketClass") // Get takes name of the bucketClass, and returns the corresponding bucketClass object, and an error if there is any. func (c *FakeBucketClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BucketClass, err error) { + emptyResult := &v1alpha1.BucketClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(bucketclassesResource, name), &v1alpha1.BucketClass{}) + Invokes(testing.NewRootGetActionWithOptions(bucketclassesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.BucketClass), err } // List takes label and field selectors, and returns the list of BucketClasses that match those selectors. func (c *FakeBucketClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BucketClassList, err error) { + emptyResult := &v1alpha1.BucketClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(bucketclassesResource, bucketclassesKind, opts), &v1alpha1.BucketClassList{}) + Invokes(testing.NewRootListActionWithOptions(bucketclassesResource, bucketclassesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -62,25 +64,27 @@ func (c *FakeBucketClasses) List(ctx context.Context, opts v1.ListOptions) (resu // Watch returns a watch.Interface that watches the requested bucketClasses. func (c *FakeBucketClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(bucketclassesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(bucketclassesResource, opts)) } // Create takes the representation of a bucketClass and creates it. Returns the server's representation of the bucketClass, and an error, if there is any. func (c *FakeBucketClasses) Create(ctx context.Context, bucketClass *v1alpha1.BucketClass, opts v1.CreateOptions) (result *v1alpha1.BucketClass, err error) { + emptyResult := &v1alpha1.BucketClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(bucketclassesResource, bucketClass), &v1alpha1.BucketClass{}) + Invokes(testing.NewRootCreateActionWithOptions(bucketclassesResource, bucketClass, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.BucketClass), err } // Update takes the representation of a bucketClass and updates it. Returns the server's representation of the bucketClass, and an error, if there is any. func (c *FakeBucketClasses) Update(ctx context.Context, bucketClass *v1alpha1.BucketClass, opts v1.UpdateOptions) (result *v1alpha1.BucketClass, err error) { + emptyResult := &v1alpha1.BucketClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(bucketclassesResource, bucketClass), &v1alpha1.BucketClass{}) + Invokes(testing.NewRootUpdateActionWithOptions(bucketclassesResource, bucketClass, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.BucketClass), err } @@ -94,7 +98,7 @@ func (c *FakeBucketClasses) Delete(ctx context.Context, name string, opts v1.Del // DeleteCollection deletes a collection of objects. func (c *FakeBucketClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(bucketclassesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(bucketclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.BucketClassList{}) return err @@ -102,10 +106,11 @@ func (c *FakeBucketClasses) DeleteCollection(ctx context.Context, opts v1.Delete // Patch applies the patch and returns the patched bucketClass. func (c *FakeBucketClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BucketClass, err error) { + emptyResult := &v1alpha1.BucketClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(bucketclassesResource, name, pt, data, subresources...), &v1alpha1.BucketClass{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(bucketclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.BucketClass), err } @@ -123,10 +128,11 @@ func (c *FakeBucketClasses) Apply(ctx context.Context, bucketClass *storagev1alp if name == nil { return nil, fmt.Errorf("bucketClass.Name must be provided to Apply") } + emptyResult := &v1alpha1.BucketClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(bucketclassesResource, *name, types.ApplyPatchType, data), &v1alpha1.BucketClass{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(bucketclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.BucketClass), err } diff --git a/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_bucketpool.go b/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_bucketpool.go index 90a84887b..ade4f2b4a 100644 --- a/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_bucketpool.go +++ b/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_bucketpool.go @@ -30,20 +30,22 @@ var bucketpoolsKind = v1alpha1.SchemeGroupVersion.WithKind("BucketPool") // Get takes name of the bucketPool, and returns the corresponding bucketPool object, and an error if there is any. func (c *FakeBucketPools) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BucketPool, err error) { + emptyResult := &v1alpha1.BucketPool{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(bucketpoolsResource, name), &v1alpha1.BucketPool{}) + Invokes(testing.NewRootGetActionWithOptions(bucketpoolsResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.BucketPool), err } // List takes label and field selectors, and returns the list of BucketPools that match those selectors. func (c *FakeBucketPools) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BucketPoolList, err error) { + emptyResult := &v1alpha1.BucketPoolList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(bucketpoolsResource, bucketpoolsKind, opts), &v1alpha1.BucketPoolList{}) + Invokes(testing.NewRootListActionWithOptions(bucketpoolsResource, bucketpoolsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -62,36 +64,39 @@ func (c *FakeBucketPools) List(ctx context.Context, opts v1.ListOptions) (result // Watch returns a watch.Interface that watches the requested bucketPools. func (c *FakeBucketPools) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(bucketpoolsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(bucketpoolsResource, opts)) } // Create takes the representation of a bucketPool and creates it. Returns the server's representation of the bucketPool, and an error, if there is any. func (c *FakeBucketPools) Create(ctx context.Context, bucketPool *v1alpha1.BucketPool, opts v1.CreateOptions) (result *v1alpha1.BucketPool, err error) { + emptyResult := &v1alpha1.BucketPool{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(bucketpoolsResource, bucketPool), &v1alpha1.BucketPool{}) + Invokes(testing.NewRootCreateActionWithOptions(bucketpoolsResource, bucketPool, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.BucketPool), err } // Update takes the representation of a bucketPool and updates it. Returns the server's representation of the bucketPool, and an error, if there is any. func (c *FakeBucketPools) Update(ctx context.Context, bucketPool *v1alpha1.BucketPool, opts v1.UpdateOptions) (result *v1alpha1.BucketPool, err error) { + emptyResult := &v1alpha1.BucketPool{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(bucketpoolsResource, bucketPool), &v1alpha1.BucketPool{}) + Invokes(testing.NewRootUpdateActionWithOptions(bucketpoolsResource, bucketPool, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.BucketPool), 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 *FakeBucketPools) UpdateStatus(ctx context.Context, bucketPool *v1alpha1.BucketPool, opts v1.UpdateOptions) (*v1alpha1.BucketPool, error) { +func (c *FakeBucketPools) UpdateStatus(ctx context.Context, bucketPool *v1alpha1.BucketPool, opts v1.UpdateOptions) (result *v1alpha1.BucketPool, err error) { + emptyResult := &v1alpha1.BucketPool{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(bucketpoolsResource, "status", bucketPool), &v1alpha1.BucketPool{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(bucketpoolsResource, "status", bucketPool, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.BucketPool), err } @@ -105,7 +110,7 @@ func (c *FakeBucketPools) Delete(ctx context.Context, name string, opts v1.Delet // DeleteCollection deletes a collection of objects. func (c *FakeBucketPools) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(bucketpoolsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(bucketpoolsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.BucketPoolList{}) return err @@ -113,10 +118,11 @@ func (c *FakeBucketPools) DeleteCollection(ctx context.Context, opts v1.DeleteOp // Patch applies the patch and returns the patched bucketPool. func (c *FakeBucketPools) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BucketPool, err error) { + emptyResult := &v1alpha1.BucketPool{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(bucketpoolsResource, name, pt, data, subresources...), &v1alpha1.BucketPool{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(bucketpoolsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.BucketPool), err } @@ -134,10 +140,11 @@ func (c *FakeBucketPools) Apply(ctx context.Context, bucketPool *storagev1alpha1 if name == nil { return nil, fmt.Errorf("bucketPool.Name must be provided to Apply") } + emptyResult := &v1alpha1.BucketPool{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(bucketpoolsResource, *name, types.ApplyPatchType, data), &v1alpha1.BucketPool{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(bucketpoolsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.BucketPool), err } @@ -156,10 +163,11 @@ func (c *FakeBucketPools) ApplyStatus(ctx context.Context, bucketPool *storagev1 if name == nil { return nil, fmt.Errorf("bucketPool.Name must be provided to Apply") } + emptyResult := &v1alpha1.BucketPool{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(bucketpoolsResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.BucketPool{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(bucketpoolsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.BucketPool), err } diff --git a/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_volume.go b/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_volume.go index 42720244f..9e3f54ca8 100644 --- a/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_volume.go +++ b/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_volume.go @@ -31,22 +31,24 @@ var volumesKind = v1alpha1.SchemeGroupVersion.WithKind("Volume") // Get takes name of the volume, and returns the corresponding volume object, and an error if there is any. func (c *FakeVolumes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Volume, err error) { + emptyResult := &v1alpha1.Volume{} obj, err := c.Fake. - Invokes(testing.NewGetAction(volumesResource, c.ns, name), &v1alpha1.Volume{}) + Invokes(testing.NewGetActionWithOptions(volumesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Volume), err } // List takes label and field selectors, and returns the list of Volumes that match those selectors. func (c *FakeVolumes) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeList, err error) { + emptyResult := &v1alpha1.VolumeList{} obj, err := c.Fake. - Invokes(testing.NewListAction(volumesResource, volumesKind, c.ns, opts), &v1alpha1.VolumeList{}) + Invokes(testing.NewListActionWithOptions(volumesResource, volumesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -65,40 +67,43 @@ func (c *FakeVolumes) List(ctx context.Context, opts v1.ListOptions) (result *v1 // Watch returns a watch.Interface that watches the requested volumes. func (c *FakeVolumes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(volumesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(volumesResource, c.ns, opts)) } // Create takes the representation of a volume and creates it. Returns the server's representation of the volume, and an error, if there is any. func (c *FakeVolumes) Create(ctx context.Context, volume *v1alpha1.Volume, opts v1.CreateOptions) (result *v1alpha1.Volume, err error) { + emptyResult := &v1alpha1.Volume{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(volumesResource, c.ns, volume), &v1alpha1.Volume{}) + Invokes(testing.NewCreateActionWithOptions(volumesResource, c.ns, volume, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Volume), err } // Update takes the representation of a volume and updates it. Returns the server's representation of the volume, and an error, if there is any. func (c *FakeVolumes) Update(ctx context.Context, volume *v1alpha1.Volume, opts v1.UpdateOptions) (result *v1alpha1.Volume, err error) { + emptyResult := &v1alpha1.Volume{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(volumesResource, c.ns, volume), &v1alpha1.Volume{}) + Invokes(testing.NewUpdateActionWithOptions(volumesResource, c.ns, volume, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Volume), 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 *FakeVolumes) UpdateStatus(ctx context.Context, volume *v1alpha1.Volume, opts v1.UpdateOptions) (*v1alpha1.Volume, error) { +func (c *FakeVolumes) UpdateStatus(ctx context.Context, volume *v1alpha1.Volume, opts v1.UpdateOptions) (result *v1alpha1.Volume, err error) { + emptyResult := &v1alpha1.Volume{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(volumesResource, "status", c.ns, volume), &v1alpha1.Volume{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(volumesResource, "status", c.ns, volume, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Volume), err } @@ -113,7 +118,7 @@ func (c *FakeVolumes) Delete(ctx context.Context, name string, opts v1.DeleteOpt // DeleteCollection deletes a collection of objects. func (c *FakeVolumes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(volumesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(volumesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.VolumeList{}) return err @@ -121,11 +126,12 @@ func (c *FakeVolumes) DeleteCollection(ctx context.Context, opts v1.DeleteOption // Patch applies the patch and returns the patched volume. func (c *FakeVolumes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Volume, err error) { + emptyResult := &v1alpha1.Volume{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(volumesResource, c.ns, name, pt, data, subresources...), &v1alpha1.Volume{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(volumesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Volume), err } @@ -143,11 +149,12 @@ func (c *FakeVolumes) Apply(ctx context.Context, volume *storagev1alpha1.VolumeA if name == nil { return nil, fmt.Errorf("volume.Name must be provided to Apply") } + emptyResult := &v1alpha1.Volume{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(volumesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.Volume{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(volumesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Volume), err } @@ -166,11 +173,12 @@ func (c *FakeVolumes) ApplyStatus(ctx context.Context, volume *storagev1alpha1.V if name == nil { return nil, fmt.Errorf("volume.Name must be provided to Apply") } + emptyResult := &v1alpha1.Volume{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(volumesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.Volume{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(volumesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Volume), err } diff --git a/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_volumeclass.go b/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_volumeclass.go index c3210dd15..b9cb27b6f 100644 --- a/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_volumeclass.go +++ b/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_volumeclass.go @@ -30,20 +30,22 @@ var volumeclassesKind = v1alpha1.SchemeGroupVersion.WithKind("VolumeClass") // Get takes name of the volumeClass, and returns the corresponding volumeClass object, and an error if there is any. func (c *FakeVolumeClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeClass, err error) { + emptyResult := &v1alpha1.VolumeClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(volumeclassesResource, name), &v1alpha1.VolumeClass{}) + Invokes(testing.NewRootGetActionWithOptions(volumeclassesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumeClass), err } // List takes label and field selectors, and returns the list of VolumeClasses that match those selectors. func (c *FakeVolumeClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeClassList, err error) { + emptyResult := &v1alpha1.VolumeClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(volumeclassesResource, volumeclassesKind, opts), &v1alpha1.VolumeClassList{}) + Invokes(testing.NewRootListActionWithOptions(volumeclassesResource, volumeclassesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -62,25 +64,27 @@ func (c *FakeVolumeClasses) List(ctx context.Context, opts v1.ListOptions) (resu // Watch returns a watch.Interface that watches the requested volumeClasses. func (c *FakeVolumeClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(volumeclassesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(volumeclassesResource, opts)) } // Create takes the representation of a volumeClass and creates it. Returns the server's representation of the volumeClass, and an error, if there is any. func (c *FakeVolumeClasses) Create(ctx context.Context, volumeClass *v1alpha1.VolumeClass, opts v1.CreateOptions) (result *v1alpha1.VolumeClass, err error) { + emptyResult := &v1alpha1.VolumeClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(volumeclassesResource, volumeClass), &v1alpha1.VolumeClass{}) + Invokes(testing.NewRootCreateActionWithOptions(volumeclassesResource, volumeClass, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumeClass), err } // Update takes the representation of a volumeClass and updates it. Returns the server's representation of the volumeClass, and an error, if there is any. func (c *FakeVolumeClasses) Update(ctx context.Context, volumeClass *v1alpha1.VolumeClass, opts v1.UpdateOptions) (result *v1alpha1.VolumeClass, err error) { + emptyResult := &v1alpha1.VolumeClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(volumeclassesResource, volumeClass), &v1alpha1.VolumeClass{}) + Invokes(testing.NewRootUpdateActionWithOptions(volumeclassesResource, volumeClass, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumeClass), err } @@ -94,7 +98,7 @@ func (c *FakeVolumeClasses) Delete(ctx context.Context, name string, opts v1.Del // DeleteCollection deletes a collection of objects. func (c *FakeVolumeClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(volumeclassesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(volumeclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.VolumeClassList{}) return err @@ -102,10 +106,11 @@ func (c *FakeVolumeClasses) DeleteCollection(ctx context.Context, opts v1.Delete // Patch applies the patch and returns the patched volumeClass. func (c *FakeVolumeClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeClass, err error) { + emptyResult := &v1alpha1.VolumeClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeclassesResource, name, pt, data, subresources...), &v1alpha1.VolumeClass{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumeClass), err } @@ -123,10 +128,11 @@ func (c *FakeVolumeClasses) Apply(ctx context.Context, volumeClass *storagev1alp if name == nil { return nil, fmt.Errorf("volumeClass.Name must be provided to Apply") } + emptyResult := &v1alpha1.VolumeClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeclassesResource, *name, types.ApplyPatchType, data), &v1alpha1.VolumeClass{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumeClass), err } diff --git a/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_volumepool.go b/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_volumepool.go index 72cc004e7..8b0045a37 100644 --- a/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_volumepool.go +++ b/client-go/ironcore/versioned/typed/storage/v1alpha1/fake/fake_volumepool.go @@ -30,20 +30,22 @@ var volumepoolsKind = v1alpha1.SchemeGroupVersion.WithKind("VolumePool") // Get takes name of the volumePool, and returns the corresponding volumePool object, and an error if there is any. func (c *FakeVolumePools) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumePool, err error) { + emptyResult := &v1alpha1.VolumePool{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(volumepoolsResource, name), &v1alpha1.VolumePool{}) + Invokes(testing.NewRootGetActionWithOptions(volumepoolsResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumePool), err } // List takes label and field selectors, and returns the list of VolumePools that match those selectors. func (c *FakeVolumePools) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumePoolList, err error) { + emptyResult := &v1alpha1.VolumePoolList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(volumepoolsResource, volumepoolsKind, opts), &v1alpha1.VolumePoolList{}) + Invokes(testing.NewRootListActionWithOptions(volumepoolsResource, volumepoolsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -62,36 +64,39 @@ func (c *FakeVolumePools) List(ctx context.Context, opts v1.ListOptions) (result // Watch returns a watch.Interface that watches the requested volumePools. func (c *FakeVolumePools) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(volumepoolsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(volumepoolsResource, opts)) } // Create takes the representation of a volumePool and creates it. Returns the server's representation of the volumePool, and an error, if there is any. func (c *FakeVolumePools) Create(ctx context.Context, volumePool *v1alpha1.VolumePool, opts v1.CreateOptions) (result *v1alpha1.VolumePool, err error) { + emptyResult := &v1alpha1.VolumePool{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(volumepoolsResource, volumePool), &v1alpha1.VolumePool{}) + Invokes(testing.NewRootCreateActionWithOptions(volumepoolsResource, volumePool, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumePool), err } // Update takes the representation of a volumePool and updates it. Returns the server's representation of the volumePool, and an error, if there is any. func (c *FakeVolumePools) Update(ctx context.Context, volumePool *v1alpha1.VolumePool, opts v1.UpdateOptions) (result *v1alpha1.VolumePool, err error) { + emptyResult := &v1alpha1.VolumePool{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(volumepoolsResource, volumePool), &v1alpha1.VolumePool{}) + Invokes(testing.NewRootUpdateActionWithOptions(volumepoolsResource, volumePool, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumePool), 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 *FakeVolumePools) UpdateStatus(ctx context.Context, volumePool *v1alpha1.VolumePool, opts v1.UpdateOptions) (*v1alpha1.VolumePool, error) { +func (c *FakeVolumePools) UpdateStatus(ctx context.Context, volumePool *v1alpha1.VolumePool, opts v1.UpdateOptions) (result *v1alpha1.VolumePool, err error) { + emptyResult := &v1alpha1.VolumePool{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(volumepoolsResource, "status", volumePool), &v1alpha1.VolumePool{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(volumepoolsResource, "status", volumePool, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumePool), err } @@ -105,7 +110,7 @@ func (c *FakeVolumePools) Delete(ctx context.Context, name string, opts v1.Delet // DeleteCollection deletes a collection of objects. func (c *FakeVolumePools) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(volumepoolsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(volumepoolsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.VolumePoolList{}) return err @@ -113,10 +118,11 @@ func (c *FakeVolumePools) DeleteCollection(ctx context.Context, opts v1.DeleteOp // Patch applies the patch and returns the patched volumePool. func (c *FakeVolumePools) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumePool, err error) { + emptyResult := &v1alpha1.VolumePool{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumepoolsResource, name, pt, data, subresources...), &v1alpha1.VolumePool{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumepoolsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumePool), err } @@ -134,10 +140,11 @@ func (c *FakeVolumePools) Apply(ctx context.Context, volumePool *storagev1alpha1 if name == nil { return nil, fmt.Errorf("volumePool.Name must be provided to Apply") } + emptyResult := &v1alpha1.VolumePool{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumepoolsResource, *name, types.ApplyPatchType, data), &v1alpha1.VolumePool{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumepoolsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumePool), err } @@ -156,10 +163,11 @@ func (c *FakeVolumePools) ApplyStatus(ctx context.Context, volumePool *storagev1 if name == nil { return nil, fmt.Errorf("volumePool.Name must be provided to Apply") } + emptyResult := &v1alpha1.VolumePool{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumepoolsResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.VolumePool{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumepoolsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumePool), err } diff --git a/client-go/ironcore/versioned/typed/storage/v1alpha1/volume.go b/client-go/ironcore/versioned/typed/storage/v1alpha1/volume.go index 62be87b7c..ea92aedce 100644 --- a/client-go/ironcore/versioned/typed/storage/v1alpha1/volume.go +++ b/client-go/ironcore/versioned/typed/storage/v1alpha1/volume.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" storagev1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/storage/v1alpha1" @@ -17,7 +14,7 @@ import ( 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" + gentype "k8s.io/client-go/gentype" ) // VolumesGetter has a method to return a VolumeInterface. @@ -30,6 +27,7 @@ type VolumesGetter interface { type VolumeInterface interface { Create(ctx context.Context, volume *v1alpha1.Volume, opts v1.CreateOptions) (*v1alpha1.Volume, error) Update(ctx context.Context, volume *v1alpha1.Volume, opts v1.UpdateOptions) (*v1alpha1.Volume, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, volume *v1alpha1.Volume, opts v1.UpdateOptions) (*v1alpha1.Volume, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -38,206 +36,25 @@ type VolumeInterface interface { 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.Volume, err error) Apply(ctx context.Context, volume *storagev1alpha1.VolumeApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Volume, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, volume *storagev1alpha1.VolumeApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Volume, err error) VolumeExpansion } // volumes implements VolumeInterface type volumes struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.Volume, *v1alpha1.VolumeList, *storagev1alpha1.VolumeApplyConfiguration] } // newVolumes returns a Volumes func newVolumes(c *StorageV1alpha1Client, namespace string) *volumes { return &volumes{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.Volume, *v1alpha1.VolumeList, *storagev1alpha1.VolumeApplyConfiguration]( + "volumes", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.Volume { return &v1alpha1.Volume{} }, + func() *v1alpha1.VolumeList { return &v1alpha1.VolumeList{} }), } } - -// Get takes name of the volume, and returns the corresponding volume object, and an error if there is any. -func (c *volumes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Volume, err error) { - result = &v1alpha1.Volume{} - err = c.client.Get(). - Namespace(c.ns). - Resource("volumes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Volumes that match those selectors. -func (c *volumes) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.VolumeList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("volumes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested volumes. -func (c *volumes) 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("volumes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a volume and creates it. Returns the server's representation of the volume, and an error, if there is any. -func (c *volumes) Create(ctx context.Context, volume *v1alpha1.Volume, opts v1.CreateOptions) (result *v1alpha1.Volume, err error) { - result = &v1alpha1.Volume{} - err = c.client.Post(). - Namespace(c.ns). - Resource("volumes"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volume). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a volume and updates it. Returns the server's representation of the volume, and an error, if there is any. -func (c *volumes) Update(ctx context.Context, volume *v1alpha1.Volume, opts v1.UpdateOptions) (result *v1alpha1.Volume, err error) { - result = &v1alpha1.Volume{} - err = c.client.Put(). - Namespace(c.ns). - Resource("volumes"). - Name(volume.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volume). - 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 *volumes) UpdateStatus(ctx context.Context, volume *v1alpha1.Volume, opts v1.UpdateOptions) (result *v1alpha1.Volume, err error) { - result = &v1alpha1.Volume{} - err = c.client.Put(). - Namespace(c.ns). - Resource("volumes"). - Name(volume.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volume). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the volume and deletes it. Returns an error if one occurs. -func (c *volumes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("volumes"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *volumes) 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("volumes"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched volume. -func (c *volumes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Volume, err error) { - result = &v1alpha1.Volume{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("volumes"). - 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 volume. -func (c *volumes) Apply(ctx context.Context, volume *storagev1alpha1.VolumeApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Volume, err error) { - if volume == nil { - return nil, fmt.Errorf("volume provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(volume) - if err != nil { - return nil, err - } - name := volume.Name - if name == nil { - return nil, fmt.Errorf("volume.Name must be provided to Apply") - } - result = &v1alpha1.Volume{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("volumes"). - 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 *volumes) ApplyStatus(ctx context.Context, volume *storagev1alpha1.VolumeApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Volume, err error) { - if volume == nil { - return nil, fmt.Errorf("volume provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(volume) - if err != nil { - return nil, err - } - - name := volume.Name - if name == nil { - return nil, fmt.Errorf("volume.Name must be provided to Apply") - } - - result = &v1alpha1.Volume{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("volumes"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcore/versioned/typed/storage/v1alpha1/volumeclass.go b/client-go/ironcore/versioned/typed/storage/v1alpha1/volumeclass.go index fc14c8980..e3c83c2d8 100644 --- a/client-go/ironcore/versioned/typed/storage/v1alpha1/volumeclass.go +++ b/client-go/ironcore/versioned/typed/storage/v1alpha1/volumeclass.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" storagev1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/storage/v1alpha1" @@ -17,7 +14,7 @@ import ( 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" + gentype "k8s.io/client-go/gentype" ) // VolumeClassesGetter has a method to return a VolumeClassInterface. @@ -42,143 +39,18 @@ type VolumeClassInterface interface { // volumeClasses implements VolumeClassInterface type volumeClasses struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.VolumeClass, *v1alpha1.VolumeClassList, *storagev1alpha1.VolumeClassApplyConfiguration] } // newVolumeClasses returns a VolumeClasses func newVolumeClasses(c *StorageV1alpha1Client) *volumeClasses { return &volumeClasses{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.VolumeClass, *v1alpha1.VolumeClassList, *storagev1alpha1.VolumeClassApplyConfiguration]( + "volumeclasses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.VolumeClass { return &v1alpha1.VolumeClass{} }, + func() *v1alpha1.VolumeClassList { return &v1alpha1.VolumeClassList{} }), } } - -// Get takes name of the volumeClass, and returns the corresponding volumeClass object, and an error if there is any. -func (c *volumeClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeClass, err error) { - result = &v1alpha1.VolumeClass{} - err = c.client.Get(). - Resource("volumeclasses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VolumeClasses that match those selectors. -func (c *volumeClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.VolumeClassList{} - err = c.client.Get(). - Resource("volumeclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested volumeClasses. -func (c *volumeClasses) 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("volumeclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a volumeClass and creates it. Returns the server's representation of the volumeClass, and an error, if there is any. -func (c *volumeClasses) Create(ctx context.Context, volumeClass *v1alpha1.VolumeClass, opts v1.CreateOptions) (result *v1alpha1.VolumeClass, err error) { - result = &v1alpha1.VolumeClass{} - err = c.client.Post(). - Resource("volumeclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volumeClass). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a volumeClass and updates it. Returns the server's representation of the volumeClass, and an error, if there is any. -func (c *volumeClasses) Update(ctx context.Context, volumeClass *v1alpha1.VolumeClass, opts v1.UpdateOptions) (result *v1alpha1.VolumeClass, err error) { - result = &v1alpha1.VolumeClass{} - err = c.client.Put(). - Resource("volumeclasses"). - Name(volumeClass.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volumeClass). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the volumeClass and deletes it. Returns an error if one occurs. -func (c *volumeClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("volumeclasses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *volumeClasses) 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("volumeclasses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched volumeClass. -func (c *volumeClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeClass, err error) { - result = &v1alpha1.VolumeClass{} - err = c.client.Patch(pt). - Resource("volumeclasses"). - 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 volumeClass. -func (c *volumeClasses) Apply(ctx context.Context, volumeClass *storagev1alpha1.VolumeClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeClass, err error) { - if volumeClass == nil { - return nil, fmt.Errorf("volumeClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(volumeClass) - if err != nil { - return nil, err - } - name := volumeClass.Name - if name == nil { - return nil, fmt.Errorf("volumeClass.Name must be provided to Apply") - } - result = &v1alpha1.VolumeClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("volumeclasses"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcore/versioned/typed/storage/v1alpha1/volumepool.go b/client-go/ironcore/versioned/typed/storage/v1alpha1/volumepool.go index 0273e3127..09d9782e8 100644 --- a/client-go/ironcore/versioned/typed/storage/v1alpha1/volumepool.go +++ b/client-go/ironcore/versioned/typed/storage/v1alpha1/volumepool.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" storagev1alpha1 "github.com/ironcore-dev/ironcore/client-go/applyconfigurations/storage/v1alpha1" @@ -17,7 +14,7 @@ import ( 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" + gentype "k8s.io/client-go/gentype" ) // VolumePoolsGetter has a method to return a VolumePoolInterface. @@ -30,6 +27,7 @@ type VolumePoolsGetter interface { type VolumePoolInterface interface { Create(ctx context.Context, volumePool *v1alpha1.VolumePool, opts v1.CreateOptions) (*v1alpha1.VolumePool, error) Update(ctx context.Context, volumePool *v1alpha1.VolumePool, opts v1.UpdateOptions) (*v1alpha1.VolumePool, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, volumePool *v1alpha1.VolumePool, opts v1.UpdateOptions) (*v1alpha1.VolumePool, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -38,193 +36,25 @@ type VolumePoolInterface interface { 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.VolumePool, err error) Apply(ctx context.Context, volumePool *storagev1alpha1.VolumePoolApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumePool, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, volumePool *storagev1alpha1.VolumePoolApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumePool, err error) VolumePoolExpansion } // volumePools implements VolumePoolInterface type volumePools struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.VolumePool, *v1alpha1.VolumePoolList, *storagev1alpha1.VolumePoolApplyConfiguration] } // newVolumePools returns a VolumePools func newVolumePools(c *StorageV1alpha1Client) *volumePools { return &volumePools{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.VolumePool, *v1alpha1.VolumePoolList, *storagev1alpha1.VolumePoolApplyConfiguration]( + "volumepools", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.VolumePool { return &v1alpha1.VolumePool{} }, + func() *v1alpha1.VolumePoolList { return &v1alpha1.VolumePoolList{} }), } } - -// Get takes name of the volumePool, and returns the corresponding volumePool object, and an error if there is any. -func (c *volumePools) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumePool, err error) { - result = &v1alpha1.VolumePool{} - err = c.client.Get(). - Resource("volumepools"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VolumePools that match those selectors. -func (c *volumePools) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumePoolList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.VolumePoolList{} - err = c.client.Get(). - Resource("volumepools"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested volumePools. -func (c *volumePools) 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("volumepools"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a volumePool and creates it. Returns the server's representation of the volumePool, and an error, if there is any. -func (c *volumePools) Create(ctx context.Context, volumePool *v1alpha1.VolumePool, opts v1.CreateOptions) (result *v1alpha1.VolumePool, err error) { - result = &v1alpha1.VolumePool{} - err = c.client.Post(). - Resource("volumepools"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volumePool). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a volumePool and updates it. Returns the server's representation of the volumePool, and an error, if there is any. -func (c *volumePools) Update(ctx context.Context, volumePool *v1alpha1.VolumePool, opts v1.UpdateOptions) (result *v1alpha1.VolumePool, err error) { - result = &v1alpha1.VolumePool{} - err = c.client.Put(). - Resource("volumepools"). - Name(volumePool.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volumePool). - 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 *volumePools) UpdateStatus(ctx context.Context, volumePool *v1alpha1.VolumePool, opts v1.UpdateOptions) (result *v1alpha1.VolumePool, err error) { - result = &v1alpha1.VolumePool{} - err = c.client.Put(). - Resource("volumepools"). - Name(volumePool.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volumePool). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the volumePool and deletes it. Returns an error if one occurs. -func (c *volumePools) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("volumepools"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *volumePools) 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("volumepools"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched volumePool. -func (c *volumePools) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumePool, err error) { - result = &v1alpha1.VolumePool{} - err = c.client.Patch(pt). - Resource("volumepools"). - 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 volumePool. -func (c *volumePools) Apply(ctx context.Context, volumePool *storagev1alpha1.VolumePoolApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumePool, err error) { - if volumePool == nil { - return nil, fmt.Errorf("volumePool provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(volumePool) - if err != nil { - return nil, err - } - name := volumePool.Name - if name == nil { - return nil, fmt.Errorf("volumePool.Name must be provided to Apply") - } - result = &v1alpha1.VolumePool{} - err = c.client.Patch(types.ApplyPatchType). - Resource("volumepools"). - 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 *volumePools) ApplyStatus(ctx context.Context, volumePool *storagev1alpha1.VolumePoolApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumePool, err error) { - if volumePool == nil { - return nil, fmt.Errorf("volumePool provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(volumePool) - if err != nil { - return nil, err - } - - name := volumePool.Name - if name == nil { - return nil, fmt.Errorf("volumePool.Name must be provided to Apply") - } - - result = &v1alpha1.VolumePool{} - err = c.client.Patch(types.ApplyPatchType). - Resource("volumepools"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/listers/compute/v1alpha1/machine.go b/client-go/listers/compute/v1alpha1/machine.go index d6c2cf924..7c62879e1 100644 --- a/client-go/listers/compute/v1alpha1/machine.go +++ b/client-go/listers/compute/v1alpha1/machine.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/compute/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -25,25 +25,17 @@ type MachineLister interface { // machineLister implements the MachineLister interface. type machineLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.Machine] } // NewMachineLister returns a new MachineLister. func NewMachineLister(indexer cache.Indexer) MachineLister { - return &machineLister{indexer: indexer} -} - -// List lists all Machines in the indexer. -func (s *machineLister) List(selector labels.Selector) (ret []*v1alpha1.Machine, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.Machine)) - }) - return ret, err + return &machineLister{listers.New[*v1alpha1.Machine](indexer, v1alpha1.Resource("machine"))} } // Machines returns an object that can list and get Machines. func (s *machineLister) Machines(namespace string) MachineNamespaceLister { - return machineNamespaceLister{indexer: s.indexer, namespace: namespace} + return machineNamespaceLister{listers.NewNamespaced[*v1alpha1.Machine](s.ResourceIndexer, namespace)} } // MachineNamespaceLister helps list and get Machines. @@ -61,26 +53,5 @@ type MachineNamespaceLister interface { // machineNamespaceLister implements the MachineNamespaceLister // interface. type machineNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Machines in the indexer for a given namespace. -func (s machineNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Machine, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.Machine)) - }) - return ret, err -} - -// Get retrieves the Machine from the indexer for a given namespace and name. -func (s machineNamespaceLister) Get(name string) (*v1alpha1.Machine, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("machine"), name) - } - return obj.(*v1alpha1.Machine), nil + listers.ResourceIndexer[*v1alpha1.Machine] } diff --git a/client-go/listers/compute/v1alpha1/machineclass.go b/client-go/listers/compute/v1alpha1/machineclass.go index 04773cb86..d761f247b 100644 --- a/client-go/listers/compute/v1alpha1/machineclass.go +++ b/client-go/listers/compute/v1alpha1/machineclass.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/compute/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -26,30 +26,10 @@ type MachineClassLister interface { // machineClassLister implements the MachineClassLister interface. type machineClassLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.MachineClass] } // NewMachineClassLister returns a new MachineClassLister. func NewMachineClassLister(indexer cache.Indexer) MachineClassLister { - return &machineClassLister{indexer: indexer} -} - -// List lists all MachineClasses in the indexer. -func (s *machineClassLister) List(selector labels.Selector) (ret []*v1alpha1.MachineClass, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.MachineClass)) - }) - return ret, err -} - -// Get retrieves the MachineClass from the index for a given name. -func (s *machineClassLister) Get(name string) (*v1alpha1.MachineClass, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("machineclass"), name) - } - return obj.(*v1alpha1.MachineClass), nil + return &machineClassLister{listers.New[*v1alpha1.MachineClass](indexer, v1alpha1.Resource("machineclass"))} } diff --git a/client-go/listers/compute/v1alpha1/machinepool.go b/client-go/listers/compute/v1alpha1/machinepool.go index 3c6c3fea6..52f087703 100644 --- a/client-go/listers/compute/v1alpha1/machinepool.go +++ b/client-go/listers/compute/v1alpha1/machinepool.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/compute/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -26,30 +26,10 @@ type MachinePoolLister interface { // machinePoolLister implements the MachinePoolLister interface. type machinePoolLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.MachinePool] } // NewMachinePoolLister returns a new MachinePoolLister. func NewMachinePoolLister(indexer cache.Indexer) MachinePoolLister { - return &machinePoolLister{indexer: indexer} -} - -// List lists all MachinePools in the indexer. -func (s *machinePoolLister) List(selector labels.Selector) (ret []*v1alpha1.MachinePool, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.MachinePool)) - }) - return ret, err -} - -// Get retrieves the MachinePool from the index for a given name. -func (s *machinePoolLister) Get(name string) (*v1alpha1.MachinePool, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("machinepool"), name) - } - return obj.(*v1alpha1.MachinePool), nil + return &machinePoolLister{listers.New[*v1alpha1.MachinePool](indexer, v1alpha1.Resource("machinepool"))} } diff --git a/client-go/listers/core/v1alpha1/resourcequota.go b/client-go/listers/core/v1alpha1/resourcequota.go index 61886b98b..711acf923 100644 --- a/client-go/listers/core/v1alpha1/resourcequota.go +++ b/client-go/listers/core/v1alpha1/resourcequota.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/core/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -25,25 +25,17 @@ type ResourceQuotaLister interface { // resourceQuotaLister implements the ResourceQuotaLister interface. type resourceQuotaLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.ResourceQuota] } // NewResourceQuotaLister returns a new ResourceQuotaLister. func NewResourceQuotaLister(indexer cache.Indexer) ResourceQuotaLister { - return &resourceQuotaLister{indexer: indexer} -} - -// List lists all ResourceQuotas in the indexer. -func (s *resourceQuotaLister) List(selector labels.Selector) (ret []*v1alpha1.ResourceQuota, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.ResourceQuota)) - }) - return ret, err + return &resourceQuotaLister{listers.New[*v1alpha1.ResourceQuota](indexer, v1alpha1.Resource("resourcequota"))} } // ResourceQuotas returns an object that can list and get ResourceQuotas. func (s *resourceQuotaLister) ResourceQuotas(namespace string) ResourceQuotaNamespaceLister { - return resourceQuotaNamespaceLister{indexer: s.indexer, namespace: namespace} + return resourceQuotaNamespaceLister{listers.NewNamespaced[*v1alpha1.ResourceQuota](s.ResourceIndexer, namespace)} } // ResourceQuotaNamespaceLister helps list and get ResourceQuotas. @@ -61,26 +53,5 @@ type ResourceQuotaNamespaceLister interface { // resourceQuotaNamespaceLister implements the ResourceQuotaNamespaceLister // interface. type resourceQuotaNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ResourceQuotas in the indexer for a given namespace. -func (s resourceQuotaNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ResourceQuota, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.ResourceQuota)) - }) - return ret, err -} - -// Get retrieves the ResourceQuota from the indexer for a given namespace and name. -func (s resourceQuotaNamespaceLister) Get(name string) (*v1alpha1.ResourceQuota, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("resourcequota"), name) - } - return obj.(*v1alpha1.ResourceQuota), nil + listers.ResourceIndexer[*v1alpha1.ResourceQuota] } diff --git a/client-go/listers/ipam/v1alpha1/prefix.go b/client-go/listers/ipam/v1alpha1/prefix.go index 6988dd207..6991c921e 100644 --- a/client-go/listers/ipam/v1alpha1/prefix.go +++ b/client-go/listers/ipam/v1alpha1/prefix.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/ipam/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -25,25 +25,17 @@ type PrefixLister interface { // prefixLister implements the PrefixLister interface. type prefixLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.Prefix] } // NewPrefixLister returns a new PrefixLister. func NewPrefixLister(indexer cache.Indexer) PrefixLister { - return &prefixLister{indexer: indexer} -} - -// List lists all Prefixes in the indexer. -func (s *prefixLister) List(selector labels.Selector) (ret []*v1alpha1.Prefix, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.Prefix)) - }) - return ret, err + return &prefixLister{listers.New[*v1alpha1.Prefix](indexer, v1alpha1.Resource("prefix"))} } // Prefixes returns an object that can list and get Prefixes. func (s *prefixLister) Prefixes(namespace string) PrefixNamespaceLister { - return prefixNamespaceLister{indexer: s.indexer, namespace: namespace} + return prefixNamespaceLister{listers.NewNamespaced[*v1alpha1.Prefix](s.ResourceIndexer, namespace)} } // PrefixNamespaceLister helps list and get Prefixes. @@ -61,26 +53,5 @@ type PrefixNamespaceLister interface { // prefixNamespaceLister implements the PrefixNamespaceLister // interface. type prefixNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Prefixes in the indexer for a given namespace. -func (s prefixNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Prefix, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.Prefix)) - }) - return ret, err -} - -// Get retrieves the Prefix from the indexer for a given namespace and name. -func (s prefixNamespaceLister) Get(name string) (*v1alpha1.Prefix, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("prefix"), name) - } - return obj.(*v1alpha1.Prefix), nil + listers.ResourceIndexer[*v1alpha1.Prefix] } diff --git a/client-go/listers/ipam/v1alpha1/prefixallocation.go b/client-go/listers/ipam/v1alpha1/prefixallocation.go index a9963a410..7d6bab707 100644 --- a/client-go/listers/ipam/v1alpha1/prefixallocation.go +++ b/client-go/listers/ipam/v1alpha1/prefixallocation.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/ipam/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -25,25 +25,17 @@ type PrefixAllocationLister interface { // prefixAllocationLister implements the PrefixAllocationLister interface. type prefixAllocationLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.PrefixAllocation] } // NewPrefixAllocationLister returns a new PrefixAllocationLister. func NewPrefixAllocationLister(indexer cache.Indexer) PrefixAllocationLister { - return &prefixAllocationLister{indexer: indexer} -} - -// List lists all PrefixAllocations in the indexer. -func (s *prefixAllocationLister) List(selector labels.Selector) (ret []*v1alpha1.PrefixAllocation, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.PrefixAllocation)) - }) - return ret, err + return &prefixAllocationLister{listers.New[*v1alpha1.PrefixAllocation](indexer, v1alpha1.Resource("prefixallocation"))} } // PrefixAllocations returns an object that can list and get PrefixAllocations. func (s *prefixAllocationLister) PrefixAllocations(namespace string) PrefixAllocationNamespaceLister { - return prefixAllocationNamespaceLister{indexer: s.indexer, namespace: namespace} + return prefixAllocationNamespaceLister{listers.NewNamespaced[*v1alpha1.PrefixAllocation](s.ResourceIndexer, namespace)} } // PrefixAllocationNamespaceLister helps list and get PrefixAllocations. @@ -61,26 +53,5 @@ type PrefixAllocationNamespaceLister interface { // prefixAllocationNamespaceLister implements the PrefixAllocationNamespaceLister // interface. type prefixAllocationNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all PrefixAllocations in the indexer for a given namespace. -func (s prefixAllocationNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.PrefixAllocation, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.PrefixAllocation)) - }) - return ret, err -} - -// Get retrieves the PrefixAllocation from the indexer for a given namespace and name. -func (s prefixAllocationNamespaceLister) Get(name string) (*v1alpha1.PrefixAllocation, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("prefixallocation"), name) - } - return obj.(*v1alpha1.PrefixAllocation), nil + listers.ResourceIndexer[*v1alpha1.PrefixAllocation] } diff --git a/client-go/listers/networking/v1alpha1/loadbalancer.go b/client-go/listers/networking/v1alpha1/loadbalancer.go index dfcb9fc7c..051ed2636 100644 --- a/client-go/listers/networking/v1alpha1/loadbalancer.go +++ b/client-go/listers/networking/v1alpha1/loadbalancer.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -25,25 +25,17 @@ type LoadBalancerLister interface { // loadBalancerLister implements the LoadBalancerLister interface. type loadBalancerLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.LoadBalancer] } // NewLoadBalancerLister returns a new LoadBalancerLister. func NewLoadBalancerLister(indexer cache.Indexer) LoadBalancerLister { - return &loadBalancerLister{indexer: indexer} -} - -// List lists all LoadBalancers in the indexer. -func (s *loadBalancerLister) List(selector labels.Selector) (ret []*v1alpha1.LoadBalancer, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.LoadBalancer)) - }) - return ret, err + return &loadBalancerLister{listers.New[*v1alpha1.LoadBalancer](indexer, v1alpha1.Resource("loadbalancer"))} } // LoadBalancers returns an object that can list and get LoadBalancers. func (s *loadBalancerLister) LoadBalancers(namespace string) LoadBalancerNamespaceLister { - return loadBalancerNamespaceLister{indexer: s.indexer, namespace: namespace} + return loadBalancerNamespaceLister{listers.NewNamespaced[*v1alpha1.LoadBalancer](s.ResourceIndexer, namespace)} } // LoadBalancerNamespaceLister helps list and get LoadBalancers. @@ -61,26 +53,5 @@ type LoadBalancerNamespaceLister interface { // loadBalancerNamespaceLister implements the LoadBalancerNamespaceLister // interface. type loadBalancerNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all LoadBalancers in the indexer for a given namespace. -func (s loadBalancerNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.LoadBalancer, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.LoadBalancer)) - }) - return ret, err -} - -// Get retrieves the LoadBalancer from the indexer for a given namespace and name. -func (s loadBalancerNamespaceLister) Get(name string) (*v1alpha1.LoadBalancer, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("loadbalancer"), name) - } - return obj.(*v1alpha1.LoadBalancer), nil + listers.ResourceIndexer[*v1alpha1.LoadBalancer] } diff --git a/client-go/listers/networking/v1alpha1/loadbalancerrouting.go b/client-go/listers/networking/v1alpha1/loadbalancerrouting.go index cf3da06d0..1328c1401 100644 --- a/client-go/listers/networking/v1alpha1/loadbalancerrouting.go +++ b/client-go/listers/networking/v1alpha1/loadbalancerrouting.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -25,25 +25,17 @@ type LoadBalancerRoutingLister interface { // loadBalancerRoutingLister implements the LoadBalancerRoutingLister interface. type loadBalancerRoutingLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.LoadBalancerRouting] } // NewLoadBalancerRoutingLister returns a new LoadBalancerRoutingLister. func NewLoadBalancerRoutingLister(indexer cache.Indexer) LoadBalancerRoutingLister { - return &loadBalancerRoutingLister{indexer: indexer} -} - -// List lists all LoadBalancerRoutings in the indexer. -func (s *loadBalancerRoutingLister) List(selector labels.Selector) (ret []*v1alpha1.LoadBalancerRouting, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.LoadBalancerRouting)) - }) - return ret, err + return &loadBalancerRoutingLister{listers.New[*v1alpha1.LoadBalancerRouting](indexer, v1alpha1.Resource("loadbalancerrouting"))} } // LoadBalancerRoutings returns an object that can list and get LoadBalancerRoutings. func (s *loadBalancerRoutingLister) LoadBalancerRoutings(namespace string) LoadBalancerRoutingNamespaceLister { - return loadBalancerRoutingNamespaceLister{indexer: s.indexer, namespace: namespace} + return loadBalancerRoutingNamespaceLister{listers.NewNamespaced[*v1alpha1.LoadBalancerRouting](s.ResourceIndexer, namespace)} } // LoadBalancerRoutingNamespaceLister helps list and get LoadBalancerRoutings. @@ -61,26 +53,5 @@ type LoadBalancerRoutingNamespaceLister interface { // loadBalancerRoutingNamespaceLister implements the LoadBalancerRoutingNamespaceLister // interface. type loadBalancerRoutingNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all LoadBalancerRoutings in the indexer for a given namespace. -func (s loadBalancerRoutingNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.LoadBalancerRouting, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.LoadBalancerRouting)) - }) - return ret, err -} - -// Get retrieves the LoadBalancerRouting from the indexer for a given namespace and name. -func (s loadBalancerRoutingNamespaceLister) Get(name string) (*v1alpha1.LoadBalancerRouting, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("loadbalancerrouting"), name) - } - return obj.(*v1alpha1.LoadBalancerRouting), nil + listers.ResourceIndexer[*v1alpha1.LoadBalancerRouting] } diff --git a/client-go/listers/networking/v1alpha1/natgateway.go b/client-go/listers/networking/v1alpha1/natgateway.go index bb59c70eb..6be6e63f5 100644 --- a/client-go/listers/networking/v1alpha1/natgateway.go +++ b/client-go/listers/networking/v1alpha1/natgateway.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -25,25 +25,17 @@ type NATGatewayLister interface { // nATGatewayLister implements the NATGatewayLister interface. type nATGatewayLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.NATGateway] } // NewNATGatewayLister returns a new NATGatewayLister. func NewNATGatewayLister(indexer cache.Indexer) NATGatewayLister { - return &nATGatewayLister{indexer: indexer} -} - -// List lists all NATGateways in the indexer. -func (s *nATGatewayLister) List(selector labels.Selector) (ret []*v1alpha1.NATGateway, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.NATGateway)) - }) - return ret, err + return &nATGatewayLister{listers.New[*v1alpha1.NATGateway](indexer, v1alpha1.Resource("natgateway"))} } // NATGateways returns an object that can list and get NATGateways. func (s *nATGatewayLister) NATGateways(namespace string) NATGatewayNamespaceLister { - return nATGatewayNamespaceLister{indexer: s.indexer, namespace: namespace} + return nATGatewayNamespaceLister{listers.NewNamespaced[*v1alpha1.NATGateway](s.ResourceIndexer, namespace)} } // NATGatewayNamespaceLister helps list and get NATGateways. @@ -61,26 +53,5 @@ type NATGatewayNamespaceLister interface { // nATGatewayNamespaceLister implements the NATGatewayNamespaceLister // interface. type nATGatewayNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all NATGateways in the indexer for a given namespace. -func (s nATGatewayNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.NATGateway, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.NATGateway)) - }) - return ret, err -} - -// Get retrieves the NATGateway from the indexer for a given namespace and name. -func (s nATGatewayNamespaceLister) Get(name string) (*v1alpha1.NATGateway, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("natgateway"), name) - } - return obj.(*v1alpha1.NATGateway), nil + listers.ResourceIndexer[*v1alpha1.NATGateway] } diff --git a/client-go/listers/networking/v1alpha1/network.go b/client-go/listers/networking/v1alpha1/network.go index 20a86fd7c..1a371879d 100644 --- a/client-go/listers/networking/v1alpha1/network.go +++ b/client-go/listers/networking/v1alpha1/network.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -25,25 +25,17 @@ type NetworkLister interface { // networkLister implements the NetworkLister interface. type networkLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.Network] } // NewNetworkLister returns a new NetworkLister. func NewNetworkLister(indexer cache.Indexer) NetworkLister { - return &networkLister{indexer: indexer} -} - -// List lists all Networks in the indexer. -func (s *networkLister) List(selector labels.Selector) (ret []*v1alpha1.Network, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.Network)) - }) - return ret, err + return &networkLister{listers.New[*v1alpha1.Network](indexer, v1alpha1.Resource("network"))} } // Networks returns an object that can list and get Networks. func (s *networkLister) Networks(namespace string) NetworkNamespaceLister { - return networkNamespaceLister{indexer: s.indexer, namespace: namespace} + return networkNamespaceLister{listers.NewNamespaced[*v1alpha1.Network](s.ResourceIndexer, namespace)} } // NetworkNamespaceLister helps list and get Networks. @@ -61,26 +53,5 @@ type NetworkNamespaceLister interface { // networkNamespaceLister implements the NetworkNamespaceLister // interface. type networkNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Networks in the indexer for a given namespace. -func (s networkNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Network, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.Network)) - }) - return ret, err -} - -// Get retrieves the Network from the indexer for a given namespace and name. -func (s networkNamespaceLister) Get(name string) (*v1alpha1.Network, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("network"), name) - } - return obj.(*v1alpha1.Network), nil + listers.ResourceIndexer[*v1alpha1.Network] } diff --git a/client-go/listers/networking/v1alpha1/networkinterface.go b/client-go/listers/networking/v1alpha1/networkinterface.go index 8b1e85352..4c0b070de 100644 --- a/client-go/listers/networking/v1alpha1/networkinterface.go +++ b/client-go/listers/networking/v1alpha1/networkinterface.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -25,25 +25,17 @@ type NetworkInterfaceLister interface { // networkInterfaceLister implements the NetworkInterfaceLister interface. type networkInterfaceLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.NetworkInterface] } // NewNetworkInterfaceLister returns a new NetworkInterfaceLister. func NewNetworkInterfaceLister(indexer cache.Indexer) NetworkInterfaceLister { - return &networkInterfaceLister{indexer: indexer} -} - -// List lists all NetworkInterfaces in the indexer. -func (s *networkInterfaceLister) List(selector labels.Selector) (ret []*v1alpha1.NetworkInterface, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.NetworkInterface)) - }) - return ret, err + return &networkInterfaceLister{listers.New[*v1alpha1.NetworkInterface](indexer, v1alpha1.Resource("networkinterface"))} } // NetworkInterfaces returns an object that can list and get NetworkInterfaces. func (s *networkInterfaceLister) NetworkInterfaces(namespace string) NetworkInterfaceNamespaceLister { - return networkInterfaceNamespaceLister{indexer: s.indexer, namespace: namespace} + return networkInterfaceNamespaceLister{listers.NewNamespaced[*v1alpha1.NetworkInterface](s.ResourceIndexer, namespace)} } // NetworkInterfaceNamespaceLister helps list and get NetworkInterfaces. @@ -61,26 +53,5 @@ type NetworkInterfaceNamespaceLister interface { // networkInterfaceNamespaceLister implements the NetworkInterfaceNamespaceLister // interface. type networkInterfaceNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all NetworkInterfaces in the indexer for a given namespace. -func (s networkInterfaceNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.NetworkInterface, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.NetworkInterface)) - }) - return ret, err -} - -// Get retrieves the NetworkInterface from the indexer for a given namespace and name. -func (s networkInterfaceNamespaceLister) Get(name string) (*v1alpha1.NetworkInterface, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("networkinterface"), name) - } - return obj.(*v1alpha1.NetworkInterface), nil + listers.ResourceIndexer[*v1alpha1.NetworkInterface] } diff --git a/client-go/listers/networking/v1alpha1/networkpolicy.go b/client-go/listers/networking/v1alpha1/networkpolicy.go index d3a51a406..f5753df4d 100644 --- a/client-go/listers/networking/v1alpha1/networkpolicy.go +++ b/client-go/listers/networking/v1alpha1/networkpolicy.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -25,25 +25,17 @@ type NetworkPolicyLister interface { // networkPolicyLister implements the NetworkPolicyLister interface. type networkPolicyLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.NetworkPolicy] } // NewNetworkPolicyLister returns a new NetworkPolicyLister. func NewNetworkPolicyLister(indexer cache.Indexer) NetworkPolicyLister { - return &networkPolicyLister{indexer: indexer} -} - -// List lists all NetworkPolicies in the indexer. -func (s *networkPolicyLister) List(selector labels.Selector) (ret []*v1alpha1.NetworkPolicy, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.NetworkPolicy)) - }) - return ret, err + return &networkPolicyLister{listers.New[*v1alpha1.NetworkPolicy](indexer, v1alpha1.Resource("networkpolicy"))} } // NetworkPolicies returns an object that can list and get NetworkPolicies. func (s *networkPolicyLister) NetworkPolicies(namespace string) NetworkPolicyNamespaceLister { - return networkPolicyNamespaceLister{indexer: s.indexer, namespace: namespace} + return networkPolicyNamespaceLister{listers.NewNamespaced[*v1alpha1.NetworkPolicy](s.ResourceIndexer, namespace)} } // NetworkPolicyNamespaceLister helps list and get NetworkPolicies. @@ -61,26 +53,5 @@ type NetworkPolicyNamespaceLister interface { // networkPolicyNamespaceLister implements the NetworkPolicyNamespaceLister // interface. type networkPolicyNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all NetworkPolicies in the indexer for a given namespace. -func (s networkPolicyNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.NetworkPolicy, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.NetworkPolicy)) - }) - return ret, err -} - -// Get retrieves the NetworkPolicy from the indexer for a given namespace and name. -func (s networkPolicyNamespaceLister) Get(name string) (*v1alpha1.NetworkPolicy, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("networkpolicy"), name) - } - return obj.(*v1alpha1.NetworkPolicy), nil + listers.ResourceIndexer[*v1alpha1.NetworkPolicy] } diff --git a/client-go/listers/networking/v1alpha1/virtualip.go b/client-go/listers/networking/v1alpha1/virtualip.go index 1d68c8879..6a28fa0b9 100644 --- a/client-go/listers/networking/v1alpha1/virtualip.go +++ b/client-go/listers/networking/v1alpha1/virtualip.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/networking/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -25,25 +25,17 @@ type VirtualIPLister interface { // virtualIPLister implements the VirtualIPLister interface. type virtualIPLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.VirtualIP] } // NewVirtualIPLister returns a new VirtualIPLister. func NewVirtualIPLister(indexer cache.Indexer) VirtualIPLister { - return &virtualIPLister{indexer: indexer} -} - -// List lists all VirtualIPs in the indexer. -func (s *virtualIPLister) List(selector labels.Selector) (ret []*v1alpha1.VirtualIP, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.VirtualIP)) - }) - return ret, err + return &virtualIPLister{listers.New[*v1alpha1.VirtualIP](indexer, v1alpha1.Resource("virtualip"))} } // VirtualIPs returns an object that can list and get VirtualIPs. func (s *virtualIPLister) VirtualIPs(namespace string) VirtualIPNamespaceLister { - return virtualIPNamespaceLister{indexer: s.indexer, namespace: namespace} + return virtualIPNamespaceLister{listers.NewNamespaced[*v1alpha1.VirtualIP](s.ResourceIndexer, namespace)} } // VirtualIPNamespaceLister helps list and get VirtualIPs. @@ -61,26 +53,5 @@ type VirtualIPNamespaceLister interface { // virtualIPNamespaceLister implements the VirtualIPNamespaceLister // interface. type virtualIPNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all VirtualIPs in the indexer for a given namespace. -func (s virtualIPNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.VirtualIP, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.VirtualIP)) - }) - return ret, err -} - -// Get retrieves the VirtualIP from the indexer for a given namespace and name. -func (s virtualIPNamespaceLister) Get(name string) (*v1alpha1.VirtualIP, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("virtualip"), name) - } - return obj.(*v1alpha1.VirtualIP), nil + listers.ResourceIndexer[*v1alpha1.VirtualIP] } diff --git a/client-go/listers/storage/v1alpha1/bucket.go b/client-go/listers/storage/v1alpha1/bucket.go index 1af61d15a..0f1d93703 100644 --- a/client-go/listers/storage/v1alpha1/bucket.go +++ b/client-go/listers/storage/v1alpha1/bucket.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -25,25 +25,17 @@ type BucketLister interface { // bucketLister implements the BucketLister interface. type bucketLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.Bucket] } // NewBucketLister returns a new BucketLister. func NewBucketLister(indexer cache.Indexer) BucketLister { - return &bucketLister{indexer: indexer} -} - -// List lists all Buckets in the indexer. -func (s *bucketLister) List(selector labels.Selector) (ret []*v1alpha1.Bucket, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.Bucket)) - }) - return ret, err + return &bucketLister{listers.New[*v1alpha1.Bucket](indexer, v1alpha1.Resource("bucket"))} } // Buckets returns an object that can list and get Buckets. func (s *bucketLister) Buckets(namespace string) BucketNamespaceLister { - return bucketNamespaceLister{indexer: s.indexer, namespace: namespace} + return bucketNamespaceLister{listers.NewNamespaced[*v1alpha1.Bucket](s.ResourceIndexer, namespace)} } // BucketNamespaceLister helps list and get Buckets. @@ -61,26 +53,5 @@ type BucketNamespaceLister interface { // bucketNamespaceLister implements the BucketNamespaceLister // interface. type bucketNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Buckets in the indexer for a given namespace. -func (s bucketNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Bucket, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.Bucket)) - }) - return ret, err -} - -// Get retrieves the Bucket from the indexer for a given namespace and name. -func (s bucketNamespaceLister) Get(name string) (*v1alpha1.Bucket, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("bucket"), name) - } - return obj.(*v1alpha1.Bucket), nil + listers.ResourceIndexer[*v1alpha1.Bucket] } diff --git a/client-go/listers/storage/v1alpha1/bucketclass.go b/client-go/listers/storage/v1alpha1/bucketclass.go index ccfb7f8c0..b2603ad56 100644 --- a/client-go/listers/storage/v1alpha1/bucketclass.go +++ b/client-go/listers/storage/v1alpha1/bucketclass.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -26,30 +26,10 @@ type BucketClassLister interface { // bucketClassLister implements the BucketClassLister interface. type bucketClassLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.BucketClass] } // NewBucketClassLister returns a new BucketClassLister. func NewBucketClassLister(indexer cache.Indexer) BucketClassLister { - return &bucketClassLister{indexer: indexer} -} - -// List lists all BucketClasses in the indexer. -func (s *bucketClassLister) List(selector labels.Selector) (ret []*v1alpha1.BucketClass, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.BucketClass)) - }) - return ret, err -} - -// Get retrieves the BucketClass from the index for a given name. -func (s *bucketClassLister) Get(name string) (*v1alpha1.BucketClass, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("bucketclass"), name) - } - return obj.(*v1alpha1.BucketClass), nil + return &bucketClassLister{listers.New[*v1alpha1.BucketClass](indexer, v1alpha1.Resource("bucketclass"))} } diff --git a/client-go/listers/storage/v1alpha1/bucketpool.go b/client-go/listers/storage/v1alpha1/bucketpool.go index b43591419..4ab74b6dc 100644 --- a/client-go/listers/storage/v1alpha1/bucketpool.go +++ b/client-go/listers/storage/v1alpha1/bucketpool.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -26,30 +26,10 @@ type BucketPoolLister interface { // bucketPoolLister implements the BucketPoolLister interface. type bucketPoolLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.BucketPool] } // NewBucketPoolLister returns a new BucketPoolLister. func NewBucketPoolLister(indexer cache.Indexer) BucketPoolLister { - return &bucketPoolLister{indexer: indexer} -} - -// List lists all BucketPools in the indexer. -func (s *bucketPoolLister) List(selector labels.Selector) (ret []*v1alpha1.BucketPool, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.BucketPool)) - }) - return ret, err -} - -// Get retrieves the BucketPool from the index for a given name. -func (s *bucketPoolLister) Get(name string) (*v1alpha1.BucketPool, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("bucketpool"), name) - } - return obj.(*v1alpha1.BucketPool), nil + return &bucketPoolLister{listers.New[*v1alpha1.BucketPool](indexer, v1alpha1.Resource("bucketpool"))} } diff --git a/client-go/listers/storage/v1alpha1/volume.go b/client-go/listers/storage/v1alpha1/volume.go index b2ae4df86..ab7bcc1a6 100644 --- a/client-go/listers/storage/v1alpha1/volume.go +++ b/client-go/listers/storage/v1alpha1/volume.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -25,25 +25,17 @@ type VolumeLister interface { // volumeLister implements the VolumeLister interface. type volumeLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.Volume] } // NewVolumeLister returns a new VolumeLister. func NewVolumeLister(indexer cache.Indexer) VolumeLister { - return &volumeLister{indexer: indexer} -} - -// List lists all Volumes in the indexer. -func (s *volumeLister) List(selector labels.Selector) (ret []*v1alpha1.Volume, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.Volume)) - }) - return ret, err + return &volumeLister{listers.New[*v1alpha1.Volume](indexer, v1alpha1.Resource("volume"))} } // Volumes returns an object that can list and get Volumes. func (s *volumeLister) Volumes(namespace string) VolumeNamespaceLister { - return volumeNamespaceLister{indexer: s.indexer, namespace: namespace} + return volumeNamespaceLister{listers.NewNamespaced[*v1alpha1.Volume](s.ResourceIndexer, namespace)} } // VolumeNamespaceLister helps list and get Volumes. @@ -61,26 +53,5 @@ type VolumeNamespaceLister interface { // volumeNamespaceLister implements the VolumeNamespaceLister // interface. type volumeNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Volumes in the indexer for a given namespace. -func (s volumeNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Volume, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.Volume)) - }) - return ret, err -} - -// Get retrieves the Volume from the indexer for a given namespace and name. -func (s volumeNamespaceLister) Get(name string) (*v1alpha1.Volume, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("volume"), name) - } - return obj.(*v1alpha1.Volume), nil + listers.ResourceIndexer[*v1alpha1.Volume] } diff --git a/client-go/listers/storage/v1alpha1/volumeclass.go b/client-go/listers/storage/v1alpha1/volumeclass.go index cde180ac8..549459cdd 100644 --- a/client-go/listers/storage/v1alpha1/volumeclass.go +++ b/client-go/listers/storage/v1alpha1/volumeclass.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -26,30 +26,10 @@ type VolumeClassLister interface { // volumeClassLister implements the VolumeClassLister interface. type volumeClassLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.VolumeClass] } // NewVolumeClassLister returns a new VolumeClassLister. func NewVolumeClassLister(indexer cache.Indexer) VolumeClassLister { - return &volumeClassLister{indexer: indexer} -} - -// List lists all VolumeClasses in the indexer. -func (s *volumeClassLister) List(selector labels.Selector) (ret []*v1alpha1.VolumeClass, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.VolumeClass)) - }) - return ret, err -} - -// Get retrieves the VolumeClass from the index for a given name. -func (s *volumeClassLister) Get(name string) (*v1alpha1.VolumeClass, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("volumeclass"), name) - } - return obj.(*v1alpha1.VolumeClass), nil + return &volumeClassLister{listers.New[*v1alpha1.VolumeClass](indexer, v1alpha1.Resource("volumeclass"))} } diff --git a/client-go/listers/storage/v1alpha1/volumepool.go b/client-go/listers/storage/v1alpha1/volumepool.go index f1c47b41d..88eaee52e 100644 --- a/client-go/listers/storage/v1alpha1/volumepool.go +++ b/client-go/listers/storage/v1alpha1/volumepool.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -26,30 +26,10 @@ type VolumePoolLister interface { // volumePoolLister implements the VolumePoolLister interface. type volumePoolLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.VolumePool] } // NewVolumePoolLister returns a new VolumePoolLister. func NewVolumePoolLister(indexer cache.Indexer) VolumePoolLister { - return &volumePoolLister{indexer: indexer} -} - -// List lists all VolumePools in the indexer. -func (s *volumePoolLister) List(selector labels.Selector) (ret []*v1alpha1.VolumePool, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.VolumePool)) - }) - return ret, err -} - -// Get retrieves the VolumePool from the index for a given name. -func (s *volumePoolLister) Get(name string) (*v1alpha1.VolumePool, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("volumepool"), name) - } - return obj.(*v1alpha1.VolumePool), nil + return &volumePoolLister{listers.New[*v1alpha1.VolumePool](indexer, v1alpha1.Resource("volumepool"))} } diff --git a/client-go/openapi/zz_generated.openapi.go b/client-go/openapi/zz_generated.openapi.go index ccdb8e077..9af04e288 100644 --- a/client-go/openapi/zz_generated.openapi.go +++ b/client-go/openapi/zz_generated.openapi.go @@ -10,8 +10,9 @@ package openapi import ( v1alpha1 "github.com/ironcore-dev/ironcore/api/common/v1alpha1" + v1 "k8s.io/api/core/v1" resource "k8s.io/apimachinery/pkg/api/resource" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" common "k8s.io/kube-openapi/pkg/common" spec "k8s.io/kube-openapi/pkg/validation/spec" ) @@ -160,7 +161,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.CephFSVolumeSource": schema_k8sio_api_core_v1_CephFSVolumeSource(ref), "k8s.io/api/core/v1.CinderPersistentVolumeSource": schema_k8sio_api_core_v1_CinderPersistentVolumeSource(ref), "k8s.io/api/core/v1.CinderVolumeSource": schema_k8sio_api_core_v1_CinderVolumeSource(ref), - "k8s.io/api/core/v1.ClaimSource": schema_k8sio_api_core_v1_ClaimSource(ref), "k8s.io/api/core/v1.ClientIPConfig": schema_k8sio_api_core_v1_ClientIPConfig(ref), "k8s.io/api/core/v1.ClusterTrustBundleProjection": schema_k8sio_api_core_v1_ClusterTrustBundleProjection(ref), "k8s.io/api/core/v1.ComponentCondition": schema_k8sio_api_core_v1_ComponentCondition(ref), @@ -182,6 +182,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.ContainerStateTerminated": schema_k8sio_api_core_v1_ContainerStateTerminated(ref), "k8s.io/api/core/v1.ContainerStateWaiting": schema_k8sio_api_core_v1_ContainerStateWaiting(ref), "k8s.io/api/core/v1.ContainerStatus": schema_k8sio_api_core_v1_ContainerStatus(ref), + "k8s.io/api/core/v1.ContainerUser": schema_k8sio_api_core_v1_ContainerUser(ref), "k8s.io/api/core/v1.DaemonEndpoint": schema_k8sio_api_core_v1_DaemonEndpoint(ref), "k8s.io/api/core/v1.DownwardAPIProjection": schema_k8sio_api_core_v1_DownwardAPIProjection(ref), "k8s.io/api/core/v1.DownwardAPIVolumeFile": schema_k8sio_api_core_v1_DownwardAPIVolumeFile(ref), @@ -219,6 +220,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.HostPathVolumeSource": schema_k8sio_api_core_v1_HostPathVolumeSource(ref), "k8s.io/api/core/v1.ISCSIPersistentVolumeSource": schema_k8sio_api_core_v1_ISCSIPersistentVolumeSource(ref), "k8s.io/api/core/v1.ISCSIVolumeSource": schema_k8sio_api_core_v1_ISCSIVolumeSource(ref), + "k8s.io/api/core/v1.ImageVolumeSource": schema_k8sio_api_core_v1_ImageVolumeSource(ref), "k8s.io/api/core/v1.KeyToPath": schema_k8sio_api_core_v1_KeyToPath(ref), "k8s.io/api/core/v1.Lifecycle": schema_k8sio_api_core_v1_Lifecycle(ref), "k8s.io/api/core/v1.LifecycleHandler": schema_k8sio_api_core_v1_LifecycleHandler(ref), @@ -226,6 +228,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.LimitRangeItem": schema_k8sio_api_core_v1_LimitRangeItem(ref), "k8s.io/api/core/v1.LimitRangeList": schema_k8sio_api_core_v1_LimitRangeList(ref), "k8s.io/api/core/v1.LimitRangeSpec": schema_k8sio_api_core_v1_LimitRangeSpec(ref), + "k8s.io/api/core/v1.LinuxContainerUser": schema_k8sio_api_core_v1_LinuxContainerUser(ref), "k8s.io/api/core/v1.List": schema_k8sio_api_core_v1_List(ref), "k8s.io/api/core/v1.LoadBalancerIngress": schema_k8sio_api_core_v1_LoadBalancerIngress(ref), "k8s.io/api/core/v1.LoadBalancerStatus": schema_k8sio_api_core_v1_LoadBalancerStatus(ref), @@ -245,6 +248,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.NodeConfigSource": schema_k8sio_api_core_v1_NodeConfigSource(ref), "k8s.io/api/core/v1.NodeConfigStatus": schema_k8sio_api_core_v1_NodeConfigStatus(ref), "k8s.io/api/core/v1.NodeDaemonEndpoints": schema_k8sio_api_core_v1_NodeDaemonEndpoints(ref), + "k8s.io/api/core/v1.NodeFeatures": schema_k8sio_api_core_v1_NodeFeatures(ref), "k8s.io/api/core/v1.NodeList": schema_k8sio_api_core_v1_NodeList(ref), "k8s.io/api/core/v1.NodeProxyOptions": schema_k8sio_api_core_v1_NodeProxyOptions(ref), "k8s.io/api/core/v1.NodeRuntimeHandler": schema_k8sio_api_core_v1_NodeRuntimeHandler(ref), @@ -315,11 +319,13 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.ReplicationControllerStatus": schema_k8sio_api_core_v1_ReplicationControllerStatus(ref), "k8s.io/api/core/v1.ResourceClaim": schema_k8sio_api_core_v1_ResourceClaim(ref), "k8s.io/api/core/v1.ResourceFieldSelector": schema_k8sio_api_core_v1_ResourceFieldSelector(ref), + "k8s.io/api/core/v1.ResourceHealth": schema_k8sio_api_core_v1_ResourceHealth(ref), "k8s.io/api/core/v1.ResourceQuota": schema_k8sio_api_core_v1_ResourceQuota(ref), "k8s.io/api/core/v1.ResourceQuotaList": schema_k8sio_api_core_v1_ResourceQuotaList(ref), "k8s.io/api/core/v1.ResourceQuotaSpec": schema_k8sio_api_core_v1_ResourceQuotaSpec(ref), "k8s.io/api/core/v1.ResourceQuotaStatus": schema_k8sio_api_core_v1_ResourceQuotaStatus(ref), "k8s.io/api/core/v1.ResourceRequirements": schema_k8sio_api_core_v1_ResourceRequirements(ref), + "k8s.io/api/core/v1.ResourceStatus": schema_k8sio_api_core_v1_ResourceStatus(ref), "k8s.io/api/core/v1.SELinuxOptions": schema_k8sio_api_core_v1_SELinuxOptions(ref), "k8s.io/api/core/v1.ScaleIOPersistentVolumeSource": schema_k8sio_api_core_v1_ScaleIOPersistentVolumeSource(ref), "k8s.io/api/core/v1.ScaleIOVolumeSource": schema_k8sio_api_core_v1_ScaleIOVolumeSource(ref), @@ -380,6 +386,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/apimachinery/pkg/apis/meta/v1.CreateOptions": schema_pkg_apis_meta_v1_CreateOptions(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.DeleteOptions": schema_pkg_apis_meta_v1_DeleteOptions(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.Duration": schema_pkg_apis_meta_v1_Duration(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.FieldSelectorRequirement": schema_pkg_apis_meta_v1_FieldSelectorRequirement(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1": schema_pkg_apis_meta_v1_FieldsV1(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.GetOptions": schema_pkg_apis_meta_v1_GetOptions(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.GroupKind": schema_pkg_apis_meta_v1_GroupKind(ref), @@ -6151,6 +6158,7 @@ func schema_k8sio_api_core_v1_AzureDiskVolumeSource(ref common.ReferenceCallback "cachingMode": { SchemaProps: spec.SchemaProps{ Description: "cachingMode is the Host Caching mode: None, Read Only, Read Write.\n\nPossible enum values:\n - `\"None\"`\n - `\"ReadOnly\"`\n - `\"ReadWrite\"`", + Default: v1.AzureDataDiskCachingReadWrite, Type: []string{"string"}, Format: "", Enum: []interface{}{"None", "ReadOnly", "ReadWrite"}, @@ -6159,6 +6167,7 @@ func schema_k8sio_api_core_v1_AzureDiskVolumeSource(ref common.ReferenceCallback "fsType": { SchemaProps: spec.SchemaProps{ Description: "fsType is Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", + Default: "ext4", Type: []string{"string"}, Format: "", }, @@ -6166,6 +6175,7 @@ func schema_k8sio_api_core_v1_AzureDiskVolumeSource(ref common.ReferenceCallback "readOnly": { SchemaProps: spec.SchemaProps{ Description: "readOnly Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", + Default: false, Type: []string{"boolean"}, Format: "", }, @@ -6173,6 +6183,7 @@ func schema_k8sio_api_core_v1_AzureDiskVolumeSource(ref common.ReferenceCallback "kind": { SchemaProps: spec.SchemaProps{ Description: "kind expected values are Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared\n\nPossible enum values:\n - `\"Dedicated\"`\n - `\"Managed\"`\n - `\"Shared\"`", + Default: v1.AzureSharedBlobDisk, Type: []string{"string"}, Format: "", Enum: []interface{}{"Dedicated", "Managed", "Shared"}, @@ -6743,33 +6754,6 @@ func schema_k8sio_api_core_v1_CinderVolumeSource(ref common.ReferenceCallback) c } } -func schema_k8sio_api_core_v1_ClaimSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ClaimSource describes a reference to a ResourceClaim.\n\nExactly one of these fields should be set. Consumers of this type must treat an empty object as if it has an unknown value.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "resourceClaimName": { - SchemaProps: spec.SchemaProps{ - Description: "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceClaimTemplateName": { - SchemaProps: spec.SchemaProps{ - Description: "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - func schema_k8sio_api_core_v1_ClientIPConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -8035,12 +8019,63 @@ func schema_k8sio_api_core_v1_ContainerStatus(ref common.ReferenceCallback) comm }, }, }, + "user": { + SchemaProps: spec.SchemaProps{ + Description: "User represents user identity information initially attached to the first process of the container", + Ref: ref("k8s.io/api/core/v1.ContainerUser"), + }, + }, + "allocatedResourcesStatus": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "name", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "AllocatedResourcesStatus represents the status of various resources allocated for this Pod.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.ResourceStatus"), + }, + }, + }, + }, + }, }, Required: []string{"name", "ready", "restartCount", "image", "imageID"}, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ContainerState", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.VolumeMountStatus", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, + "k8s.io/api/core/v1.ContainerState", "k8s.io/api/core/v1.ContainerUser", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.ResourceStatus", "k8s.io/api/core/v1.VolumeMountStatus", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, + } +} + +func schema_k8sio_api_core_v1_ContainerUser(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ContainerUser represents user identity information", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "linux": { + SchemaProps: spec.SchemaProps{ + Description: "Linux holds user identity information initially attached to the first process of the containers in Linux. Note that the actual running identity can be changed if the process has enough privilege to do so.", + Ref: ref("k8s.io/api/core/v1.LinuxContainerUser"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.LinuxContainerUser"}, } } @@ -10130,6 +10165,7 @@ func schema_k8sio_api_core_v1_ISCSIPersistentVolumeSource(ref common.ReferenceCa "iscsiInterface": { SchemaProps: spec.SchemaProps{ Description: "iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp).", + Default: "default", Type: []string{"string"}, Format: "", }, @@ -10238,6 +10274,7 @@ func schema_k8sio_api_core_v1_ISCSIVolumeSource(ref common.ReferenceCallback) co "iscsiInterface": { SchemaProps: spec.SchemaProps{ Description: "iscsiInterface is the interface Name that uses an iSCSI transport. Defaults to 'default' (tcp).", + Default: "default", Type: []string{"string"}, Format: "", }, @@ -10312,6 +10349,34 @@ func schema_k8sio_api_core_v1_ISCSIVolumeSource(ref common.ReferenceCallback) co } } +func schema_k8sio_api_core_v1_ImageVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ImageVolumeSource represents a image volume resource.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "reference": { + SchemaProps: spec.SchemaProps{ + Description: "Required: Image or artifact reference to be used. Behaves in the same way as pod.spec.containers[*].image. Pull secrets will be assembled in the same way as for the container image by looking up node credentials, SA image pull secrets, and pod spec image pull secrets. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.", + Type: []string{"string"}, + Format: "", + }, + }, + "pullPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "Policy for pulling OCI objects. Possible values are: Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.\n\nPossible enum values:\n - `\"Always\"` means that kubelet always attempts to pull the latest image. Container will fail If the pull fails.\n - `\"IfNotPresent\"` means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails.\n - `\"Never\"` means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present", + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"Always", "IfNotPresent", "Never"}, + }, + }, + }, + }, + }, + } +} + func schema_k8sio_api_core_v1_KeyToPath(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -10638,6 +10703,56 @@ func schema_k8sio_api_core_v1_LimitRangeSpec(ref common.ReferenceCallback) commo } } +func schema_k8sio_api_core_v1_LinuxContainerUser(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "LinuxContainerUser represents user identity information in Linux containers", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "uid": { + SchemaProps: spec.SchemaProps{ + Description: "UID is the primary uid initially attached to the first process in the container", + Default: 0, + Type: []string{"integer"}, + Format: "int64", + }, + }, + "gid": { + SchemaProps: spec.SchemaProps{ + Description: "GID is the primary gid initially attached to the first process in the container", + Default: 0, + Type: []string{"integer"}, + Format: "int64", + }, + }, + "supplementalGroups": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "SupplementalGroups are the supplemental groups initially attached to the first process in the container", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: 0, + Type: []string{"integer"}, + Format: "int64", + }, + }, + }, + }, + }, + }, + Required: []string{"uid", "gid"}, + }, + }, + } +} + func schema_k8sio_api_core_v1_List(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -11390,6 +11505,26 @@ func schema_k8sio_api_core_v1_NodeDaemonEndpoints(ref common.ReferenceCallback) } } +func schema_k8sio_api_core_v1_NodeFeatures(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NodeFeatures describes the set of features implemented by the CRI implementation. The features contained in the NodeFeatures should depend only on the cri implementation independent of runtime handlers.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "supplementalGroupsPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "SupplementalGroupsPolicy is set to true if the runtime supports SupplementalGroupsPolicy and ContainerUser.", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + } +} + func schema_k8sio_api_core_v1_NodeList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -11508,7 +11643,7 @@ func schema_k8sio_api_core_v1_NodeRuntimeHandlerFeatures(ref common.ReferenceCal return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "NodeRuntimeHandlerFeatures is a set of runtime features.", + Description: "NodeRuntimeHandlerFeatures is a set of features implemented by the runtime handler.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "recursiveReadOnlyMounts": { @@ -11518,6 +11653,13 @@ func schema_k8sio_api_core_v1_NodeRuntimeHandlerFeatures(ref common.ReferenceCal Format: "", }, }, + "userNamespaces": { + SchemaProps: spec.SchemaProps{ + Description: "UserNamespaces is set to true if the runtime handler supports UserNamespaces, including for volumes.", + Type: []string{"boolean"}, + Format: "", + }, + }, }, }, }, @@ -11771,7 +11913,7 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op Properties: map[string]spec.Schema{ "capacity": { SchemaProps: spec.SchemaProps{ - Description: "Capacity represents the total resources of a node. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity", + Description: "Capacity represents the total resources of a node. More info: https://kubernetes.io/docs/reference/node/node-status/#capacity", Type: []string{"object"}, AdditionalProperties: &spec.SchemaOrBool{ Allows: true, @@ -11950,11 +12092,17 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op }, }, }, + "features": { + SchemaProps: spec.SchemaProps{ + Description: "Features describes the set of features implemented by the CRI implementation.", + Ref: ref("k8s.io/api/core/v1.NodeFeatures"), + }, + }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.AttachedVolume", "k8s.io/api/core/v1.ContainerImage", "k8s.io/api/core/v1.NodeAddress", "k8s.io/api/core/v1.NodeCondition", "k8s.io/api/core/v1.NodeConfigStatus", "k8s.io/api/core/v1.NodeDaemonEndpoints", "k8s.io/api/core/v1.NodeRuntimeHandler", "k8s.io/api/core/v1.NodeSystemInfo", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, + "k8s.io/api/core/v1.AttachedVolume", "k8s.io/api/core/v1.ContainerImage", "k8s.io/api/core/v1.NodeAddress", "k8s.io/api/core/v1.NodeCondition", "k8s.io/api/core/v1.NodeConfigStatus", "k8s.io/api/core/v1.NodeDaemonEndpoints", "k8s.io/api/core/v1.NodeFeatures", "k8s.io/api/core/v1.NodeRuntimeHandler", "k8s.io/api/core/v1.NodeSystemInfo", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } @@ -12023,7 +12171,7 @@ func schema_k8sio_api_core_v1_NodeSystemInfo(ref common.ReferenceCallback) commo }, "kubeProxyVersion": { SchemaProps: spec.SchemaProps{ - Description: "KubeProxy Version reported by the node.", + Description: "Deprecated: KubeProxy Version reported by the node.", Default: "", Type: []string{"string"}, Format: "", @@ -12437,7 +12585,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCall }, "volumeAttributesClassName": { SchemaProps: spec.SchemaProps{ - Description: "volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. If specified, the CSI driver will create or update the volume with the attributes defined in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass will be applied to the claim but it's not allowed to reset this field to empty string once it is set. If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass will be set by the persistentvolume controller if it exists. If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource exists. More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/ (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled.", + Description: "volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. If specified, the CSI driver will create or update the volume with the attributes defined in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass will be applied to the claim but it's not allowed to reset this field to empty string once it is set. If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass will be set by the persistentvolume controller if it exists. If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource exists. More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/ (Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).", Type: []string{"string"}, Format: "", }, @@ -12554,7 +12702,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Default: "", Type: []string{"string"}, Format: "", - Enum: []interface{}{"ControllerResizeFailed", "ControllerResizeInProgress", "NodeResizeFailed", "NodeResizeInProgress", "NodeResizePending"}, + Enum: []interface{}{"ControllerResizeInProgress", "ControllerResizeInfeasible", "NodeResizeInProgress", "NodeResizeInfeasible", "NodeResizePending"}, }, }, }, @@ -12562,14 +12710,14 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa }, "currentVolumeAttributesClassName": { SchemaProps: spec.SchemaProps{ - Description: "currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim This is an alpha field and requires enabling VolumeAttributesClass feature.", + Description: "currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim This is a beta field and requires enabling VolumeAttributesClass feature (off by default).", Type: []string{"string"}, Format: "", }, }, "modifyVolumeStatus": { SchemaProps: spec.SchemaProps{ - Description: "ModifyVolumeStatus represents the status object of ControllerModifyVolume operation. When this is unset, there is no ModifyVolume operation being attempted. This is an alpha field and requires enabling VolumeAttributesClass feature.", + Description: "ModifyVolumeStatus represents the status object of ControllerModifyVolume operation. When this is unset, there is no ModifyVolume operation being attempted. This is a beta field and requires enabling VolumeAttributesClass feature (off by default).", Ref: ref("k8s.io/api/core/v1.ModifyVolumeStatus"), }, }, @@ -13074,7 +13222,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) }, "volumeAttributesClassName": { SchemaProps: spec.SchemaProps{ - Description: "Name of VolumeAttributesClass to which this persistent volume belongs. Empty value is not allowed. When this field is not set, it indicates that this volume does not belong to any VolumeAttributesClass. This field is mutable and can be changed by the CSI driver after a volume has been updated successfully to a new class. For an unbound PersistentVolume, the volumeAttributesClassName will be matched with unbound PersistentVolumeClaims during the binding process. This is an alpha field and requires enabling VolumeAttributesClass feature.", + Description: "Name of VolumeAttributesClass to which this persistent volume belongs. Empty value is not allowed. When this field is not set, it indicates that this volume does not belong to any VolumeAttributesClass. This field is mutable and can be changed by the CSI driver after a volume has been updated successfully to a new class. For an unbound PersistentVolume, the volumeAttributesClassName will be matched with unbound PersistentVolumeClaims during the binding process. This is a beta field and requires enabling VolumeAttributesClass feature (off by default).", Type: []string{"string"}, Format: "", }, @@ -13118,7 +13266,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeStatus(ref common.ReferenceCallbac }, "lastPhaseTransitionTime": { SchemaProps: spec.SchemaProps{ - Description: "lastPhaseTransitionTime is the time the phase transitioned from one to another and automatically resets to current time everytime a volume phase transitions. This is a beta field and requires the PersistentVolumeLastPhaseTransitionTime feature to be enabled (enabled by default).", + Description: "lastPhaseTransitionTime is the time the phase transitioned from one to another and automatically resets to current time everytime a volume phase transitions.", Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -13316,7 +13464,7 @@ func schema_k8sio_api_core_v1_PodAffinityTerm(ref common.ReferenceCallback) comm }, }, SchemaProps: spec.SchemaProps{ - Description: "MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.", + Description: "MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -13336,7 +13484,7 @@ func schema_k8sio_api_core_v1_PodAffinityTerm(ref common.ReferenceCallback) comm }, }, SchemaProps: spec.SchemaProps{ - Description: "MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.", + Description: "MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -14007,7 +14155,7 @@ func schema_k8sio_api_core_v1_PodResourceClaim(ref common.ReferenceCallback) com return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "PodResourceClaim references exactly one ResourceClaim through a ClaimSource. It adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.", + Description: "PodResourceClaim references exactly one ResourceClaim, either directly or by naming a ResourceClaimTemplate which is then turned into a ResourceClaim for the pod.\n\nIt adds a name to it that uniquely identifies the ResourceClaim inside the Pod. Containers that need access to the ResourceClaim reference it with this name.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "name": { @@ -14018,19 +14166,24 @@ func schema_k8sio_api_core_v1_PodResourceClaim(ref common.ReferenceCallback) com Format: "", }, }, - "source": { + "resourceClaimName": { SchemaProps: spec.SchemaProps{ - Description: "Source describes where to find the ResourceClaim.", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/core/v1.ClaimSource"), + Description: "ResourceClaimName is the name of a ResourceClaim object in the same namespace as this pod.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.", + Type: []string{"string"}, + Format: "", + }, + }, + "resourceClaimTemplateName": { + SchemaProps: spec.SchemaProps{ + Description: "ResourceClaimTemplateName is the name of a ResourceClaimTemplate object in the same namespace as this pod.\n\nThe template will be used to create a new ResourceClaim, which will be bound to this pod. When this pod is deleted, the ResourceClaim will also be deleted. The pod name and resource name, along with a generated component, will be used to form a unique name for the ResourceClaim, which will be recorded in pod.status.resourceClaimStatuses.\n\nThis field is immutable and no changes will be made to the corresponding ResourceClaim by the control plane after creating the ResourceClaim.\n\nExactly one of ResourceClaimName and ResourceClaimTemplateName must be set.", + Type: []string{"string"}, + Format: "", }, }, }, Required: []string{"name"}, }, }, - Dependencies: []string{ - "k8s.io/api/core/v1.ClaimSource"}, } } @@ -14051,7 +14204,7 @@ func schema_k8sio_api_core_v1_PodResourceClaimStatus(ref common.ReferenceCallbac }, "resourceClaimName": { SchemaProps: spec.SchemaProps{ - Description: "ResourceClaimName is the name of the ResourceClaim that was generated for the Pod in the namespace of the Pod. It this is unset, then generating a ResourceClaim was not necessary. The pod.spec.resourceClaims entry can be ignored in this case.", + Description: "ResourceClaimName is the name of the ResourceClaim that was generated for the Pod in the namespace of the Pod. If this is unset, then generating a ResourceClaim was not necessary. The pod.spec.resourceClaims entry can be ignored in this case.", Type: []string{"string"}, Format: "", }, @@ -14132,7 +14285,7 @@ func schema_k8sio_api_core_v1_PodSecurityContext(ref common.ReferenceCallback) c }, }, SchemaProps: spec.SchemaProps{ - Description: "A list of groups applied to the first process run in each container, in addition to the container's primary GID, the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. If unspecified, no additional groups are added to any container. Note that group memberships defined in the container image for the uid of the container process are still effective, even if they are not included in this list. Note that this field cannot be set when spec.os.name is windows.", + Description: "A list of groups applied to the first process run in each container, in addition to the container's primary GID and fsGroup (if specified). If the SupplementalGroupsPolicy feature is enabled, the supplementalGroupsPolicy field determines whether these are in addition to or instead of any group memberships defined in the container image. If unspecified, no additional groups are added, though group memberships defined in the container image may still be used, depending on the supplementalGroupsPolicy field. Note that this field cannot be set when spec.os.name is windows.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -14145,6 +14298,14 @@ func schema_k8sio_api_core_v1_PodSecurityContext(ref common.ReferenceCallback) c }, }, }, + "supplementalGroupsPolicy": { + SchemaProps: spec.SchemaProps{ + Description: "Defines how supplemental groups of the first container processes are calculated. Valid values are \"Merge\" and \"Strict\". If not specified, \"Merge\" is used. (Alpha) Using the field requires the SupplementalGroupsPolicy feature gate to be enabled and the container runtime must implement support for this feature. Note that this field cannot be set when spec.os.name is windows.\n\nPossible enum values:\n - `\"Merge\"` means that the container's provided SupplementalGroups and FsGroup (specified in SecurityContext) will be merged with the primary user's groups as defined in the container image (in /etc/group).\n - `\"Strict\"` means that the container's provided SupplementalGroups and FsGroup (specified in SecurityContext) will be used instead of any groups defined in the container image.", + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"Merge", "Strict"}, + }, + }, "fsGroup": { SchemaProps: spec.SchemaProps{ Description: "A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw----\n\nIf unset, the Kubelet will not modify the ownership and permissions of any volume. Note that this field cannot be set when spec.os.name is windows.", @@ -14397,7 +14558,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, "nodeName": { SchemaProps: spec.SchemaProps{ - Description: "NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.", + Description: "NodeName indicates in which node this pod is scheduled. If empty, this pod is a candidate for scheduling by the scheduler defined in schedulerName. Once this field is set, the kubelet for this node becomes responsible for the lifecycle of this pod. This field should not be used to express a desire for the pod to be scheduled on a specific node. https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename", Type: []string{"string"}, Format: "", }, @@ -14632,14 +14793,14 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, "setHostnameAsFQDN": { SchemaProps: spec.SchemaProps{ - Description: "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", + Description: "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\\\SYSTEM\\\\CurrentControlSet\\\\Services\\\\Tcpip\\\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", Type: []string{"boolean"}, Format: "", }, }, "os": { SchemaProps: spec.SchemaProps{ - Description: "Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set.\n\nIf the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions\n\nIf the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.hostUsers - spec.securityContext.appArmorProfile - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.containers[*].securityContext.appArmorProfile - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup", + Description: "Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set.\n\nIf the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions\n\nIf the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.hostUsers - spec.securityContext.appArmorProfile - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.securityContext.supplementalGroupsPolicy - spec.containers[*].securityContext.appArmorProfile - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup", Ref: ref("k8s.io/api/core/v1.PodOS"), }, }, @@ -15383,7 +15544,7 @@ func schema_k8sio_api_core_v1_ProjectedVolumeSource(ref common.ReferenceCallback }, }, SchemaProps: spec.SchemaProps{ - Description: "sources is the list of volume projections", + Description: "sources is the list of volume projections. Each entry in this list handles one source.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -15513,6 +15674,7 @@ func schema_k8sio_api_core_v1_RBDPersistentVolumeSource(ref common.ReferenceCall "pool": { SchemaProps: spec.SchemaProps{ Description: "pool is the rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", + Default: "rbd", Type: []string{"string"}, Format: "", }, @@ -15520,6 +15682,7 @@ func schema_k8sio_api_core_v1_RBDPersistentVolumeSource(ref common.ReferenceCall "user": { SchemaProps: spec.SchemaProps{ Description: "user is the rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", + Default: "admin", Type: []string{"string"}, Format: "", }, @@ -15527,6 +15690,7 @@ func schema_k8sio_api_core_v1_RBDPersistentVolumeSource(ref common.ReferenceCall "keyring": { SchemaProps: spec.SchemaProps{ Description: "keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", + Default: "/etc/ceph/keyring", Type: []string{"string"}, Format: "", }, @@ -15598,6 +15762,7 @@ func schema_k8sio_api_core_v1_RBDVolumeSource(ref common.ReferenceCallback) comm "pool": { SchemaProps: spec.SchemaProps{ Description: "pool is the rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", + Default: "rbd", Type: []string{"string"}, Format: "", }, @@ -15605,6 +15770,7 @@ func schema_k8sio_api_core_v1_RBDVolumeSource(ref common.ReferenceCallback) comm "user": { SchemaProps: spec.SchemaProps{ Description: "user is the rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", + Default: "admin", Type: []string{"string"}, Format: "", }, @@ -15612,6 +15778,7 @@ func schema_k8sio_api_core_v1_RBDVolumeSource(ref common.ReferenceCallback) comm "keyring": { SchemaProps: spec.SchemaProps{ Description: "keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", + Default: "/etc/ceph/keyring", Type: []string{"string"}, Format: "", }, @@ -15990,6 +16157,13 @@ func schema_k8sio_api_core_v1_ResourceClaim(ref common.ReferenceCallback) common Format: "", }, }, + "request": { + SchemaProps: spec.SchemaProps{ + Description: "Request is the name chosen for a request in the referenced claim. If empty, everything from the claim is made available, otherwise only the result of this request.", + Type: []string{"string"}, + Format: "", + }, + }, }, Required: []string{"name"}, }, @@ -16039,6 +16213,35 @@ func schema_k8sio_api_core_v1_ResourceFieldSelector(ref common.ReferenceCallback } } +func schema_k8sio_api_core_v1_ResourceHealth(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ResourceHealth represents the health of a resource. It has the latest device health information. This is a part of KEP https://kep.k8s.io/4680 and historical health changes are planned to be added in future iterations of a KEP.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "resourceID": { + SchemaProps: spec.SchemaProps{ + Description: "ResourceID is the unique identifier of the resource. See the ResourceID type for more information.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "health": { + SchemaProps: spec.SchemaProps{ + Description: "Health of the resource. can be one of:\n - Healthy: operates as normal\n - Unhealthy: reported unhealthy. We consider this a temporary health issue\n since we do not have a mechanism today to distinguish\n temporary and permanent issues.\n - Unknown: The status cannot be determined.\n For example, Device Plugin got unregistered and hasn't been re-registered since.\n\nIn future we may want to introduce the PermanentlyUnhealthy Status.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"resourceID"}, + }, + }, + } +} + func schema_k8sio_api_core_v1_ResourceQuota(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -16304,6 +16507,51 @@ func schema_k8sio_api_core_v1_ResourceRequirements(ref common.ReferenceCallback) } } +func schema_k8sio_api_core_v1_ResourceStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the resource. Must be unique within the pod and match one of the resources from the pod spec.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "resources": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "resourceID", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "List of unique Resources health. Each element in the list contains an unique resource ID and resource health. At a minimum, ResourceID must uniquely identify the Resource allocated to the Pod on the Node for the lifetime of a Pod. See ResourceID type for it's definition.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.ResourceHealth"), + }, + }, + }, + }, + }, + }, + Required: []string{"name"}, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.ResourceHealth"}, + } +} + func schema_k8sio_api_core_v1_SELinuxOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -16398,6 +16646,7 @@ func schema_k8sio_api_core_v1_ScaleIOPersistentVolumeSource(ref common.Reference "storageMode": { SchemaProps: spec.SchemaProps{ Description: "storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.", + Default: "ThinProvisioned", Type: []string{"string"}, Format: "", }, @@ -16412,6 +16661,7 @@ func schema_k8sio_api_core_v1_ScaleIOPersistentVolumeSource(ref common.Reference "fsType": { SchemaProps: spec.SchemaProps{ Description: "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\"", + Default: "xfs", Type: []string{"string"}, Format: "", }, @@ -16485,6 +16735,7 @@ func schema_k8sio_api_core_v1_ScaleIOVolumeSource(ref common.ReferenceCallback) "storageMode": { SchemaProps: spec.SchemaProps{ Description: "storageMode indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.", + Default: "ThinProvisioned", Type: []string{"string"}, Format: "", }, @@ -16499,6 +16750,7 @@ func schema_k8sio_api_core_v1_ScaleIOVolumeSource(ref common.ReferenceCallback) "fsType": { SchemaProps: spec.SchemaProps{ Description: "fsType is the filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\".", + Default: "xfs", Type: []string{"string"}, Format: "", }, @@ -17059,7 +17311,7 @@ func schema_k8sio_api_core_v1_SecurityContext(ref common.ReferenceCallback) comm }, "procMount": { SchemaProps: spec.SchemaProps{ - Description: "procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows.\n\nPossible enum values:\n - `\"Default\"` uses the container runtime defaults for readonly and masked paths for /proc. Most container runtimes mask certain paths in /proc to avoid accidental security exposure of special devices or information.\n - `\"Unmasked\"` bypasses the default masking behavior of the container runtime and ensures the newly created /proc the container stays in tact with no modifications.", + Description: "procMount denotes the type of proc mount to use for the containers. The default value is Default which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled. Note that this field cannot be set when spec.os.name is windows.\n\nPossible enum values:\n - `\"Default\"` uses the container runtime defaults for readonly and masked paths for /proc. Most container runtimes mask certain paths in /proc to avoid accidental security exposure of special devices or information.\n - `\"Unmasked\"` bypasses the default masking behavior of the container runtime and ensures the newly created /proc the container stays in tact with no modifications.", Type: []string{"string"}, Format: "", Enum: []interface{}{"Default", "Unmasked"}, @@ -18520,12 +18772,18 @@ func schema_k8sio_api_core_v1_Volume(ref common.ReferenceCallback) common.OpenAP Ref: ref("k8s.io/api/core/v1.EphemeralVolumeSource"), }, }, + "image": { + SchemaProps: spec.SchemaProps{ + Description: "image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. The volume is resolved at pod startup depending on which PullPolicy value is provided:\n\n- Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.\n\nThe volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. The volume will be mounted read-only (ro) and non-executable files (noexec). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath). The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.", + Ref: ref("k8s.io/api/core/v1.ImageVolumeSource"), + }, + }, }, Required: []string{"name"}, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource", "k8s.io/api/core/v1.AzureDiskVolumeSource", "k8s.io/api/core/v1.AzureFileVolumeSource", "k8s.io/api/core/v1.CSIVolumeSource", "k8s.io/api/core/v1.CephFSVolumeSource", "k8s.io/api/core/v1.CinderVolumeSource", "k8s.io/api/core/v1.ConfigMapVolumeSource", "k8s.io/api/core/v1.DownwardAPIVolumeSource", "k8s.io/api/core/v1.EmptyDirVolumeSource", "k8s.io/api/core/v1.EphemeralVolumeSource", "k8s.io/api/core/v1.FCVolumeSource", "k8s.io/api/core/v1.FlexVolumeSource", "k8s.io/api/core/v1.FlockerVolumeSource", "k8s.io/api/core/v1.GCEPersistentDiskVolumeSource", "k8s.io/api/core/v1.GitRepoVolumeSource", "k8s.io/api/core/v1.GlusterfsVolumeSource", "k8s.io/api/core/v1.HostPathVolumeSource", "k8s.io/api/core/v1.ISCSIVolumeSource", "k8s.io/api/core/v1.NFSVolumeSource", "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource", "k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource", "k8s.io/api/core/v1.PortworxVolumeSource", "k8s.io/api/core/v1.ProjectedVolumeSource", "k8s.io/api/core/v1.QuobyteVolumeSource", "k8s.io/api/core/v1.RBDVolumeSource", "k8s.io/api/core/v1.ScaleIOVolumeSource", "k8s.io/api/core/v1.SecretVolumeSource", "k8s.io/api/core/v1.StorageOSVolumeSource", "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"}, + "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource", "k8s.io/api/core/v1.AzureDiskVolumeSource", "k8s.io/api/core/v1.AzureFileVolumeSource", "k8s.io/api/core/v1.CSIVolumeSource", "k8s.io/api/core/v1.CephFSVolumeSource", "k8s.io/api/core/v1.CinderVolumeSource", "k8s.io/api/core/v1.ConfigMapVolumeSource", "k8s.io/api/core/v1.DownwardAPIVolumeSource", "k8s.io/api/core/v1.EmptyDirVolumeSource", "k8s.io/api/core/v1.EphemeralVolumeSource", "k8s.io/api/core/v1.FCVolumeSource", "k8s.io/api/core/v1.FlexVolumeSource", "k8s.io/api/core/v1.FlockerVolumeSource", "k8s.io/api/core/v1.GCEPersistentDiskVolumeSource", "k8s.io/api/core/v1.GitRepoVolumeSource", "k8s.io/api/core/v1.GlusterfsVolumeSource", "k8s.io/api/core/v1.HostPathVolumeSource", "k8s.io/api/core/v1.ISCSIVolumeSource", "k8s.io/api/core/v1.ImageVolumeSource", "k8s.io/api/core/v1.NFSVolumeSource", "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource", "k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource", "k8s.io/api/core/v1.PortworxVolumeSource", "k8s.io/api/core/v1.ProjectedVolumeSource", "k8s.io/api/core/v1.QuobyteVolumeSource", "k8s.io/api/core/v1.RBDVolumeSource", "k8s.io/api/core/v1.ScaleIOVolumeSource", "k8s.io/api/core/v1.SecretVolumeSource", "k8s.io/api/core/v1.StorageOSVolumeSource", "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"}, } } @@ -18694,7 +18952,7 @@ func schema_k8sio_api_core_v1_VolumeProjection(ref common.ReferenceCallback) com return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "Projection that may be projected along with other supported volume types", + Description: "Projection that may be projected along with other supported volume types. Exactly one of these fields must be set.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "secret": { @@ -18959,11 +19217,17 @@ func schema_k8sio_api_core_v1_VolumeSource(ref common.ReferenceCallback) common. Ref: ref("k8s.io/api/core/v1.EphemeralVolumeSource"), }, }, + "image": { + SchemaProps: spec.SchemaProps{ + Description: "image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. The volume is resolved at pod startup depending on which PullPolicy value is provided:\n\n- Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.\n\nThe volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. The volume will be mounted read-only (ro) and non-executable files (noexec). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath). The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.", + Ref: ref("k8s.io/api/core/v1.ImageVolumeSource"), + }, + }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource", "k8s.io/api/core/v1.AzureDiskVolumeSource", "k8s.io/api/core/v1.AzureFileVolumeSource", "k8s.io/api/core/v1.CSIVolumeSource", "k8s.io/api/core/v1.CephFSVolumeSource", "k8s.io/api/core/v1.CinderVolumeSource", "k8s.io/api/core/v1.ConfigMapVolumeSource", "k8s.io/api/core/v1.DownwardAPIVolumeSource", "k8s.io/api/core/v1.EmptyDirVolumeSource", "k8s.io/api/core/v1.EphemeralVolumeSource", "k8s.io/api/core/v1.FCVolumeSource", "k8s.io/api/core/v1.FlexVolumeSource", "k8s.io/api/core/v1.FlockerVolumeSource", "k8s.io/api/core/v1.GCEPersistentDiskVolumeSource", "k8s.io/api/core/v1.GitRepoVolumeSource", "k8s.io/api/core/v1.GlusterfsVolumeSource", "k8s.io/api/core/v1.HostPathVolumeSource", "k8s.io/api/core/v1.ISCSIVolumeSource", "k8s.io/api/core/v1.NFSVolumeSource", "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource", "k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource", "k8s.io/api/core/v1.PortworxVolumeSource", "k8s.io/api/core/v1.ProjectedVolumeSource", "k8s.io/api/core/v1.QuobyteVolumeSource", "k8s.io/api/core/v1.RBDVolumeSource", "k8s.io/api/core/v1.ScaleIOVolumeSource", "k8s.io/api/core/v1.SecretVolumeSource", "k8s.io/api/core/v1.StorageOSVolumeSource", "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"}, + "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource", "k8s.io/api/core/v1.AzureDiskVolumeSource", "k8s.io/api/core/v1.AzureFileVolumeSource", "k8s.io/api/core/v1.CSIVolumeSource", "k8s.io/api/core/v1.CephFSVolumeSource", "k8s.io/api/core/v1.CinderVolumeSource", "k8s.io/api/core/v1.ConfigMapVolumeSource", "k8s.io/api/core/v1.DownwardAPIVolumeSource", "k8s.io/api/core/v1.EmptyDirVolumeSource", "k8s.io/api/core/v1.EphemeralVolumeSource", "k8s.io/api/core/v1.FCVolumeSource", "k8s.io/api/core/v1.FlexVolumeSource", "k8s.io/api/core/v1.FlockerVolumeSource", "k8s.io/api/core/v1.GCEPersistentDiskVolumeSource", "k8s.io/api/core/v1.GitRepoVolumeSource", "k8s.io/api/core/v1.GlusterfsVolumeSource", "k8s.io/api/core/v1.HostPathVolumeSource", "k8s.io/api/core/v1.ISCSIVolumeSource", "k8s.io/api/core/v1.ImageVolumeSource", "k8s.io/api/core/v1.NFSVolumeSource", "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource", "k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource", "k8s.io/api/core/v1.PortworxVolumeSource", "k8s.io/api/core/v1.ProjectedVolumeSource", "k8s.io/api/core/v1.QuobyteVolumeSource", "k8s.io/api/core/v1.RBDVolumeSource", "k8s.io/api/core/v1.ScaleIOVolumeSource", "k8s.io/api/core/v1.SecretVolumeSource", "k8s.io/api/core/v1.StorageOSVolumeSource", "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"}, } } @@ -19777,8 +20041,58 @@ func schema_pkg_apis_meta_v1_Duration(ref common.ReferenceCallback) common.OpenA Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ Description: "Duration is a wrapper around time.Duration which supports correct marshaling to YAML and JSON. In particular, it marshals into strings, which can be used as map keys in json.", - Type: v1.Duration{}.OpenAPISchemaType(), - Format: v1.Duration{}.OpenAPISchemaFormat(), + Type: metav1.Duration{}.OpenAPISchemaType(), + Format: metav1.Duration{}.OpenAPISchemaFormat(), + }, + }, + } +} + +func schema_pkg_apis_meta_v1_FieldSelectorRequirement(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "FieldSelectorRequirement is a selector that contains values, a key, and an operator that relates the key and values.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "key": { + SchemaProps: spec.SchemaProps{ + Description: "key is the field selector key that the requirement applies to.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "operator": { + SchemaProps: spec.SchemaProps{ + Description: "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. The list of operators may grow in the future.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "values": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"key", "operator"}, }, }, } @@ -20402,8 +20716,8 @@ func schema_pkg_apis_meta_v1_MicroTime(ref common.ReferenceCallback) common.Open Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ Description: "MicroTime is version of Time with microsecond level precision.", - Type: v1.MicroTime{}.OpenAPISchemaType(), - Format: v1.MicroTime{}.OpenAPISchemaFormat(), + Type: metav1.MicroTime{}.OpenAPISchemaType(), + Format: metav1.MicroTime{}.OpenAPISchemaFormat(), }, }, } @@ -21360,8 +21674,8 @@ func schema_pkg_apis_meta_v1_Time(ref common.ReferenceCallback) common.OpenAPIDe Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ Description: "Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.", - Type: v1.Time{}.OpenAPISchemaType(), - Format: v1.Time{}.OpenAPISchemaFormat(), + Type: metav1.Time{}.OpenAPISchemaType(), + Format: metav1.Time{}.OpenAPISchemaFormat(), }, }, } diff --git a/config/apiserver/rbac/bucketpool_role.yaml b/config/apiserver/rbac/bucketpool_role.yaml index f0c864e82..bd90f1d1d 100644 --- a/config/apiserver/rbac/bucketpool_role.yaml +++ b/config/apiserver/rbac/bucketpool_role.yaml @@ -60,6 +60,7 @@ rules: - storage.ironcore.dev resources: - bucketpools/status + - buckets/status verbs: - get - patch @@ -80,11 +81,3 @@ rules: - buckets/finalizers verbs: - update -- apiGroups: - - storage.ironcore.dev - resources: - - buckets/status - verbs: - - get - - patch - - update diff --git a/config/apiserver/rbac/machinepool_role.yaml b/config/apiserver/rbac/machinepool_role.yaml index 3a659711c..df3c34b8b 100644 --- a/config/apiserver/rbac/machinepool_role.yaml +++ b/config/apiserver/rbac/machinepool_role.yaml @@ -72,6 +72,7 @@ rules: - compute.ironcore.dev resources: - machinepools/status + - machines/status verbs: - get - patch @@ -92,14 +93,6 @@ rules: - machines/finalizers verbs: - update -- apiGroups: - - compute.ironcore.dev - resources: - - machines/status - verbs: - - get - - patch - - update - apiGroups: - ipam.ironcore.dev resources: diff --git a/config/apiserver/rbac/volumepool_role.yaml b/config/apiserver/rbac/volumepool_role.yaml index 6cd20d3f6..7e363b6ce 100644 --- a/config/apiserver/rbac/volumepool_role.yaml +++ b/config/apiserver/rbac/volumepool_role.yaml @@ -60,6 +60,7 @@ rules: - storage.ironcore.dev resources: - volumepools/status + - volumes/status verbs: - get - patch @@ -80,11 +81,3 @@ rules: - volumes/finalizers verbs: - update -- apiGroups: - - storage.ironcore.dev - resources: - - volumes/status - verbs: - - get - - patch - - update diff --git a/config/bucketpoollet-broker/poollet-rbac/role.yaml b/config/bucketpoollet-broker/poollet-rbac/role.yaml index 5a2182454..57fdc81b2 100644 --- a/config/bucketpoollet-broker/poollet-rbac/role.yaml +++ b/config/bucketpoollet-broker/poollet-rbac/role.yaml @@ -60,6 +60,7 @@ rules: - storage.ironcore.dev resources: - bucketpools/status + - buckets/status verbs: - get - patch @@ -80,11 +81,3 @@ rules: - buckets/finalizers verbs: - update -- apiGroups: - - storage.ironcore.dev - resources: - - buckets/status - verbs: - - get - - patch - - update diff --git a/config/controller/rbac/role.yaml b/config/controller/rbac/role.yaml index 900c3f768..b3ad3338e 100644 --- a/config/controller/rbac/role.yaml +++ b/config/controller/rbac/role.yaml @@ -73,6 +73,7 @@ rules: - compute.ironcore.dev resources: - machineclasses/status + - machines/status verbs: - get - patch @@ -95,14 +96,6 @@ rules: - patch - update - watch -- apiGroups: - - compute.ironcore.dev - resources: - - machines/status - verbs: - - get - - patch - - update - apiGroups: - core.ironcore.dev resources: @@ -133,6 +126,7 @@ rules: - ipam.ironcore.dev resources: - prefixallocations + - prefixes verbs: - create - delete @@ -145,98 +139,25 @@ rules: - ipam.ironcore.dev resources: - prefixallocations/status + - prefixes/status verbs: - get - patch - update -- apiGroups: - - ipam.ironcore.dev - resources: - - prefixes - verbs: - - create - - delete - - get - - list - - patch - - update - - watch - apiGroups: - ipam.ironcore.dev resources: - prefixes/finalizers verbs: - update -- apiGroups: - - ipam.ironcore.dev - resources: - - prefixes/status - verbs: - - get - - patch - - update - apiGroups: - networking.ironcore.dev resources: - loadbalancerroutings - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - networking.ironcore.dev - resources: - loadbalancers - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - networking.ironcore.dev - resources: - - loadbalancers/finalizers - verbs: - - update -- apiGroups: - - networking.ironcore.dev - resources: - - loadbalancers/status - verbs: - - get - - patch - - update -- apiGroups: - - networking.ironcore.dev - resources: - - natgateways - verbs: - - get - - list - - watch -- apiGroups: - - networking.ironcore.dev - resources: - networkinterfaces - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - networking.ironcore.dev - resources: - networks + - virtualips verbs: - create - delete @@ -248,12 +169,14 @@ rules: - apiGroups: - networking.ironcore.dev resources: + - loadbalancers/finalizers - networks/finalizers verbs: - update - apiGroups: - networking.ironcore.dev resources: + - loadbalancers/status - networks/status verbs: - get @@ -262,19 +185,17 @@ rules: - apiGroups: - networking.ironcore.dev resources: - - virtualips + - natgateways verbs: - - create - - delete - get - list - - patch - - update - watch - apiGroups: - storage.ironcore.dev resources: - bucketclasses + - volumeclasses + - volumes verbs: - create - delete @@ -287,64 +208,16 @@ rules: - storage.ironcore.dev resources: - bucketclasses/finalizers + - volumeclasses/finalizers verbs: - update - apiGroups: - storage.ironcore.dev resources: - bucketclasses/status - verbs: - - get - - patch - - update -- apiGroups: - - storage.ironcore.dev - resources: - - bucketpools - verbs: - - get - - list - - watch -- apiGroups: - - storage.ironcore.dev - resources: - - buckets - verbs: - - get - - list - - patch - - update - - watch -- apiGroups: - - storage.ironcore.dev - resources: - buckets/status - verbs: - - get - - patch - - update -- apiGroups: - - storage.ironcore.dev - resources: - - volumeclasses - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - storage.ironcore.dev - resources: - - volumeclasses/finalizers - verbs: - - update -- apiGroups: - - storage.ironcore.dev - resources: - volumeclasses/status + - volumes/status verbs: - get - patch @@ -352,6 +225,7 @@ rules: - apiGroups: - storage.ironcore.dev resources: + - bucketpools - volumepools verbs: - get @@ -360,20 +234,10 @@ rules: - apiGroups: - storage.ironcore.dev resources: - - volumes + - buckets verbs: - - create - - delete - get - list - patch - update - watch -- apiGroups: - - storage.ironcore.dev - resources: - - volumes/status - verbs: - - get - - patch - - update diff --git a/config/machinepoollet-broker/broker-rbac/role.yaml b/config/machinepoollet-broker/broker-rbac/role.yaml index 63fc023d0..8cfd86258 100644 --- a/config/machinepoollet-broker/broker-rbac/role.yaml +++ b/config/machinepoollet-broker/broker-rbac/role.yaml @@ -47,89 +47,10 @@ rules: - networking.ironcore.dev resources: - loadbalancerroutings - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - networking.ironcore.dev - resources: - loadbalancers - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - networking.ironcore.dev - resources: - - loadbalancers/status - verbs: - - get - - patch - - update -- apiGroups: - - networking.ironcore.dev - resources: - natgateways - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - networking.ironcore.dev - resources: - - natgateways/status - verbs: - - get - - patch - - update -- apiGroups: - - networking.ironcore.dev - resources: - networkinterfaces - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - networking.ironcore.dev - resources: - networks - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - networking.ironcore.dev - resources: - - networks/status - verbs: - - get - - patch - - update -- apiGroups: - - networking.ironcore.dev - resources: - virtualips verbs: - create @@ -142,6 +63,9 @@ rules: - apiGroups: - networking.ironcore.dev resources: + - loadbalancers/status + - natgateways/status + - networks/status - virtualips/status verbs: - get diff --git a/config/machinepoollet-broker/poollet-rbac/role.yaml b/config/machinepoollet-broker/poollet-rbac/role.yaml index 3f4bc7e08..26f4f1faa 100644 --- a/config/machinepoollet-broker/poollet-rbac/role.yaml +++ b/config/machinepoollet-broker/poollet-rbac/role.yaml @@ -72,6 +72,7 @@ rules: - compute.ironcore.dev resources: - machinepools/status + - machines/status verbs: - get - patch @@ -92,14 +93,6 @@ rules: - machines/finalizers verbs: - update -- apiGroups: - - compute.ironcore.dev - resources: - - machines/status - verbs: - - get - - patch - - update - apiGroups: - ipam.ironcore.dev resources: diff --git a/config/volumepoollet-broker/poollet-rbac/role.yaml b/config/volumepoollet-broker/poollet-rbac/role.yaml index 2562940d7..8073307c5 100644 --- a/config/volumepoollet-broker/poollet-rbac/role.yaml +++ b/config/volumepoollet-broker/poollet-rbac/role.yaml @@ -60,6 +60,7 @@ rules: - storage.ironcore.dev resources: - volumepools/status + - volumes/status verbs: - get - patch @@ -80,11 +81,3 @@ rules: - volumes/finalizers verbs: - update -- apiGroups: - - storage.ironcore.dev - resources: - - volumes/status - verbs: - - get - - patch - - update diff --git a/go.mod b/go.mod index b6b68f007..c01f4349b 100644 --- a/go.mod +++ b/go.mod @@ -19,18 +19,18 @@ require ( golang.org/x/sync v0.10.0 golang.org/x/sys v0.28.0 google.golang.org/grpc v1.69.0 - k8s.io/api v0.30.7 - k8s.io/apimachinery v0.30.7 - k8s.io/apiserver v0.30.7 - k8s.io/client-go v0.30.7 - k8s.io/code-generator v0.30.7 - k8s.io/component-base v0.30.7 + k8s.io/api v0.31.0 + k8s.io/apimachinery v0.31.0 + k8s.io/apiserver v0.31.0 + k8s.io/client-go v0.31.0 + k8s.io/code-generator v0.31.0 + k8s.io/component-base v0.31.0 k8s.io/klog/v2 v2.130.1 - k8s.io/kube-aggregator v0.30.7 - k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 - k8s.io/kubectl v0.30.7 + k8s.io/kube-aggregator v0.31.0 + k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f + k8s.io/kubectl v0.31.0 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 - sigs.k8s.io/controller-runtime v0.18.5 + sigs.k8s.io/controller-runtime v0.19.0 sigs.k8s.io/structured-merge-diff/v4 v4.4.3 sigs.k8s.io/yaml v1.4.0 ) @@ -38,10 +38,10 @@ require ( require ( github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect - github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect + github.com/antlr4-go/antlr/v4 v4.13.0 // indirect github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cenkalti/backoff/v4 v4.2.1 // indirect + github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect @@ -49,8 +49,9 @@ require ( github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/evanphx/json-patch v5.6.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.9.0 // indirect - github.com/felixge/httpsnoop v1.0.3 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-logr/zapr v1.3.0 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect @@ -59,46 +60,46 @@ require ( github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect - github.com/google/cel-go v0.17.8 // indirect - github.com/google/gnostic-models v0.6.8 // indirect + github.com/google/cel-go v0.20.1 // indirect + github.com/google/gnostic-models v0.6.9 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect github.com/imdario/mergo v0.3.13 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/mailru/easyjson v0.7.7 // indirect - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect - github.com/moby/spdystream v0.2.0 // indirect - github.com/moby/term v0.0.0-20221205130635-1aeaba878587 // indirect + github.com/moby/spdystream v0.4.0 // indirect + github.com/moby/term v0.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.45.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/client_golang v1.19.1 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.55.0 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/stoewer/go-strcase v1.2.0 // indirect - go.etcd.io/etcd/api/v3 v3.5.10 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect - go.etcd.io/etcd/client/v3 v3.5.10 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.etcd.io/etcd/api/v3 v3.5.14 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.5.14 // indirect + go.etcd.io/etcd/client/v3 v3.5.14 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect go.opentelemetry.io/otel v1.31.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 // indirect go.opentelemetry.io/otel/metric v1.31.0 // indirect go.opentelemetry.io/otel/sdk v1.31.0 // indirect go.opentelemetry.io/otel/trace v1.31.0 // indirect - go.opentelemetry.io/proto/otlp v1.0.0 // indirect + go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/crypto v0.31.0 // indirect @@ -114,14 +115,15 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect google.golang.org/protobuf v1.35.1 // indirect + gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.30.4 // indirect - k8s.io/cli-runtime v0.30.7 // indirect - k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect - k8s.io/kms v0.30.7 // indirect - sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 // indirect + k8s.io/apiextensions-apiserver v0.31.0 // indirect + k8s.io/cli-runtime v0.31.0 // indirect + k8s.io/gengo/v2 v2.0.0-20240826214909-a7b603a56eb7 // indirect + k8s.io/kms v0.31.0 // indirect + sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect ) diff --git a/go.sum b/go.sum index 0dab80d98..e019eb082 100644 --- a/go.sum +++ b/go.sum @@ -1,13 +1,9 @@ -cloud.google.com/go v0.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM= -cloud.google.com/go/compute v1.24.0 h1:phWcR2eWzRJaL/kOiJwfFsPs4BaKq1j6vnpZrc1YlVg= -cloud.google.com/go/compute/metadata v0.5.2 h1:UxK4uu/Tn+I3p2dYWTfiX4wva7aYlKixAHn3fyqngqo= -cloud.google.com/go/compute/metadata v0.5.2/go.mod h1:C66sj2AluDcIqakBq/M8lw8/ybHgOZqin2obFxa/E5k= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= -github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df h1:7RFfzj4SSt6nnvCPbCqijJi1nWCd+TqAT3bYCStRC18= -github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= +github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= +github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= @@ -18,12 +14,10 @@ github.com/bits-and-blooms/bitset v1.20.0 h1:2F+rfL86jE2d/bmw7OhqUg2Sj/1rURkBn3M github.com/bits-and-blooms/bitset v1.20.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= -github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= -github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= +github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78 h1:QVw89YDxXxEe+l8gU8ETbOasdwEV+avkR75ZzsVV9WI= -github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= @@ -40,16 +34,16 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/envoyproxy/protoc-gen-validate v1.1.0 h1:tntQDh69XqOCOZsDz0lVJQez/2L6Uu2PdjCQwWCJ3bM= -github.com/envoyproxy/protoc-gen-validate v1.1.0/go.mod h1:sXRDRVmzEbkM7CVcM06s9shE/m23dg3wzjl0UWqJ2q4= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= -github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= -github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= +github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-chi/chi/v5 v5.2.0 h1:Aj1EtB0qR2Rdo2dG4O94RIU35w2lvQSj6BRA4+qwFL0= github.com/go-chi/chi/v5 v5.2.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -74,18 +68,16 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/golang/glog v1.2.2 h1:1+mZ9upx1Dh6FmUTFR1naJ77miKiXgALjWOZ3NVFPmY= -github.com/golang/glog v1.2.2/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= -github.com/google/cel-go v0.17.8 h1:j9m730pMZt1Fc4oKhCLUHfjj6527LuhYcYw0Rl8gqto= -github.com/google/cel-go v0.17.8/go.mod h1:HXZKzB0LXqer5lHHgfWAnlYwJaQBDKMjxjulNQzhwhY= -github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= -github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= +github.com/google/cel-go v0.20.1 h1:nDx9r8S3L4pE61eDdt8igGj8rf5kjYR3ILxWIpWNi84= +github.com/google/cel-go v0.20.1/go.mod h1:kWcIzTsPX0zmQ+H3TirHstLLf9ep5QTsZBN9u4dOYLg= +github.com/google/gnostic-models v0.6.9 h1:MU/8wDLif2qCXZmzncUQ/BOfxWfthHi63KqpoNbWqVw= +github.com/google/gnostic-models v0.6.9/go.mod h1:CiWsm0s6BSQd1hRn8/QmxqB6BesYcbSZxsz9b0KuDBw= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -96,7 +88,6 @@ github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgY github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= @@ -105,8 +96,8 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92Bcuy github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -132,14 +123,12 @@ github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhn github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= -github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/term v0.0.0-20221205130635-1aeaba878587 h1:HfkjXDfhgVaN5rmueG8cL8KKeFNecRCXFhaJ2qZ5SKA= -github.com/moby/term v0.0.0-20221205130635-1aeaba878587/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= +github.com/moby/spdystream v0.4.0 h1:Vy79D6mHeJJjiPdFEL2yku1kl0chZpJfZcPpb16BRl8= +github.com/moby/spdystream v0.4.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI= +github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= +github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -158,19 +147,19 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= -github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= +github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= +github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= +github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= @@ -193,36 +182,38 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE= github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= -go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= -go.etcd.io/etcd/api/v3 v3.5.10 h1:szRajuUUbLyppkhs9K6BRtjY37l66XQQmw7oZRANE4k= -go.etcd.io/etcd/api/v3 v3.5.10/go.mod h1:TidfmT4Uycad3NM/o25fG3J07odo4GBB9hoxaodFCtI= -go.etcd.io/etcd/client/pkg/v3 v3.5.10 h1:kfYIdQftBnbAq8pUWFXfpuuxFSKzlmM5cSn76JByiT0= -go.etcd.io/etcd/client/pkg/v3 v3.5.10/go.mod h1:DYivfIviIuQ8+/lCq4vcxuseg2P2XbHygkKwFo9fc8U= -go.etcd.io/etcd/client/v2 v2.305.10 h1:MrmRktzv/XF8CvtQt+P6wLUlURaNpSDJHFZhe//2QE4= -go.etcd.io/etcd/client/v2 v2.305.10/go.mod h1:m3CKZi69HzilhVqtPDcjhSGp+kA1OmbNn0qamH80xjA= -go.etcd.io/etcd/client/v3 v3.5.10 h1:W9TXNZ+oB3MCd/8UjxHTWK5J9Nquw9fQBLJd5ne5/Ao= -go.etcd.io/etcd/client/v3 v3.5.10/go.mod h1:RVeBnDz2PUEZqTpgqwAtUd8nAPf5kjyFyND7P1VkOKc= -go.etcd.io/etcd/pkg/v3 v3.5.10 h1:WPR8K0e9kWl1gAhB5A7gEa5ZBTNkT9NdNWrR8Qpo1CM= -go.etcd.io/etcd/pkg/v3 v3.5.10/go.mod h1:TKTuCKKcF1zxmfKWDkfz5qqYaE3JncKKZPFf8c1nFUs= -go.etcd.io/etcd/raft/v3 v3.5.10 h1:cgNAYe7xrsrn/5kXMSaH8kM/Ky8mAdMqGOxyYwpP0LA= -go.etcd.io/etcd/raft/v3 v3.5.10/go.mod h1:odD6kr8XQXTy9oQnyMPBOr0TVe+gT0neQhElQ6jbGRc= -go.etcd.io/etcd/server/v3 v3.5.10 h1:4NOGyOwD5sUZ22PiWYKmfxqoeh72z6EhYjNosKGLmZg= -go.etcd.io/etcd/server/v3 v3.5.10/go.mod h1:gBplPHfs6YI0L+RpGkTQO7buDbHv5HJGG/Bst0/zIPo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 h1:PzIubN4/sjByhDRHLviCjJuweBXWFZWhghjg7cS28+M= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0/go.mod h1:Ct6zzQEuGK3WpJs2n4dn+wfJYzd/+hNnxMRTWjGn30M= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0 h1:KfYpVmrjI7JuToy5k8XV3nkapjWx48k4E4JOtVstzQI= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0/go.mod h1:SeQhzAEccGVZVEy7aH87Nh0km+utSpo1pTv6eMMop48= +go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI= +go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE= +go.etcd.io/etcd/api/v3 v3.5.14 h1:vHObSCxyB9zlF60w7qzAdTcGaglbJOpSj1Xj9+WGxq0= +go.etcd.io/etcd/api/v3 v3.5.14/go.mod h1:BmtWcRlQvwa1h3G2jvKYwIQy4PkHlDej5t7uLMUdJUU= +go.etcd.io/etcd/client/pkg/v3 v3.5.14 h1:SaNH6Y+rVEdxfpA2Jr5wkEvN6Zykme5+YnbCkxvuWxQ= +go.etcd.io/etcd/client/pkg/v3 v3.5.14/go.mod h1:8uMgAokyG1czCtIdsq+AGyYQMvpIKnSvPjFMunkgeZI= +go.etcd.io/etcd/client/v2 v2.305.13 h1:RWfV1SX5jTU0lbCvpVQe3iPQeAHETWdOTb6pxhd77C8= +go.etcd.io/etcd/client/v2 v2.305.13/go.mod h1:iQnL7fepbiomdXMb3om1rHq96htNNGv2sJkEcZGDRRg= +go.etcd.io/etcd/client/v3 v3.5.14 h1:CWfRs4FDaDoSz81giL7zPpZH2Z35tbOrAJkkjMqOupg= +go.etcd.io/etcd/client/v3 v3.5.14/go.mod h1:k3XfdV/VIHy/97rqWjoUzrj9tk7GgJGH9J8L4dNXmAk= +go.etcd.io/etcd/pkg/v3 v3.5.13 h1:st9bDWNsKkBNpP4PR1MvM/9NqUPfvYZx/YXegsYEH8M= +go.etcd.io/etcd/pkg/v3 v3.5.13/go.mod h1:N+4PLrp7agI/Viy+dUYpX7iRtSPvKq+w8Y14d1vX+m0= +go.etcd.io/etcd/raft/v3 v3.5.13 h1:7r/NKAOups1YnKcfro2RvGGo2PTuizF/xh26Z2CTAzA= +go.etcd.io/etcd/raft/v3 v3.5.13/go.mod h1:uUFibGLn2Ksm2URMxN1fICGhk8Wu96EfDQyuLhAcAmw= +go.etcd.io/etcd/server/v3 v3.5.13 h1:V6KG+yMfMSqWt+lGnhFpP5z5dRUj1BDRJ5k1fQ9DFok= +go.etcd.io/etcd/server/v3 v3.5.13/go.mod h1:K/8nbsGupHqmr5MkgaZpLlH1QdX1pcNQLAkODy44XcQ= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg= go.opentelemetry.io/otel v1.31.0 h1:NsJcKPIW0D0H3NgzPDHmo0WW6SptzPdqg/L1zsIm2hY= go.opentelemetry.io/otel v1.31.0/go.mod h1:O0C14Yl9FgkjqcCZAsE053C13OaddMYr/hz6clDkEJE= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 h1:cl5P5/GIfFh4t6xyruOgJP5QiA1pw4fYYdv6nc6CBWw= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0/go.mod h1:zgBdWWAu7oEEMC06MMKc5NLbA/1YDXV1sMpSqEeLQLg= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 h1:tIqheXEFWAZ7O8A7m+J0aPTmpJN3YQ7qetUAdkkkKpk= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0/go.mod h1:nUeKExfxAQVbiVFn32YXpXZZHZ61Cc3s3Rn1pDBGAb0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 h1:qFffATk0X+HD+f1Z8lswGiOQYKHRlzfmdJm0wEaVrFA= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0/go.mod h1:MOiCmryaYtc+V0Ei+Tx9o5S1ZjA7kzLucuVuyzBZloQ= go.opentelemetry.io/otel/metric v1.31.0 h1:FSErL0ATQAmYHUIzSezZibnyVlft1ybhy4ozRPcF2fE= go.opentelemetry.io/otel/metric v1.31.0/go.mod h1:C3dEloVbLuYoX41KpmAhOqNriGbA+qqH6PQ5E5mUfnY= go.opentelemetry.io/otel/sdk v1.31.0 h1:xLY3abVHYZ5HSfOg3l2E5LUj2Cwva5Y7yGxnSW9H5Gk= @@ -231,8 +222,8 @@ go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4Jjx go.opentelemetry.io/otel/sdk/metric v1.31.0/go.mod h1:CRInTMVvNhUKgSAMbKyTMxqOBC0zgyxzW55lZzX43Y8= go.opentelemetry.io/otel/trace v1.31.0 h1:ffjsj1aRouKewfr85U2aGagJ46+MvodynlQ1HYdmJys= go.opentelemetry.io/otel/trace v1.31.0/go.mod h1:TXZkRk7SM2ZQLtR6eoAWQFIHPvzQ06FJAsO1tJg480A= -go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= -go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= +go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= +go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= @@ -306,6 +297,8 @@ google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojt gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= +gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= @@ -317,40 +310,40 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.30.7 h1:wB2eHI+IptVYsz5WsAQpI6+Dqi3+11wEWBqIh4fh980= -k8s.io/api v0.30.7/go.mod h1:bR0EwbmhYmJvUoeza7ZzBUmYCrVXccQ9JOdfv0BxhH0= -k8s.io/apiextensions-apiserver v0.30.4 h1:FwOMIk/rzZvM/Gx0IOz0+biZ+dlnlCeyfXW17uzV1qE= -k8s.io/apiextensions-apiserver v0.30.4/go.mod h1:m8cAkJ9PVU8Olb4cPW4hrUDBZGvoSJ0kY0G0CfdGQac= -k8s.io/apimachinery v0.30.7 h1:CoQFxvzPFKwU1eJGN/8LgM3ZJBC3hKgvwGqRrL43uIY= -k8s.io/apimachinery v0.30.7/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= -k8s.io/apiserver v0.30.7 h1:4tKcwejf+OmBniwtXAXvwGce6K+G0Q4s5bWugap4d0Y= -k8s.io/apiserver v0.30.7/go.mod h1:oj6q6jJtJWxHuavNRxFp6nhUxi8UX07HZIFKu1eWYjs= -k8s.io/cli-runtime v0.30.7 h1:XQsBcf0dKk745fklRwD5pc0IdcrPJPgUr+W349VJAV4= -k8s.io/cli-runtime v0.30.7/go.mod h1:B67pZMYMp+7h2Xyy4Yeu4T9OwYvx1UmbRUqxgpCm3vA= -k8s.io/client-go v0.30.7 h1:DQRfuGWxDzxPEyyiTE/fxzAsZcj2p9sbc5671njR52w= -k8s.io/client-go v0.30.7/go.mod h1:oED9+njB91ExCc4BNPAotniB7WH1ig7CmiBx5pVA1yw= -k8s.io/code-generator v0.30.7 h1:Vw8991AoEjwW3qjkJhsTJosrlCN+6+VA3KR7wU28Sc0= -k8s.io/code-generator v0.30.7/go.mod h1:kMe4cE9rGqC9SoXwHqV7VaD4F8G7UL0BQF6NbRqxOdo= -k8s.io/component-base v0.30.7 h1:wtbQWLzj5xAGjz+/U/nYNnAc8+wpTUvCqN0uZuCuFF8= -k8s.io/component-base v0.30.7/go.mod h1:UjPOkWiDcvUiQRTpbr3kghl+pFMtFSgqYbWKHKRcXJc= -k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 h1:NGrVE502P0s0/1hudf8zjgwki1X/TByhmAoILTarmzo= -k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= +k8s.io/api v0.31.0 h1:b9LiSjR2ym/SzTOlfMHm1tr7/21aD7fSkqgD/CVJBCo= +k8s.io/api v0.31.0/go.mod h1:0YiFF+JfFxMM6+1hQei8FY8M7s1Mth+z/q7eF1aJkTE= +k8s.io/apiextensions-apiserver v0.31.0 h1:fZgCVhGwsclj3qCw1buVXCV6khjRzKC5eCFt24kyLSk= +k8s.io/apiextensions-apiserver v0.31.0/go.mod h1:b9aMDEYaEe5sdK+1T0KU78ApR/5ZVp4i56VacZYEHxk= +k8s.io/apimachinery v0.31.0 h1:m9jOiSr3FoSSL5WO9bjm1n6B9KROYYgNZOb4tyZ1lBc= +k8s.io/apimachinery v0.31.0/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/apiserver v0.31.0 h1:p+2dgJjy+bk+B1Csz+mc2wl5gHwvNkC9QJV+w55LVrY= +k8s.io/apiserver v0.31.0/go.mod h1:KI9ox5Yu902iBnnyMmy7ajonhKnkeZYJhTZ/YI+WEMk= +k8s.io/cli-runtime v0.31.0 h1:V2Q1gj1u3/WfhD475HBQrIYsoryg/LrhhK4RwpN+DhA= +k8s.io/cli-runtime v0.31.0/go.mod h1:vg3H94wsubuvWfSmStDbekvbla5vFGC+zLWqcf+bGDw= +k8s.io/client-go v0.31.0 h1:QqEJzNjbN2Yv1H79SsS+SWnXkBgVu4Pj3CJQgbx0gI8= +k8s.io/client-go v0.31.0/go.mod h1:Y9wvC76g4fLjmU0BA+rV+h2cncoadjvjjkkIGoTLcGU= +k8s.io/code-generator v0.31.0 h1:w607nrMi1KeDKB3/F/J4lIoOgAwc+gV9ZKew4XRfMp8= +k8s.io/code-generator v0.31.0/go.mod h1:84y4w3es8rOJOUUP1rLsIiGlO1JuEaPFXQPA9e/K6U0= +k8s.io/component-base v0.31.0 h1:/KIzGM5EvPNQcYgwq5NwoQBaOlVFrghoVGr8lG6vNRs= +k8s.io/component-base v0.31.0/go.mod h1:TYVuzI1QmN4L5ItVdMSXKvH7/DtvIuas5/mm8YT3rTo= +k8s.io/gengo/v2 v2.0.0-20240826214909-a7b603a56eb7 h1:cErOOTkQ3JW19o4lo91fFurouhP8NcoBvb7CkvhZZpk= +k8s.io/gengo/v2 v2.0.0-20240826214909-a7b603a56eb7/go.mod h1:EJykeLsmFC60UQbYJezXkEsG2FLrt0GPNkU5iK5GWxU= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kms v0.30.7 h1:uxqXTHzgpPkr8RSb6zB0NrYOeXfdt5yHyQdFkRNGdz4= -k8s.io/kms v0.30.7/go.mod h1:GrMurD0qk3G4yNgGcsCEmepqf9KyyIrTXYR2lyUOJC4= -k8s.io/kube-aggregator v0.30.7 h1:27uHEqAX9OqteptducIoAPjesrcYWir2QIb1v/btabc= -k8s.io/kube-aggregator v0.30.7/go.mod h1:jWSRAe7kfNaYJ4pzn+9XeobUxZl+nC8huj2ZEAohgAg= -k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= -k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= -k8s.io/kubectl v0.30.7 h1:K9T8RufI5mKZmX5yITFzAT5I0fx9uheSVtR9OdbmIk4= -k8s.io/kubectl v0.30.7/go.mod h1:VdeIJnZTTkudzbMxkM25Us1MmeLeqhl+Eekt66eg7Ik= +k8s.io/kms v0.31.0 h1:KchILPfB1ZE+ka7223mpU5zeFNkmb45jl7RHnlImUaI= +k8s.io/kms v0.31.0/go.mod h1:OZKwl1fan3n3N5FFxnW5C4V3ygrah/3YXeJWS3O6+94= +k8s.io/kube-aggregator v0.31.0 h1:3DqSpmqHF8rey7fY+qYXLJms0tYPhxrgWvjpnKVnS0Y= +k8s.io/kube-aggregator v0.31.0/go.mod h1:Fa+OVSpMQC7zbTTz7/QG7FXe9jZ8usuJQej5sMdCrkM= +k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y= +k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4= +k8s.io/kubectl v0.31.0 h1:kANwAAPVY02r4U4jARP/C+Q1sssCcN/1p9Nk+7BQKVg= +k8s.io/kubectl v0.31.0/go.mod h1:pB47hhFypGsaHAPjlwrNbvhXgmuAr01ZBvAIIUaI8d4= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 h1:/U5vjBbQn3RChhv7P11uhYvCSm5G2GaIi5AIGBS6r4c= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0/go.mod h1:z7+wmGM2dfIiLRfrC6jb5kV2Mq/sK1ZP303cxzkV5Y4= -sigs.k8s.io/controller-runtime v0.18.5 h1:nTHio/W+Q4aBlQMgbnC5hZb4IjIidyrizMai9P6n4Rk= -sigs.k8s.io/controller-runtime v0.18.5/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3 h1:2770sDpzrjjsAtVhSeUFseziht227YAWYHLGNM8QPwY= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.30.3/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= +sigs.k8s.io/controller-runtime v0.19.0 h1:nWVM7aq+Il2ABxwiCizrVDSlmDcshi9llbaFbC0ji/Q= +sigs.k8s.io/controller-runtime v0.19.0/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.4.3 h1:sCP7Vv3xx/CWIuTPVN38lUPx0uw0lcLfzaiDa8Ja01A= diff --git a/internal/admission/plugin/resourcequota/controller.go b/internal/admission/plugin/resourcequota/controller.go index c8954873c..4321fbfc6 100644 --- a/internal/admission/plugin/resourcequota/controller.go +++ b/internal/admission/plugin/resourcequota/controller.go @@ -32,7 +32,7 @@ type EvaluatorController struct { quotaAccessor QuotaAccessor registry quota.Registry - queue workqueue.Interface + queue workqueue.TypedInterface[string] inProgress sets.Set[string] work map[string][]*admissionWaiter dirtyWork map[string][]*admissionWaiter @@ -42,7 +42,7 @@ func NewEvaluatorController(quotaAccessor QuotaAccessor, registry quota.Registry return &EvaluatorController{ quotaAccessor: quotaAccessor, registry: registry, - queue: workqueue.NewNamed("quota_admission_evaluator"), + queue: workqueue.NewTypedWithConfig[string](workqueue.TypedQueueConfig[string]{Name: "quota_admission_evaluator"}), inProgress: sets.New[string](), work: make(map[string][]*admissionWaiter), dirtyWork: make(map[string][]*admissionWaiter), @@ -214,11 +214,10 @@ func (e *EvaluatorController) completeWork(ns string) { } func (e *EvaluatorController) getWork() (string, []*admissionWaiter, bool) { - uncastNS, shutdown := e.queue.Get() + ns, shutdown := e.queue.Get() if shutdown { return "", nil, true } - ns := uncastNS.(string) e.workLock.Lock() defer e.workLock.Unlock() diff --git a/internal/apiserver/apiserver.go b/internal/apiserver/apiserver.go index 6e0710613..1880c08f0 100644 --- a/internal/apiserver/apiserver.go +++ b/internal/apiserver/apiserver.go @@ -12,7 +12,6 @@ import ( ipamrest "github.com/ironcore-dev/ironcore/internal/registry/ipam/rest" networkingrest "github.com/ironcore-dev/ironcore/internal/registry/networking/rest" storagerest "github.com/ironcore-dev/ironcore/internal/registry/storage/rest" - "k8s.io/apimachinery/pkg/version" "k8s.io/apiserver/pkg/registry/generic" genericapiserver "k8s.io/apiserver/pkg/server" serverstorage "k8s.io/apiserver/pkg/server/storage" @@ -56,12 +55,6 @@ func (cfg *Config) Complete() CompletedConfig { cfg.GenericConfig.Complete(), &cfg.ExtraConfig, } - - c.GenericConfig.Version = &version.Info{ - Major: "1", - Minor: "0", - } - return CompletedConfig{&c} } diff --git a/internal/app/apiserver/apiserver.go b/internal/app/apiserver/apiserver.go index 652ded327..231ba69d3 100644 --- a/internal/app/apiserver/apiserver.go +++ b/internal/app/apiserver/apiserver.go @@ -41,6 +41,7 @@ import ( genericoptions "k8s.io/apiserver/pkg/server/options" serverstorage "k8s.io/apiserver/pkg/server/storage" utilfeature "k8s.io/apiserver/pkg/util/feature" + utilversion "k8s.io/apiserver/pkg/util/version" netutils "k8s.io/utils/net" ) @@ -203,6 +204,8 @@ func (o *IronCoreAPIServerOptions) Config() (*apiserver.Config, error) { serverConfig := genericapiserver.NewRecommendedConfig(api.Codecs) + serverConfig.EffectiveVersion = utilversion.NewEffectiveVersion("1.0") + serverConfig.OpenAPIConfig = genericapiserver.DefaultOpenAPIConfig(ironcoreopenapi.GetOpenAPIDefinitions, openapi.NewDefinitionNamer(api.Scheme)) serverConfig.OpenAPIConfig.Info.Title = "ironcore-api" serverConfig.OpenAPIConfig.Info.Version = "0.1" @@ -244,11 +247,11 @@ func (o *IronCoreAPIServerOptions) Run(ctx context.Context) error { return err } - server.GenericAPIServer.AddPostStartHookOrDie("start-ironcore-api-server-informers", func(context genericapiserver.PostStartHookContext) error { - config.GenericConfig.SharedInformerFactory.Start(context.StopCh) - o.SharedInformerFactory.Start(context.StopCh) + server.GenericAPIServer.AddPostStartHookOrDie("start-ironcore-api-server-informers", func(hookContext genericapiserver.PostStartHookContext) error { + config.GenericConfig.SharedInformerFactory.Start(hookContext.Context.Done()) + o.SharedInformerFactory.Start(hookContext.Context.Done()) return nil }) - return server.GenericAPIServer.PrepareRun().Run(ctx.Done()) + return server.GenericAPIServer.PrepareRun().RunWithContext(ctx) } diff --git a/internal/controllers/compute/machine_scheduler.go b/internal/controllers/compute/machine_scheduler.go index 4ab7c3e16..5a59c275b 100644 --- a/internal/controllers/compute/machine_scheduler.go +++ b/internal/controllers/compute/machine_scheduler.go @@ -26,6 +26,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/predicate" + "sigs.k8s.io/controller-runtime/pkg/reconcile" ) const ( @@ -75,18 +76,18 @@ func (s *MachineScheduler) skipSchedule(log logr.Logger, machine *computev1alpha return isAssumed } -func (s *MachineScheduler) matchesLabels(ctx context.Context, pool *scheduler.ContainerInfo, machine *computev1alpha1.Machine) bool { +func (s *MachineScheduler) matchesLabels(_ context.Context, pool *scheduler.ContainerInfo, machine *computev1alpha1.Machine) bool { nodeLabels := labels.Set(pool.Node().Labels) machinePoolSelector := labels.SelectorFromSet(machine.Spec.MachinePoolSelector) return machinePoolSelector.Matches(nodeLabels) } -func (s *MachineScheduler) tolerateTaints(ctx context.Context, pool *scheduler.ContainerInfo, machine *computev1alpha1.Machine) bool { +func (s *MachineScheduler) tolerateTaints(_ context.Context, pool *scheduler.ContainerInfo, machine *computev1alpha1.Machine) bool { return v1alpha1.TolerateTaints(machine.Spec.Tolerations, pool.Node().Spec.Taints) } -func (s *MachineScheduler) fitsPool(ctx context.Context, pool *scheduler.ContainerInfo, machine *computev1alpha1.Machine) bool { +func (s *MachineScheduler) fitsPool(_ context.Context, pool *scheduler.ContainerInfo, machine *computev1alpha1.Machine) bool { machineClassName := machine.Spec.MachineClassRef.Name allocatable, ok := pool.Node().Status.Allocatable[corev1alpha1.ClassCountFor(corev1alpha1.ClassTypeMachineClass, machineClassName)] @@ -192,7 +193,7 @@ func (s *MachineScheduler) bind(ctx context.Context, log logr.Logger, assumed *c return nil } -func (s *MachineScheduler) enqueueUnscheduledMachines(ctx context.Context, queue workqueue.RateLimitingInterface) { +func (s *MachineScheduler) enqueueUnscheduledMachines(ctx context.Context, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) machineList := &computev1alpha1.MachineList{} if err := s.List(ctx, machineList, client.MatchingFields{computeclient.MachineSpecMachinePoolRefNameField: ""}); err != nil { @@ -227,7 +228,7 @@ func (s *MachineScheduler) isMachineNotAssigned() predicate.Predicate { func (s *MachineScheduler) handleMachine() handler.EventHandler { return handler.Funcs{ - CreateFunc: func(ctx context.Context, evt event.CreateEvent, queue workqueue.RateLimitingInterface) { + CreateFunc: func(ctx context.Context, evt event.CreateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { machine := evt.Object.(*computev1alpha1.Machine) log := ctrl.LoggerFrom(ctx) @@ -235,7 +236,7 @@ func (s *MachineScheduler) handleMachine() handler.EventHandler { log.Error(err, "Error adding machine to cache") } }, - UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.RateLimitingInterface) { + UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) oldInstance := evt.ObjectOld.(*computev1alpha1.Machine) @@ -244,7 +245,7 @@ func (s *MachineScheduler) handleMachine() handler.EventHandler { log.Error(err, "Error updating machine in cache") } }, - DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.RateLimitingInterface) { + DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) instance := evt.Object.(*computev1alpha1.Machine) @@ -257,18 +258,18 @@ func (s *MachineScheduler) handleMachine() handler.EventHandler { func (s *MachineScheduler) handleMachinePool() handler.EventHandler { return handler.Funcs{ - CreateFunc: func(ctx context.Context, evt event.CreateEvent, queue workqueue.RateLimitingInterface) { + CreateFunc: func(ctx context.Context, evt event.CreateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { pool := evt.Object.(*computev1alpha1.MachinePool) s.Cache.AddContainer(pool) s.enqueueUnscheduledMachines(ctx, queue) }, - UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.RateLimitingInterface) { + UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { oldPool := evt.ObjectOld.(*computev1alpha1.MachinePool) newPool := evt.ObjectNew.(*computev1alpha1.MachinePool) s.Cache.UpdateContainer(oldPool, newPool) s.enqueueUnscheduledMachines(ctx, queue) }, - DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.RateLimitingInterface) { + DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) pool := evt.Object.(*computev1alpha1.MachinePool) diff --git a/internal/controllers/compute/machineclass_controller.go b/internal/controllers/compute/machineclass_controller.go index ab80ec0d6..00e444821 100644 --- a/internal/controllers/compute/machineclass_controller.go +++ b/internal/controllers/compute/machineclass_controller.go @@ -20,6 +20,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/reconcile" ) // MachineClassReconciler reconciles a MachineClassRef object @@ -124,7 +125,7 @@ func (r *MachineClassReconciler) SetupWithManager(mgr ctrl.Manager) error { Watches( &computev1alpha1.Machine{}, handler.Funcs{ - DeleteFunc: func(ctx context.Context, event event.DeleteEvent, queue workqueue.RateLimitingInterface) { + DeleteFunc: func(ctx context.Context, event event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { machine := event.Object.(*computev1alpha1.Machine) queue.Add(ctrl.Request{NamespacedName: types.NamespacedName{Name: machine.Spec.MachineClassRef.Name}}) }, diff --git a/internal/controllers/compute/suite_test.go b/internal/controllers/compute/suite_test.go index 4430ee8aa..154e7b5d7 100644 --- a/internal/controllers/compute/suite_test.go +++ b/internal/controllers/compute/suite_test.go @@ -27,8 +27,10 @@ import ( "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "k8s.io/client-go/tools/record" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config" "sigs.k8s.io/controller-runtime/pkg/envtest" "sigs.k8s.io/controller-runtime/pkg/envtest/komega" logf "sigs.k8s.io/controller-runtime/pkg/log" @@ -118,6 +120,7 @@ var _ = BeforeSuite(func() { Metrics: metricserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/internal/controllers/core/core_suite_test.go b/internal/controllers/core/core_suite_test.go index 933b907fe..22f6778c3 100644 --- a/internal/controllers/core/core_suite_test.go +++ b/internal/controllers/core/core_suite_test.go @@ -26,8 +26,10 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config" "sigs.k8s.io/controller-runtime/pkg/envtest" "sigs.k8s.io/controller-runtime/pkg/envtest/komega" logf "sigs.k8s.io/controller-runtime/pkg/log" @@ -104,6 +106,7 @@ var _ = BeforeSuite(func() { Metrics: metricserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/internal/controllers/ipam/prefix_controller.go b/internal/controllers/ipam/prefix_controller.go index 06b2522b4..4e1c897c5 100644 --- a/internal/controllers/ipam/prefix_controller.go +++ b/internal/controllers/ipam/prefix_controller.go @@ -27,6 +27,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/reconcile" ) const ( @@ -79,13 +80,13 @@ type PrefixReconciler struct { Scheme *runtime.Scheme PrefixAllocationTimeout time.Duration - allocationLimiter workqueue.RateLimiter + allocationLimiter workqueue.TypedRateLimiter[reconcile.Request] waitTimeByKey sync.Map } func (r *PrefixReconciler) allocationBackoffFor(key client.ObjectKey) time.Duration { now := time.Now() - waitTimeIface, _ := r.waitTimeByKey.LoadOrStore(key, now.Add(r.allocationLimiter.When(key))) + waitTimeIface, _ := r.waitTimeByKey.LoadOrStore(key, now.Add(r.allocationLimiter.When(reconcile.Request{NamespacedName: key}))) waitTime := waitTimeIface.(time.Time) if now.After(waitTime) { return 0 @@ -95,7 +96,7 @@ func (r *PrefixReconciler) allocationBackoffFor(key client.ObjectKey) time.Durat func (r *PrefixReconciler) forgetAllocationBackoffFor(key client.ObjectKey) { r.waitTimeByKey.Delete(key) - r.allocationLimiter.Forget(key) + r.allocationLimiter.Forget(reconcile.Request{NamespacedName: key}) } //+kubebuilder:rbac:groups=ipam.ironcore.dev,resources=prefixes,verbs=get;list;watch;create;update;patch;delete @@ -594,7 +595,7 @@ func (r *PrefixReconciler) reconcile(ctx context.Context, log logr.Logger, prefi // SetupWithManager sets up the controller with the Manager. func (r *PrefixReconciler) SetupWithManager(mgr ctrl.Manager) error { - r.allocationLimiter = workqueue.NewItemExponentialFailureRateLimiter(5*time.Millisecond, 1000*time.Second) + r.allocationLimiter = workqueue.NewTypedItemExponentialFailureRateLimiter[reconcile.Request](5*time.Millisecond, 1000*time.Second) return ctrl.NewControllerManagedBy(mgr). For(&ipamv1alpha1.Prefix{}). diff --git a/internal/controllers/ipam/suite_test.go b/internal/controllers/ipam/suite_test.go index 4c6c39847..a97b68c84 100644 --- a/internal/controllers/ipam/suite_test.go +++ b/internal/controllers/ipam/suite_test.go @@ -9,6 +9,7 @@ import ( "time" "github.com/ironcore-dev/controller-utils/buildutils" + ipamv1alpha1 "github.com/ironcore-dev/ironcore/api/ipam/v1alpha1" ipamclient "github.com/ironcore-dev/ironcore/internal/client/ipam" utilsenvtest "github.com/ironcore-dev/ironcore/utils/envtest" "github.com/ironcore-dev/ironcore/utils/envtest/apiserver" @@ -18,14 +19,14 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/record" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config" "sigs.k8s.io/controller-runtime/pkg/envtest" logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/log/zap" metricserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" - - ipamv1alpha1 "github.com/ironcore-dev/ironcore/api/ipam/v1alpha1" //+kubebuilder:scaffold:imports ) @@ -95,6 +96,7 @@ var _ = BeforeSuite(func() { Metrics: metricserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/internal/controllers/networking/loadbalancer_controller.go b/internal/controllers/networking/loadbalancer_controller.go index b9244513d..96d8bf5fc 100644 --- a/internal/controllers/networking/loadbalancer_controller.go +++ b/internal/controllers/networking/loadbalancer_controller.go @@ -23,6 +23,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/predicate" + "sigs.k8s.io/controller-runtime/pkg/reconcile" ) var ( @@ -178,7 +179,7 @@ func (r *LoadBalancerReconciler) applyRouting( } func (r *LoadBalancerReconciler) enqueueByNetworkInterface() handler.EventHandler { - getEnqueueFunc := func(ctx context.Context, nic *networkingv1alpha1.NetworkInterface) func(nics []*networkingv1alpha1.NetworkInterface, queue workqueue.RateLimitingInterface) { + getEnqueueFunc := func(ctx context.Context, nic *networkingv1alpha1.NetworkInterface) func(nics []*networkingv1alpha1.NetworkInterface, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) loadBalancerList := &networkingv1alpha1.LoadBalancerList{} if err := r.List(ctx, loadBalancerList, @@ -189,7 +190,7 @@ func (r *LoadBalancerReconciler) enqueueByNetworkInterface() handler.EventHandle return nil } - return func(nics []*networkingv1alpha1.NetworkInterface, queue workqueue.RateLimitingInterface) { + return func(nics []*networkingv1alpha1.NetworkInterface, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { for _, loadBalancer := range loadBalancerList.Items { loadBalancerKey := client.ObjectKeyFromObject(&loadBalancer) log := log.WithValues("LoadBalancerKey", loadBalancerKey) @@ -215,14 +216,14 @@ func (r *LoadBalancerReconciler) enqueueByNetworkInterface() handler.EventHandle } return handler.Funcs{ - CreateFunc: func(ctx context.Context, evt event.CreateEvent, queue workqueue.RateLimitingInterface) { + CreateFunc: func(ctx context.Context, evt event.CreateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { nic := evt.Object.(*networkingv1alpha1.NetworkInterface) enqueueFunc := getEnqueueFunc(ctx, nic) if enqueueFunc != nil { enqueueFunc([]*networkingv1alpha1.NetworkInterface{nic}, queue) } }, - UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.RateLimitingInterface) { + UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { newNic := evt.ObjectNew.(*networkingv1alpha1.NetworkInterface) oldNic := evt.ObjectOld.(*networkingv1alpha1.NetworkInterface) enqueueFunc := getEnqueueFunc(ctx, newNic) @@ -230,14 +231,14 @@ func (r *LoadBalancerReconciler) enqueueByNetworkInterface() handler.EventHandle enqueueFunc([]*networkingv1alpha1.NetworkInterface{newNic, oldNic}, queue) } }, - DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.RateLimitingInterface) { + DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { nic := evt.Object.(*networkingv1alpha1.NetworkInterface) enqueueFunc := getEnqueueFunc(ctx, nic) if enqueueFunc != nil { enqueueFunc([]*networkingv1alpha1.NetworkInterface{nic}, queue) } }, - GenericFunc: func(ctx context.Context, evt event.GenericEvent, queue workqueue.RateLimitingInterface) { + GenericFunc: func(ctx context.Context, evt event.GenericEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { nic := evt.Object.(*networkingv1alpha1.NetworkInterface) enqueueFunc := getEnqueueFunc(ctx, nic) if enqueueFunc != nil { diff --git a/internal/controllers/networking/suite_test.go b/internal/controllers/networking/suite_test.go index 2b74918f6..4ed975e69 100644 --- a/internal/controllers/networking/suite_test.go +++ b/internal/controllers/networking/suite_test.go @@ -20,8 +20,10 @@ import ( . "github.com/onsi/gomega" "k8s.io/client-go/kubernetes/scheme" "k8s.io/utils/lru" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config" "sigs.k8s.io/controller-runtime/pkg/envtest" . "sigs.k8s.io/controller-runtime/pkg/envtest/komega" logf "sigs.k8s.io/controller-runtime/pkg/log" @@ -101,6 +103,7 @@ var _ = BeforeSuite(func() { Metrics: metricserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/internal/controllers/storage/bucketclass_controller.go b/internal/controllers/storage/bucketclass_controller.go index 07ee42a56..03131c525 100644 --- a/internal/controllers/storage/bucketclass_controller.go +++ b/internal/controllers/storage/bucketclass_controller.go @@ -20,6 +20,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/reconcile" ) // BucketClassReconciler reconciles a BucketClass object @@ -123,7 +124,7 @@ func (r *BucketClassReconciler) SetupWithManager(mgr ctrl.Manager) error { Watches( &storagev1alpha1.Bucket{}, handler.Funcs{ - DeleteFunc: func(ctx context.Context, event event.DeleteEvent, queue workqueue.RateLimitingInterface) { + DeleteFunc: func(ctx context.Context, event event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { bucket := event.Object.(*storagev1alpha1.Bucket) bucketClassRef := bucket.Spec.BucketClassRef if bucketClassRef == nil { diff --git a/internal/controllers/storage/suite_test.go b/internal/controllers/storage/suite_test.go index 6c67304a8..86902a214 100644 --- a/internal/controllers/storage/suite_test.go +++ b/internal/controllers/storage/suite_test.go @@ -12,6 +12,7 @@ import ( "github.com/ironcore-dev/controller-utils/buildutils" computev1alpha1 "github.com/ironcore-dev/ironcore/api/compute/v1alpha1" corev1alpha1 "github.com/ironcore-dev/ironcore/api/core/v1alpha1" + storagev1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" computeclient "github.com/ironcore-dev/ironcore/internal/client/compute" storageclient "github.com/ironcore-dev/ironcore/internal/client/storage" "github.com/ironcore-dev/ironcore/internal/controllers/storage/scheduler" @@ -21,12 +22,12 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/record" "k8s.io/utils/lru" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" + ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config" "sigs.k8s.io/controller-runtime/pkg/envtest/komega" metricserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" - storagev1alpha1 "github.com/ironcore-dev/ironcore/api/storage/v1alpha1" - . "github.com/ironcore-dev/ironcore/utils/testing" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -118,6 +119,7 @@ var _ = BeforeSuite(func() { Metrics: metricserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/internal/controllers/storage/volume_scheduler.go b/internal/controllers/storage/volume_scheduler.go index 33ba84f7c..e83fe0b6a 100644 --- a/internal/controllers/storage/volume_scheduler.go +++ b/internal/controllers/storage/volume_scheduler.go @@ -25,6 +25,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/predicate" + "sigs.k8s.io/controller-runtime/pkg/reconcile" ) const ( @@ -81,18 +82,18 @@ func (s *VolumeScheduler) skipSchedule(log logr.Logger, volume *storagev1alpha1. return isAssumed } -func (s *VolumeScheduler) matchesLabels(ctx context.Context, pool *scheduler.ContainerInfo, volume *storagev1alpha1.Volume) bool { +func (s *VolumeScheduler) matchesLabels(_ context.Context, pool *scheduler.ContainerInfo, volume *storagev1alpha1.Volume) bool { nodeLabels := labels.Set(pool.Node().Labels) volumePoolSelector := labels.SelectorFromSet(volume.Spec.VolumePoolSelector) return volumePoolSelector.Matches(nodeLabels) } -func (s *VolumeScheduler) tolerateTaints(ctx context.Context, pool *scheduler.ContainerInfo, volume *storagev1alpha1.Volume) bool { +func (s *VolumeScheduler) tolerateTaints(_ context.Context, pool *scheduler.ContainerInfo, volume *storagev1alpha1.Volume) bool { return v1alpha1.TolerateTaints(volume.Spec.Tolerations, pool.Node().Spec.Taints) } -func (s *VolumeScheduler) fitsPool(ctx context.Context, pool *scheduler.ContainerInfo, volume *storagev1alpha1.Volume) bool { +func (s *VolumeScheduler) fitsPool(_ context.Context, pool *scheduler.ContainerInfo, volume *storagev1alpha1.Volume) bool { volumeClassName := volume.Spec.VolumeClassRef.Name allocatable, ok := pool.Node().Status.Allocatable[corev1alpha1.ClassCountFor(corev1alpha1.ClassTypeVolumeClass, volumeClassName)] @@ -199,7 +200,7 @@ func (s *VolumeScheduler) reconcileExists(ctx context.Context, log logr.Logger, return ctrl.Result{}, nil } -func (s *VolumeScheduler) enqueueUnscheduledVolumes(ctx context.Context, queue workqueue.RateLimitingInterface) { +func (s *VolumeScheduler) enqueueUnscheduledVolumes(ctx context.Context, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) volumeList := &storagev1alpha1.VolumeList{} if err := s.List(ctx, volumeList, client.MatchingFields{storageclient.VolumeSpecVolumePoolRefNameField: ""}); err != nil { @@ -234,7 +235,7 @@ func (s *VolumeScheduler) isVolumeNotAssigned() predicate.Predicate { func (s *VolumeScheduler) handleVolume() handler.EventHandler { return handler.Funcs{ - CreateFunc: func(ctx context.Context, evt event.CreateEvent, queue workqueue.RateLimitingInterface) { + CreateFunc: func(ctx context.Context, evt event.CreateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { volume := evt.Object.(*storagev1alpha1.Volume) log := ctrl.LoggerFrom(ctx) @@ -242,7 +243,7 @@ func (s *VolumeScheduler) handleVolume() handler.EventHandler { log.Error(err, "Error adding volume to cache") } }, - UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.RateLimitingInterface) { + UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) oldInstance := evt.ObjectOld.(*storagev1alpha1.Volume) @@ -251,7 +252,7 @@ func (s *VolumeScheduler) handleVolume() handler.EventHandler { log.Error(err, "Error updating volume in cache") } }, - DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.RateLimitingInterface) { + DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) instance := evt.Object.(*storagev1alpha1.Volume) @@ -264,18 +265,18 @@ func (s *VolumeScheduler) handleVolume() handler.EventHandler { func (s *VolumeScheduler) handleVolumePool() handler.EventHandler { return handler.Funcs{ - CreateFunc: func(ctx context.Context, evt event.CreateEvent, queue workqueue.RateLimitingInterface) { + CreateFunc: func(ctx context.Context, evt event.CreateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { pool := evt.Object.(*storagev1alpha1.VolumePool) s.Cache.AddContainer(pool) s.enqueueUnscheduledVolumes(ctx, queue) }, - UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.RateLimitingInterface) { + UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { oldPool := evt.ObjectOld.(*storagev1alpha1.VolumePool) newPool := evt.ObjectNew.(*storagev1alpha1.VolumePool) s.Cache.UpdateContainer(oldPool, newPool) s.enqueueUnscheduledVolumes(ctx, queue) }, - DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.RateLimitingInterface) { + DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) pool := evt.Object.(*storagev1alpha1.VolumePool) diff --git a/internal/controllers/storage/volumeclass_controller.go b/internal/controllers/storage/volumeclass_controller.go index 8879f66f4..31efdf015 100644 --- a/internal/controllers/storage/volumeclass_controller.go +++ b/internal/controllers/storage/volumeclass_controller.go @@ -20,6 +20,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/reconcile" ) // VolumeClassReconciler reconciles a VolumeClass object @@ -123,7 +124,7 @@ func (r *VolumeClassReconciler) SetupWithManager(mgr ctrl.Manager) error { Watches( &storagev1alpha1.Volume{}, handler.Funcs{ - DeleteFunc: func(ctx context.Context, event event.DeleteEvent, queue workqueue.RateLimitingInterface) { + DeleteFunc: func(ctx context.Context, event event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { volume := event.Object.(*storagev1alpha1.Volume) volumeClassRef := volume.Spec.VolumeClassRef if volumeClassRef == nil { diff --git a/poollet/bucketpoollet/bem/bem_test.go b/poollet/bucketpoollet/bem/bem_test.go index 775eaffed..0e16d2e00 100644 --- a/poollet/bucketpoollet/bem/bem_test.go +++ b/poollet/bucketpoollet/bem/bem_test.go @@ -23,8 +23,10 @@ import ( "k8s.io/apimachinery/pkg/fields" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/record" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config" metricserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" ) @@ -51,6 +53,7 @@ var _ = Describe("BucketEventMapper", func() { Metrics: metricserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/poollet/bucketpoollet/controllers/controllers_suite_test.go b/poollet/bucketpoollet/controllers/controllers_suite_test.go index 2f081ec2f..fbd64112d 100644 --- a/poollet/bucketpoollet/controllers/controllers_suite_test.go +++ b/poollet/bucketpoollet/controllers/controllers_suite_test.go @@ -30,8 +30,10 @@ import ( "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "k8s.io/client-go/tools/record" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config" "sigs.k8s.io/controller-runtime/pkg/envtest" logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/log/zap" @@ -184,6 +186,7 @@ func SetupTest() (*corev1.Namespace, *storagev1alpha1.BucketPool, *storagev1alph Metrics: metricserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/poollet/machinepoollet/controllers/controllers_suite_test.go b/poollet/machinepoollet/controllers/controllers_suite_test.go index 2a521a13f..59a2b6089 100644 --- a/poollet/machinepoollet/controllers/controllers_suite_test.go +++ b/poollet/machinepoollet/controllers/controllers_suite_test.go @@ -35,8 +35,10 @@ import ( "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "k8s.io/client-go/tools/record" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config" "sigs.k8s.io/controller-runtime/pkg/envtest" . "sigs.k8s.io/controller-runtime/pkg/envtest/komega" logf "sigs.k8s.io/controller-runtime/pkg/log" @@ -193,6 +195,7 @@ func SetupTest() (*corev1.Namespace, *computev1alpha1.MachinePool, *computev1alp Metrics: metricserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/poollet/machinepoollet/handler/handler.go b/poollet/machinepoollet/handler/handler.go index 6fb1fdb01..21a6c901c 100644 --- a/poollet/machinepoollet/handler/handler.go +++ b/poollet/machinepoollet/handler/handler.go @@ -13,26 +13,26 @@ import ( // EnqueueRequestForName enqueues a reconcile.Request for a name without namespace. type EnqueueRequestForName string -func (e EnqueueRequestForName) enqueue(queue workqueue.RateLimitingInterface) { +func (e EnqueueRequestForName) enqueue(queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { queue.Add(reconcile.Request{NamespacedName: client.ObjectKey{Name: string(e)}}) } // Create implements handler.EventHandler. -func (e EnqueueRequestForName) Create(_ event.CreateEvent, queue workqueue.RateLimitingInterface) { +func (e EnqueueRequestForName) Create(_ event.CreateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { e.enqueue(queue) } // Update implements handler.EventHandler. -func (e EnqueueRequestForName) Update(_ event.UpdateEvent, queue workqueue.RateLimitingInterface) { +func (e EnqueueRequestForName) Update(_ event.UpdateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { e.enqueue(queue) } // Delete implements handler.EventHandler. -func (e EnqueueRequestForName) Delete(_ event.DeleteEvent, queue workqueue.RateLimitingInterface) { +func (e EnqueueRequestForName) Delete(_ event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { e.enqueue(queue) } // Generic implements handler.EventHandler. -func (e EnqueueRequestForName) Generic(_ event.GenericEvent, queue workqueue.RateLimitingInterface) { +func (e EnqueueRequestForName) Generic(_ event.GenericEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { e.enqueue(queue) } diff --git a/poollet/machinepoollet/mem/mem_test.go b/poollet/machinepoollet/mem/mem_test.go index dbcb89596..b4ecb4a5b 100644 --- a/poollet/machinepoollet/mem/mem_test.go +++ b/poollet/machinepoollet/mem/mem_test.go @@ -23,8 +23,10 @@ import ( "k8s.io/apimachinery/pkg/fields" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/record" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config" metricserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" ) @@ -53,6 +55,7 @@ var _ = Describe("MachineEventMapper", func() { Metrics: metricserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/poollet/volumepoollet/controllers/controllers_suite_test.go b/poollet/volumepoollet/controllers/controllers_suite_test.go index fdc57fafc..090522a36 100644 --- a/poollet/volumepoollet/controllers/controllers_suite_test.go +++ b/poollet/volumepoollet/controllers/controllers_suite_test.go @@ -30,8 +30,10 @@ import ( "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "k8s.io/client-go/tools/record" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config" "sigs.k8s.io/controller-runtime/pkg/envtest" . "sigs.k8s.io/controller-runtime/pkg/envtest/komega" logf "sigs.k8s.io/controller-runtime/pkg/log" @@ -208,6 +210,7 @@ func SetupTest() (*corev1.Namespace, *storagev1alpha1.VolumePool, *storagev1alph Metrics: metricserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/poollet/volumepoollet/vem/vem_test.go b/poollet/volumepoollet/vem/vem_test.go index 096c42a67..516ca9b05 100644 --- a/poollet/volumepoollet/vem/vem_test.go +++ b/poollet/volumepoollet/vem/vem_test.go @@ -26,8 +26,10 @@ import ( "k8s.io/apimachinery/pkg/fields" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/record" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config" metricserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" ) @@ -56,6 +58,7 @@ var _ = Describe("VolumeEventMapper", func() { Metrics: metricserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/utils/certificate/rotator.go b/utils/certificate/rotator.go index 9d73bcece..2f82fa54f 100644 --- a/utils/certificate/rotator.go +++ b/utils/certificate/rotator.go @@ -57,7 +57,7 @@ type rotator struct { forceInitial bool certificate atomic.Pointer[tls.Certificate] - queue workqueue.RateLimitingInterface + queue workqueue.TypedRateLimitingInterface[string] } type Rotator interface { @@ -278,7 +278,7 @@ func (r *rotator) rotate(ctx context.Context) error { return nil } -func (r *rotator) enqueue(key interface{}) { +func (r *rotator) enqueue(key string) { // If we want a forced initial rotation, respect it / reset it afterwards. force := r.forceInitial if force { @@ -349,7 +349,7 @@ func (r *rotator) Start(ctx context.Context) error { } r.started = true - r.queue = workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()) + r.queue = workqueue.NewTypedRateLimitingQueue(workqueue.DefaultTypedControllerRateLimiter[string]()) r.startedMu.Unlock() var wg sync.WaitGroup diff --git a/utils/client/config/controller.go b/utils/client/config/controller.go index 07f3c0d70..6cd82388e 100644 --- a/utils/client/config/controller.go +++ b/utils/client/config/controller.go @@ -65,7 +65,7 @@ type controller struct { logConstructor func() logr.Logger store Store - queue workqueue.RateLimitingInterface + queue workqueue.TypedRateLimitingInterface[string] configRotator utilrest.ConfigRotator } @@ -181,7 +181,7 @@ func (c *controller) Start(ctx context.Context) error { return fmt.Errorf("controller was already started") } - c.queue = workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()) + c.queue = workqueue.NewTypedRateLimitingQueue(workqueue.DefaultTypedControllerRateLimiter[string]()) go func() { <-ctx.Done() c.queue.ShutDown() diff --git a/utils/debug/handler.go b/utils/debug/handler.go index 255453d84..1967abab5 100644 --- a/utils/debug/handler.go +++ b/utils/debug/handler.go @@ -1,6 +1,5 @@ // SPDX-FileCopyrightText: 2023 SAP SE or an SAP affiliate company and IronCore contributors // SPDX-License-Identifier: Apache-2.0 - package debug import ( @@ -13,39 +12,79 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/reconcile" ) type loggingQueue struct { mu sync.RWMutex - done bool - log logr.Logger - workqueue.RateLimitingInterface + done bool + log logr.Logger + queue workqueue.TypedRateLimitingInterface[reconcile.Request] } -func newLoggingQueue(log logr.Logger, queue workqueue.RateLimitingInterface) *loggingQueue { - return &loggingQueue{log: log, RateLimitingInterface: queue} +func newLoggingQueue(log logr.Logger, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) *loggingQueue { + return &loggingQueue{log: log, queue: queue} } -func (q *loggingQueue) Add(item interface{}) { +func (q *loggingQueue) Add(item reconcile.Request) { q.mu.RLock() defer q.mu.RUnlock() q.log.Info("Add", "Item", item, "Done", q.done) - q.RateLimitingInterface.Add(item) + q.queue.Add(item) } -func (q *loggingQueue) AddRateLimited(item interface{}) { +func (q *loggingQueue) AddRateLimited(item reconcile.Request) { q.mu.RLock() defer q.mu.RUnlock() q.log.Info("AddRateLimited", "Item", item, "Done", q.done) - q.RateLimitingInterface.AddRateLimited(item) + q.queue.AddRateLimited(item) } -func (q *loggingQueue) AddAfter(item interface{}, duration time.Duration) { +func (q *loggingQueue) AddAfter(item reconcile.Request, duration time.Duration) { q.mu.RLock() defer q.mu.RUnlock() q.log.Info("AddAfter", "Item", item, "Duration", duration, "Done", q.done) - q.RateLimitingInterface.AddAfter(item, duration) + q.queue.AddAfter(item, duration) +} + +func (q *loggingQueue) Done(item reconcile.Request) { + q.mu.Lock() + defer q.mu.Unlock() + q.done = true + q.queue.Done(item) +} + +func (q *loggingQueue) Forget(item reconcile.Request) { + q.queue.Forget(item) +} + +func (q *loggingQueue) NumRequeues(item reconcile.Request) int { + return q.queue.NumRequeues(item) +} + +func (q *loggingQueue) Get() (reconcile.Request, bool) { + item, shutdown := q.queue.Get() + if shutdown { + return reconcile.Request{}, false + } + return item, true +} + +func (q *loggingQueue) Len() int { + return q.queue.Len() +} + +func (q *loggingQueue) ShutDown() { + q.queue.ShutDown() +} + +func (q *loggingQueue) ShutDownWithDrain() { + q.queue.ShutDownWithDrain() +} + +func (q *loggingQueue) ShuttingDown() bool { + return q.queue.ShuttingDown() } func (q *loggingQueue) Finish() { @@ -60,7 +99,7 @@ type debugHandler struct { objectValue func(client.Object) any } -func (d *debugHandler) Create(ctx context.Context, evt event.CreateEvent, queue workqueue.RateLimitingInterface) { +func (d *debugHandler) Create(ctx context.Context, evt event.CreateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := d.log.WithValues("Event", "Create", "Object", d.objectValue(evt.Object)) log.Info("Handling Event") @@ -70,7 +109,7 @@ func (d *debugHandler) Create(ctx context.Context, evt event.CreateEvent, queue d.handler.Create(ctx, evt, lQueue) } -func (d *debugHandler) Update(ctx context.Context, evt event.UpdateEvent, queue workqueue.RateLimitingInterface) { +func (d *debugHandler) Update(ctx context.Context, evt event.UpdateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := d.log.WithValues("Event", "Update", "ObjectOld", d.objectValue(evt.ObjectOld), "ObjectNew", d.objectValue(evt.ObjectNew)) log.Info("Handling Event") @@ -80,7 +119,7 @@ func (d *debugHandler) Update(ctx context.Context, evt event.UpdateEvent, queue d.handler.Update(ctx, evt, lQueue) } -func (d *debugHandler) Delete(ctx context.Context, evt event.DeleteEvent, queue workqueue.RateLimitingInterface) { +func (d *debugHandler) Delete(ctx context.Context, evt event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := d.log.WithValues("Event", "Delete", "Object", d.objectValue(evt.Object)) log.Info("Handling Event") @@ -90,7 +129,7 @@ func (d *debugHandler) Delete(ctx context.Context, evt event.DeleteEvent, queue d.handler.Delete(ctx, evt, lQueue) } -func (d *debugHandler) Generic(ctx context.Context, evt event.GenericEvent, queue workqueue.RateLimitingInterface) { +func (d *debugHandler) Generic(ctx context.Context, evt event.GenericEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := d.log.WithValues("Event", "Generic", "Object", d.objectValue(evt.Object)) log.Info("Handling Event") diff --git a/utils/rest/configrotator.go b/utils/rest/configrotator.go index 53b77311d..b6d84246c 100644 --- a/utils/rest/configrotator.go +++ b/utils/rest/configrotator.go @@ -65,7 +65,7 @@ type configRotator struct { certRotator certificate.Rotator - queue workqueue.RateLimitingInterface + queue workqueue.TypedRateLimitingInterface[string] closeConns func() baseConfig *rest.Config @@ -270,7 +270,7 @@ func (r *configRotator) Start(ctx context.Context) error { return fmt.Errorf("configRotator already started") } - r.queue = workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()) + r.queue = workqueue.NewTypedRateLimitingQueue(workqueue.DefaultTypedControllerRateLimiter[string]()) go func() { <-ctx.Done() r.queue.ShutDown()