From 213570700b1ebffb363f6e7c914a86502caba209 Mon Sep 17 00:00:00 2001 From: sujeet01 Date: Fri, 20 Dec 2024 03:39:54 +0530 Subject: [PATCH] Upgrade k8s dependencies to `v0.31.0` and controller-runtime to `v0.19.0` --- .github/workflows/lint.yml | 2 +- Makefile | 11 +- .../controllers/controllers_suite_test.go | 5 +- .../controllers/networkpolicy_controller.go | 13 +- .../core/v1alpha1/affinity.go | 4 +- .../core/v1alpha1/daemonset.go | 10 +- .../core/v1alpha1/daemonsetspec.go | 4 +- .../core/v1alpha1/daemonsetstatus.go | 4 +- .../core/v1alpha1/instance.go | 10 +- .../core/v1alpha1/instanceaffinityterm.go | 4 +- .../core/v1alpha1/instanceantiaffinity.go | 4 +- .../core/v1alpha1/instancespec.go | 4 +- .../core/v1alpha1/instancestatus.go | 4 +- .../core/v1alpha1/instancetemplate.go | 10 +- .../applyconfigurations/core/v1alpha1/ip.go | 10 +- .../core/v1alpha1/ipaddress.go | 10 +- .../core/v1alpha1/ipaddressclaimref.go | 4 +- .../core/v1alpha1/ipaddressspec.go | 4 +- .../core/v1alpha1/ipblock.go | 4 +- .../core/v1alpha1/ipclaimref.go | 4 +- .../core/v1alpha1/ipspec.go | 4 +- .../core/v1alpha1/loadbalancer.go | 10 +- .../core/v1alpha1/loadbalancerdestination.go | 4 +- .../core/v1alpha1/loadbalancerip.go | 4 +- .../core/v1alpha1/loadbalancerport.go | 4 +- .../core/v1alpha1/loadbalancerrouting.go | 10 +- .../core/v1alpha1/loadbalancerspec.go | 4 +- .../core/v1alpha1/loadbalancerstatus.go | 4 +- .../core/v1alpha1/loadbalancertargetref.go | 4 +- .../core/v1alpha1/localuidreference.go | 4 +- .../core/v1alpha1/natgateway.go | 10 +- .../core/v1alpha1/natgatewayautoscaler.go | 10 +- .../core/v1alpha1/natgatewayautoscalerspec.go | 4 +- .../core/v1alpha1/natgatewayip.go | 4 +- .../core/v1alpha1/natgatewayspec.go | 4 +- .../core/v1alpha1/natgatewaystatus.go | 4 +- .../core/v1alpha1/natip.go | 4 +- .../core/v1alpha1/natipsection.go | 4 +- .../core/v1alpha1/nattable.go | 10 +- .../core/v1alpha1/nattableiptargetref.go | 4 +- .../core/v1alpha1/network.go | 10 +- .../core/v1alpha1/networkid.go | 10 +- .../core/v1alpha1/networkidclaimref.go | 4 +- .../core/v1alpha1/networkidspec.go | 4 +- .../core/v1alpha1/networkinterface.go | 10 +- .../core/v1alpha1/networkinterfacenat.go | 4 +- .../v1alpha1/networkinterfacenatclaimref.go | 4 +- .../core/v1alpha1/networkinterfacepublicip.go | 4 +- .../core/v1alpha1/networkinterfacespec.go | 4 +- .../core/v1alpha1/networkinterfacestatus.go | 4 +- .../core/v1alpha1/networkpeering.go | 4 +- .../core/v1alpha1/networkpeeringstatus.go | 4 +- .../core/v1alpha1/networkpolicy.go | 10 +- .../core/v1alpha1/networkpolicyegressrule.go | 4 +- .../core/v1alpha1/networkpolicyingressrule.go | 4 +- .../core/v1alpha1/networkpolicypeer.go | 4 +- .../core/v1alpha1/networkpolicyport.go | 4 +- .../core/v1alpha1/networkpolicyrule.go | 10 +- .../core/v1alpha1/networkpolicyspec.go | 4 +- .../core/v1alpha1/networkspec.go | 4 +- .../core/v1alpha1/networkstatus.go | 4 +- .../applyconfigurations/core/v1alpha1/node.go | 10 +- .../core/v1alpha1/nodeaffinity.go | 4 +- .../core/v1alpha1/nodeselector.go | 4 +- .../core/v1alpha1/nodeselectorrequirement.go | 4 +- .../core/v1alpha1/nodeselectorterm.go | 4 +- .../core/v1alpha1/objectip.go | 4 +- .../core/v1alpha1/objectselector.go | 4 +- .../core/v1alpha1/pciaddress.go | 4 +- .../core/v1alpha1/peeringprefix.go | 4 +- .../applyconfigurations/core/v1alpha1/rule.go | 4 +- .../core/v1alpha1/targetnetworkinterface.go | 4 +- .../core/v1alpha1/topologyspreadconstraint.go | 4 +- client-go/applyconfigurations/utils.go | 7 + .../informers/externalversions/factory.go | 1 + .../versioned/fake/clientset_generated.go | 39 +- .../typed/core/v1alpha1/daemonset.go | 205 +------- .../core/v1alpha1/fake/fake_daemonset.go | 46 +- .../typed/core/v1alpha1/fake/fake_instance.go | 46 +- .../typed/core/v1alpha1/fake/fake_ip.go | 46 +- .../core/v1alpha1/fake/fake_ipaddress.go | 34 +- .../core/v1alpha1/fake/fake_loadbalancer.go | 46 +- .../v1alpha1/fake/fake_loadbalancerrouting.go | 34 +- .../core/v1alpha1/fake/fake_natgateway.go | 46 +- .../fake/fake_natgatewayautoscaler.go | 46 +- .../typed/core/v1alpha1/fake/fake_nattable.go | 34 +- .../typed/core/v1alpha1/fake/fake_network.go | 46 +- .../core/v1alpha1/fake/fake_networkid.go | 34 +- .../v1alpha1/fake/fake_networkinterface.go | 46 +- .../core/v1alpha1/fake/fake_networkpolicy.go | 34 +- .../v1alpha1/fake/fake_networkpolicyrule.go | 34 +- .../typed/core/v1alpha1/fake/fake_node.go | 46 +- .../versioned/typed/core/v1alpha1/instance.go | 205 +------- .../versioned/typed/core/v1alpha1/ip.go | 205 +------- .../typed/core/v1alpha1/ipaddress.go | 146 +----- .../typed/core/v1alpha1/loadbalancer.go | 205 +------- .../core/v1alpha1/loadbalancerrouting.go | 157 +----- .../typed/core/v1alpha1/natgateway.go | 205 +------- .../core/v1alpha1/natgatewayautoscaler.go | 205 +------- .../versioned/typed/core/v1alpha1/nattable.go | 157 +----- .../versioned/typed/core/v1alpha1/network.go | 205 +------- .../typed/core/v1alpha1/networkid.go | 146 +----- .../typed/core/v1alpha1/networkinterface.go | 205 +------- .../typed/core/v1alpha1/networkpolicy.go | 157 +----- .../typed/core/v1alpha1/networkpolicyrule.go | 157 +----- .../versioned/typed/core/v1alpha1/node.go | 192 +------- client-go/listers/core/v1alpha1/daemonset.go | 39 +- client-go/listers/core/v1alpha1/instance.go | 39 +- client-go/listers/core/v1alpha1/ip.go | 39 +- client-go/listers/core/v1alpha1/ipaddress.go | 26 +- .../listers/core/v1alpha1/loadbalancer.go | 39 +- .../core/v1alpha1/loadbalancerrouting.go | 39 +- client-go/listers/core/v1alpha1/natgateway.go | 39 +- .../core/v1alpha1/natgatewayautoscaler.go | 39 +- client-go/listers/core/v1alpha1/nattable.go | 39 +- client-go/listers/core/v1alpha1/network.go | 39 +- client-go/listers/core/v1alpha1/networkid.go | 26 +- .../listers/core/v1alpha1/networkinterface.go | 39 +- .../listers/core/v1alpha1/networkpolicy.go | 39 +- .../core/v1alpha1/networkpolicyrule.go | 39 +- client-go/listers/core/v1alpha1/node.go | 26 +- client-go/openapi/zz_generated.openapi.go | 448 +++++++++++++++--- config/apinetlet/apinet-rbac/role.yaml | 88 +--- config/apinetlet/rbac/role.yaml | 121 +---- config/apiserver/rbac/apinetlet_role.yaml | 88 +--- config/apiserver/rbac/metalnetlet_role.yaml | 108 +---- config/controller/rbac/role.yaml | 115 +---- config/metalnetlet/apinet-rbac/role.yaml | 108 +---- config/metalnetlet/rbac/role.yaml | 24 - go.mod | 95 ++-- go.sum | 225 +++++---- internal/apiserver/apiserver.go | 6 - internal/app/apiserver/apiserver.go | 11 +- internal/app/app_suite_test.go | 2 +- .../controllers/controllers_suite_test.go | 2 +- internal/controllers/daemonset_controller.go | 7 +- .../controllers/ipaddressgc_controller.go | 7 +- .../controllers/networkidgc_controller.go | 7 +- .../networkinterfacenatrelease_controller.go | 7 +- internal/controllers/scheduler_controller.go | 17 +- .../controllers/controllers_suite_test.go | 5 +- utils/handler/expectations.go | 9 +- utils/handler/sourceaware.go | 11 +- 143 files changed, 1514 insertions(+), 4363 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a31f7ea9..e40afaae 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,4 +17,4 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: - version: v1.61 + version: v1.62 diff --git a/Makefile b/Makefile index ba4e55b8..059e8e78 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ METALNETLET_IMG ?= metalnetlet:latest KIND_CLUSTER_NAME ?= kind # 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 # Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) ifeq (,$(shell go env GOBIN)) @@ -334,12 +334,13 @@ GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint ## Tool Versions KUSTOMIZE_VERSION ?= v5.1.1 VGOPATH_VERSION ?= v0.1.5 -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 GOIMPORTS_VERSION ?= v0.25.0 -GOLANGCI_LINT_VERSION ?= v1.61.0 -OPENAPI_EXTRACTOR_VERSION ?= v0.1.4 +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 @@ -376,7 +377,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/apinetlet/controllers/controllers_suite_test.go b/apinetlet/controllers/controllers_suite_test.go index 4a170f54..be9405f8 100644 --- a/apinetlet/controllers/controllers_suite_test.go +++ b/apinetlet/controllers/controllers_suite_test.go @@ -27,8 +27,10 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" + "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" @@ -77,7 +79,7 @@ var _ = BeforeSuite(func() { // Note that you must have the required binaries setup under the bin directory to perform // the tests directly. When we run make test it will be setup and used automatically. BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s", - fmt.Sprintf("1.29.0-%s-%s", runtime.GOOS, runtime.GOARCH)), + fmt.Sprintf("1.31.0-%s-%s", runtime.GOOS, runtime.GOARCH)), } testEnvExt = &envtestutils.EnvironmentExtensions{ APIServiceDirectoryPaths: []string{ @@ -148,6 +150,7 @@ func SetupTest(apiNetNamespace *corev1.Namespace) *corev1.Namespace { Metrics: metricsserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/apinetlet/controllers/networkpolicy_controller.go b/apinetlet/controllers/networkpolicy_controller.go index 588c0275..3b15c85e 100644 --- a/apinetlet/controllers/networkpolicy_controller.go +++ b/apinetlet/controllers/networkpolicy_controller.go @@ -35,6 +35,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" "sigs.k8s.io/controller-runtime/pkg/source" ) @@ -470,7 +471,7 @@ func (r *NetworkPolicyReconciler) enqueueByNetwork() handler.EventHandler { } func (r *NetworkPolicyReconciler) enqueueByNetworkInterface() handler.EventHandler { - getEnqueueFunc := func(ctx context.Context, nic *apinetv1alpha1.NetworkInterface) func(nics []*apinetv1alpha1.NetworkInterface, queue workqueue.RateLimitingInterface) { + getEnqueueFunc := func(ctx context.Context, nic *apinetv1alpha1.NetworkInterface) func(nics []*apinetv1alpha1.NetworkInterface, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) networkPolicyList := &apinetv1alpha1.NetworkPolicyList{} if err := r.APINetClient.List(ctx, networkPolicyList, @@ -481,7 +482,7 @@ func (r *NetworkPolicyReconciler) enqueueByNetworkInterface() handler.EventHandl return nil } - return func(nics []*apinetv1alpha1.NetworkInterface, queue workqueue.RateLimitingInterface) { + return func(nics []*apinetv1alpha1.NetworkInterface, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { for _, networkPolicy := range networkPolicyList.Items { networkPolicyKey := client.ObjectKeyFromObject(&networkPolicy) log := log.WithValues("networkPolicyKey", networkPolicyKey) @@ -507,14 +508,14 @@ func (r *NetworkPolicyReconciler) enqueueByNetworkInterface() handler.EventHandl } 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.(*apinetv1alpha1.NetworkInterface) enqueueFunc := getEnqueueFunc(ctx, nic) if enqueueFunc != nil { enqueueFunc([]*apinetv1alpha1.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.(*apinetv1alpha1.NetworkInterface) oldNic := evt.ObjectOld.(*apinetv1alpha1.NetworkInterface) enqueueFunc := getEnqueueFunc(ctx, newNic) @@ -522,14 +523,14 @@ func (r *NetworkPolicyReconciler) enqueueByNetworkInterface() handler.EventHandl enqueueFunc([]*apinetv1alpha1.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.(*apinetv1alpha1.NetworkInterface) enqueueFunc := getEnqueueFunc(ctx, nic) if enqueueFunc != nil { enqueueFunc([]*apinetv1alpha1.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.(*apinetv1alpha1.NetworkInterface) enqueueFunc := getEnqueueFunc(ctx, nic) if enqueueFunc != nil { diff --git a/client-go/applyconfigurations/core/v1alpha1/affinity.go b/client-go/applyconfigurations/core/v1alpha1/affinity.go index 0fc29458..c2e59d79 100644 --- a/client-go/applyconfigurations/core/v1alpha1/affinity.go +++ b/client-go/applyconfigurations/core/v1alpha1/affinity.go @@ -5,14 +5,14 @@ package v1alpha1 -// AffinityApplyConfiguration represents an declarative configuration of the Affinity type for use +// AffinityApplyConfiguration represents a declarative configuration of the Affinity type for use // with apply. type AffinityApplyConfiguration struct { NodeAffinity *NodeAffinityApplyConfiguration `json:"nodeAffinity,omitempty"` InstanceAntiAffinity *InstanceAntiAffinityApplyConfiguration `json:"instanceAntiAffinity,omitempty"` } -// AffinityApplyConfiguration constructs an declarative configuration of the Affinity type for use with +// AffinityApplyConfiguration constructs a declarative configuration of the Affinity type for use with // apply. func Affinity() *AffinityApplyConfiguration { return &AffinityApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/daemonset.go b/client-go/applyconfigurations/core/v1alpha1/daemonset.go index cce8f4d8..d6c40526 100644 --- a/client-go/applyconfigurations/core/v1alpha1/daemonset.go +++ b/client-go/applyconfigurations/core/v1alpha1/daemonset.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// DaemonSetApplyConfiguration represents an declarative configuration of the DaemonSet type for use +// DaemonSetApplyConfiguration represents a declarative configuration of the DaemonSet type for use // with apply. type DaemonSetApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -23,7 +23,7 @@ type DaemonSetApplyConfiguration struct { Status *DaemonSetStatusApplyConfiguration `json:"status,omitempty"` } -// DaemonSet constructs an declarative configuration of the DaemonSet type for use with +// DaemonSet constructs a declarative configuration of the DaemonSet type for use with // apply. func DaemonSet(name, namespace string) *DaemonSetApplyConfiguration { b := &DaemonSetApplyConfiguration{} @@ -243,3 +243,9 @@ func (b *DaemonSetApplyConfiguration) WithStatus(value *DaemonSetStatusApplyConf b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *DaemonSetApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/core/v1alpha1/daemonsetspec.go b/client-go/applyconfigurations/core/v1alpha1/daemonsetspec.go index be41f725..6d945395 100644 --- a/client-go/applyconfigurations/core/v1alpha1/daemonsetspec.go +++ b/client-go/applyconfigurations/core/v1alpha1/daemonsetspec.go @@ -9,14 +9,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// DaemonSetSpecApplyConfiguration represents an declarative configuration of the DaemonSetSpec type for use +// DaemonSetSpecApplyConfiguration represents a declarative configuration of the DaemonSetSpec type for use // with apply. type DaemonSetSpecApplyConfiguration struct { Selector *v1.LabelSelectorApplyConfiguration `json:"nodeSelector,omitempty"` Template *InstanceTemplateApplyConfiguration `json:"template,omitempty"` } -// DaemonSetSpecApplyConfiguration constructs an declarative configuration of the DaemonSetSpec type for use with +// DaemonSetSpecApplyConfiguration constructs a declarative configuration of the DaemonSetSpec type for use with // apply. func DaemonSetSpec() *DaemonSetSpecApplyConfiguration { return &DaemonSetSpecApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/daemonsetstatus.go b/client-go/applyconfigurations/core/v1alpha1/daemonsetstatus.go index 0e612a67..ee20353c 100644 --- a/client-go/applyconfigurations/core/v1alpha1/daemonsetstatus.go +++ b/client-go/applyconfigurations/core/v1alpha1/daemonsetstatus.go @@ -5,13 +5,13 @@ package v1alpha1 -// DaemonSetStatusApplyConfiguration represents an declarative configuration of the DaemonSetStatus type for use +// DaemonSetStatusApplyConfiguration represents a declarative configuration of the DaemonSetStatus type for use // with apply. type DaemonSetStatusApplyConfiguration struct { CollisionCount *int32 `json:"collisionCount,omitempty"` } -// DaemonSetStatusApplyConfiguration constructs an declarative configuration of the DaemonSetStatus type for use with +// DaemonSetStatusApplyConfiguration constructs a declarative configuration of the DaemonSetStatus type for use with // apply. func DaemonSetStatus() *DaemonSetStatusApplyConfiguration { return &DaemonSetStatusApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/instance.go b/client-go/applyconfigurations/core/v1alpha1/instance.go index eafeeeb3..6ff9bbe8 100644 --- a/client-go/applyconfigurations/core/v1alpha1/instance.go +++ b/client-go/applyconfigurations/core/v1alpha1/instance.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// InstanceApplyConfiguration represents an declarative configuration of the Instance type for use +// InstanceApplyConfiguration represents a declarative configuration of the Instance type for use // with apply. type InstanceApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -23,7 +23,7 @@ type InstanceApplyConfiguration struct { Status *InstanceStatusApplyConfiguration `json:"status,omitempty"` } -// Instance constructs an declarative configuration of the Instance type for use with +// Instance constructs a declarative configuration of the Instance type for use with // apply. func Instance(name, namespace string) *InstanceApplyConfiguration { b := &InstanceApplyConfiguration{} @@ -243,3 +243,9 @@ func (b *InstanceApplyConfiguration) WithStatus(value *InstanceStatusApplyConfig b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *InstanceApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/core/v1alpha1/instanceaffinityterm.go b/client-go/applyconfigurations/core/v1alpha1/instanceaffinityterm.go index 3d632f95..f8d3df24 100644 --- a/client-go/applyconfigurations/core/v1alpha1/instanceaffinityterm.go +++ b/client-go/applyconfigurations/core/v1alpha1/instanceaffinityterm.go @@ -9,14 +9,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// InstanceAffinityTermApplyConfiguration represents an declarative configuration of the InstanceAffinityTerm type for use +// InstanceAffinityTermApplyConfiguration represents a declarative configuration of the InstanceAffinityTerm type for use // with apply. type InstanceAffinityTermApplyConfiguration struct { LabelSelector *v1.LabelSelectorApplyConfiguration `json:"labelSelector,omitempty"` TopologyKey *string `json:"topologyKey,omitempty"` } -// InstanceAffinityTermApplyConfiguration constructs an declarative configuration of the InstanceAffinityTerm type for use with +// InstanceAffinityTermApplyConfiguration constructs a declarative configuration of the InstanceAffinityTerm type for use with // apply. func InstanceAffinityTerm() *InstanceAffinityTermApplyConfiguration { return &InstanceAffinityTermApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/instanceantiaffinity.go b/client-go/applyconfigurations/core/v1alpha1/instanceantiaffinity.go index a52628a2..0dab2d6e 100644 --- a/client-go/applyconfigurations/core/v1alpha1/instanceantiaffinity.go +++ b/client-go/applyconfigurations/core/v1alpha1/instanceantiaffinity.go @@ -5,13 +5,13 @@ package v1alpha1 -// InstanceAntiAffinityApplyConfiguration represents an declarative configuration of the InstanceAntiAffinity type for use +// InstanceAntiAffinityApplyConfiguration represents a declarative configuration of the InstanceAntiAffinity type for use // with apply. type InstanceAntiAffinityApplyConfiguration struct { RequiredDuringSchedulingIgnoredDuringExecution []InstanceAffinityTermApplyConfiguration `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` } -// InstanceAntiAffinityApplyConfiguration constructs an declarative configuration of the InstanceAntiAffinity type for use with +// InstanceAntiAffinityApplyConfiguration constructs a declarative configuration of the InstanceAntiAffinity type for use with // apply. func InstanceAntiAffinity() *InstanceAntiAffinityApplyConfiguration { return &InstanceAntiAffinityApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/instancespec.go b/client-go/applyconfigurations/core/v1alpha1/instancespec.go index c1ed7472..5d0d39e7 100644 --- a/client-go/applyconfigurations/core/v1alpha1/instancespec.go +++ b/client-go/applyconfigurations/core/v1alpha1/instancespec.go @@ -11,7 +11,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// InstanceSpecApplyConfiguration represents an declarative configuration of the InstanceSpec type for use +// InstanceSpecApplyConfiguration represents a declarative configuration of the InstanceSpec type for use // with apply. type InstanceSpecApplyConfiguration struct { Type *v1alpha1.InstanceType `json:"type,omitempty"` @@ -24,7 +24,7 @@ type InstanceSpecApplyConfiguration struct { NodeRef *v1.LocalObjectReference `json:"nodeRef,omitempty"` } -// InstanceSpecApplyConfiguration constructs an declarative configuration of the InstanceSpec type for use with +// InstanceSpecApplyConfiguration constructs a declarative configuration of the InstanceSpec type for use with // apply. func InstanceSpec() *InstanceSpecApplyConfiguration { return &InstanceSpecApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/instancestatus.go b/client-go/applyconfigurations/core/v1alpha1/instancestatus.go index 61adbf7d..bc8b84f0 100644 --- a/client-go/applyconfigurations/core/v1alpha1/instancestatus.go +++ b/client-go/applyconfigurations/core/v1alpha1/instancestatus.go @@ -9,14 +9,14 @@ import ( net "github.com/ironcore-dev/ironcore-net/apimachinery/api/net" ) -// InstanceStatusApplyConfiguration represents an declarative configuration of the InstanceStatus type for use +// InstanceStatusApplyConfiguration represents a declarative configuration of the InstanceStatus type for use // with apply. type InstanceStatusApplyConfiguration struct { IPs []net.IP `json:"ips,omitempty"` CollisionCount *int32 `json:"collisionCount,omitempty"` } -// InstanceStatusApplyConfiguration constructs an declarative configuration of the InstanceStatus type for use with +// InstanceStatusApplyConfiguration constructs a declarative configuration of the InstanceStatus type for use with // apply. func InstanceStatus() *InstanceStatusApplyConfiguration { return &InstanceStatusApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/instancetemplate.go b/client-go/applyconfigurations/core/v1alpha1/instancetemplate.go index 7ce77101..5e352100 100644 --- a/client-go/applyconfigurations/core/v1alpha1/instancetemplate.go +++ b/client-go/applyconfigurations/core/v1alpha1/instancetemplate.go @@ -11,14 +11,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// InstanceTemplateApplyConfiguration represents an declarative configuration of the InstanceTemplate type for use +// InstanceTemplateApplyConfiguration represents a declarative configuration of the InstanceTemplate type for use // with apply. type InstanceTemplateApplyConfiguration struct { *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *InstanceSpecApplyConfiguration `json:"spec,omitempty"` } -// InstanceTemplateApplyConfiguration constructs an declarative configuration of the InstanceTemplate type for use with +// InstanceTemplateApplyConfiguration constructs a declarative configuration of the InstanceTemplate type for use with // apply. func InstanceTemplate() *InstanceTemplateApplyConfiguration { return &InstanceTemplateApplyConfiguration{} @@ -173,3 +173,9 @@ func (b *InstanceTemplateApplyConfiguration) WithSpec(value *InstanceSpecApplyCo b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *InstanceTemplateApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/core/v1alpha1/ip.go b/client-go/applyconfigurations/core/v1alpha1/ip.go index 0d174a11..6ba37cd0 100644 --- a/client-go/applyconfigurations/core/v1alpha1/ip.go +++ b/client-go/applyconfigurations/core/v1alpha1/ip.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// IPApplyConfiguration represents an declarative configuration of the IP type for use +// IPApplyConfiguration represents a declarative configuration of the IP type for use // with apply. type IPApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -23,7 +23,7 @@ type IPApplyConfiguration struct { Status *corev1alpha1.IPStatus `json:"status,omitempty"` } -// IP constructs an declarative configuration of the IP type for use with +// IP constructs a declarative configuration of the IP type for use with // apply. func IP(name, namespace string) *IPApplyConfiguration { b := &IPApplyConfiguration{} @@ -243,3 +243,9 @@ func (b *IPApplyConfiguration) WithStatus(value corev1alpha1.IPStatus) *IPApplyC b.Status = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *IPApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/core/v1alpha1/ipaddress.go b/client-go/applyconfigurations/core/v1alpha1/ipaddress.go index 2955ea27..04b6ea27 100644 --- a/client-go/applyconfigurations/core/v1alpha1/ipaddress.go +++ b/client-go/applyconfigurations/core/v1alpha1/ipaddress.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// IPAddressApplyConfiguration represents an declarative configuration of the IPAddress type for use +// IPAddressApplyConfiguration represents a declarative configuration of the IPAddress type for use // with apply. type IPAddressApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -22,7 +22,7 @@ type IPAddressApplyConfiguration struct { Spec *IPAddressSpecApplyConfiguration `json:"spec,omitempty"` } -// IPAddress constructs an declarative configuration of the IPAddress type for use with +// IPAddress constructs a declarative configuration of the IPAddress type for use with // apply. func IPAddress(name string) *IPAddressApplyConfiguration { b := &IPAddressApplyConfiguration{} @@ -232,3 +232,9 @@ func (b *IPAddressApplyConfiguration) WithSpec(value *IPAddressSpecApplyConfigur b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *IPAddressApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/core/v1alpha1/ipaddressclaimref.go b/client-go/applyconfigurations/core/v1alpha1/ipaddressclaimref.go index 488683d8..108f55bf 100644 --- a/client-go/applyconfigurations/core/v1alpha1/ipaddressclaimref.go +++ b/client-go/applyconfigurations/core/v1alpha1/ipaddressclaimref.go @@ -9,7 +9,7 @@ import ( types "k8s.io/apimachinery/pkg/types" ) -// IPAddressClaimRefApplyConfiguration represents an declarative configuration of the IPAddressClaimRef type for use +// IPAddressClaimRefApplyConfiguration represents a declarative configuration of the IPAddressClaimRef type for use // with apply. type IPAddressClaimRefApplyConfiguration struct { Group *string `json:"group,omitempty"` @@ -19,7 +19,7 @@ type IPAddressClaimRefApplyConfiguration struct { UID *types.UID `json:"uid,omitempty"` } -// IPAddressClaimRefApplyConfiguration constructs an declarative configuration of the IPAddressClaimRef type for use with +// IPAddressClaimRefApplyConfiguration constructs a declarative configuration of the IPAddressClaimRef type for use with // apply. func IPAddressClaimRef() *IPAddressClaimRefApplyConfiguration { return &IPAddressClaimRefApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/ipaddressspec.go b/client-go/applyconfigurations/core/v1alpha1/ipaddressspec.go index 2ec35413..adece6b7 100644 --- a/client-go/applyconfigurations/core/v1alpha1/ipaddressspec.go +++ b/client-go/applyconfigurations/core/v1alpha1/ipaddressspec.go @@ -9,14 +9,14 @@ import ( net "github.com/ironcore-dev/ironcore-net/apimachinery/api/net" ) -// IPAddressSpecApplyConfiguration represents an declarative configuration of the IPAddressSpec type for use +// IPAddressSpecApplyConfiguration represents a declarative configuration of the IPAddressSpec type for use // with apply. type IPAddressSpecApplyConfiguration struct { IP *net.IP `json:"ip,omitempty"` ClaimRef *IPAddressClaimRefApplyConfiguration `json:"claimRef,omitempty"` } -// IPAddressSpecApplyConfiguration constructs an declarative configuration of the IPAddressSpec type for use with +// IPAddressSpecApplyConfiguration constructs a declarative configuration of the IPAddressSpec type for use with // apply. func IPAddressSpec() *IPAddressSpecApplyConfiguration { return &IPAddressSpecApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/ipblock.go b/client-go/applyconfigurations/core/v1alpha1/ipblock.go index ded7aaa9..f9f942cf 100644 --- a/client-go/applyconfigurations/core/v1alpha1/ipblock.go +++ b/client-go/applyconfigurations/core/v1alpha1/ipblock.go @@ -9,14 +9,14 @@ import ( net "github.com/ironcore-dev/ironcore-net/apimachinery/api/net" ) -// 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 *net.IPPrefix `json:"cidr,omitempty"` Except []net.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/core/v1alpha1/ipclaimref.go b/client-go/applyconfigurations/core/v1alpha1/ipclaimref.go index 6ff12014..b9964f14 100644 --- a/client-go/applyconfigurations/core/v1alpha1/ipclaimref.go +++ b/client-go/applyconfigurations/core/v1alpha1/ipclaimref.go @@ -9,7 +9,7 @@ import ( types "k8s.io/apimachinery/pkg/types" ) -// IPClaimRefApplyConfiguration represents an declarative configuration of the IPClaimRef type for use +// IPClaimRefApplyConfiguration represents a declarative configuration of the IPClaimRef type for use // with apply. type IPClaimRefApplyConfiguration struct { Group *string `json:"group,omitempty"` @@ -18,7 +18,7 @@ type IPClaimRefApplyConfiguration struct { UID *types.UID `json:"uid,omitempty"` } -// IPClaimRefApplyConfiguration constructs an declarative configuration of the IPClaimRef type for use with +// IPClaimRefApplyConfiguration constructs a declarative configuration of the IPClaimRef type for use with // apply. func IPClaimRef() *IPClaimRefApplyConfiguration { return &IPClaimRefApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/ipspec.go b/client-go/applyconfigurations/core/v1alpha1/ipspec.go index 9499290a..150ab349 100644 --- a/client-go/applyconfigurations/core/v1alpha1/ipspec.go +++ b/client-go/applyconfigurations/core/v1alpha1/ipspec.go @@ -11,7 +11,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// IPSpecApplyConfiguration represents an declarative configuration of the IPSpec type for use +// IPSpecApplyConfiguration represents a declarative configuration of the IPSpec type for use // with apply. type IPSpecApplyConfiguration struct { Type *v1alpha1.IPType `json:"type,omitempty"` @@ -20,7 +20,7 @@ type IPSpecApplyConfiguration struct { ClaimRef *IPClaimRefApplyConfiguration `json:"claimRef,omitempty"` } -// IPSpecApplyConfiguration constructs an declarative configuration of the IPSpec type for use with +// IPSpecApplyConfiguration constructs a declarative configuration of the IPSpec type for use with // apply. func IPSpec() *IPSpecApplyConfiguration { return &IPSpecApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/loadbalancer.go b/client-go/applyconfigurations/core/v1alpha1/loadbalancer.go index 293fc5ec..e5c2ad1d 100644 --- a/client-go/applyconfigurations/core/v1alpha1/loadbalancer.go +++ b/client-go/applyconfigurations/core/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/core/v1alpha1/loadbalancerdestination.go b/client-go/applyconfigurations/core/v1alpha1/loadbalancerdestination.go index d971787f..83985500 100644 --- a/client-go/applyconfigurations/core/v1alpha1/loadbalancerdestination.go +++ b/client-go/applyconfigurations/core/v1alpha1/loadbalancerdestination.go @@ -9,14 +9,14 @@ import ( net "github.com/ironcore-dev/ironcore-net/apimachinery/api/net" ) -// 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 *net.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/core/v1alpha1/loadbalancerip.go b/client-go/applyconfigurations/core/v1alpha1/loadbalancerip.go index 68a3e57f..2c2cae49 100644 --- a/client-go/applyconfigurations/core/v1alpha1/loadbalancerip.go +++ b/client-go/applyconfigurations/core/v1alpha1/loadbalancerip.go @@ -10,7 +10,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// LoadBalancerIPApplyConfiguration represents an declarative configuration of the LoadBalancerIP type for use +// LoadBalancerIPApplyConfiguration represents a declarative configuration of the LoadBalancerIP type for use // with apply. type LoadBalancerIPApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -18,7 +18,7 @@ type LoadBalancerIPApplyConfiguration struct { IP *net.IP `json:"ip,omitempty"` } -// LoadBalancerIPApplyConfiguration constructs an declarative configuration of the LoadBalancerIP type for use with +// LoadBalancerIPApplyConfiguration constructs a declarative configuration of the LoadBalancerIP type for use with // apply. func LoadBalancerIP() *LoadBalancerIPApplyConfiguration { return &LoadBalancerIPApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/loadbalancerport.go b/client-go/applyconfigurations/core/v1alpha1/loadbalancerport.go index 9cf24466..8b052ca5 100644 --- a/client-go/applyconfigurations/core/v1alpha1/loadbalancerport.go +++ b/client-go/applyconfigurations/core/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/core/v1alpha1/loadbalancerrouting.go b/client-go/applyconfigurations/core/v1alpha1/loadbalancerrouting.go index f051b1ed..90c66491 100644 --- a/client-go/applyconfigurations/core/v1alpha1/loadbalancerrouting.go +++ b/client-go/applyconfigurations/core/v1alpha1/loadbalancerrouting.go @@ -14,7 +14,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"` @@ -22,7 +22,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{} @@ -239,3 +239,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/core/v1alpha1/loadbalancerspec.go b/client-go/applyconfigurations/core/v1alpha1/loadbalancerspec.go index 8c7e45d6..29c6b2a5 100644 --- a/client-go/applyconfigurations/core/v1alpha1/loadbalancerspec.go +++ b/client-go/applyconfigurations/core/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 { Template *InstanceTemplateApplyConfiguration `json:"template,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/core/v1alpha1/loadbalancerstatus.go b/client-go/applyconfigurations/core/v1alpha1/loadbalancerstatus.go index fbdedec8..f9c10955 100644 --- a/client-go/applyconfigurations/core/v1alpha1/loadbalancerstatus.go +++ b/client-go/applyconfigurations/core/v1alpha1/loadbalancerstatus.go @@ -5,13 +5,13 @@ package 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 { CollisionCount *int32 `json:"collisionCount,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/core/v1alpha1/loadbalancertargetref.go b/client-go/applyconfigurations/core/v1alpha1/loadbalancertargetref.go index 88e6aee6..57cf3e04 100644 --- a/client-go/applyconfigurations/core/v1alpha1/loadbalancertargetref.go +++ b/client-go/applyconfigurations/core/v1alpha1/loadbalancertargetref.go @@ -10,7 +10,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"` @@ -18,7 +18,7 @@ type LoadBalancerTargetRefApplyConfiguration struct { NodeRef *v1.LocalObjectReference `json:"nodeRef,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/core/v1alpha1/localuidreference.go b/client-go/applyconfigurations/core/v1alpha1/localuidreference.go index ce288721..f1f31b35 100644 --- a/client-go/applyconfigurations/core/v1alpha1/localuidreference.go +++ b/client-go/applyconfigurations/core/v1alpha1/localuidreference.go @@ -9,14 +9,14 @@ import ( types "k8s.io/apimachinery/pkg/types" ) -// LocalUIDReferenceApplyConfiguration represents an declarative configuration of the LocalUIDReference type for use +// LocalUIDReferenceApplyConfiguration represents a declarative configuration of the LocalUIDReference type for use // with apply. type LocalUIDReferenceApplyConfiguration struct { Name *string `json:"name,omitempty"` UID *types.UID `json:"uid,omitempty"` } -// LocalUIDReferenceApplyConfiguration constructs an declarative configuration of the LocalUIDReference type for use with +// LocalUIDReferenceApplyConfiguration constructs a declarative configuration of the LocalUIDReference type for use with // apply. func LocalUIDReference() *LocalUIDReferenceApplyConfiguration { return &LocalUIDReferenceApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/natgateway.go b/client-go/applyconfigurations/core/v1alpha1/natgateway.go index a6ecc568..8f445d95 100644 --- a/client-go/applyconfigurations/core/v1alpha1/natgateway.go +++ b/client-go/applyconfigurations/core/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/core/v1alpha1/natgatewayautoscaler.go b/client-go/applyconfigurations/core/v1alpha1/natgatewayautoscaler.go index d230d6f0..c97ab231 100644 --- a/client-go/applyconfigurations/core/v1alpha1/natgatewayautoscaler.go +++ b/client-go/applyconfigurations/core/v1alpha1/natgatewayautoscaler.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// NATGatewayAutoscalerApplyConfiguration represents an declarative configuration of the NATGatewayAutoscaler type for use +// NATGatewayAutoscalerApplyConfiguration represents a declarative configuration of the NATGatewayAutoscaler type for use // with apply. type NATGatewayAutoscalerApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -23,7 +23,7 @@ type NATGatewayAutoscalerApplyConfiguration struct { Status *corev1alpha1.NATGatewayAutoscalerStatus `json:"status,omitempty"` } -// NATGatewayAutoscaler constructs an declarative configuration of the NATGatewayAutoscaler type for use with +// NATGatewayAutoscaler constructs a declarative configuration of the NATGatewayAutoscaler type for use with // apply. func NATGatewayAutoscaler(name, namespace string) *NATGatewayAutoscalerApplyConfiguration { b := &NATGatewayAutoscalerApplyConfiguration{} @@ -243,3 +243,9 @@ func (b *NATGatewayAutoscalerApplyConfiguration) WithStatus(value corev1alpha1.N b.Status = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *NATGatewayAutoscalerApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/core/v1alpha1/natgatewayautoscalerspec.go b/client-go/applyconfigurations/core/v1alpha1/natgatewayautoscalerspec.go index b0e46d34..581b6836 100644 --- a/client-go/applyconfigurations/core/v1alpha1/natgatewayautoscalerspec.go +++ b/client-go/applyconfigurations/core/v1alpha1/natgatewayautoscalerspec.go @@ -9,7 +9,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// NATGatewayAutoscalerSpecApplyConfiguration represents an declarative configuration of the NATGatewayAutoscalerSpec type for use +// NATGatewayAutoscalerSpecApplyConfiguration represents a declarative configuration of the NATGatewayAutoscalerSpec type for use // with apply. type NATGatewayAutoscalerSpecApplyConfiguration struct { NATGatewayRef *v1.LocalObjectReference `json:"natGatewayRef,omitempty"` @@ -17,7 +17,7 @@ type NATGatewayAutoscalerSpecApplyConfiguration struct { MaxPublicIPs *int32 `json:"maxPublicIPs,omitempty"` } -// NATGatewayAutoscalerSpecApplyConfiguration constructs an declarative configuration of the NATGatewayAutoscalerSpec type for use with +// NATGatewayAutoscalerSpecApplyConfiguration constructs a declarative configuration of the NATGatewayAutoscalerSpec type for use with // apply. func NATGatewayAutoscalerSpec() *NATGatewayAutoscalerSpecApplyConfiguration { return &NATGatewayAutoscalerSpecApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/natgatewayip.go b/client-go/applyconfigurations/core/v1alpha1/natgatewayip.go index 5453be9d..039615ae 100644 --- a/client-go/applyconfigurations/core/v1alpha1/natgatewayip.go +++ b/client-go/applyconfigurations/core/v1alpha1/natgatewayip.go @@ -9,14 +9,14 @@ import ( net "github.com/ironcore-dev/ironcore-net/apimachinery/api/net" ) -// NATGatewayIPApplyConfiguration represents an declarative configuration of the NATGatewayIP type for use +// NATGatewayIPApplyConfiguration represents a declarative configuration of the NATGatewayIP type for use // with apply. type NATGatewayIPApplyConfiguration struct { Name *string `json:"name,omitempty"` IP *net.IP `json:"ip,omitempty"` } -// NATGatewayIPApplyConfiguration constructs an declarative configuration of the NATGatewayIP type for use with +// NATGatewayIPApplyConfiguration constructs a declarative configuration of the NATGatewayIP type for use with // apply. func NATGatewayIP() *NATGatewayIPApplyConfiguration { return &NATGatewayIPApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/natgatewayspec.go b/client-go/applyconfigurations/core/v1alpha1/natgatewayspec.go index 19ec05dc..a14c7c20 100644 --- a/client-go/applyconfigurations/core/v1alpha1/natgatewayspec.go +++ b/client-go/applyconfigurations/core/v1alpha1/natgatewayspec.go @@ -9,7 +9,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 { IPFamily *v1.IPFamily `json:"ipFamily,omitempty"` @@ -18,7 +18,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/core/v1alpha1/natgatewaystatus.go b/client-go/applyconfigurations/core/v1alpha1/natgatewaystatus.go index f972aec4..44afdcf9 100644 --- a/client-go/applyconfigurations/core/v1alpha1/natgatewaystatus.go +++ b/client-go/applyconfigurations/core/v1alpha1/natgatewaystatus.go @@ -5,14 +5,14 @@ package 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 { UsedNATIPs *int64 `json:"usedNATIPs,omitempty"` RequestedNATIPs *int64 `json:"requestedNATIPs,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/core/v1alpha1/natip.go b/client-go/applyconfigurations/core/v1alpha1/natip.go index 4e662b4c..9bf7ceea 100644 --- a/client-go/applyconfigurations/core/v1alpha1/natip.go +++ b/client-go/applyconfigurations/core/v1alpha1/natip.go @@ -9,14 +9,14 @@ import ( net "github.com/ironcore-dev/ironcore-net/apimachinery/api/net" ) -// NATIPApplyConfiguration represents an declarative configuration of the NATIP type for use +// NATIPApplyConfiguration represents a declarative configuration of the NATIP type for use // with apply. type NATIPApplyConfiguration struct { IP *net.IP `json:"ip,omitempty"` Sections []NATIPSectionApplyConfiguration `json:"sections,omitempty"` } -// NATIPApplyConfiguration constructs an declarative configuration of the NATIP type for use with +// NATIPApplyConfiguration constructs a declarative configuration of the NATIP type for use with // apply. func NATIP() *NATIPApplyConfiguration { return &NATIPApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/natipsection.go b/client-go/applyconfigurations/core/v1alpha1/natipsection.go index d42de229..691045e1 100644 --- a/client-go/applyconfigurations/core/v1alpha1/natipsection.go +++ b/client-go/applyconfigurations/core/v1alpha1/natipsection.go @@ -9,7 +9,7 @@ import ( net "github.com/ironcore-dev/ironcore-net/apimachinery/api/net" ) -// NATIPSectionApplyConfiguration represents an declarative configuration of the NATIPSection type for use +// NATIPSectionApplyConfiguration represents a declarative configuration of the NATIPSection type for use // with apply. type NATIPSectionApplyConfiguration struct { IP *net.IP `json:"ip,omitempty"` @@ -18,7 +18,7 @@ type NATIPSectionApplyConfiguration struct { TargetRef *NATTableIPTargetRefApplyConfiguration `json:"targetRef,omitempty"` } -// NATIPSectionApplyConfiguration constructs an declarative configuration of the NATIPSection type for use with +// NATIPSectionApplyConfiguration constructs a declarative configuration of the NATIPSection type for use with // apply. func NATIPSection() *NATIPSectionApplyConfiguration { return &NATIPSectionApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/nattable.go b/client-go/applyconfigurations/core/v1alpha1/nattable.go index 49996ac8..a43d27fb 100644 --- a/client-go/applyconfigurations/core/v1alpha1/nattable.go +++ b/client-go/applyconfigurations/core/v1alpha1/nattable.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// NATTableApplyConfiguration represents an declarative configuration of the NATTable type for use +// NATTableApplyConfiguration represents a declarative configuration of the NATTable type for use // with apply. type NATTableApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -22,7 +22,7 @@ type NATTableApplyConfiguration struct { IPs []NATIPApplyConfiguration `json:"ips,omitempty"` } -// NATTable constructs an declarative configuration of the NATTable type for use with +// NATTable constructs a declarative configuration of the NATTable type for use with // apply. func NATTable(name, namespace string) *NATTableApplyConfiguration { b := &NATTableApplyConfiguration{} @@ -239,3 +239,9 @@ func (b *NATTableApplyConfiguration) WithIPs(values ...*NATIPApplyConfiguration) } return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *NATTableApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/core/v1alpha1/nattableiptargetref.go b/client-go/applyconfigurations/core/v1alpha1/nattableiptargetref.go index 3dd36194..448722bb 100644 --- a/client-go/applyconfigurations/core/v1alpha1/nattableiptargetref.go +++ b/client-go/applyconfigurations/core/v1alpha1/nattableiptargetref.go @@ -10,7 +10,7 @@ import ( types "k8s.io/apimachinery/pkg/types" ) -// NATTableIPTargetRefApplyConfiguration represents an declarative configuration of the NATTableIPTargetRef type for use +// NATTableIPTargetRefApplyConfiguration represents a declarative configuration of the NATTableIPTargetRef type for use // with apply. type NATTableIPTargetRefApplyConfiguration struct { UID *types.UID `json:"uid,omitempty"` @@ -18,7 +18,7 @@ type NATTableIPTargetRefApplyConfiguration struct { NodeRef *v1.LocalObjectReference `json:"nodeRef,omitempty"` } -// NATTableIPTargetRefApplyConfiguration constructs an declarative configuration of the NATTableIPTargetRef type for use with +// NATTableIPTargetRefApplyConfiguration constructs a declarative configuration of the NATTableIPTargetRef type for use with // apply. func NATTableIPTargetRef() *NATTableIPTargetRefApplyConfiguration { return &NATTableIPTargetRefApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/network.go b/client-go/applyconfigurations/core/v1alpha1/network.go index 7e6501b5..6a92ec3e 100644 --- a/client-go/applyconfigurations/core/v1alpha1/network.go +++ b/client-go/applyconfigurations/core/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/core/v1alpha1/networkid.go b/client-go/applyconfigurations/core/v1alpha1/networkid.go index f50bdd53..11b53b3e 100644 --- a/client-go/applyconfigurations/core/v1alpha1/networkid.go +++ b/client-go/applyconfigurations/core/v1alpha1/networkid.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// NetworkIDApplyConfiguration represents an declarative configuration of the NetworkID type for use +// NetworkIDApplyConfiguration represents a declarative configuration of the NetworkID type for use // with apply. type NetworkIDApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -22,7 +22,7 @@ type NetworkIDApplyConfiguration struct { Spec *NetworkIDSpecApplyConfiguration `json:"spec,omitempty"` } -// NetworkID constructs an declarative configuration of the NetworkID type for use with +// NetworkID constructs a declarative configuration of the NetworkID type for use with // apply. func NetworkID(name string) *NetworkIDApplyConfiguration { b := &NetworkIDApplyConfiguration{} @@ -232,3 +232,9 @@ func (b *NetworkIDApplyConfiguration) WithSpec(value *NetworkIDSpecApplyConfigur b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *NetworkIDApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/core/v1alpha1/networkidclaimref.go b/client-go/applyconfigurations/core/v1alpha1/networkidclaimref.go index a90e1241..0040ed7b 100644 --- a/client-go/applyconfigurations/core/v1alpha1/networkidclaimref.go +++ b/client-go/applyconfigurations/core/v1alpha1/networkidclaimref.go @@ -9,7 +9,7 @@ import ( types "k8s.io/apimachinery/pkg/types" ) -// NetworkIDClaimRefApplyConfiguration represents an declarative configuration of the NetworkIDClaimRef type for use +// NetworkIDClaimRefApplyConfiguration represents a declarative configuration of the NetworkIDClaimRef type for use // with apply. type NetworkIDClaimRefApplyConfiguration struct { Group *string `json:"group,omitempty"` @@ -19,7 +19,7 @@ type NetworkIDClaimRefApplyConfiguration struct { UID *types.UID `json:"uid,omitempty"` } -// NetworkIDClaimRefApplyConfiguration constructs an declarative configuration of the NetworkIDClaimRef type for use with +// NetworkIDClaimRefApplyConfiguration constructs a declarative configuration of the NetworkIDClaimRef type for use with // apply. func NetworkIDClaimRef() *NetworkIDClaimRefApplyConfiguration { return &NetworkIDClaimRefApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/networkidspec.go b/client-go/applyconfigurations/core/v1alpha1/networkidspec.go index 875ec1cc..68d0fb8b 100644 --- a/client-go/applyconfigurations/core/v1alpha1/networkidspec.go +++ b/client-go/applyconfigurations/core/v1alpha1/networkidspec.go @@ -5,13 +5,13 @@ package v1alpha1 -// NetworkIDSpecApplyConfiguration represents an declarative configuration of the NetworkIDSpec type for use +// NetworkIDSpecApplyConfiguration represents a declarative configuration of the NetworkIDSpec type for use // with apply. type NetworkIDSpecApplyConfiguration struct { ClaimRef *NetworkIDClaimRefApplyConfiguration `json:"claimRef,omitempty"` } -// NetworkIDSpecApplyConfiguration constructs an declarative configuration of the NetworkIDSpec type for use with +// NetworkIDSpecApplyConfiguration constructs a declarative configuration of the NetworkIDSpec type for use with // apply. func NetworkIDSpec() *NetworkIDSpecApplyConfiguration { return &NetworkIDSpecApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/networkinterface.go b/client-go/applyconfigurations/core/v1alpha1/networkinterface.go index 44d9ae00..ef33bf45 100644 --- a/client-go/applyconfigurations/core/v1alpha1/networkinterface.go +++ b/client-go/applyconfigurations/core/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/core/v1alpha1/networkinterfacenat.go b/client-go/applyconfigurations/core/v1alpha1/networkinterfacenat.go index 2a8a890f..947fb5c3 100644 --- a/client-go/applyconfigurations/core/v1alpha1/networkinterfacenat.go +++ b/client-go/applyconfigurations/core/v1alpha1/networkinterfacenat.go @@ -9,14 +9,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// NetworkInterfaceNATApplyConfiguration represents an declarative configuration of the NetworkInterfaceNAT type for use +// NetworkInterfaceNATApplyConfiguration represents a declarative configuration of the NetworkInterfaceNAT type for use // with apply. type NetworkInterfaceNATApplyConfiguration struct { IPFamily *v1.IPFamily `json:"ipFamily,omitempty"` ClaimRef *NetworkInterfaceNATClaimRefApplyConfiguration `json:"claimRef,omitempty"` } -// NetworkInterfaceNATApplyConfiguration constructs an declarative configuration of the NetworkInterfaceNAT type for use with +// NetworkInterfaceNATApplyConfiguration constructs a declarative configuration of the NetworkInterfaceNAT type for use with // apply. func NetworkInterfaceNAT() *NetworkInterfaceNATApplyConfiguration { return &NetworkInterfaceNATApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/networkinterfacenatclaimref.go b/client-go/applyconfigurations/core/v1alpha1/networkinterfacenatclaimref.go index e63a7f70..ecd5e25b 100644 --- a/client-go/applyconfigurations/core/v1alpha1/networkinterfacenatclaimref.go +++ b/client-go/applyconfigurations/core/v1alpha1/networkinterfacenatclaimref.go @@ -9,14 +9,14 @@ import ( types "k8s.io/apimachinery/pkg/types" ) -// NetworkInterfaceNATClaimRefApplyConfiguration represents an declarative configuration of the NetworkInterfaceNATClaimRef type for use +// NetworkInterfaceNATClaimRefApplyConfiguration represents a declarative configuration of the NetworkInterfaceNATClaimRef type for use // with apply. type NetworkInterfaceNATClaimRefApplyConfiguration struct { Name *string `json:"name,omitempty"` UID *types.UID `json:"uid,omitempty"` } -// NetworkInterfaceNATClaimRefApplyConfiguration constructs an declarative configuration of the NetworkInterfaceNATClaimRef type for use with +// NetworkInterfaceNATClaimRefApplyConfiguration constructs a declarative configuration of the NetworkInterfaceNATClaimRef type for use with // apply. func NetworkInterfaceNATClaimRef() *NetworkInterfaceNATClaimRefApplyConfiguration { return &NetworkInterfaceNATClaimRefApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/networkinterfacepublicip.go b/client-go/applyconfigurations/core/v1alpha1/networkinterfacepublicip.go index 663578b5..a58bdfef 100644 --- a/client-go/applyconfigurations/core/v1alpha1/networkinterfacepublicip.go +++ b/client-go/applyconfigurations/core/v1alpha1/networkinterfacepublicip.go @@ -10,7 +10,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// NetworkInterfacePublicIPApplyConfiguration represents an declarative configuration of the NetworkInterfacePublicIP type for use +// NetworkInterfacePublicIPApplyConfiguration represents a declarative configuration of the NetworkInterfacePublicIP type for use // with apply. type NetworkInterfacePublicIPApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -18,7 +18,7 @@ type NetworkInterfacePublicIPApplyConfiguration struct { IP *net.IP `json:"ip,omitempty"` } -// NetworkInterfacePublicIPApplyConfiguration constructs an declarative configuration of the NetworkInterfacePublicIP type for use with +// NetworkInterfacePublicIPApplyConfiguration constructs a declarative configuration of the NetworkInterfacePublicIP type for use with // apply. func NetworkInterfacePublicIP() *NetworkInterfacePublicIPApplyConfiguration { return &NetworkInterfacePublicIPApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/networkinterfacespec.go b/client-go/applyconfigurations/core/v1alpha1/networkinterfacespec.go index 3178cf5a..4dbbf2f1 100644 --- a/client-go/applyconfigurations/core/v1alpha1/networkinterfacespec.go +++ b/client-go/applyconfigurations/core/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 { NodeRef *v1.LocalObjectReference `json:"nodeRef,omitempty"` @@ -21,7 +21,7 @@ type NetworkInterfaceSpecApplyConfiguration struct { PublicIPs []NetworkInterfacePublicIPApplyConfiguration `json:"publicIPs,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/core/v1alpha1/networkinterfacestatus.go b/client-go/applyconfigurations/core/v1alpha1/networkinterfacestatus.go index 3b95eec6..dc285722 100644 --- a/client-go/applyconfigurations/core/v1alpha1/networkinterfacestatus.go +++ b/client-go/applyconfigurations/core/v1alpha1/networkinterfacestatus.go @@ -10,7 +10,7 @@ import ( net "github.com/ironcore-dev/ironcore-net/apimachinery/api/net" ) -// 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"` @@ -20,7 +20,7 @@ type NetworkInterfaceStatusApplyConfiguration struct { NATIPs []net.IP `json:"natIPs,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/core/v1alpha1/networkpeering.go b/client-go/applyconfigurations/core/v1alpha1/networkpeering.go index 1c752394..5bec2e49 100644 --- a/client-go/applyconfigurations/core/v1alpha1/networkpeering.go +++ b/client-go/applyconfigurations/core/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/core/v1alpha1/networkpeeringstatus.go b/client-go/applyconfigurations/core/v1alpha1/networkpeeringstatus.go index 68a76fcc..ae176f60 100644 --- a/client-go/applyconfigurations/core/v1alpha1/networkpeeringstatus.go +++ b/client-go/applyconfigurations/core/v1alpha1/networkpeeringstatus.go @@ -9,14 +9,14 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore-net/api/core/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 { ID *int32 `json:"id,omitempty"` State *v1alpha1.NetworkPeeringState `json:"state,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/core/v1alpha1/networkpolicy.go b/client-go/applyconfigurations/core/v1alpha1/networkpolicy.go index 6faa6d24..1560cae8 100644 --- a/client-go/applyconfigurations/core/v1alpha1/networkpolicy.go +++ b/client-go/applyconfigurations/core/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"` @@ -22,7 +22,7 @@ type NetworkPolicyApplyConfiguration struct { Spec *NetworkPolicySpecApplyConfiguration `json:"spec,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{} @@ -234,3 +234,9 @@ func (b *NetworkPolicyApplyConfiguration) WithSpec(value *NetworkPolicySpecApply b.Spec = 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/core/v1alpha1/networkpolicyegressrule.go b/client-go/applyconfigurations/core/v1alpha1/networkpolicyegressrule.go index 571ebb06..bf0a1c70 100644 --- a/client-go/applyconfigurations/core/v1alpha1/networkpolicyegressrule.go +++ b/client-go/applyconfigurations/core/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/core/v1alpha1/networkpolicyingressrule.go b/client-go/applyconfigurations/core/v1alpha1/networkpolicyingressrule.go index b9f6aa2a..54de82ff 100644 --- a/client-go/applyconfigurations/core/v1alpha1/networkpolicyingressrule.go +++ b/client-go/applyconfigurations/core/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 { From []NetworkPolicyPeerApplyConfiguration `json:"from,omitempty"` Ports []NetworkPolicyPortApplyConfiguration `json:"ports,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/core/v1alpha1/networkpolicypeer.go b/client-go/applyconfigurations/core/v1alpha1/networkpolicypeer.go index 1b18b49f..4ad4dc9e 100644 --- a/client-go/applyconfigurations/core/v1alpha1/networkpolicypeer.go +++ b/client-go/applyconfigurations/core/v1alpha1/networkpolicypeer.go @@ -5,14 +5,14 @@ package 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 *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/core/v1alpha1/networkpolicyport.go b/client-go/applyconfigurations/core/v1alpha1/networkpolicyport.go index 8c0d1120..4d4158e5 100644 --- a/client-go/applyconfigurations/core/v1alpha1/networkpolicyport.go +++ b/client-go/applyconfigurations/core/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/core/v1alpha1/networkpolicyrule.go b/client-go/applyconfigurations/core/v1alpha1/networkpolicyrule.go index d58ae236..3f7e5385 100644 --- a/client-go/applyconfigurations/core/v1alpha1/networkpolicyrule.go +++ b/client-go/applyconfigurations/core/v1alpha1/networkpolicyrule.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// NetworkPolicyRuleApplyConfiguration represents an declarative configuration of the NetworkPolicyRule type for use +// NetworkPolicyRuleApplyConfiguration represents a declarative configuration of the NetworkPolicyRule type for use // with apply. type NetworkPolicyRuleApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -26,7 +26,7 @@ type NetworkPolicyRuleApplyConfiguration struct { EgressRules []RuleApplyConfiguration `json:"egressRule,omitempty"` } -// NetworkPolicyRule constructs an declarative configuration of the NetworkPolicyRule type for use with +// NetworkPolicyRule constructs a declarative configuration of the NetworkPolicyRule type for use with // apply. func NetworkPolicyRule(name, namespace string) *NetworkPolicyRuleApplyConfiguration { b := &NetworkPolicyRuleApplyConfiguration{} @@ -285,3 +285,9 @@ func (b *NetworkPolicyRuleApplyConfiguration) WithEgressRules(values ...*RuleApp } return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *NetworkPolicyRuleApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/core/v1alpha1/networkpolicyspec.go b/client-go/applyconfigurations/core/v1alpha1/networkpolicyspec.go index 61cf5c3e..ba228d81 100644 --- a/client-go/applyconfigurations/core/v1alpha1/networkpolicyspec.go +++ b/client-go/applyconfigurations/core/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"` @@ -22,7 +22,7 @@ type NetworkPolicySpecApplyConfiguration struct { PolicyTypes []corev1alpha1.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/core/v1alpha1/networkspec.go b/client-go/applyconfigurations/core/v1alpha1/networkspec.go index b8b350a8..5a32cbbb 100644 --- a/client-go/applyconfigurations/core/v1alpha1/networkspec.go +++ b/client-go/applyconfigurations/core/v1alpha1/networkspec.go @@ -5,14 +5,14 @@ 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 { ID *string `json:"id,omitempty"` Peerings []NetworkPeeringApplyConfiguration `json:"peerings,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/core/v1alpha1/networkstatus.go b/client-go/applyconfigurations/core/v1alpha1/networkstatus.go index 8cb0c087..4bc70e77 100644 --- a/client-go/applyconfigurations/core/v1alpha1/networkstatus.go +++ b/client-go/applyconfigurations/core/v1alpha1/networkstatus.go @@ -9,13 +9,13 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore-net/api/core/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 { Peerings map[string][]v1alpha1.NetworkPeeringStatus `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/core/v1alpha1/node.go b/client-go/applyconfigurations/core/v1alpha1/node.go index 9afce131..9553d132 100644 --- a/client-go/applyconfigurations/core/v1alpha1/node.go +++ b/client-go/applyconfigurations/core/v1alpha1/node.go @@ -14,7 +14,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// NodeApplyConfiguration represents an declarative configuration of the Node type for use +// NodeApplyConfiguration represents a declarative configuration of the Node type for use // with apply. type NodeApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -23,7 +23,7 @@ type NodeApplyConfiguration struct { Status *v1alpha1.NodeStatus `json:"status,omitempty"` } -// Node constructs an declarative configuration of the Node type for use with +// Node constructs a declarative configuration of the Node type for use with // apply. func Node(name string) *NodeApplyConfiguration { b := &NodeApplyConfiguration{} @@ -241,3 +241,9 @@ func (b *NodeApplyConfiguration) WithStatus(value v1alpha1.NodeStatus) *NodeAppl b.Status = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *NodeApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/client-go/applyconfigurations/core/v1alpha1/nodeaffinity.go b/client-go/applyconfigurations/core/v1alpha1/nodeaffinity.go index bb5077f5..8a2d7fdf 100644 --- a/client-go/applyconfigurations/core/v1alpha1/nodeaffinity.go +++ b/client-go/applyconfigurations/core/v1alpha1/nodeaffinity.go @@ -5,13 +5,13 @@ package v1alpha1 -// NodeAffinityApplyConfiguration represents an declarative configuration of the NodeAffinity type for use +// NodeAffinityApplyConfiguration represents a declarative configuration of the NodeAffinity type for use // with apply. type NodeAffinityApplyConfiguration struct { RequiredDuringSchedulingIgnoredDuringExecution *NodeSelectorApplyConfiguration `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` } -// NodeAffinityApplyConfiguration constructs an declarative configuration of the NodeAffinity type for use with +// NodeAffinityApplyConfiguration constructs a declarative configuration of the NodeAffinity type for use with // apply. func NodeAffinity() *NodeAffinityApplyConfiguration { return &NodeAffinityApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/nodeselector.go b/client-go/applyconfigurations/core/v1alpha1/nodeselector.go index 188acce7..744cbfeb 100644 --- a/client-go/applyconfigurations/core/v1alpha1/nodeselector.go +++ b/client-go/applyconfigurations/core/v1alpha1/nodeselector.go @@ -5,13 +5,13 @@ package v1alpha1 -// NodeSelectorApplyConfiguration represents an declarative configuration of the NodeSelector type for use +// NodeSelectorApplyConfiguration represents a declarative configuration of the NodeSelector type for use // with apply. type NodeSelectorApplyConfiguration struct { NodeSelectorTerms []NodeSelectorTermApplyConfiguration `json:"nodeSelectorTerms,omitempty"` } -// NodeSelectorApplyConfiguration constructs an declarative configuration of the NodeSelector type for use with +// NodeSelectorApplyConfiguration constructs a declarative configuration of the NodeSelector type for use with // apply. func NodeSelector() *NodeSelectorApplyConfiguration { return &NodeSelectorApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/nodeselectorrequirement.go b/client-go/applyconfigurations/core/v1alpha1/nodeselectorrequirement.go index fbbb869f..e742d9c3 100644 --- a/client-go/applyconfigurations/core/v1alpha1/nodeselectorrequirement.go +++ b/client-go/applyconfigurations/core/v1alpha1/nodeselectorrequirement.go @@ -9,7 +9,7 @@ import ( v1alpha1 "github.com/ironcore-dev/ironcore-net/api/core/v1alpha1" ) -// NodeSelectorRequirementApplyConfiguration represents an declarative configuration of the NodeSelectorRequirement type for use +// NodeSelectorRequirementApplyConfiguration represents a declarative configuration of the NodeSelectorRequirement type for use // with apply. type NodeSelectorRequirementApplyConfiguration struct { Key *string `json:"key,omitempty"` @@ -17,7 +17,7 @@ type NodeSelectorRequirementApplyConfiguration struct { Values []string `json:"values,omitempty"` } -// NodeSelectorRequirementApplyConfiguration constructs an declarative configuration of the NodeSelectorRequirement type for use with +// NodeSelectorRequirementApplyConfiguration constructs a declarative configuration of the NodeSelectorRequirement type for use with // apply. func NodeSelectorRequirement() *NodeSelectorRequirementApplyConfiguration { return &NodeSelectorRequirementApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/nodeselectorterm.go b/client-go/applyconfigurations/core/v1alpha1/nodeselectorterm.go index 0630e328..5c71edea 100644 --- a/client-go/applyconfigurations/core/v1alpha1/nodeselectorterm.go +++ b/client-go/applyconfigurations/core/v1alpha1/nodeselectorterm.go @@ -5,14 +5,14 @@ package v1alpha1 -// NodeSelectorTermApplyConfiguration represents an declarative configuration of the NodeSelectorTerm type for use +// NodeSelectorTermApplyConfiguration represents a declarative configuration of the NodeSelectorTerm type for use // with apply. type NodeSelectorTermApplyConfiguration struct { MatchExpressions []NodeSelectorRequirementApplyConfiguration `json:"matchExpressions,omitempty"` MatchFields []NodeSelectorRequirementApplyConfiguration `json:"matchFields,omitempty"` } -// NodeSelectorTermApplyConfiguration constructs an declarative configuration of the NodeSelectorTerm type for use with +// NodeSelectorTermApplyConfiguration constructs a declarative configuration of the NodeSelectorTerm type for use with // apply. func NodeSelectorTerm() *NodeSelectorTermApplyConfiguration { return &NodeSelectorTermApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/objectip.go b/client-go/applyconfigurations/core/v1alpha1/objectip.go index c50070ff..9460c341 100644 --- a/client-go/applyconfigurations/core/v1alpha1/objectip.go +++ b/client-go/applyconfigurations/core/v1alpha1/objectip.go @@ -10,14 +10,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// ObjectIPApplyConfiguration represents an declarative configuration of the ObjectIP type for use +// ObjectIPApplyConfiguration represents a declarative configuration of the ObjectIP type for use // with apply. type ObjectIPApplyConfiguration struct { IPFamily *v1.IPFamily `json:"ipFamily,omitempty"` Prefix *net.IPPrefix `json:"prefix,omitempty"` } -// ObjectIPApplyConfiguration constructs an declarative configuration of the ObjectIP type for use with +// ObjectIPApplyConfiguration constructs a declarative configuration of the ObjectIP type for use with // apply. func ObjectIP() *ObjectIPApplyConfiguration { return &ObjectIPApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/objectselector.go b/client-go/applyconfigurations/core/v1alpha1/objectselector.go index 7f9c4f79..4c0e609c 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/pciaddress.go b/client-go/applyconfigurations/core/v1alpha1/pciaddress.go index 6f75b1c7..029c22fa 100644 --- a/client-go/applyconfigurations/core/v1alpha1/pciaddress.go +++ b/client-go/applyconfigurations/core/v1alpha1/pciaddress.go @@ -5,7 +5,7 @@ package v1alpha1 -// PCIAddressApplyConfiguration represents an declarative configuration of the PCIAddress type for use +// PCIAddressApplyConfiguration represents a declarative configuration of the PCIAddress type for use // with apply. type PCIAddressApplyConfiguration struct { Domain *string `json:"domain,omitempty"` @@ -14,7 +14,7 @@ type PCIAddressApplyConfiguration struct { Function *string `json:"function,omitempty"` } -// PCIAddressApplyConfiguration constructs an declarative configuration of the PCIAddress type for use with +// PCIAddressApplyConfiguration constructs a declarative configuration of the PCIAddress type for use with // apply. func PCIAddress() *PCIAddressApplyConfiguration { return &PCIAddressApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/peeringprefix.go b/client-go/applyconfigurations/core/v1alpha1/peeringprefix.go index 3f56b0ed..b75812aa 100644 --- a/client-go/applyconfigurations/core/v1alpha1/peeringprefix.go +++ b/client-go/applyconfigurations/core/v1alpha1/peeringprefix.go @@ -9,14 +9,14 @@ import ( net "github.com/ironcore-dev/ironcore-net/apimachinery/api/net" ) -// 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"` Prefix *net.IPPrefix `json:"prefix,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/core/v1alpha1/rule.go b/client-go/applyconfigurations/core/v1alpha1/rule.go index cbd9fc17..89d45709 100644 --- a/client-go/applyconfigurations/core/v1alpha1/rule.go +++ b/client-go/applyconfigurations/core/v1alpha1/rule.go @@ -5,7 +5,7 @@ package v1alpha1 -// RuleApplyConfiguration represents an declarative configuration of the Rule type for use +// RuleApplyConfiguration represents a declarative configuration of the Rule type for use // with apply. type RuleApplyConfiguration struct { CIDRBlock []IPBlockApplyConfiguration `json:"ipBlock,omitempty"` @@ -13,7 +13,7 @@ type RuleApplyConfiguration struct { NetworkPolicyPorts []NetworkPolicyPortApplyConfiguration `json:"networkPolicyPorts,omitempty"` } -// RuleApplyConfiguration constructs an declarative configuration of the Rule type for use with +// RuleApplyConfiguration constructs a declarative configuration of the Rule type for use with // apply. func Rule() *RuleApplyConfiguration { return &RuleApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/targetnetworkinterface.go b/client-go/applyconfigurations/core/v1alpha1/targetnetworkinterface.go index 2ab5c3f8..b7150611 100644 --- a/client-go/applyconfigurations/core/v1alpha1/targetnetworkinterface.go +++ b/client-go/applyconfigurations/core/v1alpha1/targetnetworkinterface.go @@ -9,14 +9,14 @@ import ( net "github.com/ironcore-dev/ironcore-net/apimachinery/api/net" ) -// TargetNetworkInterfaceApplyConfiguration represents an declarative configuration of the TargetNetworkInterface type for use +// TargetNetworkInterfaceApplyConfiguration represents a declarative configuration of the TargetNetworkInterface type for use // with apply. type TargetNetworkInterfaceApplyConfiguration struct { IP *net.IP `json:"ip,omitempty"` TargetRef *LocalUIDReferenceApplyConfiguration `json:"targetRef,omitempty"` } -// TargetNetworkInterfaceApplyConfiguration constructs an declarative configuration of the TargetNetworkInterface type for use with +// TargetNetworkInterfaceApplyConfiguration constructs a declarative configuration of the TargetNetworkInterface type for use with // apply. func TargetNetworkInterface() *TargetNetworkInterfaceApplyConfiguration { return &TargetNetworkInterfaceApplyConfiguration{} diff --git a/client-go/applyconfigurations/core/v1alpha1/topologyspreadconstraint.go b/client-go/applyconfigurations/core/v1alpha1/topologyspreadconstraint.go index 620eeb57..c4918c17 100644 --- a/client-go/applyconfigurations/core/v1alpha1/topologyspreadconstraint.go +++ b/client-go/applyconfigurations/core/v1alpha1/topologyspreadconstraint.go @@ -10,7 +10,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// TopologySpreadConstraintApplyConfiguration represents an declarative configuration of the TopologySpreadConstraint type for use +// TopologySpreadConstraintApplyConfiguration represents a declarative configuration of the TopologySpreadConstraint type for use // with apply. type TopologySpreadConstraintApplyConfiguration struct { MaxSkew *int32 `json:"maxSkew,omitempty"` @@ -19,7 +19,7 @@ type TopologySpreadConstraintApplyConfiguration struct { LabelSelector *v1.LabelSelectorApplyConfiguration `json:"labelSelector,omitempty"` } -// TopologySpreadConstraintApplyConfiguration constructs an declarative configuration of the TopologySpreadConstraint type for use with +// TopologySpreadConstraintApplyConfiguration constructs a declarative configuration of the TopologySpreadConstraint type for use with // apply. func TopologySpreadConstraint() *TopologySpreadConstraintApplyConfiguration { return &TopologySpreadConstraintApplyConfiguration{} diff --git a/client-go/applyconfigurations/utils.go b/client-go/applyconfigurations/utils.go index 45490441..9316a349 100644 --- a/client-go/applyconfigurations/utils.go +++ b/client-go/applyconfigurations/utils.go @@ -8,7 +8,10 @@ package applyconfigurations import ( v1alpha1 "github.com/ironcore-dev/ironcore-net/api/core/v1alpha1" corev1alpha1 "github.com/ironcore-dev/ironcore-net/client-go/applyconfigurations/core/v1alpha1" + internal "github.com/ironcore-dev/ironcore-net/client-go/applyconfigurations/internal" + 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 @@ -158,3 +161,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 09a6a4f7..23dfa545 100644 --- a/client-go/informers/externalversions/factory.go +++ b/client-go/informers/externalversions/factory.go @@ -215,6 +215,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/ironcorenet/versioned/fake/clientset_generated.go b/client-go/ironcorenet/versioned/fake/clientset_generated.go index e34b2a53..7d7a1402 100644 --- a/client-go/ironcorenet/versioned/fake/clientset_generated.go +++ b/client-go/ironcorenet/versioned/fake/clientset_generated.go @@ -6,6 +6,7 @@ package fake import ( + applyconfigurations "github.com/ironcore-dev/ironcore-net/client-go/applyconfigurations" clientset "github.com/ironcore-dev/ironcore-net/client-go/ironcorenet/versioned" corev1alpha1 "github.com/ironcore-dev/ironcore-net/client-go/ironcorenet/versioned/typed/core/v1alpha1" fakecorev1alpha1 "github.com/ironcore-dev/ironcore-net/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake" @@ -18,8 +19,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 { @@ -61,6 +66,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/ironcorenet/versioned/typed/core/v1alpha1/daemonset.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/daemonset.go index 2ca28d6b..8a45758c 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/daemonset.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/daemonset.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore-net/api/core/v1alpha1" corev1alpha1 "github.com/ironcore-dev/ironcore-net/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" ) // DaemonSetsGetter has a method to return a DaemonSetInterface. @@ -30,6 +27,7 @@ type DaemonSetsGetter interface { type DaemonSetInterface interface { Create(ctx context.Context, daemonSet *v1alpha1.DaemonSet, opts v1.CreateOptions) (*v1alpha1.DaemonSet, error) Update(ctx context.Context, daemonSet *v1alpha1.DaemonSet, opts v1.UpdateOptions) (*v1alpha1.DaemonSet, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, daemonSet *v1alpha1.DaemonSet, opts v1.UpdateOptions) (*v1alpha1.DaemonSet, 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 DaemonSetInterface 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.DaemonSet, err error) Apply(ctx context.Context, daemonSet *corev1alpha1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.DaemonSet, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, daemonSet *corev1alpha1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.DaemonSet, err error) DaemonSetExpansion } // daemonSets implements DaemonSetInterface type daemonSets struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.DaemonSet, *v1alpha1.DaemonSetList, *corev1alpha1.DaemonSetApplyConfiguration] } // newDaemonSets returns a DaemonSets func newDaemonSets(c *CoreV1alpha1Client, namespace string) *daemonSets { return &daemonSets{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.DaemonSet, *v1alpha1.DaemonSetList, *corev1alpha1.DaemonSetApplyConfiguration]( + "daemonsets", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.DaemonSet { return &v1alpha1.DaemonSet{} }, + func() *v1alpha1.DaemonSetList { return &v1alpha1.DaemonSetList{} }), } } - -// Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any. -func (c *daemonSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.DaemonSet, err error) { - result = &v1alpha1.DaemonSet{} - err = c.client.Get(). - Namespace(c.ns). - Resource("daemonsets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of DaemonSets that match those selectors. -func (c *daemonSets) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.DaemonSetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.DaemonSetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("daemonsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested daemonSets. -func (c *daemonSets) 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("daemonsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any. -func (c *daemonSets) Create(ctx context.Context, daemonSet *v1alpha1.DaemonSet, opts v1.CreateOptions) (result *v1alpha1.DaemonSet, err error) { - result = &v1alpha1.DaemonSet{} - err = c.client.Post(). - Namespace(c.ns). - Resource("daemonsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(daemonSet). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any. -func (c *daemonSets) Update(ctx context.Context, daemonSet *v1alpha1.DaemonSet, opts v1.UpdateOptions) (result *v1alpha1.DaemonSet, err error) { - result = &v1alpha1.DaemonSet{} - err = c.client.Put(). - Namespace(c.ns). - Resource("daemonsets"). - Name(daemonSet.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(daemonSet). - 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 *daemonSets) UpdateStatus(ctx context.Context, daemonSet *v1alpha1.DaemonSet, opts v1.UpdateOptions) (result *v1alpha1.DaemonSet, err error) { - result = &v1alpha1.DaemonSet{} - err = c.client.Put(). - Namespace(c.ns). - Resource("daemonsets"). - Name(daemonSet.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(daemonSet). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. -func (c *daemonSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("daemonsets"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *daemonSets) 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("daemonsets"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched daemonSet. -func (c *daemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.DaemonSet, err error) { - result = &v1alpha1.DaemonSet{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("daemonsets"). - 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 daemonSet. -func (c *daemonSets) Apply(ctx context.Context, daemonSet *corev1alpha1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.DaemonSet, err error) { - if daemonSet == nil { - return nil, fmt.Errorf("daemonSet provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(daemonSet) - if err != nil { - return nil, err - } - name := daemonSet.Name - if name == nil { - return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") - } - result = &v1alpha1.DaemonSet{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("daemonsets"). - 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 *daemonSets) ApplyStatus(ctx context.Context, daemonSet *corev1alpha1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.DaemonSet, err error) { - if daemonSet == nil { - return nil, fmt.Errorf("daemonSet provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(daemonSet) - if err != nil { - return nil, err - } - - name := daemonSet.Name - if name == nil { - return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") - } - - result = &v1alpha1.DaemonSet{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("daemonsets"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_daemonset.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_daemonset.go index 32a02879..07c50633 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_daemonset.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_daemonset.go @@ -31,22 +31,24 @@ var daemonsetsKind = v1alpha1.SchemeGroupVersion.WithKind("DaemonSet") // Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any. func (c *FakeDaemonSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.DaemonSet, err error) { + emptyResult := &v1alpha1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewGetAction(daemonsetsResource, c.ns, name), &v1alpha1.DaemonSet{}) + Invokes(testing.NewGetActionWithOptions(daemonsetsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.DaemonSet), err } // List takes label and field selectors, and returns the list of DaemonSets that match those selectors. func (c *FakeDaemonSets) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.DaemonSetList, err error) { + emptyResult := &v1alpha1.DaemonSetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(daemonsetsResource, daemonsetsKind, c.ns, opts), &v1alpha1.DaemonSetList{}) + Invokes(testing.NewListActionWithOptions(daemonsetsResource, daemonsetsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -65,40 +67,43 @@ func (c *FakeDaemonSets) List(ctx context.Context, opts v1.ListOptions) (result // Watch returns a watch.Interface that watches the requested daemonSets. func (c *FakeDaemonSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(daemonsetsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(daemonsetsResource, c.ns, opts)) } // Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any. func (c *FakeDaemonSets) Create(ctx context.Context, daemonSet *v1alpha1.DaemonSet, opts v1.CreateOptions) (result *v1alpha1.DaemonSet, err error) { + emptyResult := &v1alpha1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(daemonsetsResource, c.ns, daemonSet), &v1alpha1.DaemonSet{}) + Invokes(testing.NewCreateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.DaemonSet), err } // Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any. func (c *FakeDaemonSets) Update(ctx context.Context, daemonSet *v1alpha1.DaemonSet, opts v1.UpdateOptions) (result *v1alpha1.DaemonSet, err error) { + emptyResult := &v1alpha1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), &v1alpha1.DaemonSet{}) + Invokes(testing.NewUpdateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.DaemonSet), 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 *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1alpha1.DaemonSet, opts v1.UpdateOptions) (*v1alpha1.DaemonSet, error) { +func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1alpha1.DaemonSet, opts v1.UpdateOptions) (result *v1alpha1.DaemonSet, err error) { + emptyResult := &v1alpha1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), &v1alpha1.DaemonSet{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(daemonsetsResource, "status", c.ns, daemonSet, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.DaemonSet), err } @@ -113,7 +118,7 @@ func (c *FakeDaemonSets) Delete(ctx context.Context, name string, opts v1.Delete // DeleteCollection deletes a collection of objects. func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(daemonsetsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(daemonsetsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.DaemonSetList{}) return err @@ -121,11 +126,12 @@ func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, opts v1.DeleteOpt // Patch applies the patch and returns the patched daemonSet. func (c *FakeDaemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.DaemonSet, err error) { + emptyResult := &v1alpha1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, pt, data, subresources...), &v1alpha1.DaemonSet{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.DaemonSet), err } @@ -143,11 +149,12 @@ func (c *FakeDaemonSets) Apply(ctx context.Context, daemonSet *corev1alpha1.Daem if name == nil { return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") } + emptyResult := &v1alpha1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.DaemonSet{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.DaemonSet), err } @@ -166,11 +173,12 @@ func (c *FakeDaemonSets) ApplyStatus(ctx context.Context, daemonSet *corev1alpha if name == nil { return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") } + emptyResult := &v1alpha1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.DaemonSet{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.DaemonSet), err } diff --git a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_instance.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_instance.go index 05745c1a..2c9eae03 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_instance.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_instance.go @@ -31,22 +31,24 @@ var instancesKind = v1alpha1.SchemeGroupVersion.WithKind("Instance") // Get takes name of the instance, and returns the corresponding instance object, and an error if there is any. func (c *FakeInstances) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Instance, err error) { + emptyResult := &v1alpha1.Instance{} obj, err := c.Fake. - Invokes(testing.NewGetAction(instancesResource, c.ns, name), &v1alpha1.Instance{}) + Invokes(testing.NewGetActionWithOptions(instancesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Instance), err } // List takes label and field selectors, and returns the list of Instances that match those selectors. func (c *FakeInstances) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.InstanceList, err error) { + emptyResult := &v1alpha1.InstanceList{} obj, err := c.Fake. - Invokes(testing.NewListAction(instancesResource, instancesKind, c.ns, opts), &v1alpha1.InstanceList{}) + Invokes(testing.NewListActionWithOptions(instancesResource, instancesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -65,40 +67,43 @@ func (c *FakeInstances) List(ctx context.Context, opts v1.ListOptions) (result * // Watch returns a watch.Interface that watches the requested instances. func (c *FakeInstances) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(instancesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(instancesResource, c.ns, opts)) } // Create takes the representation of a instance and creates it. Returns the server's representation of the instance, and an error, if there is any. func (c *FakeInstances) Create(ctx context.Context, instance *v1alpha1.Instance, opts v1.CreateOptions) (result *v1alpha1.Instance, err error) { + emptyResult := &v1alpha1.Instance{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(instancesResource, c.ns, instance), &v1alpha1.Instance{}) + Invokes(testing.NewCreateActionWithOptions(instancesResource, c.ns, instance, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Instance), err } // Update takes the representation of a instance and updates it. Returns the server's representation of the instance, and an error, if there is any. func (c *FakeInstances) Update(ctx context.Context, instance *v1alpha1.Instance, opts v1.UpdateOptions) (result *v1alpha1.Instance, err error) { + emptyResult := &v1alpha1.Instance{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(instancesResource, c.ns, instance), &v1alpha1.Instance{}) + Invokes(testing.NewUpdateActionWithOptions(instancesResource, c.ns, instance, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Instance), 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 *FakeInstances) UpdateStatus(ctx context.Context, instance *v1alpha1.Instance, opts v1.UpdateOptions) (*v1alpha1.Instance, error) { +func (c *FakeInstances) UpdateStatus(ctx context.Context, instance *v1alpha1.Instance, opts v1.UpdateOptions) (result *v1alpha1.Instance, err error) { + emptyResult := &v1alpha1.Instance{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(instancesResource, "status", c.ns, instance), &v1alpha1.Instance{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(instancesResource, "status", c.ns, instance, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Instance), err } @@ -113,7 +118,7 @@ func (c *FakeInstances) Delete(ctx context.Context, name string, opts v1.DeleteO // DeleteCollection deletes a collection of objects. func (c *FakeInstances) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(instancesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(instancesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.InstanceList{}) return err @@ -121,11 +126,12 @@ func (c *FakeInstances) DeleteCollection(ctx context.Context, opts v1.DeleteOpti // Patch applies the patch and returns the patched instance. func (c *FakeInstances) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Instance, err error) { + emptyResult := &v1alpha1.Instance{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(instancesResource, c.ns, name, pt, data, subresources...), &v1alpha1.Instance{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(instancesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Instance), err } @@ -143,11 +149,12 @@ func (c *FakeInstances) Apply(ctx context.Context, instance *corev1alpha1.Instan if name == nil { return nil, fmt.Errorf("instance.Name must be provided to Apply") } + emptyResult := &v1alpha1.Instance{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(instancesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.Instance{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(instancesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Instance), err } @@ -166,11 +173,12 @@ func (c *FakeInstances) ApplyStatus(ctx context.Context, instance *corev1alpha1. if name == nil { return nil, fmt.Errorf("instance.Name must be provided to Apply") } + emptyResult := &v1alpha1.Instance{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(instancesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.Instance{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(instancesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Instance), err } diff --git a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_ip.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_ip.go index 22452a9b..04731077 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_ip.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_ip.go @@ -31,22 +31,24 @@ var ipsKind = v1alpha1.SchemeGroupVersion.WithKind("IP") // Get takes name of the iP, and returns the corresponding iP object, and an error if there is any. func (c *FakeIPs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.IP, err error) { + emptyResult := &v1alpha1.IP{} obj, err := c.Fake. - Invokes(testing.NewGetAction(ipsResource, c.ns, name), &v1alpha1.IP{}) + Invokes(testing.NewGetActionWithOptions(ipsResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.IP), err } // List takes label and field selectors, and returns the list of IPs that match those selectors. func (c *FakeIPs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.IPList, err error) { + emptyResult := &v1alpha1.IPList{} obj, err := c.Fake. - Invokes(testing.NewListAction(ipsResource, ipsKind, c.ns, opts), &v1alpha1.IPList{}) + Invokes(testing.NewListActionWithOptions(ipsResource, ipsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -65,40 +67,43 @@ func (c *FakeIPs) List(ctx context.Context, opts v1.ListOptions) (result *v1alph // Watch returns a watch.Interface that watches the requested iPs. func (c *FakeIPs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(ipsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(ipsResource, c.ns, opts)) } // Create takes the representation of a iP and creates it. Returns the server's representation of the iP, and an error, if there is any. func (c *FakeIPs) Create(ctx context.Context, iP *v1alpha1.IP, opts v1.CreateOptions) (result *v1alpha1.IP, err error) { + emptyResult := &v1alpha1.IP{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(ipsResource, c.ns, iP), &v1alpha1.IP{}) + Invokes(testing.NewCreateActionWithOptions(ipsResource, c.ns, iP, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.IP), err } // Update takes the representation of a iP and updates it. Returns the server's representation of the iP, and an error, if there is any. func (c *FakeIPs) Update(ctx context.Context, iP *v1alpha1.IP, opts v1.UpdateOptions) (result *v1alpha1.IP, err error) { + emptyResult := &v1alpha1.IP{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(ipsResource, c.ns, iP), &v1alpha1.IP{}) + Invokes(testing.NewUpdateActionWithOptions(ipsResource, c.ns, iP, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.IP), 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 *FakeIPs) UpdateStatus(ctx context.Context, iP *v1alpha1.IP, opts v1.UpdateOptions) (*v1alpha1.IP, error) { +func (c *FakeIPs) UpdateStatus(ctx context.Context, iP *v1alpha1.IP, opts v1.UpdateOptions) (result *v1alpha1.IP, err error) { + emptyResult := &v1alpha1.IP{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(ipsResource, "status", c.ns, iP), &v1alpha1.IP{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(ipsResource, "status", c.ns, iP, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.IP), err } @@ -113,7 +118,7 @@ func (c *FakeIPs) Delete(ctx context.Context, name string, opts v1.DeleteOptions // DeleteCollection deletes a collection of objects. func (c *FakeIPs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(ipsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(ipsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.IPList{}) return err @@ -121,11 +126,12 @@ func (c *FakeIPs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, l // Patch applies the patch and returns the patched iP. func (c *FakeIPs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.IP, err error) { + emptyResult := &v1alpha1.IP{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(ipsResource, c.ns, name, pt, data, subresources...), &v1alpha1.IP{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(ipsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.IP), err } @@ -143,11 +149,12 @@ func (c *FakeIPs) Apply(ctx context.Context, iP *corev1alpha1.IPApplyConfigurati if name == nil { return nil, fmt.Errorf("iP.Name must be provided to Apply") } + emptyResult := &v1alpha1.IP{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(ipsResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.IP{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(ipsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.IP), err } @@ -166,11 +173,12 @@ func (c *FakeIPs) ApplyStatus(ctx context.Context, iP *corev1alpha1.IPApplyConfi if name == nil { return nil, fmt.Errorf("iP.Name must be provided to Apply") } + emptyResult := &v1alpha1.IP{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(ipsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.IP{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(ipsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.IP), err } diff --git a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_ipaddress.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_ipaddress.go index c1d2a4f9..5855b1c8 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_ipaddress.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_ipaddress.go @@ -30,20 +30,22 @@ var ipaddressesKind = v1alpha1.SchemeGroupVersion.WithKind("IPAddress") // Get takes name of the iPAddress, and returns the corresponding iPAddress object, and an error if there is any. func (c *FakeIPAddresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.IPAddress, err error) { + emptyResult := &v1alpha1.IPAddress{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(ipaddressesResource, name), &v1alpha1.IPAddress{}) + Invokes(testing.NewRootGetActionWithOptions(ipaddressesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.IPAddress), err } // List takes label and field selectors, and returns the list of IPAddresses that match those selectors. func (c *FakeIPAddresses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.IPAddressList, err error) { + emptyResult := &v1alpha1.IPAddressList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(ipaddressesResource, ipaddressesKind, opts), &v1alpha1.IPAddressList{}) + Invokes(testing.NewRootListActionWithOptions(ipaddressesResource, ipaddressesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -62,25 +64,27 @@ func (c *FakeIPAddresses) List(ctx context.Context, opts v1.ListOptions) (result // Watch returns a watch.Interface that watches the requested iPAddresses. func (c *FakeIPAddresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(ipaddressesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(ipaddressesResource, opts)) } // Create takes the representation of a iPAddress and creates it. Returns the server's representation of the iPAddress, and an error, if there is any. func (c *FakeIPAddresses) Create(ctx context.Context, iPAddress *v1alpha1.IPAddress, opts v1.CreateOptions) (result *v1alpha1.IPAddress, err error) { + emptyResult := &v1alpha1.IPAddress{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(ipaddressesResource, iPAddress), &v1alpha1.IPAddress{}) + Invokes(testing.NewRootCreateActionWithOptions(ipaddressesResource, iPAddress, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.IPAddress), err } // Update takes the representation of a iPAddress and updates it. Returns the server's representation of the iPAddress, and an error, if there is any. func (c *FakeIPAddresses) Update(ctx context.Context, iPAddress *v1alpha1.IPAddress, opts v1.UpdateOptions) (result *v1alpha1.IPAddress, err error) { + emptyResult := &v1alpha1.IPAddress{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(ipaddressesResource, iPAddress), &v1alpha1.IPAddress{}) + Invokes(testing.NewRootUpdateActionWithOptions(ipaddressesResource, iPAddress, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.IPAddress), err } @@ -94,7 +98,7 @@ func (c *FakeIPAddresses) Delete(ctx context.Context, name string, opts v1.Delet // DeleteCollection deletes a collection of objects. func (c *FakeIPAddresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(ipaddressesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(ipaddressesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.IPAddressList{}) return err @@ -102,10 +106,11 @@ func (c *FakeIPAddresses) DeleteCollection(ctx context.Context, opts v1.DeleteOp // Patch applies the patch and returns the patched iPAddress. func (c *FakeIPAddresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.IPAddress, err error) { + emptyResult := &v1alpha1.IPAddress{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(ipaddressesResource, name, pt, data, subresources...), &v1alpha1.IPAddress{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(ipaddressesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.IPAddress), err } @@ -123,10 +128,11 @@ func (c *FakeIPAddresses) Apply(ctx context.Context, iPAddress *corev1alpha1.IPA if name == nil { return nil, fmt.Errorf("iPAddress.Name must be provided to Apply") } + emptyResult := &v1alpha1.IPAddress{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(ipaddressesResource, *name, types.ApplyPatchType, data), &v1alpha1.IPAddress{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(ipaddressesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.IPAddress), err } diff --git a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_loadbalancer.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_loadbalancer.go index f590a264..f4de3276 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_loadbalancer.go +++ b/client-go/ironcorenet/versioned/typed/core/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 *corev1alpha 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 *corev 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/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_loadbalancerrouting.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_loadbalancerrouting.go index e61c7854..b7a0024f 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_loadbalancerrouting.go +++ b/client-go/ironcorenet/versioned/typed/core/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/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_natgateway.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_natgateway.go index 605b2f50..205d56ee 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_natgateway.go +++ b/client-go/ironcorenet/versioned/typed/core/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 *corev1alpha1.NA 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 *corev1alp 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/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_natgatewayautoscaler.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_natgatewayautoscaler.go index dd79e260..8fede74a 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_natgatewayautoscaler.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_natgatewayautoscaler.go @@ -31,22 +31,24 @@ var natgatewayautoscalersKind = v1alpha1.SchemeGroupVersion.WithKind("NATGateway // Get takes name of the nATGatewayAutoscaler, and returns the corresponding nATGatewayAutoscaler object, and an error if there is any. func (c *FakeNATGatewayAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NATGatewayAutoscaler, err error) { + emptyResult := &v1alpha1.NATGatewayAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewGetAction(natgatewayautoscalersResource, c.ns, name), &v1alpha1.NATGatewayAutoscaler{}) + Invokes(testing.NewGetActionWithOptions(natgatewayautoscalersResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NATGatewayAutoscaler), err } // List takes label and field selectors, and returns the list of NATGatewayAutoscalers that match those selectors. func (c *FakeNATGatewayAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NATGatewayAutoscalerList, err error) { + emptyResult := &v1alpha1.NATGatewayAutoscalerList{} obj, err := c.Fake. - Invokes(testing.NewListAction(natgatewayautoscalersResource, natgatewayautoscalersKind, c.ns, opts), &v1alpha1.NATGatewayAutoscalerList{}) + Invokes(testing.NewListActionWithOptions(natgatewayautoscalersResource, natgatewayautoscalersKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -65,40 +67,43 @@ func (c *FakeNATGatewayAutoscalers) List(ctx context.Context, opts v1.ListOption // Watch returns a watch.Interface that watches the requested nATGatewayAutoscalers. func (c *FakeNATGatewayAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(natgatewayautoscalersResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(natgatewayautoscalersResource, c.ns, opts)) } // Create takes the representation of a nATGatewayAutoscaler and creates it. Returns the server's representation of the nATGatewayAutoscaler, and an error, if there is any. func (c *FakeNATGatewayAutoscalers) Create(ctx context.Context, nATGatewayAutoscaler *v1alpha1.NATGatewayAutoscaler, opts v1.CreateOptions) (result *v1alpha1.NATGatewayAutoscaler, err error) { + emptyResult := &v1alpha1.NATGatewayAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(natgatewayautoscalersResource, c.ns, nATGatewayAutoscaler), &v1alpha1.NATGatewayAutoscaler{}) + Invokes(testing.NewCreateActionWithOptions(natgatewayautoscalersResource, c.ns, nATGatewayAutoscaler, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NATGatewayAutoscaler), err } // Update takes the representation of a nATGatewayAutoscaler and updates it. Returns the server's representation of the nATGatewayAutoscaler, and an error, if there is any. func (c *FakeNATGatewayAutoscalers) Update(ctx context.Context, nATGatewayAutoscaler *v1alpha1.NATGatewayAutoscaler, opts v1.UpdateOptions) (result *v1alpha1.NATGatewayAutoscaler, err error) { + emptyResult := &v1alpha1.NATGatewayAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(natgatewayautoscalersResource, c.ns, nATGatewayAutoscaler), &v1alpha1.NATGatewayAutoscaler{}) + Invokes(testing.NewUpdateActionWithOptions(natgatewayautoscalersResource, c.ns, nATGatewayAutoscaler, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NATGatewayAutoscaler), 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 *FakeNATGatewayAutoscalers) UpdateStatus(ctx context.Context, nATGatewayAutoscaler *v1alpha1.NATGatewayAutoscaler, opts v1.UpdateOptions) (*v1alpha1.NATGatewayAutoscaler, error) { +func (c *FakeNATGatewayAutoscalers) UpdateStatus(ctx context.Context, nATGatewayAutoscaler *v1alpha1.NATGatewayAutoscaler, opts v1.UpdateOptions) (result *v1alpha1.NATGatewayAutoscaler, err error) { + emptyResult := &v1alpha1.NATGatewayAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(natgatewayautoscalersResource, "status", c.ns, nATGatewayAutoscaler), &v1alpha1.NATGatewayAutoscaler{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(natgatewayautoscalersResource, "status", c.ns, nATGatewayAutoscaler, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NATGatewayAutoscaler), err } @@ -113,7 +118,7 @@ func (c *FakeNATGatewayAutoscalers) Delete(ctx context.Context, name string, opt // DeleteCollection deletes a collection of objects. func (c *FakeNATGatewayAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(natgatewayautoscalersResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(natgatewayautoscalersResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.NATGatewayAutoscalerList{}) return err @@ -121,11 +126,12 @@ func (c *FakeNATGatewayAutoscalers) DeleteCollection(ctx context.Context, opts v // Patch applies the patch and returns the patched nATGatewayAutoscaler. func (c *FakeNATGatewayAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NATGatewayAutoscaler, err error) { + emptyResult := &v1alpha1.NATGatewayAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(natgatewayautoscalersResource, c.ns, name, pt, data, subresources...), &v1alpha1.NATGatewayAutoscaler{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(natgatewayautoscalersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NATGatewayAutoscaler), err } @@ -143,11 +149,12 @@ func (c *FakeNATGatewayAutoscalers) Apply(ctx context.Context, nATGatewayAutosca if name == nil { return nil, fmt.Errorf("nATGatewayAutoscaler.Name must be provided to Apply") } + emptyResult := &v1alpha1.NATGatewayAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(natgatewayautoscalersResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.NATGatewayAutoscaler{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(natgatewayautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NATGatewayAutoscaler), err } @@ -166,11 +173,12 @@ func (c *FakeNATGatewayAutoscalers) ApplyStatus(ctx context.Context, nATGatewayA if name == nil { return nil, fmt.Errorf("nATGatewayAutoscaler.Name must be provided to Apply") } + emptyResult := &v1alpha1.NATGatewayAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(natgatewayautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha1.NATGatewayAutoscaler{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(natgatewayautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NATGatewayAutoscaler), err } diff --git a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_nattable.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_nattable.go index 4689c323..b79d043e 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_nattable.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_nattable.go @@ -31,22 +31,24 @@ var nattablesKind = v1alpha1.SchemeGroupVersion.WithKind("NATTable") // Get takes name of the nATTable, and returns the corresponding nATTable object, and an error if there is any. func (c *FakeNATTables) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NATTable, err error) { + emptyResult := &v1alpha1.NATTable{} obj, err := c.Fake. - Invokes(testing.NewGetAction(nattablesResource, c.ns, name), &v1alpha1.NATTable{}) + Invokes(testing.NewGetActionWithOptions(nattablesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NATTable), err } // List takes label and field selectors, and returns the list of NATTables that match those selectors. func (c *FakeNATTables) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NATTableList, err error) { + emptyResult := &v1alpha1.NATTableList{} obj, err := c.Fake. - Invokes(testing.NewListAction(nattablesResource, nattablesKind, c.ns, opts), &v1alpha1.NATTableList{}) + Invokes(testing.NewListActionWithOptions(nattablesResource, nattablesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -65,28 +67,30 @@ func (c *FakeNATTables) List(ctx context.Context, opts v1.ListOptions) (result * // Watch returns a watch.Interface that watches the requested nATTables. func (c *FakeNATTables) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(nattablesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(nattablesResource, c.ns, opts)) } // Create takes the representation of a nATTable and creates it. Returns the server's representation of the nATTable, and an error, if there is any. func (c *FakeNATTables) Create(ctx context.Context, nATTable *v1alpha1.NATTable, opts v1.CreateOptions) (result *v1alpha1.NATTable, err error) { + emptyResult := &v1alpha1.NATTable{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(nattablesResource, c.ns, nATTable), &v1alpha1.NATTable{}) + Invokes(testing.NewCreateActionWithOptions(nattablesResource, c.ns, nATTable, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NATTable), err } // Update takes the representation of a nATTable and updates it. Returns the server's representation of the nATTable, and an error, if there is any. func (c *FakeNATTables) Update(ctx context.Context, nATTable *v1alpha1.NATTable, opts v1.UpdateOptions) (result *v1alpha1.NATTable, err error) { + emptyResult := &v1alpha1.NATTable{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(nattablesResource, c.ns, nATTable), &v1alpha1.NATTable{}) + Invokes(testing.NewUpdateActionWithOptions(nattablesResource, c.ns, nATTable, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NATTable), err } @@ -101,7 +105,7 @@ func (c *FakeNATTables) Delete(ctx context.Context, name string, opts v1.DeleteO // DeleteCollection deletes a collection of objects. func (c *FakeNATTables) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(nattablesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(nattablesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.NATTableList{}) return err @@ -109,11 +113,12 @@ func (c *FakeNATTables) DeleteCollection(ctx context.Context, opts v1.DeleteOpti // Patch applies the patch and returns the patched nATTable. func (c *FakeNATTables) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NATTable, err error) { + emptyResult := &v1alpha1.NATTable{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(nattablesResource, c.ns, name, pt, data, subresources...), &v1alpha1.NATTable{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(nattablesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NATTable), err } @@ -131,11 +136,12 @@ func (c *FakeNATTables) Apply(ctx context.Context, nATTable *corev1alpha1.NATTab if name == nil { return nil, fmt.Errorf("nATTable.Name must be provided to Apply") } + emptyResult := &v1alpha1.NATTable{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(nattablesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.NATTable{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(nattablesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NATTable), err } diff --git a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_network.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_network.go index 1503a549..82dc21f6 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_network.go +++ b/client-go/ironcorenet/versioned/typed/core/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 *corev1alpha1.NetworkA 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 *corev1alpha1.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, "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/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_networkid.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_networkid.go index 4d3f0e59..0c00c049 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_networkid.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_networkid.go @@ -30,20 +30,22 @@ var networkidsKind = v1alpha1.SchemeGroupVersion.WithKind("NetworkID") // Get takes name of the networkID, and returns the corresponding networkID object, and an error if there is any. func (c *FakeNetworkIDs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NetworkID, err error) { + emptyResult := &v1alpha1.NetworkID{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(networkidsResource, name), &v1alpha1.NetworkID{}) + Invokes(testing.NewRootGetActionWithOptions(networkidsResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkID), err } // List takes label and field selectors, and returns the list of NetworkIDs that match those selectors. func (c *FakeNetworkIDs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NetworkIDList, err error) { + emptyResult := &v1alpha1.NetworkIDList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(networkidsResource, networkidsKind, opts), &v1alpha1.NetworkIDList{}) + Invokes(testing.NewRootListActionWithOptions(networkidsResource, networkidsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -62,25 +64,27 @@ func (c *FakeNetworkIDs) List(ctx context.Context, opts v1.ListOptions) (result // Watch returns a watch.Interface that watches the requested networkIDs. func (c *FakeNetworkIDs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(networkidsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(networkidsResource, opts)) } // Create takes the representation of a networkID and creates it. Returns the server's representation of the networkID, and an error, if there is any. func (c *FakeNetworkIDs) Create(ctx context.Context, networkID *v1alpha1.NetworkID, opts v1.CreateOptions) (result *v1alpha1.NetworkID, err error) { + emptyResult := &v1alpha1.NetworkID{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(networkidsResource, networkID), &v1alpha1.NetworkID{}) + Invokes(testing.NewRootCreateActionWithOptions(networkidsResource, networkID, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkID), err } // Update takes the representation of a networkID and updates it. Returns the server's representation of the networkID, and an error, if there is any. func (c *FakeNetworkIDs) Update(ctx context.Context, networkID *v1alpha1.NetworkID, opts v1.UpdateOptions) (result *v1alpha1.NetworkID, err error) { + emptyResult := &v1alpha1.NetworkID{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(networkidsResource, networkID), &v1alpha1.NetworkID{}) + Invokes(testing.NewRootUpdateActionWithOptions(networkidsResource, networkID, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkID), err } @@ -94,7 +98,7 @@ func (c *FakeNetworkIDs) Delete(ctx context.Context, name string, opts v1.Delete // DeleteCollection deletes a collection of objects. func (c *FakeNetworkIDs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(networkidsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(networkidsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.NetworkIDList{}) return err @@ -102,10 +106,11 @@ func (c *FakeNetworkIDs) DeleteCollection(ctx context.Context, opts v1.DeleteOpt // Patch applies the patch and returns the patched networkID. func (c *FakeNetworkIDs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NetworkID, err error) { + emptyResult := &v1alpha1.NetworkID{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(networkidsResource, name, pt, data, subresources...), &v1alpha1.NetworkID{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(networkidsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkID), err } @@ -123,10 +128,11 @@ func (c *FakeNetworkIDs) Apply(ctx context.Context, networkID *corev1alpha1.Netw if name == nil { return nil, fmt.Errorf("networkID.Name must be provided to Apply") } + emptyResult := &v1alpha1.NetworkID{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(networkidsResource, *name, types.ApplyPatchType, data), &v1alpha1.NetworkID{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(networkidsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkID), err } diff --git a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_networkinterface.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_networkinterface.go index 96f3f4a9..ec0d6343 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_networkinterface.go +++ b/client-go/ironcorenet/versioned/typed/core/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 *cor 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/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_networkpolicy.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_networkpolicy.go index f049464e..ad1fe03d 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_networkpolicy.go +++ b/client-go/ironcorenet/versioned/typed/core/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,28 +67,30 @@ 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 } @@ -101,7 +105,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 @@ -109,11 +113,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 } @@ -131,11 +136,12 @@ func (c *FakeNetworkPolicies) Apply(ctx context.Context, networkPolicy *corev1al 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 } diff --git a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_networkpolicyrule.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_networkpolicyrule.go index fef99157..eb9c6f9a 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_networkpolicyrule.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_networkpolicyrule.go @@ -31,22 +31,24 @@ var networkpolicyrulesKind = v1alpha1.SchemeGroupVersion.WithKind("NetworkPolicy // Get takes name of the networkPolicyRule, and returns the corresponding networkPolicyRule object, and an error if there is any. func (c *FakeNetworkPolicyRules) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NetworkPolicyRule, err error) { + emptyResult := &v1alpha1.NetworkPolicyRule{} obj, err := c.Fake. - Invokes(testing.NewGetAction(networkpolicyrulesResource, c.ns, name), &v1alpha1.NetworkPolicyRule{}) + Invokes(testing.NewGetActionWithOptions(networkpolicyrulesResource, c.ns, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkPolicyRule), err } // List takes label and field selectors, and returns the list of NetworkPolicyRules that match those selectors. func (c *FakeNetworkPolicyRules) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NetworkPolicyRuleList, err error) { + emptyResult := &v1alpha1.NetworkPolicyRuleList{} obj, err := c.Fake. - Invokes(testing.NewListAction(networkpolicyrulesResource, networkpolicyrulesKind, c.ns, opts), &v1alpha1.NetworkPolicyRuleList{}) + Invokes(testing.NewListActionWithOptions(networkpolicyrulesResource, networkpolicyrulesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -65,28 +67,30 @@ func (c *FakeNetworkPolicyRules) List(ctx context.Context, opts v1.ListOptions) // Watch returns a watch.Interface that watches the requested networkPolicyRules. func (c *FakeNetworkPolicyRules) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(networkpolicyrulesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(networkpolicyrulesResource, c.ns, opts)) } // Create takes the representation of a networkPolicyRule and creates it. Returns the server's representation of the networkPolicyRule, and an error, if there is any. func (c *FakeNetworkPolicyRules) Create(ctx context.Context, networkPolicyRule *v1alpha1.NetworkPolicyRule, opts v1.CreateOptions) (result *v1alpha1.NetworkPolicyRule, err error) { + emptyResult := &v1alpha1.NetworkPolicyRule{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(networkpolicyrulesResource, c.ns, networkPolicyRule), &v1alpha1.NetworkPolicyRule{}) + Invokes(testing.NewCreateActionWithOptions(networkpolicyrulesResource, c.ns, networkPolicyRule, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkPolicyRule), err } // Update takes the representation of a networkPolicyRule and updates it. Returns the server's representation of the networkPolicyRule, and an error, if there is any. func (c *FakeNetworkPolicyRules) Update(ctx context.Context, networkPolicyRule *v1alpha1.NetworkPolicyRule, opts v1.UpdateOptions) (result *v1alpha1.NetworkPolicyRule, err error) { + emptyResult := &v1alpha1.NetworkPolicyRule{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(networkpolicyrulesResource, c.ns, networkPolicyRule), &v1alpha1.NetworkPolicyRule{}) + Invokes(testing.NewUpdateActionWithOptions(networkpolicyrulesResource, c.ns, networkPolicyRule, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkPolicyRule), err } @@ -101,7 +105,7 @@ func (c *FakeNetworkPolicyRules) Delete(ctx context.Context, name string, opts v // DeleteCollection deletes a collection of objects. func (c *FakeNetworkPolicyRules) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(networkpolicyrulesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(networkpolicyrulesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.NetworkPolicyRuleList{}) return err @@ -109,11 +113,12 @@ func (c *FakeNetworkPolicyRules) DeleteCollection(ctx context.Context, opts v1.D // Patch applies the patch and returns the patched networkPolicyRule. func (c *FakeNetworkPolicyRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NetworkPolicyRule, err error) { + emptyResult := &v1alpha1.NetworkPolicyRule{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(networkpolicyrulesResource, c.ns, name, pt, data, subresources...), &v1alpha1.NetworkPolicyRule{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(networkpolicyrulesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkPolicyRule), err } @@ -131,11 +136,12 @@ func (c *FakeNetworkPolicyRules) Apply(ctx context.Context, networkPolicyRule *c if name == nil { return nil, fmt.Errorf("networkPolicyRule.Name must be provided to Apply") } + emptyResult := &v1alpha1.NetworkPolicyRule{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(networkpolicyrulesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.NetworkPolicyRule{}) + Invokes(testing.NewPatchSubresourceActionWithOptions(networkpolicyrulesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.NetworkPolicyRule), err } diff --git a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_node.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_node.go index 32ecdb89..78ed0fc3 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_node.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/fake/fake_node.go @@ -30,20 +30,22 @@ var nodesKind = v1alpha1.SchemeGroupVersion.WithKind("Node") // Get takes name of the node, and returns the corresponding node object, and an error if there is any. func (c *FakeNodes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Node, err error) { + emptyResult := &v1alpha1.Node{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(nodesResource, name), &v1alpha1.Node{}) + Invokes(testing.NewRootGetActionWithOptions(nodesResource, name, options), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Node), err } // List takes label and field selectors, and returns the list of Nodes that match those selectors. func (c *FakeNodes) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NodeList, err error) { + emptyResult := &v1alpha1.NodeList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(nodesResource, nodesKind, opts), &v1alpha1.NodeList{}) + Invokes(testing.NewRootListActionWithOptions(nodesResource, nodesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -62,36 +64,39 @@ func (c *FakeNodes) List(ctx context.Context, opts v1.ListOptions) (result *v1al // Watch returns a watch.Interface that watches the requested nodes. func (c *FakeNodes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(nodesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(nodesResource, opts)) } // Create takes the representation of a node and creates it. Returns the server's representation of the node, and an error, if there is any. func (c *FakeNodes) Create(ctx context.Context, node *v1alpha1.Node, opts v1.CreateOptions) (result *v1alpha1.Node, err error) { + emptyResult := &v1alpha1.Node{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(nodesResource, node), &v1alpha1.Node{}) + Invokes(testing.NewRootCreateActionWithOptions(nodesResource, node, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Node), err } // Update takes the representation of a node and updates it. Returns the server's representation of the node, and an error, if there is any. func (c *FakeNodes) Update(ctx context.Context, node *v1alpha1.Node, opts v1.UpdateOptions) (result *v1alpha1.Node, err error) { + emptyResult := &v1alpha1.Node{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(nodesResource, node), &v1alpha1.Node{}) + Invokes(testing.NewRootUpdateActionWithOptions(nodesResource, node, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Node), 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 *FakeNodes) UpdateStatus(ctx context.Context, node *v1alpha1.Node, opts v1.UpdateOptions) (*v1alpha1.Node, error) { +func (c *FakeNodes) UpdateStatus(ctx context.Context, node *v1alpha1.Node, opts v1.UpdateOptions) (result *v1alpha1.Node, err error) { + emptyResult := &v1alpha1.Node{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(nodesResource, "status", node), &v1alpha1.Node{}) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(nodesResource, "status", node, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Node), err } @@ -105,7 +110,7 @@ func (c *FakeNodes) Delete(ctx context.Context, name string, opts v1.DeleteOptio // DeleteCollection deletes a collection of objects. func (c *FakeNodes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(nodesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(nodesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.NodeList{}) return err @@ -113,10 +118,11 @@ func (c *FakeNodes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, // Patch applies the patch and returns the patched node. func (c *FakeNodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Node, err error) { + emptyResult := &v1alpha1.Node{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(nodesResource, name, pt, data, subresources...), &v1alpha1.Node{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(nodesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Node), err } @@ -134,10 +140,11 @@ func (c *FakeNodes) Apply(ctx context.Context, node *corev1alpha1.NodeApplyConfi if name == nil { return nil, fmt.Errorf("node.Name must be provided to Apply") } + emptyResult := &v1alpha1.Node{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(nodesResource, *name, types.ApplyPatchType, data), &v1alpha1.Node{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(nodesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Node), err } @@ -156,10 +163,11 @@ func (c *FakeNodes) ApplyStatus(ctx context.Context, node *corev1alpha1.NodeAppl if name == nil { return nil, fmt.Errorf("node.Name must be provided to Apply") } + emptyResult := &v1alpha1.Node{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(nodesResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.Node{}) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(nodesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Node), err } diff --git a/client-go/ironcorenet/versioned/typed/core/v1alpha1/instance.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/instance.go index e9fcc47a..b793edda 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/instance.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/instance.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore-net/api/core/v1alpha1" corev1alpha1 "github.com/ironcore-dev/ironcore-net/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" ) // InstancesGetter has a method to return a InstanceInterface. @@ -30,6 +27,7 @@ type InstancesGetter interface { type InstanceInterface interface { Create(ctx context.Context, instance *v1alpha1.Instance, opts v1.CreateOptions) (*v1alpha1.Instance, error) Update(ctx context.Context, instance *v1alpha1.Instance, opts v1.UpdateOptions) (*v1alpha1.Instance, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, instance *v1alpha1.Instance, opts v1.UpdateOptions) (*v1alpha1.Instance, 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 InstanceInterface 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.Instance, err error) Apply(ctx context.Context, instance *corev1alpha1.InstanceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Instance, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, instance *corev1alpha1.InstanceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Instance, err error) InstanceExpansion } // instances implements InstanceInterface type instances struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.Instance, *v1alpha1.InstanceList, *corev1alpha1.InstanceApplyConfiguration] } // newInstances returns a Instances func newInstances(c *CoreV1alpha1Client, namespace string) *instances { return &instances{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.Instance, *v1alpha1.InstanceList, *corev1alpha1.InstanceApplyConfiguration]( + "instances", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.Instance { return &v1alpha1.Instance{} }, + func() *v1alpha1.InstanceList { return &v1alpha1.InstanceList{} }), } } - -// Get takes name of the instance, and returns the corresponding instance object, and an error if there is any. -func (c *instances) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Instance, err error) { - result = &v1alpha1.Instance{} - err = c.client.Get(). - Namespace(c.ns). - Resource("instances"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Instances that match those selectors. -func (c *instances) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.InstanceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.InstanceList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("instances"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested instances. -func (c *instances) 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("instances"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a instance and creates it. Returns the server's representation of the instance, and an error, if there is any. -func (c *instances) Create(ctx context.Context, instance *v1alpha1.Instance, opts v1.CreateOptions) (result *v1alpha1.Instance, err error) { - result = &v1alpha1.Instance{} - err = c.client.Post(). - Namespace(c.ns). - Resource("instances"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(instance). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a instance and updates it. Returns the server's representation of the instance, and an error, if there is any. -func (c *instances) Update(ctx context.Context, instance *v1alpha1.Instance, opts v1.UpdateOptions) (result *v1alpha1.Instance, err error) { - result = &v1alpha1.Instance{} - err = c.client.Put(). - Namespace(c.ns). - Resource("instances"). - Name(instance.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(instance). - 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 *instances) UpdateStatus(ctx context.Context, instance *v1alpha1.Instance, opts v1.UpdateOptions) (result *v1alpha1.Instance, err error) { - result = &v1alpha1.Instance{} - err = c.client.Put(). - Namespace(c.ns). - Resource("instances"). - Name(instance.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(instance). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the instance and deletes it. Returns an error if one occurs. -func (c *instances) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("instances"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *instances) 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("instances"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched instance. -func (c *instances) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Instance, err error) { - result = &v1alpha1.Instance{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("instances"). - 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 instance. -func (c *instances) Apply(ctx context.Context, instance *corev1alpha1.InstanceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Instance, err error) { - if instance == nil { - return nil, fmt.Errorf("instance provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(instance) - if err != nil { - return nil, err - } - name := instance.Name - if name == nil { - return nil, fmt.Errorf("instance.Name must be provided to Apply") - } - result = &v1alpha1.Instance{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("instances"). - 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 *instances) ApplyStatus(ctx context.Context, instance *corev1alpha1.InstanceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Instance, err error) { - if instance == nil { - return nil, fmt.Errorf("instance provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(instance) - if err != nil { - return nil, err - } - - name := instance.Name - if name == nil { - return nil, fmt.Errorf("instance.Name must be provided to Apply") - } - - result = &v1alpha1.Instance{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("instances"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcorenet/versioned/typed/core/v1alpha1/ip.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/ip.go index 7031c438..d8eedcc1 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/ip.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/ip.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore-net/api/core/v1alpha1" corev1alpha1 "github.com/ironcore-dev/ironcore-net/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" ) // IPsGetter has a method to return a IPInterface. @@ -30,6 +27,7 @@ type IPsGetter interface { type IPInterface interface { Create(ctx context.Context, iP *v1alpha1.IP, opts v1.CreateOptions) (*v1alpha1.IP, error) Update(ctx context.Context, iP *v1alpha1.IP, opts v1.UpdateOptions) (*v1alpha1.IP, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, iP *v1alpha1.IP, opts v1.UpdateOptions) (*v1alpha1.IP, 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 IPInterface 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.IP, err error) Apply(ctx context.Context, iP *corev1alpha1.IPApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.IP, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, iP *corev1alpha1.IPApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.IP, err error) IPExpansion } // iPs implements IPInterface type iPs struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.IP, *v1alpha1.IPList, *corev1alpha1.IPApplyConfiguration] } // newIPs returns a IPs func newIPs(c *CoreV1alpha1Client, namespace string) *iPs { return &iPs{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.IP, *v1alpha1.IPList, *corev1alpha1.IPApplyConfiguration]( + "ips", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.IP { return &v1alpha1.IP{} }, + func() *v1alpha1.IPList { return &v1alpha1.IPList{} }), } } - -// Get takes name of the iP, and returns the corresponding iP object, and an error if there is any. -func (c *iPs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.IP, err error) { - result = &v1alpha1.IP{} - err = c.client.Get(). - Namespace(c.ns). - Resource("ips"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of IPs that match those selectors. -func (c *iPs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.IPList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.IPList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("ips"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested iPs. -func (c *iPs) 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("ips"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a iP and creates it. Returns the server's representation of the iP, and an error, if there is any. -func (c *iPs) Create(ctx context.Context, iP *v1alpha1.IP, opts v1.CreateOptions) (result *v1alpha1.IP, err error) { - result = &v1alpha1.IP{} - err = c.client.Post(). - Namespace(c.ns). - Resource("ips"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(iP). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a iP and updates it. Returns the server's representation of the iP, and an error, if there is any. -func (c *iPs) Update(ctx context.Context, iP *v1alpha1.IP, opts v1.UpdateOptions) (result *v1alpha1.IP, err error) { - result = &v1alpha1.IP{} - err = c.client.Put(). - Namespace(c.ns). - Resource("ips"). - Name(iP.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(iP). - 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 *iPs) UpdateStatus(ctx context.Context, iP *v1alpha1.IP, opts v1.UpdateOptions) (result *v1alpha1.IP, err error) { - result = &v1alpha1.IP{} - err = c.client.Put(). - Namespace(c.ns). - Resource("ips"). - Name(iP.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(iP). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the iP and deletes it. Returns an error if one occurs. -func (c *iPs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("ips"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *iPs) 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("ips"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched iP. -func (c *iPs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.IP, err error) { - result = &v1alpha1.IP{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("ips"). - 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 iP. -func (c *iPs) Apply(ctx context.Context, iP *corev1alpha1.IPApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.IP, err error) { - if iP == nil { - return nil, fmt.Errorf("iP provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(iP) - if err != nil { - return nil, err - } - name := iP.Name - if name == nil { - return nil, fmt.Errorf("iP.Name must be provided to Apply") - } - result = &v1alpha1.IP{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("ips"). - 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 *iPs) ApplyStatus(ctx context.Context, iP *corev1alpha1.IPApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.IP, err error) { - if iP == nil { - return nil, fmt.Errorf("iP provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(iP) - if err != nil { - return nil, err - } - - name := iP.Name - if name == nil { - return nil, fmt.Errorf("iP.Name must be provided to Apply") - } - - result = &v1alpha1.IP{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("ips"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcorenet/versioned/typed/core/v1alpha1/ipaddress.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/ipaddress.go index 214fe1d2..e8ee4978 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/ipaddress.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/ipaddress.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore-net/api/core/v1alpha1" corev1alpha1 "github.com/ironcore-dev/ironcore-net/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" ) // IPAddressesGetter has a method to return a IPAddressInterface. @@ -42,143 +39,18 @@ type IPAddressInterface interface { // iPAddresses implements IPAddressInterface type iPAddresses struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.IPAddress, *v1alpha1.IPAddressList, *corev1alpha1.IPAddressApplyConfiguration] } // newIPAddresses returns a IPAddresses func newIPAddresses(c *CoreV1alpha1Client) *iPAddresses { return &iPAddresses{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.IPAddress, *v1alpha1.IPAddressList, *corev1alpha1.IPAddressApplyConfiguration]( + "ipaddresses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.IPAddress { return &v1alpha1.IPAddress{} }, + func() *v1alpha1.IPAddressList { return &v1alpha1.IPAddressList{} }), } } - -// Get takes name of the iPAddress, and returns the corresponding iPAddress object, and an error if there is any. -func (c *iPAddresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.IPAddress, err error) { - result = &v1alpha1.IPAddress{} - err = c.client.Get(). - Resource("ipaddresses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of IPAddresses that match those selectors. -func (c *iPAddresses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.IPAddressList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.IPAddressList{} - err = c.client.Get(). - Resource("ipaddresses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested iPAddresses. -func (c *iPAddresses) 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("ipaddresses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a iPAddress and creates it. Returns the server's representation of the iPAddress, and an error, if there is any. -func (c *iPAddresses) Create(ctx context.Context, iPAddress *v1alpha1.IPAddress, opts v1.CreateOptions) (result *v1alpha1.IPAddress, err error) { - result = &v1alpha1.IPAddress{} - err = c.client.Post(). - Resource("ipaddresses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(iPAddress). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a iPAddress and updates it. Returns the server's representation of the iPAddress, and an error, if there is any. -func (c *iPAddresses) Update(ctx context.Context, iPAddress *v1alpha1.IPAddress, opts v1.UpdateOptions) (result *v1alpha1.IPAddress, err error) { - result = &v1alpha1.IPAddress{} - err = c.client.Put(). - Resource("ipaddresses"). - Name(iPAddress.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(iPAddress). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the iPAddress and deletes it. Returns an error if one occurs. -func (c *iPAddresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("ipaddresses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *iPAddresses) 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("ipaddresses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched iPAddress. -func (c *iPAddresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.IPAddress, err error) { - result = &v1alpha1.IPAddress{} - err = c.client.Patch(pt). - Resource("ipaddresses"). - 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 iPAddress. -func (c *iPAddresses) Apply(ctx context.Context, iPAddress *corev1alpha1.IPAddressApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.IPAddress, err error) { - if iPAddress == nil { - return nil, fmt.Errorf("iPAddress provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(iPAddress) - if err != nil { - return nil, err - } - name := iPAddress.Name - if name == nil { - return nil, fmt.Errorf("iPAddress.Name must be provided to Apply") - } - result = &v1alpha1.IPAddress{} - err = c.client.Patch(types.ApplyPatchType). - Resource("ipaddresses"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcorenet/versioned/typed/core/v1alpha1/loadbalancer.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/loadbalancer.go index b16fe9a1..d281fb57 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/loadbalancer.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/loadbalancer.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore-net/api/core/v1alpha1" corev1alpha1 "github.com/ironcore-dev/ironcore-net/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" ) // 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 *corev1alpha1.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 *corev1alpha1.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, *corev1alpha1.LoadBalancerApplyConfiguration] } // newLoadBalancers returns a LoadBalancers func newLoadBalancers(c *CoreV1alpha1Client, namespace string) *loadBalancers { return &loadBalancers{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.LoadBalancer, *v1alpha1.LoadBalancerList, *corev1alpha1.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 *corev1alpha1.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 *corev1alpha1.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/ironcorenet/versioned/typed/core/v1alpha1/loadbalancerrouting.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/loadbalancerrouting.go index 83975a91..6fcaf9de 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/loadbalancerrouting.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/loadbalancerrouting.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore-net/api/core/v1alpha1" corev1alpha1 "github.com/ironcore-dev/ironcore-net/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" ) // 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, *corev1alpha1.LoadBalancerRoutingApplyConfiguration] } // newLoadBalancerRoutings returns a LoadBalancerRoutings func newLoadBalancerRoutings(c *CoreV1alpha1Client, namespace string) *loadBalancerRoutings { return &loadBalancerRoutings{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.LoadBalancerRouting, *v1alpha1.LoadBalancerRoutingList, *corev1alpha1.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 *corev1alpha1.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/ironcorenet/versioned/typed/core/v1alpha1/natgateway.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/natgateway.go index 64baf05a..5d0078ef 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/natgateway.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/natgateway.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore-net/api/core/v1alpha1" corev1alpha1 "github.com/ironcore-dev/ironcore-net/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" ) // 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 *corev1alpha1.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 *corev1alpha1.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, *corev1alpha1.NATGatewayApplyConfiguration] } // newNATGateways returns a NATGateways func newNATGateways(c *CoreV1alpha1Client, namespace string) *nATGateways { return &nATGateways{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.NATGateway, *v1alpha1.NATGatewayList, *corev1alpha1.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 *corev1alpha1.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 *corev1alpha1.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/ironcorenet/versioned/typed/core/v1alpha1/natgatewayautoscaler.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/natgatewayautoscaler.go index 54357b8a..174c3545 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/natgatewayautoscaler.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/natgatewayautoscaler.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore-net/api/core/v1alpha1" corev1alpha1 "github.com/ironcore-dev/ironcore-net/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" ) // NATGatewayAutoscalersGetter has a method to return a NATGatewayAutoscalerInterface. @@ -30,6 +27,7 @@ type NATGatewayAutoscalersGetter interface { type NATGatewayAutoscalerInterface interface { Create(ctx context.Context, nATGatewayAutoscaler *v1alpha1.NATGatewayAutoscaler, opts v1.CreateOptions) (*v1alpha1.NATGatewayAutoscaler, error) Update(ctx context.Context, nATGatewayAutoscaler *v1alpha1.NATGatewayAutoscaler, opts v1.UpdateOptions) (*v1alpha1.NATGatewayAutoscaler, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, nATGatewayAutoscaler *v1alpha1.NATGatewayAutoscaler, opts v1.UpdateOptions) (*v1alpha1.NATGatewayAutoscaler, 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 NATGatewayAutoscalerInterface 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.NATGatewayAutoscaler, err error) Apply(ctx context.Context, nATGatewayAutoscaler *corev1alpha1.NATGatewayAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.NATGatewayAutoscaler, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, nATGatewayAutoscaler *corev1alpha1.NATGatewayAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.NATGatewayAutoscaler, err error) NATGatewayAutoscalerExpansion } // nATGatewayAutoscalers implements NATGatewayAutoscalerInterface type nATGatewayAutoscalers struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.NATGatewayAutoscaler, *v1alpha1.NATGatewayAutoscalerList, *corev1alpha1.NATGatewayAutoscalerApplyConfiguration] } // newNATGatewayAutoscalers returns a NATGatewayAutoscalers func newNATGatewayAutoscalers(c *CoreV1alpha1Client, namespace string) *nATGatewayAutoscalers { return &nATGatewayAutoscalers{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.NATGatewayAutoscaler, *v1alpha1.NATGatewayAutoscalerList, *corev1alpha1.NATGatewayAutoscalerApplyConfiguration]( + "natgatewayautoscalers", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.NATGatewayAutoscaler { return &v1alpha1.NATGatewayAutoscaler{} }, + func() *v1alpha1.NATGatewayAutoscalerList { return &v1alpha1.NATGatewayAutoscalerList{} }), } } - -// Get takes name of the nATGatewayAutoscaler, and returns the corresponding nATGatewayAutoscaler object, and an error if there is any. -func (c *nATGatewayAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NATGatewayAutoscaler, err error) { - result = &v1alpha1.NATGatewayAutoscaler{} - err = c.client.Get(). - Namespace(c.ns). - Resource("natgatewayautoscalers"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of NATGatewayAutoscalers that match those selectors. -func (c *nATGatewayAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NATGatewayAutoscalerList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.NATGatewayAutoscalerList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("natgatewayautoscalers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested nATGatewayAutoscalers. -func (c *nATGatewayAutoscalers) 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("natgatewayautoscalers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a nATGatewayAutoscaler and creates it. Returns the server's representation of the nATGatewayAutoscaler, and an error, if there is any. -func (c *nATGatewayAutoscalers) Create(ctx context.Context, nATGatewayAutoscaler *v1alpha1.NATGatewayAutoscaler, opts v1.CreateOptions) (result *v1alpha1.NATGatewayAutoscaler, err error) { - result = &v1alpha1.NATGatewayAutoscaler{} - err = c.client.Post(). - Namespace(c.ns). - Resource("natgatewayautoscalers"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(nATGatewayAutoscaler). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a nATGatewayAutoscaler and updates it. Returns the server's representation of the nATGatewayAutoscaler, and an error, if there is any. -func (c *nATGatewayAutoscalers) Update(ctx context.Context, nATGatewayAutoscaler *v1alpha1.NATGatewayAutoscaler, opts v1.UpdateOptions) (result *v1alpha1.NATGatewayAutoscaler, err error) { - result = &v1alpha1.NATGatewayAutoscaler{} - err = c.client.Put(). - Namespace(c.ns). - Resource("natgatewayautoscalers"). - Name(nATGatewayAutoscaler.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(nATGatewayAutoscaler). - 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 *nATGatewayAutoscalers) UpdateStatus(ctx context.Context, nATGatewayAutoscaler *v1alpha1.NATGatewayAutoscaler, opts v1.UpdateOptions) (result *v1alpha1.NATGatewayAutoscaler, err error) { - result = &v1alpha1.NATGatewayAutoscaler{} - err = c.client.Put(). - Namespace(c.ns). - Resource("natgatewayautoscalers"). - Name(nATGatewayAutoscaler.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(nATGatewayAutoscaler). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the nATGatewayAutoscaler and deletes it. Returns an error if one occurs. -func (c *nATGatewayAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("natgatewayautoscalers"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *nATGatewayAutoscalers) 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("natgatewayautoscalers"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched nATGatewayAutoscaler. -func (c *nATGatewayAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NATGatewayAutoscaler, err error) { - result = &v1alpha1.NATGatewayAutoscaler{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("natgatewayautoscalers"). - 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 nATGatewayAutoscaler. -func (c *nATGatewayAutoscalers) Apply(ctx context.Context, nATGatewayAutoscaler *corev1alpha1.NATGatewayAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.NATGatewayAutoscaler, err error) { - if nATGatewayAutoscaler == nil { - return nil, fmt.Errorf("nATGatewayAutoscaler provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(nATGatewayAutoscaler) - if err != nil { - return nil, err - } - name := nATGatewayAutoscaler.Name - if name == nil { - return nil, fmt.Errorf("nATGatewayAutoscaler.Name must be provided to Apply") - } - result = &v1alpha1.NATGatewayAutoscaler{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("natgatewayautoscalers"). - 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 *nATGatewayAutoscalers) ApplyStatus(ctx context.Context, nATGatewayAutoscaler *corev1alpha1.NATGatewayAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.NATGatewayAutoscaler, err error) { - if nATGatewayAutoscaler == nil { - return nil, fmt.Errorf("nATGatewayAutoscaler provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(nATGatewayAutoscaler) - if err != nil { - return nil, err - } - - name := nATGatewayAutoscaler.Name - if name == nil { - return nil, fmt.Errorf("nATGatewayAutoscaler.Name must be provided to Apply") - } - - result = &v1alpha1.NATGatewayAutoscaler{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("natgatewayautoscalers"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcorenet/versioned/typed/core/v1alpha1/nattable.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/nattable.go index a7ce62e7..2301abdf 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/nattable.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/nattable.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore-net/api/core/v1alpha1" corev1alpha1 "github.com/ironcore-dev/ironcore-net/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" ) // NATTablesGetter has a method to return a NATTableInterface. @@ -42,154 +39,18 @@ type NATTableInterface interface { // nATTables implements NATTableInterface type nATTables struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.NATTable, *v1alpha1.NATTableList, *corev1alpha1.NATTableApplyConfiguration] } // newNATTables returns a NATTables func newNATTables(c *CoreV1alpha1Client, namespace string) *nATTables { return &nATTables{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.NATTable, *v1alpha1.NATTableList, *corev1alpha1.NATTableApplyConfiguration]( + "nattables", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.NATTable { return &v1alpha1.NATTable{} }, + func() *v1alpha1.NATTableList { return &v1alpha1.NATTableList{} }), } } - -// Get takes name of the nATTable, and returns the corresponding nATTable object, and an error if there is any. -func (c *nATTables) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NATTable, err error) { - result = &v1alpha1.NATTable{} - err = c.client.Get(). - Namespace(c.ns). - Resource("nattables"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of NATTables that match those selectors. -func (c *nATTables) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NATTableList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.NATTableList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("nattables"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested nATTables. -func (c *nATTables) 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("nattables"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a nATTable and creates it. Returns the server's representation of the nATTable, and an error, if there is any. -func (c *nATTables) Create(ctx context.Context, nATTable *v1alpha1.NATTable, opts v1.CreateOptions) (result *v1alpha1.NATTable, err error) { - result = &v1alpha1.NATTable{} - err = c.client.Post(). - Namespace(c.ns). - Resource("nattables"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(nATTable). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a nATTable and updates it. Returns the server's representation of the nATTable, and an error, if there is any. -func (c *nATTables) Update(ctx context.Context, nATTable *v1alpha1.NATTable, opts v1.UpdateOptions) (result *v1alpha1.NATTable, err error) { - result = &v1alpha1.NATTable{} - err = c.client.Put(). - Namespace(c.ns). - Resource("nattables"). - Name(nATTable.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(nATTable). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the nATTable and deletes it. Returns an error if one occurs. -func (c *nATTables) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("nattables"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *nATTables) 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("nattables"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched nATTable. -func (c *nATTables) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NATTable, err error) { - result = &v1alpha1.NATTable{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("nattables"). - 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 nATTable. -func (c *nATTables) Apply(ctx context.Context, nATTable *corev1alpha1.NATTableApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.NATTable, err error) { - if nATTable == nil { - return nil, fmt.Errorf("nATTable provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(nATTable) - if err != nil { - return nil, err - } - name := nATTable.Name - if name == nil { - return nil, fmt.Errorf("nATTable.Name must be provided to Apply") - } - result = &v1alpha1.NATTable{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("nattables"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcorenet/versioned/typed/core/v1alpha1/network.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/network.go index 0b9db270..f8271fe5 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/network.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/network.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore-net/api/core/v1alpha1" corev1alpha1 "github.com/ironcore-dev/ironcore-net/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" ) // 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 *corev1alpha1.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 *corev1alpha1.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, *corev1alpha1.NetworkApplyConfiguration] } // newNetworks returns a Networks func newNetworks(c *CoreV1alpha1Client, namespace string) *networks { return &networks{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.Network, *v1alpha1.NetworkList, *corev1alpha1.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 *corev1alpha1.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 *corev1alpha1.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/ironcorenet/versioned/typed/core/v1alpha1/networkid.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/networkid.go index e2ef2065..dc757e4a 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/networkid.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/networkid.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore-net/api/core/v1alpha1" corev1alpha1 "github.com/ironcore-dev/ironcore-net/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" ) // NetworkIDsGetter has a method to return a NetworkIDInterface. @@ -42,143 +39,18 @@ type NetworkIDInterface interface { // networkIDs implements NetworkIDInterface type networkIDs struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.NetworkID, *v1alpha1.NetworkIDList, *corev1alpha1.NetworkIDApplyConfiguration] } // newNetworkIDs returns a NetworkIDs func newNetworkIDs(c *CoreV1alpha1Client) *networkIDs { return &networkIDs{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.NetworkID, *v1alpha1.NetworkIDList, *corev1alpha1.NetworkIDApplyConfiguration]( + "networkids", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.NetworkID { return &v1alpha1.NetworkID{} }, + func() *v1alpha1.NetworkIDList { return &v1alpha1.NetworkIDList{} }), } } - -// Get takes name of the networkID, and returns the corresponding networkID object, and an error if there is any. -func (c *networkIDs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NetworkID, err error) { - result = &v1alpha1.NetworkID{} - err = c.client.Get(). - Resource("networkids"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of NetworkIDs that match those selectors. -func (c *networkIDs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NetworkIDList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.NetworkIDList{} - err = c.client.Get(). - Resource("networkids"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested networkIDs. -func (c *networkIDs) 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("networkids"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a networkID and creates it. Returns the server's representation of the networkID, and an error, if there is any. -func (c *networkIDs) Create(ctx context.Context, networkID *v1alpha1.NetworkID, opts v1.CreateOptions) (result *v1alpha1.NetworkID, err error) { - result = &v1alpha1.NetworkID{} - err = c.client.Post(). - Resource("networkids"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(networkID). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a networkID and updates it. Returns the server's representation of the networkID, and an error, if there is any. -func (c *networkIDs) Update(ctx context.Context, networkID *v1alpha1.NetworkID, opts v1.UpdateOptions) (result *v1alpha1.NetworkID, err error) { - result = &v1alpha1.NetworkID{} - err = c.client.Put(). - Resource("networkids"). - Name(networkID.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(networkID). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the networkID and deletes it. Returns an error if one occurs. -func (c *networkIDs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("networkids"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *networkIDs) 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("networkids"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched networkID. -func (c *networkIDs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NetworkID, err error) { - result = &v1alpha1.NetworkID{} - err = c.client.Patch(pt). - Resource("networkids"). - 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 networkID. -func (c *networkIDs) Apply(ctx context.Context, networkID *corev1alpha1.NetworkIDApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.NetworkID, err error) { - if networkID == nil { - return nil, fmt.Errorf("networkID provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(networkID) - if err != nil { - return nil, err - } - name := networkID.Name - if name == nil { - return nil, fmt.Errorf("networkID.Name must be provided to Apply") - } - result = &v1alpha1.NetworkID{} - err = c.client.Patch(types.ApplyPatchType). - Resource("networkids"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcorenet/versioned/typed/core/v1alpha1/networkinterface.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/networkinterface.go index 33b56b5b..42af028e 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/networkinterface.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/networkinterface.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore-net/api/core/v1alpha1" corev1alpha1 "github.com/ironcore-dev/ironcore-net/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" ) // 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 *corev1alpha1.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 *corev1alpha1.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, *corev1alpha1.NetworkInterfaceApplyConfiguration] } // newNetworkInterfaces returns a NetworkInterfaces func newNetworkInterfaces(c *CoreV1alpha1Client, namespace string) *networkInterfaces { return &networkInterfaces{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.NetworkInterface, *v1alpha1.NetworkInterfaceList, *corev1alpha1.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 *corev1alpha1.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 *corev1alpha1.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/ironcorenet/versioned/typed/core/v1alpha1/networkpolicy.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/networkpolicy.go index 7a1ac1cb..16810293 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/networkpolicy.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/networkpolicy.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore-net/api/core/v1alpha1" corev1alpha1 "github.com/ironcore-dev/ironcore-net/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" ) // NetworkPoliciesGetter has a method to return a NetworkPolicyInterface. @@ -42,154 +39,18 @@ type NetworkPolicyInterface interface { // networkPolicies implements NetworkPolicyInterface type networkPolicies struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.NetworkPolicy, *v1alpha1.NetworkPolicyList, *corev1alpha1.NetworkPolicyApplyConfiguration] } // newNetworkPolicies returns a NetworkPolicies func newNetworkPolicies(c *CoreV1alpha1Client, namespace string) *networkPolicies { return &networkPolicies{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.NetworkPolicy, *v1alpha1.NetworkPolicyList, *corev1alpha1.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 -} - -// 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 *corev1alpha1.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 -} diff --git a/client-go/ironcorenet/versioned/typed/core/v1alpha1/networkpolicyrule.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/networkpolicyrule.go index 83658b5a..d27025a7 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/networkpolicyrule.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/networkpolicyrule.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore-net/api/core/v1alpha1" corev1alpha1 "github.com/ironcore-dev/ironcore-net/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" ) // NetworkPolicyRulesGetter has a method to return a NetworkPolicyRuleInterface. @@ -42,154 +39,18 @@ type NetworkPolicyRuleInterface interface { // networkPolicyRules implements NetworkPolicyRuleInterface type networkPolicyRules struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.NetworkPolicyRule, *v1alpha1.NetworkPolicyRuleList, *corev1alpha1.NetworkPolicyRuleApplyConfiguration] } // newNetworkPolicyRules returns a NetworkPolicyRules func newNetworkPolicyRules(c *CoreV1alpha1Client, namespace string) *networkPolicyRules { return &networkPolicyRules{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.NetworkPolicyRule, *v1alpha1.NetworkPolicyRuleList, *corev1alpha1.NetworkPolicyRuleApplyConfiguration]( + "networkpolicyrules", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.NetworkPolicyRule { return &v1alpha1.NetworkPolicyRule{} }, + func() *v1alpha1.NetworkPolicyRuleList { return &v1alpha1.NetworkPolicyRuleList{} }), } } - -// Get takes name of the networkPolicyRule, and returns the corresponding networkPolicyRule object, and an error if there is any. -func (c *networkPolicyRules) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NetworkPolicyRule, err error) { - result = &v1alpha1.NetworkPolicyRule{} - err = c.client.Get(). - Namespace(c.ns). - Resource("networkpolicyrules"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of NetworkPolicyRules that match those selectors. -func (c *networkPolicyRules) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NetworkPolicyRuleList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.NetworkPolicyRuleList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("networkpolicyrules"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested networkPolicyRules. -func (c *networkPolicyRules) 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("networkpolicyrules"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a networkPolicyRule and creates it. Returns the server's representation of the networkPolicyRule, and an error, if there is any. -func (c *networkPolicyRules) Create(ctx context.Context, networkPolicyRule *v1alpha1.NetworkPolicyRule, opts v1.CreateOptions) (result *v1alpha1.NetworkPolicyRule, err error) { - result = &v1alpha1.NetworkPolicyRule{} - err = c.client.Post(). - Namespace(c.ns). - Resource("networkpolicyrules"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(networkPolicyRule). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a networkPolicyRule and updates it. Returns the server's representation of the networkPolicyRule, and an error, if there is any. -func (c *networkPolicyRules) Update(ctx context.Context, networkPolicyRule *v1alpha1.NetworkPolicyRule, opts v1.UpdateOptions) (result *v1alpha1.NetworkPolicyRule, err error) { - result = &v1alpha1.NetworkPolicyRule{} - err = c.client.Put(). - Namespace(c.ns). - Resource("networkpolicyrules"). - Name(networkPolicyRule.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(networkPolicyRule). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the networkPolicyRule and deletes it. Returns an error if one occurs. -func (c *networkPolicyRules) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("networkpolicyrules"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *networkPolicyRules) 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("networkpolicyrules"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched networkPolicyRule. -func (c *networkPolicyRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NetworkPolicyRule, err error) { - result = &v1alpha1.NetworkPolicyRule{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("networkpolicyrules"). - 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 networkPolicyRule. -func (c *networkPolicyRules) Apply(ctx context.Context, networkPolicyRule *corev1alpha1.NetworkPolicyRuleApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.NetworkPolicyRule, err error) { - if networkPolicyRule == nil { - return nil, fmt.Errorf("networkPolicyRule provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(networkPolicyRule) - if err != nil { - return nil, err - } - name := networkPolicyRule.Name - if name == nil { - return nil, fmt.Errorf("networkPolicyRule.Name must be provided to Apply") - } - result = &v1alpha1.NetworkPolicyRule{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("networkpolicyrules"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/ironcorenet/versioned/typed/core/v1alpha1/node.go b/client-go/ironcorenet/versioned/typed/core/v1alpha1/node.go index b1ce533c..188d6a3f 100644 --- a/client-go/ironcorenet/versioned/typed/core/v1alpha1/node.go +++ b/client-go/ironcorenet/versioned/typed/core/v1alpha1/node.go @@ -7,9 +7,6 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "github.com/ironcore-dev/ironcore-net/api/core/v1alpha1" corev1alpha1 "github.com/ironcore-dev/ironcore-net/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" ) // NodesGetter has a method to return a NodeInterface. @@ -30,6 +27,7 @@ type NodesGetter interface { type NodeInterface interface { Create(ctx context.Context, node *v1alpha1.Node, opts v1.CreateOptions) (*v1alpha1.Node, error) Update(ctx context.Context, node *v1alpha1.Node, opts v1.UpdateOptions) (*v1alpha1.Node, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, node *v1alpha1.Node, opts v1.UpdateOptions) (*v1alpha1.Node, 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 NodeInterface 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.Node, err error) Apply(ctx context.Context, node *corev1alpha1.NodeApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Node, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, node *corev1alpha1.NodeApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Node, err error) NodeExpansion } // nodes implements NodeInterface type nodes struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.Node, *v1alpha1.NodeList, *corev1alpha1.NodeApplyConfiguration] } // newNodes returns a Nodes func newNodes(c *CoreV1alpha1Client) *nodes { return &nodes{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.Node, *v1alpha1.NodeList, *corev1alpha1.NodeApplyConfiguration]( + "nodes", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.Node { return &v1alpha1.Node{} }, + func() *v1alpha1.NodeList { return &v1alpha1.NodeList{} }), } } - -// Get takes name of the node, and returns the corresponding node object, and an error if there is any. -func (c *nodes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Node, err error) { - result = &v1alpha1.Node{} - err = c.client.Get(). - Resource("nodes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Nodes that match those selectors. -func (c *nodes) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NodeList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.NodeList{} - err = c.client.Get(). - Resource("nodes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested nodes. -func (c *nodes) 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("nodes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a node and creates it. Returns the server's representation of the node, and an error, if there is any. -func (c *nodes) Create(ctx context.Context, node *v1alpha1.Node, opts v1.CreateOptions) (result *v1alpha1.Node, err error) { - result = &v1alpha1.Node{} - err = c.client.Post(). - Resource("nodes"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(node). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a node and updates it. Returns the server's representation of the node, and an error, if there is any. -func (c *nodes) Update(ctx context.Context, node *v1alpha1.Node, opts v1.UpdateOptions) (result *v1alpha1.Node, err error) { - result = &v1alpha1.Node{} - err = c.client.Put(). - Resource("nodes"). - Name(node.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(node). - 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 *nodes) UpdateStatus(ctx context.Context, node *v1alpha1.Node, opts v1.UpdateOptions) (result *v1alpha1.Node, err error) { - result = &v1alpha1.Node{} - err = c.client.Put(). - Resource("nodes"). - Name(node.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(node). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the node and deletes it. Returns an error if one occurs. -func (c *nodes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("nodes"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *nodes) 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("nodes"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched node. -func (c *nodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Node, err error) { - result = &v1alpha1.Node{} - err = c.client.Patch(pt). - Resource("nodes"). - 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 node. -func (c *nodes) Apply(ctx context.Context, node *corev1alpha1.NodeApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Node, err error) { - if node == nil { - return nil, fmt.Errorf("node provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(node) - if err != nil { - return nil, err - } - name := node.Name - if name == nil { - return nil, fmt.Errorf("node.Name must be provided to Apply") - } - result = &v1alpha1.Node{} - err = c.client.Patch(types.ApplyPatchType). - Resource("nodes"). - 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 *nodes) ApplyStatus(ctx context.Context, node *corev1alpha1.NodeApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Node, err error) { - if node == nil { - return nil, fmt.Errorf("node provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(node) - if err != nil { - return nil, err - } - - name := node.Name - if name == nil { - return nil, fmt.Errorf("node.Name must be provided to Apply") - } - - result = &v1alpha1.Node{} - err = c.client.Patch(types.ApplyPatchType). - Resource("nodes"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/client-go/listers/core/v1alpha1/daemonset.go b/client-go/listers/core/v1alpha1/daemonset.go index 8d00dcab..f9c21171 100644 --- a/client-go/listers/core/v1alpha1/daemonset.go +++ b/client-go/listers/core/v1alpha1/daemonset.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore-net/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 DaemonSetLister interface { // daemonSetLister implements the DaemonSetLister interface. type daemonSetLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.DaemonSet] } // NewDaemonSetLister returns a new DaemonSetLister. func NewDaemonSetLister(indexer cache.Indexer) DaemonSetLister { - return &daemonSetLister{indexer: indexer} -} - -// List lists all DaemonSets in the indexer. -func (s *daemonSetLister) List(selector labels.Selector) (ret []*v1alpha1.DaemonSet, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.DaemonSet)) - }) - return ret, err + return &daemonSetLister{listers.New[*v1alpha1.DaemonSet](indexer, v1alpha1.Resource("daemonset"))} } // DaemonSets returns an object that can list and get DaemonSets. func (s *daemonSetLister) DaemonSets(namespace string) DaemonSetNamespaceLister { - return daemonSetNamespaceLister{indexer: s.indexer, namespace: namespace} + return daemonSetNamespaceLister{listers.NewNamespaced[*v1alpha1.DaemonSet](s.ResourceIndexer, namespace)} } // DaemonSetNamespaceLister helps list and get DaemonSets. @@ -61,26 +53,5 @@ type DaemonSetNamespaceLister interface { // daemonSetNamespaceLister implements the DaemonSetNamespaceLister // interface. type daemonSetNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all DaemonSets in the indexer for a given namespace. -func (s daemonSetNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.DaemonSet, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.DaemonSet)) - }) - return ret, err -} - -// Get retrieves the DaemonSet from the indexer for a given namespace and name. -func (s daemonSetNamespaceLister) Get(name string) (*v1alpha1.DaemonSet, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("daemonset"), name) - } - return obj.(*v1alpha1.DaemonSet), nil + listers.ResourceIndexer[*v1alpha1.DaemonSet] } diff --git a/client-go/listers/core/v1alpha1/instance.go b/client-go/listers/core/v1alpha1/instance.go index 1f29ef7f..26f7dbb2 100644 --- a/client-go/listers/core/v1alpha1/instance.go +++ b/client-go/listers/core/v1alpha1/instance.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore-net/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 InstanceLister interface { // instanceLister implements the InstanceLister interface. type instanceLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.Instance] } // NewInstanceLister returns a new InstanceLister. func NewInstanceLister(indexer cache.Indexer) InstanceLister { - return &instanceLister{indexer: indexer} -} - -// List lists all Instances in the indexer. -func (s *instanceLister) List(selector labels.Selector) (ret []*v1alpha1.Instance, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.Instance)) - }) - return ret, err + return &instanceLister{listers.New[*v1alpha1.Instance](indexer, v1alpha1.Resource("instance"))} } // Instances returns an object that can list and get Instances. func (s *instanceLister) Instances(namespace string) InstanceNamespaceLister { - return instanceNamespaceLister{indexer: s.indexer, namespace: namespace} + return instanceNamespaceLister{listers.NewNamespaced[*v1alpha1.Instance](s.ResourceIndexer, namespace)} } // InstanceNamespaceLister helps list and get Instances. @@ -61,26 +53,5 @@ type InstanceNamespaceLister interface { // instanceNamespaceLister implements the InstanceNamespaceLister // interface. type instanceNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Instances in the indexer for a given namespace. -func (s instanceNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Instance, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.Instance)) - }) - return ret, err -} - -// Get retrieves the Instance from the indexer for a given namespace and name. -func (s instanceNamespaceLister) Get(name string) (*v1alpha1.Instance, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("instance"), name) - } - return obj.(*v1alpha1.Instance), nil + listers.ResourceIndexer[*v1alpha1.Instance] } diff --git a/client-go/listers/core/v1alpha1/ip.go b/client-go/listers/core/v1alpha1/ip.go index ac785756..bb47216f 100644 --- a/client-go/listers/core/v1alpha1/ip.go +++ b/client-go/listers/core/v1alpha1/ip.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore-net/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 IPLister interface { // iPLister implements the IPLister interface. type iPLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.IP] } // NewIPLister returns a new IPLister. func NewIPLister(indexer cache.Indexer) IPLister { - return &iPLister{indexer: indexer} -} - -// List lists all IPs in the indexer. -func (s *iPLister) List(selector labels.Selector) (ret []*v1alpha1.IP, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.IP)) - }) - return ret, err + return &iPLister{listers.New[*v1alpha1.IP](indexer, v1alpha1.Resource("ip"))} } // IPs returns an object that can list and get IPs. func (s *iPLister) IPs(namespace string) IPNamespaceLister { - return iPNamespaceLister{indexer: s.indexer, namespace: namespace} + return iPNamespaceLister{listers.NewNamespaced[*v1alpha1.IP](s.ResourceIndexer, namespace)} } // IPNamespaceLister helps list and get IPs. @@ -61,26 +53,5 @@ type IPNamespaceLister interface { // iPNamespaceLister implements the IPNamespaceLister // interface. type iPNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all IPs in the indexer for a given namespace. -func (s iPNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.IP, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.IP)) - }) - return ret, err -} - -// Get retrieves the IP from the indexer for a given namespace and name. -func (s iPNamespaceLister) Get(name string) (*v1alpha1.IP, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("ip"), name) - } - return obj.(*v1alpha1.IP), nil + listers.ResourceIndexer[*v1alpha1.IP] } diff --git a/client-go/listers/core/v1alpha1/ipaddress.go b/client-go/listers/core/v1alpha1/ipaddress.go index 18f26ff5..35c82995 100644 --- a/client-go/listers/core/v1alpha1/ipaddress.go +++ b/client-go/listers/core/v1alpha1/ipaddress.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore-net/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" ) @@ -26,30 +26,10 @@ type IPAddressLister interface { // iPAddressLister implements the IPAddressLister interface. type iPAddressLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.IPAddress] } // NewIPAddressLister returns a new IPAddressLister. func NewIPAddressLister(indexer cache.Indexer) IPAddressLister { - return &iPAddressLister{indexer: indexer} -} - -// List lists all IPAddresses in the indexer. -func (s *iPAddressLister) List(selector labels.Selector) (ret []*v1alpha1.IPAddress, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.IPAddress)) - }) - return ret, err -} - -// Get retrieves the IPAddress from the index for a given name. -func (s *iPAddressLister) Get(name string) (*v1alpha1.IPAddress, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("ipaddress"), name) - } - return obj.(*v1alpha1.IPAddress), nil + return &iPAddressLister{listers.New[*v1alpha1.IPAddress](indexer, v1alpha1.Resource("ipaddress"))} } diff --git a/client-go/listers/core/v1alpha1/loadbalancer.go b/client-go/listers/core/v1alpha1/loadbalancer.go index 4e022edd..651ed239 100644 --- a/client-go/listers/core/v1alpha1/loadbalancer.go +++ b/client-go/listers/core/v1alpha1/loadbalancer.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore-net/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 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/core/v1alpha1/loadbalancerrouting.go b/client-go/listers/core/v1alpha1/loadbalancerrouting.go index dccf3e9c..bbb4c89b 100644 --- a/client-go/listers/core/v1alpha1/loadbalancerrouting.go +++ b/client-go/listers/core/v1alpha1/loadbalancerrouting.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore-net/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 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/core/v1alpha1/natgateway.go b/client-go/listers/core/v1alpha1/natgateway.go index ce87dbf0..a3f64bba 100644 --- a/client-go/listers/core/v1alpha1/natgateway.go +++ b/client-go/listers/core/v1alpha1/natgateway.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore-net/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 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/core/v1alpha1/natgatewayautoscaler.go b/client-go/listers/core/v1alpha1/natgatewayautoscaler.go index 34cd56d8..2135903d 100644 --- a/client-go/listers/core/v1alpha1/natgatewayautoscaler.go +++ b/client-go/listers/core/v1alpha1/natgatewayautoscaler.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore-net/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 NATGatewayAutoscalerLister interface { // nATGatewayAutoscalerLister implements the NATGatewayAutoscalerLister interface. type nATGatewayAutoscalerLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.NATGatewayAutoscaler] } // NewNATGatewayAutoscalerLister returns a new NATGatewayAutoscalerLister. func NewNATGatewayAutoscalerLister(indexer cache.Indexer) NATGatewayAutoscalerLister { - return &nATGatewayAutoscalerLister{indexer: indexer} -} - -// List lists all NATGatewayAutoscalers in the indexer. -func (s *nATGatewayAutoscalerLister) List(selector labels.Selector) (ret []*v1alpha1.NATGatewayAutoscaler, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.NATGatewayAutoscaler)) - }) - return ret, err + return &nATGatewayAutoscalerLister{listers.New[*v1alpha1.NATGatewayAutoscaler](indexer, v1alpha1.Resource("natgatewayautoscaler"))} } // NATGatewayAutoscalers returns an object that can list and get NATGatewayAutoscalers. func (s *nATGatewayAutoscalerLister) NATGatewayAutoscalers(namespace string) NATGatewayAutoscalerNamespaceLister { - return nATGatewayAutoscalerNamespaceLister{indexer: s.indexer, namespace: namespace} + return nATGatewayAutoscalerNamespaceLister{listers.NewNamespaced[*v1alpha1.NATGatewayAutoscaler](s.ResourceIndexer, namespace)} } // NATGatewayAutoscalerNamespaceLister helps list and get NATGatewayAutoscalers. @@ -61,26 +53,5 @@ type NATGatewayAutoscalerNamespaceLister interface { // nATGatewayAutoscalerNamespaceLister implements the NATGatewayAutoscalerNamespaceLister // interface. type nATGatewayAutoscalerNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all NATGatewayAutoscalers in the indexer for a given namespace. -func (s nATGatewayAutoscalerNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.NATGatewayAutoscaler, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.NATGatewayAutoscaler)) - }) - return ret, err -} - -// Get retrieves the NATGatewayAutoscaler from the indexer for a given namespace and name. -func (s nATGatewayAutoscalerNamespaceLister) Get(name string) (*v1alpha1.NATGatewayAutoscaler, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("natgatewayautoscaler"), name) - } - return obj.(*v1alpha1.NATGatewayAutoscaler), nil + listers.ResourceIndexer[*v1alpha1.NATGatewayAutoscaler] } diff --git a/client-go/listers/core/v1alpha1/nattable.go b/client-go/listers/core/v1alpha1/nattable.go index 686e892b..89cb4309 100644 --- a/client-go/listers/core/v1alpha1/nattable.go +++ b/client-go/listers/core/v1alpha1/nattable.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore-net/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 NATTableLister interface { // nATTableLister implements the NATTableLister interface. type nATTableLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.NATTable] } // NewNATTableLister returns a new NATTableLister. func NewNATTableLister(indexer cache.Indexer) NATTableLister { - return &nATTableLister{indexer: indexer} -} - -// List lists all NATTables in the indexer. -func (s *nATTableLister) List(selector labels.Selector) (ret []*v1alpha1.NATTable, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.NATTable)) - }) - return ret, err + return &nATTableLister{listers.New[*v1alpha1.NATTable](indexer, v1alpha1.Resource("nattable"))} } // NATTables returns an object that can list and get NATTables. func (s *nATTableLister) NATTables(namespace string) NATTableNamespaceLister { - return nATTableNamespaceLister{indexer: s.indexer, namespace: namespace} + return nATTableNamespaceLister{listers.NewNamespaced[*v1alpha1.NATTable](s.ResourceIndexer, namespace)} } // NATTableNamespaceLister helps list and get NATTables. @@ -61,26 +53,5 @@ type NATTableNamespaceLister interface { // nATTableNamespaceLister implements the NATTableNamespaceLister // interface. type nATTableNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all NATTables in the indexer for a given namespace. -func (s nATTableNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.NATTable, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.NATTable)) - }) - return ret, err -} - -// Get retrieves the NATTable from the indexer for a given namespace and name. -func (s nATTableNamespaceLister) Get(name string) (*v1alpha1.NATTable, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("nattable"), name) - } - return obj.(*v1alpha1.NATTable), nil + listers.ResourceIndexer[*v1alpha1.NATTable] } diff --git a/client-go/listers/core/v1alpha1/network.go b/client-go/listers/core/v1alpha1/network.go index bd4548a4..47404bd5 100644 --- a/client-go/listers/core/v1alpha1/network.go +++ b/client-go/listers/core/v1alpha1/network.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore-net/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 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/core/v1alpha1/networkid.go b/client-go/listers/core/v1alpha1/networkid.go index 1ffe5689..fa129d95 100644 --- a/client-go/listers/core/v1alpha1/networkid.go +++ b/client-go/listers/core/v1alpha1/networkid.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore-net/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" ) @@ -26,30 +26,10 @@ type NetworkIDLister interface { // networkIDLister implements the NetworkIDLister interface. type networkIDLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.NetworkID] } // NewNetworkIDLister returns a new NetworkIDLister. func NewNetworkIDLister(indexer cache.Indexer) NetworkIDLister { - return &networkIDLister{indexer: indexer} -} - -// List lists all NetworkIDs in the indexer. -func (s *networkIDLister) List(selector labels.Selector) (ret []*v1alpha1.NetworkID, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.NetworkID)) - }) - return ret, err -} - -// Get retrieves the NetworkID from the index for a given name. -func (s *networkIDLister) Get(name string) (*v1alpha1.NetworkID, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("networkid"), name) - } - return obj.(*v1alpha1.NetworkID), nil + return &networkIDLister{listers.New[*v1alpha1.NetworkID](indexer, v1alpha1.Resource("networkid"))} } diff --git a/client-go/listers/core/v1alpha1/networkinterface.go b/client-go/listers/core/v1alpha1/networkinterface.go index edbb75c7..38754e3b 100644 --- a/client-go/listers/core/v1alpha1/networkinterface.go +++ b/client-go/listers/core/v1alpha1/networkinterface.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore-net/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 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/core/v1alpha1/networkpolicy.go b/client-go/listers/core/v1alpha1/networkpolicy.go index 87f169b0..f8fbb73b 100644 --- a/client-go/listers/core/v1alpha1/networkpolicy.go +++ b/client-go/listers/core/v1alpha1/networkpolicy.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore-net/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 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/core/v1alpha1/networkpolicyrule.go b/client-go/listers/core/v1alpha1/networkpolicyrule.go index c58b4808..b6dfee57 100644 --- a/client-go/listers/core/v1alpha1/networkpolicyrule.go +++ b/client-go/listers/core/v1alpha1/networkpolicyrule.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore-net/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 NetworkPolicyRuleLister interface { // networkPolicyRuleLister implements the NetworkPolicyRuleLister interface. type networkPolicyRuleLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.NetworkPolicyRule] } // NewNetworkPolicyRuleLister returns a new NetworkPolicyRuleLister. func NewNetworkPolicyRuleLister(indexer cache.Indexer) NetworkPolicyRuleLister { - return &networkPolicyRuleLister{indexer: indexer} -} - -// List lists all NetworkPolicyRules in the indexer. -func (s *networkPolicyRuleLister) List(selector labels.Selector) (ret []*v1alpha1.NetworkPolicyRule, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.NetworkPolicyRule)) - }) - return ret, err + return &networkPolicyRuleLister{listers.New[*v1alpha1.NetworkPolicyRule](indexer, v1alpha1.Resource("networkpolicyrule"))} } // NetworkPolicyRules returns an object that can list and get NetworkPolicyRules. func (s *networkPolicyRuleLister) NetworkPolicyRules(namespace string) NetworkPolicyRuleNamespaceLister { - return networkPolicyRuleNamespaceLister{indexer: s.indexer, namespace: namespace} + return networkPolicyRuleNamespaceLister{listers.NewNamespaced[*v1alpha1.NetworkPolicyRule](s.ResourceIndexer, namespace)} } // NetworkPolicyRuleNamespaceLister helps list and get NetworkPolicyRules. @@ -61,26 +53,5 @@ type NetworkPolicyRuleNamespaceLister interface { // networkPolicyRuleNamespaceLister implements the NetworkPolicyRuleNamespaceLister // interface. type networkPolicyRuleNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all NetworkPolicyRules in the indexer for a given namespace. -func (s networkPolicyRuleNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.NetworkPolicyRule, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.NetworkPolicyRule)) - }) - return ret, err -} - -// Get retrieves the NetworkPolicyRule from the indexer for a given namespace and name. -func (s networkPolicyRuleNamespaceLister) Get(name string) (*v1alpha1.NetworkPolicyRule, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("networkpolicyrule"), name) - } - return obj.(*v1alpha1.NetworkPolicyRule), nil + listers.ResourceIndexer[*v1alpha1.NetworkPolicyRule] } diff --git a/client-go/listers/core/v1alpha1/node.go b/client-go/listers/core/v1alpha1/node.go index bef5c5b9..4a286b20 100644 --- a/client-go/listers/core/v1alpha1/node.go +++ b/client-go/listers/core/v1alpha1/node.go @@ -7,8 +7,8 @@ package v1alpha1 import ( v1alpha1 "github.com/ironcore-dev/ironcore-net/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" ) @@ -26,30 +26,10 @@ type NodeLister interface { // nodeLister implements the NodeLister interface. type nodeLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.Node] } // NewNodeLister returns a new NodeLister. func NewNodeLister(indexer cache.Indexer) NodeLister { - return &nodeLister{indexer: indexer} -} - -// List lists all Nodes in the indexer. -func (s *nodeLister) List(selector labels.Selector) (ret []*v1alpha1.Node, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.Node)) - }) - return ret, err -} - -// Get retrieves the Node from the index for a given name. -func (s *nodeLister) Get(name string) (*v1alpha1.Node, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("node"), name) - } - return obj.(*v1alpha1.Node), nil + return &nodeLister{listers.New[*v1alpha1.Node](indexer, v1alpha1.Resource("node"))} } diff --git a/client-go/openapi/zz_generated.openapi.go b/client-go/openapi/zz_generated.openapi.go index 8e895f92..96bbfe0d 100644 --- a/client-go/openapi/zz_generated.openapi.go +++ b/client-go/openapi/zz_generated.openapi.go @@ -10,8 +10,9 @@ package openapi import ( net "github.com/ironcore-dev/ironcore-net/apimachinery/api/net" + 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" ) @@ -124,7 +125,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), @@ -146,6 +146,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), @@ -183,6 +184,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), @@ -190,6 +192,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), @@ -209,6 +212,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), @@ -279,11 +283,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), @@ -344,6 +350,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), @@ -4227,6 +4234,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"}, @@ -4235,6 +4243,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: "", }, @@ -4242,6 +4251,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: "", }, @@ -4249,6 +4259,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"}, @@ -4819,33 +4830,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{ @@ -6111,12 +6095,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"}, } } @@ -8130,11 +8165,13 @@ func schema_k8sio_api_core_v1_HostIP(ref common.ReferenceCallback) common.OpenAP "ip": { SchemaProps: spec.SchemaProps{ Description: "IP is the IP address assigned to the host", + Default: "", Type: []string{"string"}, Format: "", }, }, }, + Required: []string{"ip"}, }, }, } @@ -8204,6 +8241,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: "", }, @@ -8312,6 +8350,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: "", }, @@ -8386,6 +8425,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{ @@ -8712,6 +8779,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{ @@ -9464,6 +9581,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{ @@ -9582,7 +9719,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": { @@ -9592,6 +9729,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: "", + }, + }, }, }, }, @@ -9845,7 +9989,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, @@ -10024,11 +10168,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"}, } } @@ -10097,7 +10247,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: "", @@ -10511,7 +10661,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: "", }, @@ -10628,7 +10778,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"}, }, }, }, @@ -10636,14 +10786,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"), }, }, @@ -11148,7 +11298,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: "", }, @@ -11192,7 +11342,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"), }, }, @@ -11390,7 +11540,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{ @@ -11410,7 +11560,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{ @@ -11798,11 +11948,13 @@ func schema_k8sio_api_core_v1_PodIP(ref common.ReferenceCallback) common.OpenAPI "ip": { SchemaProps: spec.SchemaProps{ Description: "IP is the IP address assigned to the pod", + Default: "", Type: []string{"string"}, Format: "", }, }, }, + Required: []string{"ip"}, }, }, } @@ -12079,7 +12231,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": { @@ -12090,19 +12242,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"}, } } @@ -12123,7 +12280,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: "", }, @@ -12204,7 +12361,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{ @@ -12217,6 +12374,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.", @@ -12469,7 +12634,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: "", }, @@ -12704,14 +12869,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"), }, }, @@ -13455,7 +13620,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{ @@ -13585,6 +13750,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: "", }, @@ -13592,6 +13758,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: "", }, @@ -13599,6 +13766,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: "", }, @@ -13670,6 +13838,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: "", }, @@ -13677,6 +13846,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: "", }, @@ -13684,6 +13854,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: "", }, @@ -14062,6 +14233,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"}, }, @@ -14111,6 +14289,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{ @@ -14376,6 +14583,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{ @@ -14470,6 +14722,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: "", }, @@ -14484,6 +14737,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: "", }, @@ -14557,6 +14811,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: "", }, @@ -14571,6 +14826,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: "", }, @@ -15131,7 +15387,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"}, @@ -16592,12 +16848,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"}, } } @@ -16766,7 +17028,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": { @@ -17031,11 +17293,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"}, } } @@ -17849,8 +18117,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"}, }, }, } @@ -18474,8 +18792,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(), }, }, } @@ -19432,8 +19750,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/apinetlet/apinet-rbac/role.yaml b/config/apinetlet/apinet-rbac/role.yaml index 0ee5289c..688f35e0 100644 --- a/config/apinetlet/apinet-rbac/role.yaml +++ b/config/apinetlet/apinet-rbac/role.yaml @@ -35,94 +35,13 @@ rules: - core.apinet.ironcore.dev resources: - ips - verbs: - - create - - delete - - deletecollection - - get - - list - - patch - - update - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - loadbalancerroutings - verbs: - - create - - delete - - deletecollection - - get - - list - - patch - - update - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - loadbalancers - verbs: - - create - - delete - - deletecollection - - get - - list - - patch - - update - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - natgatewayautoscalers - verbs: - - create - - delete - - deletecollection - - get - - list - - patch - - update - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - natgateways - verbs: - - create - - delete - - deletecollection - - get - - list - - patch - - update - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - - networkinterfaces - verbs: - - get - - list - - patch - - update - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - networkpolicies - verbs: - - create - - delete - - deletecollection - - get - - list - - patch - - update - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - networkpolicyrules + - networks verbs: - create - delete @@ -135,11 +54,8 @@ rules: - apiGroups: - core.apinet.ironcore.dev resources: - - networks + - networkinterfaces verbs: - - create - - delete - - deletecollection - get - list - patch diff --git a/config/apinetlet/rbac/role.yaml b/config/apinetlet/rbac/role.yaml index 08ed9bf1..3e51868a 100644 --- a/config/apinetlet/rbac/role.yaml +++ b/config/apinetlet/rbac/role.yaml @@ -42,122 +42,10 @@ rules: - networking.ironcore.dev resources: - loadbalancers - verbs: - - get - - list - - patch - - update - - watch -- apiGroups: - - networking.ironcore.dev - resources: - - loadbalancers/finalizers - verbs: - - patch - - update -- apiGroups: - - networking.ironcore.dev - resources: - - loadbalancers/status - verbs: - - get - - patch - - update -- apiGroups: - - networking.ironcore.dev - resources: - natgateways - verbs: - - get - - list - - patch - - update - - watch -- apiGroups: - - networking.ironcore.dev - resources: - - natgateways/finalizers - verbs: - - patch - - update -- apiGroups: - - networking.ironcore.dev - resources: - - natgateways/status - verbs: - - get - - patch - - update -- apiGroups: - - networking.ironcore.dev - resources: - networkinterfaces - verbs: - - get - - list - - patch - - update - - watch -- apiGroups: - - networking.ironcore.dev - resources: - - networkinterfaces/finalizers - verbs: - - patch - - update -- apiGroups: - - networking.ironcore.dev - resources: - - networkinterfaces/status - verbs: - - get - - patch - - update -- apiGroups: - - networking.ironcore.dev - resources: - networkpolicies - verbs: - - get - - list - - patch - - update - - watch -- apiGroups: - - networking.ironcore.dev - resources: - - networkpolicies/finalizers - verbs: - - patch - - update -- apiGroups: - - networking.ironcore.dev - resources: - networks - verbs: - - get - - list - - patch - - update - - watch -- apiGroups: - - networking.ironcore.dev - resources: - - networks/finalizers - verbs: - - patch - - update -- apiGroups: - - networking.ironcore.dev - resources: - - networks/status - verbs: - - get - - patch - - update -- apiGroups: - - networking.ironcore.dev - resources: - virtualips verbs: - get @@ -168,6 +56,11 @@ rules: - apiGroups: - networking.ironcore.dev resources: + - loadbalancers/finalizers + - natgateways/finalizers + - networkinterfaces/finalizers + - networkpolicies/finalizers + - networks/finalizers - virtualips/finalizers verbs: - patch @@ -175,6 +68,10 @@ rules: - apiGroups: - networking.ironcore.dev resources: + - loadbalancers/status + - natgateways/status + - networkinterfaces/status + - networks/status - virtualips/status verbs: - get diff --git a/config/apiserver/rbac/apinetlet_role.yaml b/config/apiserver/rbac/apinetlet_role.yaml index d3f202c7..e7d6dfa2 100644 --- a/config/apiserver/rbac/apinetlet_role.yaml +++ b/config/apiserver/rbac/apinetlet_role.yaml @@ -35,94 +35,13 @@ rules: - core.apinet.ironcore.dev resources: - ips - verbs: - - create - - delete - - deletecollection - - get - - list - - patch - - update - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - loadbalancerroutings - verbs: - - create - - delete - - deletecollection - - get - - list - - patch - - update - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - loadbalancers - verbs: - - create - - delete - - deletecollection - - get - - list - - patch - - update - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - natgatewayautoscalers - verbs: - - create - - delete - - deletecollection - - get - - list - - patch - - update - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - natgateways - verbs: - - create - - delete - - deletecollection - - get - - list - - patch - - update - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - - networkinterfaces - verbs: - - get - - list - - patch - - update - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - networkpolicies - verbs: - - create - - delete - - deletecollection - - get - - list - - patch - - update - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - networkpolicyrules + - networks verbs: - create - delete @@ -135,11 +54,8 @@ rules: - apiGroups: - core.apinet.ironcore.dev resources: - - networks + - networkinterfaces verbs: - - create - - delete - - deletecollection - get - list - patch diff --git a/config/apiserver/rbac/metalnetlet_role.yaml b/config/apiserver/rbac/metalnetlet_role.yaml index e078cffb..4c8b3878 100644 --- a/config/apiserver/rbac/metalnetlet_role.yaml +++ b/config/apiserver/rbac/metalnetlet_role.yaml @@ -42,6 +42,8 @@ rules: - core.apinet.ironcore.dev resources: - instances + - networkinterfaces + - networks verbs: - get - list @@ -52,6 +54,9 @@ rules: - core.apinet.ironcore.dev resources: - instances/finalizers + - networkinterfaces/finalizers + - networks/finalizers + - nodes/finalizers verbs: - patch - update @@ -59,6 +64,9 @@ rules: - core.apinet.ironcore.dev resources: - instances/status + - networkinterfaces/status + - networks/status + - nodes/status verbs: - get - patch @@ -67,100 +75,15 @@ rules: - core.apinet.ironcore.dev resources: - loadbalancerroutings - verbs: - - get - - list - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - loadbalancers - verbs: - - get - - list - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - natgateways - verbs: - - get - - list - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - nattables - verbs: - - get - - list - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - - networkinterfaces - verbs: - - get - - list - - patch - - update - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - - networkinterfaces/finalizers - verbs: - - patch - - update -- apiGroups: - - core.apinet.ironcore.dev - resources: - - networkinterfaces/status - verbs: - - get - - patch - - update -- apiGroups: - - core.apinet.ironcore.dev - resources: - networkpolicies - verbs: - - get - - list - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - networkpolicyrules verbs: - get - list - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - - networks - verbs: - - get - - list - - patch - - update - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - - networks/finalizers - verbs: - - patch - - update -- apiGroups: - - core.apinet.ironcore.dev - resources: - - networks/status - verbs: - - get - - patch - - update - apiGroups: - core.apinet.ironcore.dev resources: @@ -173,18 +96,3 @@ rules: - patch - update - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - - nodes/finalizers - verbs: - - patch - - update -- apiGroups: - - core.apinet.ironcore.dev - resources: - - nodes/status - verbs: - - get - - patch - - update diff --git a/config/controller/rbac/role.yaml b/config/controller/rbac/role.yaml index 8d7ebdb0..f5843d64 100644 --- a/config/controller/rbac/role.yaml +++ b/config/controller/rbac/role.yaml @@ -49,6 +49,9 @@ rules: - core.apinet.ironcore.dev resources: - daemonsets/status + - loadbalancers/status + - natgatewayautoscalers/status + - natgateways/status verbs: - get - patch @@ -70,6 +73,7 @@ rules: - core.apinet.ironcore.dev resources: - ipaddresses + - networkids verbs: - delete - get @@ -79,42 +83,11 @@ rules: - core.apinet.ironcore.dev resources: - ips - verbs: - - get - - list - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - - loadbalancerroutings - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - loadbalancers - verbs: - - get - - list - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - - loadbalancers/status - verbs: - - get - - patch - - update -- apiGroups: - - core.apinet.ironcore.dev - resources: - natgatewayautoscalers + - networkpolicies + - networks + - nodes verbs: - get - list @@ -122,33 +95,9 @@ rules: - apiGroups: - core.apinet.ironcore.dev resources: - - natgatewayautoscalers/status - verbs: - - get - - patch - - update -- apiGroups: - - core.apinet.ironcore.dev - resources: - - natgateways - verbs: - - get - - list - - patch - - update - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - - natgateways/status - verbs: - - get - - patch - - update -- apiGroups: - - core.apinet.ironcore.dev - resources: + - loadbalancerroutings - nattables + - networkpolicyrules verbs: - create - delete @@ -160,15 +109,7 @@ rules: - apiGroups: - core.apinet.ironcore.dev resources: - - networkids - verbs: - - delete - - get - - list - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: + - natgateways - networkinterfaces verbs: - get @@ -176,39 +117,3 @@ rules: - patch - update - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - - networkpolicies - verbs: - - get - - list - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - - networkpolicyrules - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - - networks - verbs: - - get - - list - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - - nodes - verbs: - - get - - list - - watch diff --git a/config/metalnetlet/apinet-rbac/role.yaml b/config/metalnetlet/apinet-rbac/role.yaml index 21e20486..336728c6 100644 --- a/config/metalnetlet/apinet-rbac/role.yaml +++ b/config/metalnetlet/apinet-rbac/role.yaml @@ -42,6 +42,8 @@ rules: - core.apinet.ironcore.dev resources: - instances + - networkinterfaces + - networks verbs: - get - list @@ -52,6 +54,9 @@ rules: - core.apinet.ironcore.dev resources: - instances/finalizers + - networkinterfaces/finalizers + - networks/finalizers + - nodes/finalizers verbs: - patch - update @@ -59,6 +64,9 @@ rules: - core.apinet.ironcore.dev resources: - instances/status + - networkinterfaces/status + - networks/status + - nodes/status verbs: - get - patch @@ -67,100 +75,15 @@ rules: - core.apinet.ironcore.dev resources: - loadbalancerroutings - verbs: - - get - - list - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - loadbalancers - verbs: - - get - - list - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - natgateways - verbs: - - get - - list - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - nattables - verbs: - - get - - list - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - - networkinterfaces - verbs: - - get - - list - - patch - - update - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - - networkinterfaces/finalizers - verbs: - - patch - - update -- apiGroups: - - core.apinet.ironcore.dev - resources: - - networkinterfaces/status - verbs: - - get - - patch - - update -- apiGroups: - - core.apinet.ironcore.dev - resources: - networkpolicies - verbs: - - get - - list - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - networkpolicyrules verbs: - get - list - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - - networks - verbs: - - get - - list - - patch - - update - - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - - networks/finalizers - verbs: - - patch - - update -- apiGroups: - - core.apinet.ironcore.dev - resources: - - networks/status - verbs: - - get - - patch - - update - apiGroups: - core.apinet.ironcore.dev resources: @@ -173,18 +96,3 @@ rules: - patch - update - watch -- apiGroups: - - core.apinet.ironcore.dev - resources: - - nodes/finalizers - verbs: - - patch - - update -- apiGroups: - - core.apinet.ironcore.dev - resources: - - nodes/status - verbs: - - get - - patch - - update diff --git a/config/metalnetlet/rbac/role.yaml b/config/metalnetlet/rbac/role.yaml index fb5ea1b9..29d09283 100644 --- a/config/metalnetlet/rbac/role.yaml +++ b/config/metalnetlet/rbac/role.yaml @@ -43,31 +43,7 @@ rules: - networking.metalnet.ironcore.dev resources: - loadbalancers - verbs: - - create - - delete - - deletecollection - - get - - list - - patch - - update - - watch -- apiGroups: - - networking.metalnet.ironcore.dev - resources: - networkinterfaces - verbs: - - create - - delete - - deletecollection - - get - - list - - patch - - update - - watch -- apiGroups: - - networking.metalnet.ironcore.dev - resources: - networks verbs: - create diff --git a/go.mod b/go.mod index 205b51c6..b711682d 100644 --- a/go.mod +++ b/go.mod @@ -3,12 +3,12 @@ module github.com/ironcore-dev/ironcore-net go 1.23.0 require ( - github.com/bits-and-blooms/bitset v1.19.1 + github.com/bits-and-blooms/bitset v1.20.0 github.com/go-logr/logr v1.4.2 github.com/gogo/protobuf v1.3.2 github.com/google/uuid v1.6.0 github.com/ironcore-dev/controller-utils v0.9.6 - github.com/ironcore-dev/ironcore v0.2.0 + github.com/ironcore-dev/ironcore v0.2.2-0.20241219142352-bf1d9998cc71 github.com/ironcore-dev/metalnet v0.3.10 github.com/onsi/ginkgo/v2 v2.22.0 github.com/onsi/gomega v1.36.1 @@ -16,83 +16,83 @@ require ( github.com/spf13/pflag v1.0.5 go4.org/netipx v0.0.0-20220812043211-3cc044ffd68d golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 - k8s.io/api v0.30.6 - k8s.io/apimachinery v0.30.6 - k8s.io/apiserver v0.30.6 - k8s.io/client-go v0.30.6 - k8s.io/code-generator v0.30.6 - k8s.io/component-base v0.30.6 + 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-openapi v0.0.0-20240228011516-70dd3763d340 - k8s.io/utils v0.0.0-20240102154912-e7106e64919e - sigs.k8s.io/controller-runtime v0.18.5 - sigs.k8s.io/structured-merge-diff/v4 v4.4.1 + k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f + k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 + sigs.k8s.io/controller-runtime v0.19.0 + sigs.k8s.io/structured-merge-diff/v4 v4.4.3 ) require ( 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/blang/semver/v4 v4.0.0 // 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 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect 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.19.6 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect - github.com/go-openapi/swag v0.22.4 // indirect + github.com/go-openapi/swag v0.23.0 // indirect 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/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db // 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/mailru/easyjson v0.7.7 // indirect - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.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/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 - go.opentelemetry.io/otel v1.21.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/metric v1.21.0 // indirect - go.opentelemetry.io/otel/sdk v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect - go.opentelemetry.io/proto/otlp v1.0.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.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.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 golang.org/x/mod v0.21.0 // indirect golang.org/x/net v0.30.0 // indirect - golang.org/x/oauth2 v0.22.0 // indirect + golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sync v0.10.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/term v0.27.0 // indirect @@ -100,19 +100,20 @@ require ( golang.org/x/time v0.3.0 // indirect golang.org/x/tools v0.26.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect - google.golang.org/grpc v1.67.1 // indirect + 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/grpc v1.69.0 // 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.6 // indirect - k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect - k8s.io/kms v0.30.6 // indirect - k8s.io/kube-aggregator v0.29.4 // indirect - sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 // indirect + k8s.io/apiextensions-apiserver v0.31.0 // indirect + k8s.io/gengo/v2 v2.0.0-20240826214909-a7b603a56eb7 // indirect + k8s.io/kms v0.31.0 // indirect + k8s.io/kube-aggregator 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 sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/go.sum b/go.sum index 647b7be8..1209f3ad 100644 --- a/go.sum +++ b/go.sum @@ -1,24 +1,19 @@ -cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= -cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY= -cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY= 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/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bits-and-blooms/bitset v1.19.1 h1:mv2yVhy96D2CuskLPXnc58oJNMs5PCWjAZuyYU0p12M= -github.com/bits-and-blooms/bitset v1.19.1/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/bits-and-blooms/bitset v1.20.0 h1:2F+rfL86jE2d/bmw7OhqUg2Sj/1rURkBn3MdfoPyRVU= +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-20240723142845-024c85f92f20 h1:N+3sFI5GUjRKBi+i0TxYVST9h4Ie192jJWpHvthBBgg= -github.com/cncf/xds/go v0.0.0-20240723142845-024c85f92f20/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= @@ -33,16 +28,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-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -50,13 +45,14 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= -github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= -github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -64,18 +60,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= @@ -94,16 +88,16 @@ 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= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/ironcore-dev/controller-utils v0.9.6 h1:4A7ysv18C9hw9hXYPtesM+uFQZxuC78jTD9jaLcjpiY= github.com/ironcore-dev/controller-utils v0.9.6/go.mod h1:m4bb/NovyLb9h4DShqjNHXCt5dBOHObhpfKkeBVNjGA= -github.com/ironcore-dev/ironcore v0.2.0 h1:HETSSh46t+aKbJZql5dcbXBRUjHSwHYy7ZixN24vdnM= -github.com/ironcore-dev/ironcore v0.2.0/go.mod h1:wlvF43Afs1OpO0w6ZIXw+YaLnfBOfrEi9f4/MBdR1mc= +github.com/ironcore-dev/ironcore v0.2.2-0.20241219142352-bf1d9998cc71 h1:VKs+pwoJlulKA0qrwLSPvfSt7RSPperthCpImLxY9hw= +github.com/ironcore-dev/ironcore v0.2.2-0.20241219142352-bf1d9998cc71/go.mod h1:GcIk18Ys125szpjrDsDDZmskAkgF5+I5xO8UJs88zdM= github.com/ironcore-dev/metalnet v0.3.10 h1:Hv8M7uOlRiGPlSLvrPn7xaaTwHybalg05g5cYdrO5Ds= github.com/ironcore-dev/metalnet v0.3.10/go.mod h1:1zaY6/trlx6n/nw2JuEpf7d3nlxXwRE/46kDlTKH/2c= github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ= @@ -123,8 +117,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= 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/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= @@ -132,6 +124,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/onsi/ginkgo/v2 v2.22.0 h1:Yed107/8DjTr0lKCNt7Dn8yQ6ybuDRQoMGrNFKzMfHg= github.com/onsi/ginkgo/v2 v2.22.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= github.com/onsi/gomega v1.36.1 h1:bJDPBO7ibjxcbHMgSCoo4Yj18UWbKDlLwX1x9sybDcw= @@ -141,16 +135,16 @@ 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.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= @@ -176,44 +170,48 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf github.com/stretchr/testify v1.10.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.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= -go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= -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/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= -go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= -go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= -go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= -go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= -go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= -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.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.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= +go.opentelemetry.io/otel/sdk v1.31.0/go.mod h1:TfRbMdhvxIIr/B2N2LQW2S5v9m3gOQ/08KsbbO5BPT0= +go.opentelemetry.io/otel/sdk/metric v1.31.0 h1:i9hxxLJF/9kkvfHppyLL55aW7iIJz4JjxTeYusH7zMc= +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.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= @@ -241,8 +239,8 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= -golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= -golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= +golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -275,62 +273,63 @@ gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= -google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= -google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= -google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53 h1:fVoAXEKA4+yufmbdVYv+SE73+cPZbbbe8paLsHfkK+U= +google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53/go.mod h1:riSXTwQ4+nqmPGtobMFyW5FqVAmIs0St6VPp4Ug7CE4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 h1:X58yt85/IXCx0Y3ZwN6sEIKZzQtDEYaBWrDvErdXrRE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/grpc v1.69.0 h1:quSiOM1GJPmPH5XtU+BCoVXcDVJJAzNcoyfC2cCjGkI= +google.golang.org/grpc v1.69.0/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= 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= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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.6 h1:uqRDLnFkmPLorI9D0x1dGXdYeRQMhQHlrHDgZ3/45RE= -k8s.io/api v0.30.6/go.mod h1:6x759Hj7155pXRKStxzM7TMN9hW0x7WrBr51kuDMSHo= -k8s.io/apiextensions-apiserver v0.30.6 h1:eXmd0cki9xjpUguN7zaWI8I6wo1utHQj6RWqeBaVmew= -k8s.io/apiextensions-apiserver v0.30.6/go.mod h1:va7pN44YJJDHrShKhPSL9S5CyTJ8idAmqIARt5wY4j8= -k8s.io/apimachinery v0.30.6 h1:dlplzGrUL/DiPOVVVjDcT9ZoQBOwYeB6hcFy90veggs= -k8s.io/apimachinery v0.30.6/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= -k8s.io/apiserver v0.30.6 h1:kMkE/pln4hJpc1OJGa/u8CzpLtr4URbmgkdfw37lzMA= -k8s.io/apiserver v0.30.6/go.mod h1:kloaQDI0pBfhnHM0vfsgzOkWpTW7Z69rjPWEsMlIUzg= -k8s.io/client-go v0.30.6 h1:hMo7AUkHy/UqnwPMH+oJvFR9gpvXVfQnsiO+G2fdE30= -k8s.io/client-go v0.30.6/go.mod h1:DDN89/30A1DfatO+c3ksYMM12kL7a/CZvsBaVjwh33g= -k8s.io/code-generator v0.30.6 h1:P0pDCNLfT5lxrY6kZ07WtdIHc7a5cZCiJYz1B3MRbu8= -k8s.io/code-generator v0.30.6/go.mod h1:Sg5PSxoHkTD7iFp+gM4d1XvCFCvrMkEa9uoHnCbyfwE= -k8s.io/component-base v0.30.6 h1:t94cw6cQ7bplaS3Y5C/txkUXpaxG+wbgspTmudGUpNs= -k8s.io/component-base v0.30.6/go.mod h1:GAemfIPE9Zc3bxOmeLPpHKKHzfuMlmTwsAjx/bWaJvQ= -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/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.6 h1:54j1mvj/DnCTkZOIdxFk9MHKoTcsnZ45CBnhRimpGGE= -k8s.io/kms v0.30.6/go.mod h1:GrMurD0qk3G4yNgGcsCEmepqf9KyyIrTXYR2lyUOJC4= -k8s.io/kube-aggregator v0.29.4 h1:yT7vYtwIag4G8HNrktYZ3qz6p6oHKronMAXOw4eQ2WQ= -k8s.io/kube-aggregator v0.29.4/go.mod h1:zBfe4iXXmw5HinNgN0JoAu5rpXdyCUvRfG99+FVOd68= -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/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= -k8s.io/utils v0.0.0-20240102154912-e7106e64919e/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= +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/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.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.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= -sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +sigs.k8s.io/structured-merge-diff/v4 v4.4.3 h1:sCP7Vv3xx/CWIuTPVN38lUPx0uw0lcLfzaiDa8Ja01A= +sigs.k8s.io/structured-merge-diff/v4 v4.4.3/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/internal/apiserver/apiserver.go b/internal/apiserver/apiserver.go index 4457e50f..6aa17f32 100644 --- a/internal/apiserver/apiserver.go +++ b/internal/apiserver/apiserver.go @@ -37,7 +37,6 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/version" "k8s.io/apiserver/pkg/registry/rest" genericapiserver "k8s.io/apiserver/pkg/server" ) @@ -101,11 +100,6 @@ func (cfg *Config) Complete() CompletedConfig { &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 4c5ee23b..4d7b25db 100644 --- a/internal/app/apiserver/apiserver.go +++ b/internal/app/apiserver/apiserver.go @@ -26,6 +26,7 @@ import ( genericapiserver "k8s.io/apiserver/pkg/server" "k8s.io/apiserver/pkg/server/options" utilfeature "k8s.io/apiserver/pkg/util/feature" + utilversion "k8s.io/apiserver/pkg/util/version" netutils "k8s.io/utils/net" ) @@ -118,6 +119,8 @@ func (o *IronCoreNetServerOptions) Config() (*apiserver.Config, error) { serverConfig := genericapiserver.NewRecommendedConfig(apiserver.Codecs) + serverConfig.EffectiveVersion = utilversion.NewEffectiveVersion("1.0") + serverConfig.OpenAPIConfig = genericapiserver.DefaultOpenAPIConfig(apinetopenapi.GetOpenAPIDefinitions, openapi.NewDefinitionNamer(apiserver.Scheme)) serverConfig.OpenAPIConfig.Info.Title = "ironcore-net-api" serverConfig.OpenAPIConfig.Info.Version = "0.1" @@ -154,11 +157,11 @@ func (o *IronCoreNetServerOptions) Run(ctx context.Context) error { return err } - server.GenericAPIServer.AddPostStartHookOrDie("start-ironcore-net-server-informers", func(context genericapiserver.PostStartHookContext) error { - config.GenericConfig.SharedInformerFactory.Start(context.StopCh) - o.SharedInformerFactory.Start(context.StopCh) + server.GenericAPIServer.AddPostStartHookOrDie("start-ironcore-net-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/app/app_suite_test.go b/internal/app/app_suite_test.go index bb5df40f..30342cd1 100644 --- a/internal/app/app_suite_test.go +++ b/internal/app/app_suite_test.go @@ -63,7 +63,7 @@ var _ = BeforeSuite(func() { // Note that you must have the required binaries setup under the bin directory to perform // the tests directly. When we run make test it will be setup and used automatically. BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s", - fmt.Sprintf("1.29.0-%s-%s", runtime.GOOS, runtime.GOARCH)), + fmt.Sprintf("1.31.0-%s-%s", runtime.GOOS, runtime.GOARCH)), } testEnvExt = &utilsenvtest.EnvironmentExtensions{ APIServiceDirectoryPaths: []string{filepath.Join("..", "..", "config", "apiserver", "apiservice", "bases")}, diff --git a/internal/controllers/controllers_suite_test.go b/internal/controllers/controllers_suite_test.go index 2c6527e8..80b775e4 100644 --- a/internal/controllers/controllers_suite_test.go +++ b/internal/controllers/controllers_suite_test.go @@ -82,7 +82,7 @@ var _ = BeforeSuite(func() { // Note that you must have the required binaries setup under the bin directory to perform // the tests directly. When we run make test it will be setup and used automatically. BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s", - fmt.Sprintf("1.29.0-%s-%s", runtime.GOOS, runtime.GOARCH)), + fmt.Sprintf("1.31.0-%s-%s", runtime.GOOS, runtime.GOARCH)), } testEnvExt = &utilsenvtest.EnvironmentExtensions{ APIServiceDirectoryPaths: []string{filepath.Join("..", "..", "config", "apiserver", "apiservice", "bases")}, diff --git a/internal/controllers/daemonset_controller.go b/internal/controllers/daemonset_controller.go index 975028fe..a99f912b 100644 --- a/internal/controllers/daemonset_controller.go +++ b/internal/controllers/daemonset_controller.go @@ -26,6 +26,7 @@ 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 DaemonSetReconciler struct { @@ -366,7 +367,7 @@ func (r *DaemonSetReconciler) reconcile( } func (r *DaemonSetReconciler) enqueueByNode() handler.EventHandler { - enqueueAllDaemonSets := func(ctx context.Context, queue workqueue.RateLimitingInterface) { + enqueueAllDaemonSets := func(ctx context.Context, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) dsList := &v1alpha1.DaemonSetList{} @@ -381,10 +382,10 @@ func (r *DaemonSetReconciler) enqueueByNode() 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]) { enqueueAllDaemonSets(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]) { enqueueAllDaemonSets(ctx, queue) }, } diff --git a/internal/controllers/ipaddressgc_controller.go b/internal/controllers/ipaddressgc_controller.go index 3ecfc76e..46dcadde 100644 --- a/internal/controllers/ipaddressgc_controller.go +++ b/internal/controllers/ipaddressgc_controller.go @@ -18,6 +18,7 @@ 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 IPAddressGCReconciler struct { @@ -113,7 +114,7 @@ func (r *IPAddressGCReconciler) ipAddressClaimerExists(ctx context.Context, addr } func (r *IPAddressGCReconciler) enqueueByClaimer() handler.EventHandler { - mapAndEnqueue := func(ctx context.Context, claimer client.Object, queue workqueue.RateLimitingInterface) { + mapAndEnqueue := func(ctx context.Context, claimer client.Object, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) addrList := &v1alpha1.IPAddressList{} @@ -132,10 +133,10 @@ func (r *IPAddressGCReconciler) enqueueByClaimer() handler.EventHandler { } return &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]) { mapAndEnqueue(ctx, event.Object, queue) }, - GenericFunc: func(ctx context.Context, event event.GenericEvent, queue workqueue.RateLimitingInterface) { + GenericFunc: func(ctx context.Context, event event.GenericEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { if !event.Object.GetDeletionTimestamp().IsZero() { mapAndEnqueue(ctx, event.Object, queue) } diff --git a/internal/controllers/networkidgc_controller.go b/internal/controllers/networkidgc_controller.go index a0df0fba..fd8c0c55 100644 --- a/internal/controllers/networkidgc_controller.go +++ b/internal/controllers/networkidgc_controller.go @@ -19,6 +19,7 @@ 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 NetworkIDGCReconciler struct { @@ -114,7 +115,7 @@ func (r *NetworkIDGCReconciler) networkIDClaimerExists(ctx context.Context, netw } func (r *NetworkIDGCReconciler) enqueueByClaimer() handler.EventHandler { - mapAndEnqueue := func(ctx context.Context, claimer client.Object, queue workqueue.RateLimitingInterface) { + mapAndEnqueue := func(ctx context.Context, claimer client.Object, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) networkIDList := &v1alpha1.NetworkIDList{} @@ -131,10 +132,10 @@ func (r *NetworkIDGCReconciler) enqueueByClaimer() handler.EventHandler { } return &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]) { mapAndEnqueue(ctx, event.Object, queue) }, - GenericFunc: func(ctx context.Context, event event.GenericEvent, queue workqueue.RateLimitingInterface) { + GenericFunc: func(ctx context.Context, event event.GenericEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { if !event.Object.GetDeletionTimestamp().IsZero() { mapAndEnqueue(ctx, event.Object, queue) } diff --git a/internal/controllers/networkinterfacenatrelease_controller.go b/internal/controllers/networkinterfacenatrelease_controller.go index 78dc0e92..7d022b85 100644 --- a/internal/controllers/networkinterfacenatrelease_controller.go +++ b/internal/controllers/networkinterfacenatrelease_controller.go @@ -16,6 +16,7 @@ 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 NetworkInterfaceNATReleaseReconciler struct { @@ -100,7 +101,7 @@ func (r *NetworkInterfaceNATReleaseReconciler) Reconcile(ctx context.Context, re } func (r *NetworkInterfaceNATReleaseReconciler) enqueueByNATGateway() handler.EventHandler { - mapAndEnqueue := func(ctx context.Context, natGateway *v1alpha1.NATGateway, queue workqueue.RateLimitingInterface) { + mapAndEnqueue := func(ctx context.Context, natGateway *v1alpha1.NATGateway, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { log := ctrl.LoggerFrom(ctx) nicList := &v1alpha1.NetworkInterfaceList{} @@ -119,11 +120,11 @@ func (r *NetworkInterfaceNATReleaseReconciler) enqueueByNATGateway() handler.Eve } return &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]) { natGateway := event.Object.(*v1alpha1.NATGateway) mapAndEnqueue(ctx, natGateway, queue) }, - GenericFunc: func(ctx context.Context, event event.GenericEvent, queue workqueue.RateLimitingInterface) { + GenericFunc: func(ctx context.Context, event event.GenericEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { natGateway := event.Object.(*v1alpha1.NATGateway) if !natGateway.GetDeletionTimestamp().IsZero() { mapAndEnqueue(ctx, natGateway, queue) diff --git a/internal/controllers/scheduler_controller.go b/internal/controllers/scheduler_controller.go index 00cdceb8..4ae09da2 100644 --- a/internal/controllers/scheduler_controller.go +++ b/internal/controllers/scheduler_controller.go @@ -25,6 +25,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" ) const ( @@ -538,7 +539,7 @@ func (r *SchedulerReconciler) instanceNotAssignedPredicate() predicate.Predicate func (r *SchedulerReconciler) handleNode() 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]) { node := evt.Object.(*v1alpha1.Node) log := ctrl.LoggerFrom(ctx) @@ -562,12 +563,12 @@ func (r *SchedulerReconciler) handleNode() handler.EventHandler { queue.Add(ctrl.Request{NamespacedName: client.ObjectKeyFromObject(&instance)}) } }, - UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.RateLimitingInterface) { + UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { oldNode := evt.ObjectOld.(*v1alpha1.Node) newNode := evt.ObjectNew.(*v1alpha1.Node) r.Cache.UpdateContainer(oldNode, newNode) }, - DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.RateLimitingInterface) { + DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { node := evt.Object.(*v1alpha1.Node) log := ctrl.LoggerFrom(ctx) @@ -587,7 +588,7 @@ func (r *SchedulerReconciler) isInstanceAssigned() predicate.Predicate { func (r *SchedulerReconciler) handleAssignedInstances() 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]) { instance := evt.Object.(*v1alpha1.Instance) log := ctrl.LoggerFrom(ctx) @@ -595,7 +596,7 @@ func (r *SchedulerReconciler) handleAssignedInstances() handler.EventHandler { log.Error(err, "Error adding instance 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]) { oldInstance := evt.ObjectOld.(*v1alpha1.Instance) newInstance := evt.ObjectNew.(*v1alpha1.Instance) log := ctrl.LoggerFrom(ctx) @@ -615,7 +616,7 @@ func (r *SchedulerReconciler) handleAssignedInstances() handler.EventHandler { } } }, - DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.RateLimitingInterface) { + DeleteFunc: func(ctx context.Context, evt event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { instance := evt.Object.(*v1alpha1.Instance) log := ctrl.LoggerFrom(ctx) @@ -628,11 +629,11 @@ func (r *SchedulerReconciler) handleAssignedInstances() handler.EventHandler { func (r *SchedulerReconciler) handleUnassignedInstance() 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]) { instance := evt.Object.(*v1alpha1.Instance) queue.Add(ctrl.Request{NamespacedName: client.ObjectKeyFromObject(instance)}) }, - UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.RateLimitingInterface) { + UpdateFunc: func(ctx context.Context, evt event.UpdateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { oldInstance := evt.ObjectOld.(*v1alpha1.Instance) newInstance := evt.ObjectNew.(*v1alpha1.Instance) log := ctrl.LoggerFrom(ctx) diff --git a/metalnetlet/controllers/controllers_suite_test.go b/metalnetlet/controllers/controllers_suite_test.go index 70a4a4c8..7e6dd866 100644 --- a/metalnetlet/controllers/controllers_suite_test.go +++ b/metalnetlet/controllers/controllers_suite_test.go @@ -25,8 +25,10 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" + "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" @@ -93,7 +95,7 @@ var _ = BeforeSuite(func() { // Note that you must have the required binaries setup under the bin directory to perform // the tests directly. When we run make test it will be setup and used automatically. BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s", - fmt.Sprintf("1.29.0-%s-%s", runtime.GOOS, runtime.GOARCH)), + fmt.Sprintf("1.31.0-%s-%s", runtime.GOOS, runtime.GOARCH)), } testEnvExt = &utilsenvtest.EnvironmentExtensions{ APIServiceDirectoryPaths: []string{filepath.Join("..", "..", "config", "apiserver", "apiservice", "bases")}, @@ -142,6 +144,7 @@ func SetupTest(metalnetNs *corev1.Namespace) { Metrics: metricsserver.Options{ BindAddress: "0", }, + Controller: ctrlconfig.Controller{SkipNameValidation: ptr.To(true)}, }) Expect(err).ToNot(HaveOccurred()) diff --git a/utils/handler/expectations.go b/utils/handler/expectations.go index 755e0693..49edbe43 100644 --- a/utils/handler/expectations.go +++ b/utils/handler/expectations.go @@ -18,6 +18,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/apiutil" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/reconcile" ) var observeExpectationsForControllerLog = ctrl.Log.WithName("eventhandler").WithName("observeExpectationsForController") @@ -118,17 +119,17 @@ func (o *observeExpectationsForController) add(obj client.Object) { o.expectations.CreationObserved(*ctrlKey, client.ObjectKeyFromObject(obj)) } -func (o *observeExpectationsForController) Create(_ context.Context, evt event.CreateEvent, _ workqueue.RateLimitingInterface) { +func (o *observeExpectationsForController) Create(_ context.Context, evt event.CreateEvent, _ workqueue.TypedRateLimitingInterface[reconcile.Request]) { o.add(evt.Object) } -func (o *observeExpectationsForController) Update(_ context.Context, _ event.UpdateEvent, _ workqueue.RateLimitingInterface) { +func (o *observeExpectationsForController) Update(_ context.Context, _ event.UpdateEvent, _ workqueue.TypedRateLimitingInterface[reconcile.Request]) { } -func (o *observeExpectationsForController) Delete(_ context.Context, evt event.DeleteEvent, _ workqueue.RateLimitingInterface) { +func (o *observeExpectationsForController) Delete(_ context.Context, evt event.DeleteEvent, _ workqueue.TypedRateLimitingInterface[reconcile.Request]) { o.delete(evt.Object) } -func (o *observeExpectationsForController) Generic(_ context.Context, evt event.GenericEvent, _ workqueue.RateLimitingInterface) { +func (o *observeExpectationsForController) Generic(_ context.Context, evt event.GenericEvent, _ workqueue.TypedRateLimitingInterface[reconcile.Request]) { o.add(evt.Object) } diff --git a/utils/handler/sourceaware.go b/utils/handler/sourceaware.go index c9488060..9dea5980 100644 --- a/utils/handler/sourceaware.go +++ b/utils/handler/sourceaware.go @@ -18,6 +18,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/apiutil" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/handler" + "sigs.k8s.io/controller-runtime/pkg/reconcile" ) var log = ctrl.Log.WithName("eventhandler").WithName("enqueueRequestForSource") @@ -100,13 +101,13 @@ func (e *enqueueRequestForSource) addRequests( reqs.Insert(ctrl.Request{NamespacedName: client.ObjectKey{Namespace: namespace, Name: name}}) } -func (e *enqueueRequestForSource) enqueueRequests(reqs sets.Set[ctrl.Request], queue workqueue.RateLimitingInterface) { +func (e *enqueueRequestForSource) enqueueRequests(reqs sets.Set[ctrl.Request], queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { for req := range reqs { queue.Add(req) } } -func (e *enqueueRequestForSource) Create(ctx context.Context, evt event.CreateEvent, queue workqueue.RateLimitingInterface) { +func (e *enqueueRequestForSource) Create(ctx context.Context, evt event.CreateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { namespaceLabel, nameLabel, err := e.getLabels() if err != nil { log.Error(err, "Error getting labels") @@ -118,7 +119,7 @@ func (e *enqueueRequestForSource) Create(ctx context.Context, evt event.CreateEv e.enqueueRequests(reqs, queue) } -func (e *enqueueRequestForSource) Update(ctx context.Context, evt event.UpdateEvent, queue workqueue.RateLimitingInterface) { +func (e *enqueueRequestForSource) Update(ctx context.Context, evt event.UpdateEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { namespaceLabel, nameLabel, err := e.getLabels() if err != nil { log.Error(err, "Error getting labels") @@ -131,7 +132,7 @@ func (e *enqueueRequestForSource) Update(ctx context.Context, evt event.UpdateEv e.enqueueRequests(reqs, queue) } -func (e *enqueueRequestForSource) Delete(ctx context.Context, evt event.DeleteEvent, queue workqueue.RateLimitingInterface) { +func (e *enqueueRequestForSource) Delete(ctx context.Context, evt event.DeleteEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { namespaceLabel, nameLabel, err := e.getLabels() if err != nil { log.Error(err, "Error getting labels") @@ -143,7 +144,7 @@ func (e *enqueueRequestForSource) Delete(ctx context.Context, evt event.DeleteEv e.enqueueRequests(reqs, queue) } -func (e *enqueueRequestForSource) Generic(ctx context.Context, evt event.GenericEvent, queue workqueue.RateLimitingInterface) { +func (e *enqueueRequestForSource) Generic(ctx context.Context, evt event.GenericEvent, queue workqueue.TypedRateLimitingInterface[reconcile.Request]) { namespaceLabel, nameLabel, err := e.getLabels() if err != nil { log.Error(err, "Error getting labels")