From 79c893df5ad31e0fe487b40615d977ad2bf59cc6 Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Wed, 15 Jun 2022 15:17:24 +0300 Subject: [PATCH 001/159] Replaces path.Operation with filepath.Operation (staging) The path module has a few different functions: Clean, Split, Join, Ext, Dir, Base, IsAbs. These functions do not take into account the OS-specific path separator, meaning that they won't behave as intended on Windows. For example, Dir is supposed to return all but the last element of the path. For the path "C:\some\dir\somewhere", it is supposed to return "C:\some\dir\", however, it returns ".". Instead of these functions, the ones in filepath should be used instead. Kubernetes-commit: 856bb5c8f266f5276f1a576f47be622d7cb384e7 --- tools/clientcmd/api/helpers.go | 5 ++--- tools/clientcmd/config.go | 3 +-- tools/clientcmd/loader_test.go | 19 +++++++++---------- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/tools/clientcmd/api/helpers.go b/tools/clientcmd/api/helpers.go index dd5f918067..261dcacb5b 100644 --- a/tools/clientcmd/api/helpers.go +++ b/tools/clientcmd/api/helpers.go @@ -21,7 +21,6 @@ import ( "errors" "fmt" "os" - "path" "path/filepath" "reflect" "strings" @@ -115,7 +114,7 @@ func ShortenConfig(config *Config) { // FlattenConfig changes the config object into a self-contained config (useful for making secrets) func FlattenConfig(config *Config) error { for key, authInfo := range config.AuthInfos { - baseDir, err := MakeAbs(path.Dir(authInfo.LocationOfOrigin), "") + baseDir, err := MakeAbs(filepath.Dir(authInfo.LocationOfOrigin), "") if err != nil { return err } @@ -130,7 +129,7 @@ func FlattenConfig(config *Config) error { config.AuthInfos[key] = authInfo } for key, cluster := range config.Clusters { - baseDir, err := MakeAbs(path.Dir(cluster.LocationOfOrigin), "") + baseDir, err := MakeAbs(filepath.Dir(cluster.LocationOfOrigin), "") if err != nil { return err } diff --git a/tools/clientcmd/config.go b/tools/clientcmd/config.go index 31f8963160..2cd213ccb3 100644 --- a/tools/clientcmd/config.go +++ b/tools/clientcmd/config.go @@ -19,7 +19,6 @@ package clientcmd import ( "errors" "os" - "path" "path/filepath" "reflect" "sort" @@ -148,7 +147,7 @@ func NewDefaultPathOptions() *PathOptions { EnvVar: RecommendedConfigPathEnvVar, ExplicitFileFlag: RecommendedConfigPathFlag, - GlobalFileSubpath: path.Join(RecommendedHomeDir, RecommendedFileName), + GlobalFileSubpath: filepath.Join(RecommendedHomeDir, RecommendedFileName), LoadingRules: NewDefaultClientConfigLoadingRules(), } diff --git a/tools/clientcmd/loader_test.go b/tools/clientcmd/loader_test.go index fbc4528389..778ef03ca6 100644 --- a/tools/clientcmd/loader_test.go +++ b/tools/clientcmd/loader_test.go @@ -21,7 +21,6 @@ import ( "flag" "fmt" "os" - "path" "path/filepath" "reflect" "strings" @@ -539,13 +538,13 @@ func TestResolveRelativePaths(t *testing.T) { configDir1, _ := os.MkdirTemp("", "") defer os.RemoveAll(configDir1) - configFile1 := path.Join(configDir1, ".kubeconfig") + configFile1 := filepath.Join(configDir1, ".kubeconfig") configDir1, _ = filepath.Abs(configDir1) configDir2, _ := os.MkdirTemp("", "") defer os.RemoveAll(configDir2) configDir2, _ = os.MkdirTemp(configDir2, "") - configFile2 := path.Join(configDir2, ".kubeconfig") + configFile2 := filepath.Join(configDir2, ".kubeconfig") configDir2, _ = filepath.Abs(configDir2) WriteToFile(pathResolutionConfig1, configFile1) @@ -564,11 +563,11 @@ func TestResolveRelativePaths(t *testing.T) { for key, cluster := range mergedConfig.Clusters { if key == "relative-server-1" { foundClusterCount++ - matchStringArg(path.Join(configDir1, pathResolutionConfig1.Clusters["relative-server-1"].CertificateAuthority), cluster.CertificateAuthority, t) + matchStringArg(filepath.Join(configDir1, pathResolutionConfig1.Clusters["relative-server-1"].CertificateAuthority), cluster.CertificateAuthority, t) } if key == "relative-server-2" { foundClusterCount++ - matchStringArg(path.Join(configDir2, pathResolutionConfig2.Clusters["relative-server-2"].CertificateAuthority), cluster.CertificateAuthority, t) + matchStringArg(filepath.Join(configDir2, pathResolutionConfig2.Clusters["relative-server-2"].CertificateAuthority), cluster.CertificateAuthority, t) } if key == "absolute-server-1" { foundClusterCount++ @@ -587,13 +586,13 @@ func TestResolveRelativePaths(t *testing.T) { for key, authInfo := range mergedConfig.AuthInfos { if key == "relative-user-1" { foundAuthInfoCount++ - matchStringArg(path.Join(configDir1, pathResolutionConfig1.AuthInfos["relative-user-1"].ClientCertificate), authInfo.ClientCertificate, t) - matchStringArg(path.Join(configDir1, pathResolutionConfig1.AuthInfos["relative-user-1"].ClientKey), authInfo.ClientKey, t) + matchStringArg(filepath.Join(configDir1, pathResolutionConfig1.AuthInfos["relative-user-1"].ClientCertificate), authInfo.ClientCertificate, t) + matchStringArg(filepath.Join(configDir1, pathResolutionConfig1.AuthInfos["relative-user-1"].ClientKey), authInfo.ClientKey, t) } if key == "relative-user-2" { foundAuthInfoCount++ - matchStringArg(path.Join(configDir2, pathResolutionConfig2.AuthInfos["relative-user-2"].ClientCertificate), authInfo.ClientCertificate, t) - matchStringArg(path.Join(configDir2, pathResolutionConfig2.AuthInfos["relative-user-2"].ClientKey), authInfo.ClientKey, t) + matchStringArg(filepath.Join(configDir2, pathResolutionConfig2.AuthInfos["relative-user-2"].ClientCertificate), authInfo.ClientCertificate, t) + matchStringArg(filepath.Join(configDir2, pathResolutionConfig2.AuthInfos["relative-user-2"].ClientKey), authInfo.ClientKey, t) } if key == "absolute-user-1" { foundAuthInfoCount++ @@ -607,7 +606,7 @@ func TestResolveRelativePaths(t *testing.T) { } if key == "relative-cmd-1" { foundAuthInfoCount++ - matchStringArg(path.Join(configDir1, pathResolutionConfig1.AuthInfos[key].Exec.Command), authInfo.Exec.Command, t) + matchStringArg(filepath.Join(configDir1, pathResolutionConfig1.AuthInfos[key].Exec.Command), authInfo.Exec.Command, t) } if key == "absolute-cmd-1" { foundAuthInfoCount++ From 05ff4bb2fdad22ac022a312f66fe3e09a22d62e8 Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Fri, 27 Oct 2023 16:57:01 +0200 Subject: [PATCH 002/159] Generify lister-gen This adds a generic implementation of a lister, and uses it to replace the template code in generated listers. The corresponding templates are no longer used and are removed. Listers are reduced to their interfaces (non-namespaced and namespaced if appropriate), their specific structs, and their constructors. All method implementations are provided by the generic implementation. The dedicated interface is preserved so that each lister can have its own set of methods (e.g. the method returning the namespaced lister if appropriate), and the dedicated struct is preserved to allow expansions to be defined where necessary. The external interface is unchanged and doesn't expose generics. Signed-off-by: Stephen Kitt Kubernetes-commit: 2e9adcd14aae27394238291fa08fb603bf2f3e77 --- listers/generic_helpers.go | 72 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 listers/generic_helpers.go diff --git a/listers/generic_helpers.go b/listers/generic_helpers.go new file mode 100644 index 0000000000..c69bb22b11 --- /dev/null +++ b/listers/generic_helpers.go @@ -0,0 +1,72 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package listers + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/client-go/tools/cache" +) + +// ResourceIndexer wraps an indexer, resource, and optional namespace for a given type. +// This is intended for use by listers (generated by lister-gen) only. +type ResourceIndexer[T runtime.Object] struct { + indexer cache.Indexer + resource schema.GroupResource + namespace string // empty for non-namespaced types +} + +// New returns a new instance of a lister (resource indexer) wrapping the given indexer and resource for the specified type. +// This is intended for use by listers (generated by lister-gen) only. +func New[T runtime.Object](indexer cache.Indexer, resource schema.GroupResource) ResourceIndexer[T] { + return ResourceIndexer[T]{indexer: indexer, resource: resource} +} + +// NewNamespaced returns a new instance of a namespaced lister (resource indexer) wrapping the given parent and namespace for the specified type. +// This is intended for use by listers (generated by lister-gen) only. +func NewNamespaced[T runtime.Object](parent ResourceIndexer[T], namespace string) ResourceIndexer[T] { + return ResourceIndexer[T]{indexer: parent.indexer, resource: parent.resource, namespace: namespace} +} + +// List lists all resources in the indexer matching the given selector. +func (l ResourceIndexer[T]) List(selector labels.Selector) (ret []T, err error) { + // ListAllByNamespace reverts to ListAll on empty namespaces + err = cache.ListAllByNamespace(l.indexer, l.namespace, selector, func(m interface{}) { + ret = append(ret, m.(T)) + }) + return ret, err +} + +// Get retrieves the resource from the index for a given name. +func (l ResourceIndexer[T]) Get(name string) (T, error) { + var key string + if l.namespace == "" { + key = name + } else { + key = l.namespace + "/" + name + } + obj, exists, err := l.indexer.GetByKey(key) + if err != nil { + return *new(T), err + } + if !exists { + return *new(T), errors.NewNotFound(l.resource, name) + } + return obj.(T), nil +} From 9d701d35041f3af175409ec3f8bd7f0021d61d7e Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Thu, 9 Nov 2023 17:39:39 +0100 Subject: [PATCH 003/159] Regenerate all listers Signed-off-by: Stephen Kitt Kubernetes-commit: e6f44957cdb961d1ada2ae570d331c6bc0ecc8e2 --- .../v1/mutatingwebhookconfiguration.go | 26 ++----------- .../v1/validatingadmissionpolicy.go | 26 ++----------- .../v1/validatingadmissionpolicybinding.go | 26 ++----------- .../v1/validatingwebhookconfiguration.go | 26 ++----------- .../v1alpha1/validatingadmissionpolicy.go | 26 ++----------- .../validatingadmissionpolicybinding.go | 26 ++----------- .../v1beta1/mutatingwebhookconfiguration.go | 26 ++----------- .../v1beta1/validatingadmissionpolicy.go | 26 ++----------- .../validatingadmissionpolicybinding.go | 26 ++----------- .../v1beta1/validatingwebhookconfiguration.go | 26 ++----------- .../v1alpha1/storageversion.go | 26 ++----------- listers/apps/v1/controllerrevision.go | 39 +++---------------- listers/apps/v1/daemonset.go | 39 +++---------------- listers/apps/v1/deployment.go | 39 +++---------------- listers/apps/v1/replicaset.go | 39 +++---------------- listers/apps/v1/statefulset.go | 39 +++---------------- listers/apps/v1beta1/controllerrevision.go | 39 +++---------------- listers/apps/v1beta1/deployment.go | 39 +++---------------- listers/apps/v1beta1/statefulset.go | 39 +++---------------- listers/apps/v1beta2/controllerrevision.go | 39 +++---------------- listers/apps/v1beta2/daemonset.go | 39 +++---------------- listers/apps/v1beta2/deployment.go | 39 +++---------------- listers/apps/v1beta2/replicaset.go | 39 +++---------------- listers/apps/v1beta2/statefulset.go | 39 +++---------------- .../autoscaling/v1/horizontalpodautoscaler.go | 39 +++---------------- .../autoscaling/v2/horizontalpodautoscaler.go | 39 +++---------------- .../v2beta1/horizontalpodautoscaler.go | 39 +++---------------- .../v2beta2/horizontalpodautoscaler.go | 39 +++---------------- listers/batch/v1/cronjob.go | 39 +++---------------- listers/batch/v1/job.go | 39 +++---------------- listers/batch/v1beta1/cronjob.go | 39 +++---------------- .../v1/certificatesigningrequest.go | 26 ++----------- .../v1alpha1/clustertrustbundle.go | 26 ++----------- .../v1beta1/certificatesigningrequest.go | 26 ++----------- listers/coordination/v1/lease.go | 39 +++---------------- listers/coordination/v1beta1/lease.go | 39 +++---------------- listers/core/v1/componentstatus.go | 26 ++----------- listers/core/v1/configmap.go | 39 +++---------------- listers/core/v1/endpoints.go | 39 +++---------------- listers/core/v1/event.go | 39 +++---------------- listers/core/v1/limitrange.go | 39 +++---------------- listers/core/v1/namespace.go | 26 ++----------- listers/core/v1/node.go | 26 ++----------- listers/core/v1/persistentvolume.go | 26 ++----------- listers/core/v1/persistentvolumeclaim.go | 39 +++---------------- listers/core/v1/pod.go | 39 +++---------------- listers/core/v1/podtemplate.go | 39 +++---------------- listers/core/v1/replicationcontroller.go | 39 +++---------------- listers/core/v1/resourcequota.go | 39 +++---------------- listers/core/v1/secret.go | 39 +++---------------- listers/core/v1/service.go | 39 +++---------------- listers/core/v1/serviceaccount.go | 39 +++---------------- listers/discovery/v1/endpointslice.go | 39 +++---------------- listers/discovery/v1beta1/endpointslice.go | 39 +++---------------- listers/events/v1/event.go | 39 +++---------------- listers/events/v1beta1/event.go | 39 +++---------------- listers/extensions/v1beta1/daemonset.go | 39 +++---------------- listers/extensions/v1beta1/deployment.go | 39 +++---------------- listers/extensions/v1beta1/ingress.go | 39 +++---------------- listers/extensions/v1beta1/networkpolicy.go | 39 +++---------------- listers/extensions/v1beta1/replicaset.go | 39 +++---------------- listers/flowcontrol/v1/flowschema.go | 26 ++----------- .../v1/prioritylevelconfiguration.go | 26 ++----------- listers/flowcontrol/v1beta1/flowschema.go | 26 ++----------- .../v1beta1/prioritylevelconfiguration.go | 26 ++----------- listers/flowcontrol/v1beta2/flowschema.go | 26 ++----------- .../v1beta2/prioritylevelconfiguration.go | 26 ++----------- listers/flowcontrol/v1beta3/flowschema.go | 26 ++----------- .../v1beta3/prioritylevelconfiguration.go | 26 ++----------- listers/imagepolicy/v1alpha1/imagereview.go | 26 ++----------- listers/networking/v1/ingress.go | 39 +++---------------- listers/networking/v1/ingressclass.go | 26 ++----------- listers/networking/v1/networkpolicy.go | 39 +++---------------- listers/networking/v1alpha1/ipaddress.go | 26 ++----------- listers/networking/v1alpha1/servicecidr.go | 26 ++----------- listers/networking/v1beta1/ingress.go | 39 +++---------------- listers/networking/v1beta1/ingressclass.go | 26 ++----------- listers/node/v1/runtimeclass.go | 26 ++----------- listers/node/v1alpha1/runtimeclass.go | 26 ++----------- listers/node/v1beta1/runtimeclass.go | 26 ++----------- listers/policy/v1/eviction.go | 39 +++---------------- listers/policy/v1/poddisruptionbudget.go | 39 +++---------------- listers/policy/v1beta1/eviction.go | 39 +++---------------- listers/policy/v1beta1/poddisruptionbudget.go | 39 +++---------------- listers/rbac/v1/clusterrole.go | 26 ++----------- listers/rbac/v1/clusterrolebinding.go | 26 ++----------- listers/rbac/v1/role.go | 39 +++---------------- listers/rbac/v1/rolebinding.go | 39 +++---------------- listers/rbac/v1alpha1/clusterrole.go | 26 ++----------- listers/rbac/v1alpha1/clusterrolebinding.go | 26 ++----------- listers/rbac/v1alpha1/role.go | 39 +++---------------- listers/rbac/v1alpha1/rolebinding.go | 39 +++---------------- listers/rbac/v1beta1/clusterrole.go | 26 ++----------- listers/rbac/v1beta1/clusterrolebinding.go | 26 ++----------- listers/rbac/v1beta1/role.go | 39 +++---------------- listers/rbac/v1beta1/rolebinding.go | 39 +++---------------- .../resource/v1alpha2/podschedulingcontext.go | 39 +++---------------- listers/resource/v1alpha2/resourceclaim.go | 39 +++---------------- .../v1alpha2/resourceclaimparameters.go | 39 +++---------------- .../v1alpha2/resourceclaimtemplate.go | 39 +++---------------- listers/resource/v1alpha2/resourceclass.go | 26 ++----------- .../v1alpha2/resourceclassparameters.go | 39 +++---------------- listers/resource/v1alpha2/resourceslice.go | 26 ++----------- listers/scheduling/v1/priorityclass.go | 26 ++----------- listers/scheduling/v1alpha1/priorityclass.go | 26 ++----------- listers/scheduling/v1beta1/priorityclass.go | 26 ++----------- listers/storage/v1/csidriver.go | 26 ++----------- listers/storage/v1/csinode.go | 26 ++----------- listers/storage/v1/csistoragecapacity.go | 39 +++---------------- listers/storage/v1/storageclass.go | 26 ++----------- listers/storage/v1/volumeattachment.go | 26 ++----------- .../storage/v1alpha1/csistoragecapacity.go | 39 +++---------------- listers/storage/v1alpha1/volumeattachment.go | 26 ++----------- .../storage/v1alpha1/volumeattributesclass.go | 26 ++----------- listers/storage/v1beta1/csidriver.go | 26 ++----------- listers/storage/v1beta1/csinode.go | 26 ++----------- listers/storage/v1beta1/csistoragecapacity.go | 39 +++---------------- listers/storage/v1beta1/storageclass.go | 26 ++----------- listers/storage/v1beta1/volumeattachment.go | 26 ++----------- .../v1alpha1/storageversionmigration.go | 26 ++----------- 120 files changed, 488 insertions(+), 3464 deletions(-) diff --git a/listers/admissionregistration/v1/mutatingwebhookconfiguration.go b/listers/admissionregistration/v1/mutatingwebhookconfiguration.go index fe9e27985d..4ab267e42e 100644 --- a/listers/admissionregistration/v1/mutatingwebhookconfiguration.go +++ b/listers/admissionregistration/v1/mutatingwebhookconfiguration.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/admissionregistration/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type MutatingWebhookConfigurationLister interface { // mutatingWebhookConfigurationLister implements the MutatingWebhookConfigurationLister interface. type mutatingWebhookConfigurationLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.MutatingWebhookConfiguration] } // NewMutatingWebhookConfigurationLister returns a new MutatingWebhookConfigurationLister. func NewMutatingWebhookConfigurationLister(indexer cache.Indexer) MutatingWebhookConfigurationLister { - return &mutatingWebhookConfigurationLister{indexer: indexer} -} - -// List lists all MutatingWebhookConfigurations in the indexer. -func (s *mutatingWebhookConfigurationLister) List(selector labels.Selector) (ret []*v1.MutatingWebhookConfiguration, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.MutatingWebhookConfiguration)) - }) - return ret, err -} - -// Get retrieves the MutatingWebhookConfiguration from the index for a given name. -func (s *mutatingWebhookConfigurationLister) Get(name string) (*v1.MutatingWebhookConfiguration, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("mutatingwebhookconfiguration"), name) - } - return obj.(*v1.MutatingWebhookConfiguration), nil + return &mutatingWebhookConfigurationLister{listers.New[*v1.MutatingWebhookConfiguration](indexer, v1.Resource("mutatingwebhookconfiguration"))} } diff --git a/listers/admissionregistration/v1/validatingadmissionpolicy.go b/listers/admissionregistration/v1/validatingadmissionpolicy.go index fff072f4c2..f233cdbe80 100644 --- a/listers/admissionregistration/v1/validatingadmissionpolicy.go +++ b/listers/admissionregistration/v1/validatingadmissionpolicy.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/admissionregistration/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type ValidatingAdmissionPolicyLister interface { // validatingAdmissionPolicyLister implements the ValidatingAdmissionPolicyLister interface. type validatingAdmissionPolicyLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.ValidatingAdmissionPolicy] } // NewValidatingAdmissionPolicyLister returns a new ValidatingAdmissionPolicyLister. func NewValidatingAdmissionPolicyLister(indexer cache.Indexer) ValidatingAdmissionPolicyLister { - return &validatingAdmissionPolicyLister{indexer: indexer} -} - -// List lists all ValidatingAdmissionPolicies in the indexer. -func (s *validatingAdmissionPolicyLister) List(selector labels.Selector) (ret []*v1.ValidatingAdmissionPolicy, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ValidatingAdmissionPolicy)) - }) - return ret, err -} - -// Get retrieves the ValidatingAdmissionPolicy from the index for a given name. -func (s *validatingAdmissionPolicyLister) Get(name string) (*v1.ValidatingAdmissionPolicy, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("validatingadmissionpolicy"), name) - } - return obj.(*v1.ValidatingAdmissionPolicy), nil + return &validatingAdmissionPolicyLister{listers.New[*v1.ValidatingAdmissionPolicy](indexer, v1.Resource("validatingadmissionpolicy"))} } diff --git a/listers/admissionregistration/v1/validatingadmissionpolicybinding.go b/listers/admissionregistration/v1/validatingadmissionpolicybinding.go index 07856981e5..450a066725 100644 --- a/listers/admissionregistration/v1/validatingadmissionpolicybinding.go +++ b/listers/admissionregistration/v1/validatingadmissionpolicybinding.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/admissionregistration/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type ValidatingAdmissionPolicyBindingLister interface { // validatingAdmissionPolicyBindingLister implements the ValidatingAdmissionPolicyBindingLister interface. type validatingAdmissionPolicyBindingLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.ValidatingAdmissionPolicyBinding] } // NewValidatingAdmissionPolicyBindingLister returns a new ValidatingAdmissionPolicyBindingLister. func NewValidatingAdmissionPolicyBindingLister(indexer cache.Indexer) ValidatingAdmissionPolicyBindingLister { - return &validatingAdmissionPolicyBindingLister{indexer: indexer} -} - -// List lists all ValidatingAdmissionPolicyBindings in the indexer. -func (s *validatingAdmissionPolicyBindingLister) List(selector labels.Selector) (ret []*v1.ValidatingAdmissionPolicyBinding, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ValidatingAdmissionPolicyBinding)) - }) - return ret, err -} - -// Get retrieves the ValidatingAdmissionPolicyBinding from the index for a given name. -func (s *validatingAdmissionPolicyBindingLister) Get(name string) (*v1.ValidatingAdmissionPolicyBinding, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("validatingadmissionpolicybinding"), name) - } - return obj.(*v1.ValidatingAdmissionPolicyBinding), nil + return &validatingAdmissionPolicyBindingLister{listers.New[*v1.ValidatingAdmissionPolicyBinding](indexer, v1.Resource("validatingadmissionpolicybinding"))} } diff --git a/listers/admissionregistration/v1/validatingwebhookconfiguration.go b/listers/admissionregistration/v1/validatingwebhookconfiguration.go index 1579a0ebb7..99045a6752 100644 --- a/listers/admissionregistration/v1/validatingwebhookconfiguration.go +++ b/listers/admissionregistration/v1/validatingwebhookconfiguration.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/admissionregistration/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type ValidatingWebhookConfigurationLister interface { // validatingWebhookConfigurationLister implements the ValidatingWebhookConfigurationLister interface. type validatingWebhookConfigurationLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.ValidatingWebhookConfiguration] } // NewValidatingWebhookConfigurationLister returns a new ValidatingWebhookConfigurationLister. func NewValidatingWebhookConfigurationLister(indexer cache.Indexer) ValidatingWebhookConfigurationLister { - return &validatingWebhookConfigurationLister{indexer: indexer} -} - -// List lists all ValidatingWebhookConfigurations in the indexer. -func (s *validatingWebhookConfigurationLister) List(selector labels.Selector) (ret []*v1.ValidatingWebhookConfiguration, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ValidatingWebhookConfiguration)) - }) - return ret, err -} - -// Get retrieves the ValidatingWebhookConfiguration from the index for a given name. -func (s *validatingWebhookConfigurationLister) Get(name string) (*v1.ValidatingWebhookConfiguration, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("validatingwebhookconfiguration"), name) - } - return obj.(*v1.ValidatingWebhookConfiguration), nil + return &validatingWebhookConfigurationLister{listers.New[*v1.ValidatingWebhookConfiguration](indexer, v1.Resource("validatingwebhookconfiguration"))} } diff --git a/listers/admissionregistration/v1alpha1/validatingadmissionpolicy.go b/listers/admissionregistration/v1alpha1/validatingadmissionpolicy.go index ae500183a7..c3aec2d736 100644 --- a/listers/admissionregistration/v1alpha1/validatingadmissionpolicy.go +++ b/listers/admissionregistration/v1alpha1/validatingadmissionpolicy.go @@ -20,8 +20,8 @@ package v1alpha1 import ( v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type ValidatingAdmissionPolicyLister interface { // validatingAdmissionPolicyLister implements the ValidatingAdmissionPolicyLister interface. type validatingAdmissionPolicyLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.ValidatingAdmissionPolicy] } // NewValidatingAdmissionPolicyLister returns a new ValidatingAdmissionPolicyLister. func NewValidatingAdmissionPolicyLister(indexer cache.Indexer) ValidatingAdmissionPolicyLister { - return &validatingAdmissionPolicyLister{indexer: indexer} -} - -// List lists all ValidatingAdmissionPolicies in the indexer. -func (s *validatingAdmissionPolicyLister) List(selector labels.Selector) (ret []*v1alpha1.ValidatingAdmissionPolicy, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.ValidatingAdmissionPolicy)) - }) - return ret, err -} - -// Get retrieves the ValidatingAdmissionPolicy from the index for a given name. -func (s *validatingAdmissionPolicyLister) Get(name string) (*v1alpha1.ValidatingAdmissionPolicy, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("validatingadmissionpolicy"), name) - } - return obj.(*v1alpha1.ValidatingAdmissionPolicy), nil + return &validatingAdmissionPolicyLister{listers.New[*v1alpha1.ValidatingAdmissionPolicy](indexer, v1alpha1.Resource("validatingadmissionpolicy"))} } diff --git a/listers/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go b/listers/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go index 552854daf2..5a2cf79c53 100644 --- a/listers/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go +++ b/listers/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go @@ -20,8 +20,8 @@ package v1alpha1 import ( v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type ValidatingAdmissionPolicyBindingLister interface { // validatingAdmissionPolicyBindingLister implements the ValidatingAdmissionPolicyBindingLister interface. type validatingAdmissionPolicyBindingLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.ValidatingAdmissionPolicyBinding] } // NewValidatingAdmissionPolicyBindingLister returns a new ValidatingAdmissionPolicyBindingLister. func NewValidatingAdmissionPolicyBindingLister(indexer cache.Indexer) ValidatingAdmissionPolicyBindingLister { - return &validatingAdmissionPolicyBindingLister{indexer: indexer} -} - -// List lists all ValidatingAdmissionPolicyBindings in the indexer. -func (s *validatingAdmissionPolicyBindingLister) List(selector labels.Selector) (ret []*v1alpha1.ValidatingAdmissionPolicyBinding, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.ValidatingAdmissionPolicyBinding)) - }) - return ret, err -} - -// Get retrieves the ValidatingAdmissionPolicyBinding from the index for a given name. -func (s *validatingAdmissionPolicyBindingLister) Get(name string) (*v1alpha1.ValidatingAdmissionPolicyBinding, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("validatingadmissionpolicybinding"), name) - } - return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), nil + return &validatingAdmissionPolicyBindingLister{listers.New[*v1alpha1.ValidatingAdmissionPolicyBinding](indexer, v1alpha1.Resource("validatingadmissionpolicybinding"))} } diff --git a/listers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/listers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index 93c6096ee9..3bad49ac0a 100644 --- a/listers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/listers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/admissionregistration/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type MutatingWebhookConfigurationLister interface { // mutatingWebhookConfigurationLister implements the MutatingWebhookConfigurationLister interface. type mutatingWebhookConfigurationLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.MutatingWebhookConfiguration] } // NewMutatingWebhookConfigurationLister returns a new MutatingWebhookConfigurationLister. func NewMutatingWebhookConfigurationLister(indexer cache.Indexer) MutatingWebhookConfigurationLister { - return &mutatingWebhookConfigurationLister{indexer: indexer} -} - -// List lists all MutatingWebhookConfigurations in the indexer. -func (s *mutatingWebhookConfigurationLister) List(selector labels.Selector) (ret []*v1beta1.MutatingWebhookConfiguration, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.MutatingWebhookConfiguration)) - }) - return ret, err -} - -// Get retrieves the MutatingWebhookConfiguration from the index for a given name. -func (s *mutatingWebhookConfigurationLister) Get(name string) (*v1beta1.MutatingWebhookConfiguration, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("mutatingwebhookconfiguration"), name) - } - return obj.(*v1beta1.MutatingWebhookConfiguration), nil + return &mutatingWebhookConfigurationLister{listers.New[*v1beta1.MutatingWebhookConfiguration](indexer, v1beta1.Resource("mutatingwebhookconfiguration"))} } diff --git a/listers/admissionregistration/v1beta1/validatingadmissionpolicy.go b/listers/admissionregistration/v1beta1/validatingadmissionpolicy.go index 7018b3ceec..74d7c6ce3e 100644 --- a/listers/admissionregistration/v1beta1/validatingadmissionpolicy.go +++ b/listers/admissionregistration/v1beta1/validatingadmissionpolicy.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/admissionregistration/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type ValidatingAdmissionPolicyLister interface { // validatingAdmissionPolicyLister implements the ValidatingAdmissionPolicyLister interface. type validatingAdmissionPolicyLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.ValidatingAdmissionPolicy] } // NewValidatingAdmissionPolicyLister returns a new ValidatingAdmissionPolicyLister. func NewValidatingAdmissionPolicyLister(indexer cache.Indexer) ValidatingAdmissionPolicyLister { - return &validatingAdmissionPolicyLister{indexer: indexer} -} - -// List lists all ValidatingAdmissionPolicies in the indexer. -func (s *validatingAdmissionPolicyLister) List(selector labels.Selector) (ret []*v1beta1.ValidatingAdmissionPolicy, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.ValidatingAdmissionPolicy)) - }) - return ret, err -} - -// Get retrieves the ValidatingAdmissionPolicy from the index for a given name. -func (s *validatingAdmissionPolicyLister) Get(name string) (*v1beta1.ValidatingAdmissionPolicy, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("validatingadmissionpolicy"), name) - } - return obj.(*v1beta1.ValidatingAdmissionPolicy), nil + return &validatingAdmissionPolicyLister{listers.New[*v1beta1.ValidatingAdmissionPolicy](indexer, v1beta1.Resource("validatingadmissionpolicy"))} } diff --git a/listers/admissionregistration/v1beta1/validatingadmissionpolicybinding.go b/listers/admissionregistration/v1beta1/validatingadmissionpolicybinding.go index 5fcebfd22f..668d652bb7 100644 --- a/listers/admissionregistration/v1beta1/validatingadmissionpolicybinding.go +++ b/listers/admissionregistration/v1beta1/validatingadmissionpolicybinding.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/admissionregistration/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type ValidatingAdmissionPolicyBindingLister interface { // validatingAdmissionPolicyBindingLister implements the ValidatingAdmissionPolicyBindingLister interface. type validatingAdmissionPolicyBindingLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.ValidatingAdmissionPolicyBinding] } // NewValidatingAdmissionPolicyBindingLister returns a new ValidatingAdmissionPolicyBindingLister. func NewValidatingAdmissionPolicyBindingLister(indexer cache.Indexer) ValidatingAdmissionPolicyBindingLister { - return &validatingAdmissionPolicyBindingLister{indexer: indexer} -} - -// List lists all ValidatingAdmissionPolicyBindings in the indexer. -func (s *validatingAdmissionPolicyBindingLister) List(selector labels.Selector) (ret []*v1beta1.ValidatingAdmissionPolicyBinding, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.ValidatingAdmissionPolicyBinding)) - }) - return ret, err -} - -// Get retrieves the ValidatingAdmissionPolicyBinding from the index for a given name. -func (s *validatingAdmissionPolicyBindingLister) Get(name string) (*v1beta1.ValidatingAdmissionPolicyBinding, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("validatingadmissionpolicybinding"), name) - } - return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), nil + return &validatingAdmissionPolicyBindingLister{listers.New[*v1beta1.ValidatingAdmissionPolicyBinding](indexer, v1beta1.Resource("validatingadmissionpolicybinding"))} } diff --git a/listers/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/listers/admissionregistration/v1beta1/validatingwebhookconfiguration.go index 7c17fccb2e..16167d5738 100644 --- a/listers/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/listers/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/admissionregistration/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type ValidatingWebhookConfigurationLister interface { // validatingWebhookConfigurationLister implements the ValidatingWebhookConfigurationLister interface. type validatingWebhookConfigurationLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.ValidatingWebhookConfiguration] } // NewValidatingWebhookConfigurationLister returns a new ValidatingWebhookConfigurationLister. func NewValidatingWebhookConfigurationLister(indexer cache.Indexer) ValidatingWebhookConfigurationLister { - return &validatingWebhookConfigurationLister{indexer: indexer} -} - -// List lists all ValidatingWebhookConfigurations in the indexer. -func (s *validatingWebhookConfigurationLister) List(selector labels.Selector) (ret []*v1beta1.ValidatingWebhookConfiguration, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.ValidatingWebhookConfiguration)) - }) - return ret, err -} - -// Get retrieves the ValidatingWebhookConfiguration from the index for a given name. -func (s *validatingWebhookConfigurationLister) Get(name string) (*v1beta1.ValidatingWebhookConfiguration, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("validatingwebhookconfiguration"), name) - } - return obj.(*v1beta1.ValidatingWebhookConfiguration), nil + return &validatingWebhookConfigurationLister{listers.New[*v1beta1.ValidatingWebhookConfiguration](indexer, v1beta1.Resource("validatingwebhookconfiguration"))} } diff --git a/listers/apiserverinternal/v1alpha1/storageversion.go b/listers/apiserverinternal/v1alpha1/storageversion.go index 9a6d74b2bf..ce51b88f28 100644 --- a/listers/apiserverinternal/v1alpha1/storageversion.go +++ b/listers/apiserverinternal/v1alpha1/storageversion.go @@ -20,8 +20,8 @@ package v1alpha1 import ( v1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type StorageVersionLister interface { // storageVersionLister implements the StorageVersionLister interface. type storageVersionLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.StorageVersion] } // NewStorageVersionLister returns a new StorageVersionLister. func NewStorageVersionLister(indexer cache.Indexer) StorageVersionLister { - return &storageVersionLister{indexer: indexer} -} - -// List lists all StorageVersions in the indexer. -func (s *storageVersionLister) List(selector labels.Selector) (ret []*v1alpha1.StorageVersion, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.StorageVersion)) - }) - return ret, err -} - -// Get retrieves the StorageVersion from the index for a given name. -func (s *storageVersionLister) Get(name string) (*v1alpha1.StorageVersion, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("storageversion"), name) - } - return obj.(*v1alpha1.StorageVersion), nil + return &storageVersionLister{listers.New[*v1alpha1.StorageVersion](indexer, v1alpha1.Resource("storageversion"))} } diff --git a/listers/apps/v1/controllerrevision.go b/listers/apps/v1/controllerrevision.go index 9e2f973746..b9061b159e 100644 --- a/listers/apps/v1/controllerrevision.go +++ b/listers/apps/v1/controllerrevision.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/apps/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type ControllerRevisionLister interface { // controllerRevisionLister implements the ControllerRevisionLister interface. type controllerRevisionLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.ControllerRevision] } // NewControllerRevisionLister returns a new ControllerRevisionLister. func NewControllerRevisionLister(indexer cache.Indexer) ControllerRevisionLister { - return &controllerRevisionLister{indexer: indexer} -} - -// List lists all ControllerRevisions in the indexer. -func (s *controllerRevisionLister) List(selector labels.Selector) (ret []*v1.ControllerRevision, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ControllerRevision)) - }) - return ret, err + return &controllerRevisionLister{listers.New[*v1.ControllerRevision](indexer, v1.Resource("controllerrevision"))} } // ControllerRevisions returns an object that can list and get ControllerRevisions. func (s *controllerRevisionLister) ControllerRevisions(namespace string) ControllerRevisionNamespaceLister { - return controllerRevisionNamespaceLister{indexer: s.indexer, namespace: namespace} + return controllerRevisionNamespaceLister{listers.NewNamespaced[*v1.ControllerRevision](s.ResourceIndexer, namespace)} } // ControllerRevisionNamespaceLister helps list and get ControllerRevisions. @@ -74,26 +66,5 @@ type ControllerRevisionNamespaceLister interface { // controllerRevisionNamespaceLister implements the ControllerRevisionNamespaceLister // interface. type controllerRevisionNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ControllerRevisions in the indexer for a given namespace. -func (s controllerRevisionNamespaceLister) List(selector labels.Selector) (ret []*v1.ControllerRevision, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ControllerRevision)) - }) - return ret, err -} - -// Get retrieves the ControllerRevision from the indexer for a given namespace and name. -func (s controllerRevisionNamespaceLister) Get(name string) (*v1.ControllerRevision, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("controllerrevision"), name) - } - return obj.(*v1.ControllerRevision), nil + listers.ResourceIndexer[*v1.ControllerRevision] } diff --git a/listers/apps/v1/daemonset.go b/listers/apps/v1/daemonset.go index 061959e3da..4240cb6248 100644 --- a/listers/apps/v1/daemonset.go +++ b/listers/apps/v1/daemonset.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/apps/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type DaemonSetLister interface { // daemonSetLister implements the DaemonSetLister interface. type daemonSetLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.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 []*v1.DaemonSet, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.DaemonSet)) - }) - return ret, err + return &daemonSetLister{listers.New[*v1.DaemonSet](indexer, v1.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[*v1.DaemonSet](s.ResourceIndexer, namespace)} } // DaemonSetNamespaceLister helps list and get DaemonSets. @@ -74,26 +66,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 []*v1.DaemonSet, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.DaemonSet)) - }) - return ret, err -} - -// Get retrieves the DaemonSet from the indexer for a given namespace and name. -func (s daemonSetNamespaceLister) Get(name string) (*v1.DaemonSet, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("daemonset"), name) - } - return obj.(*v1.DaemonSet), nil + listers.ResourceIndexer[*v1.DaemonSet] } diff --git a/listers/apps/v1/deployment.go b/listers/apps/v1/deployment.go index 7704034172..3337026b73 100644 --- a/listers/apps/v1/deployment.go +++ b/listers/apps/v1/deployment.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/apps/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type DeploymentLister interface { // deploymentLister implements the DeploymentLister interface. type deploymentLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Deployment] } // NewDeploymentLister returns a new DeploymentLister. func NewDeploymentLister(indexer cache.Indexer) DeploymentLister { - return &deploymentLister{indexer: indexer} -} - -// List lists all Deployments in the indexer. -func (s *deploymentLister) List(selector labels.Selector) (ret []*v1.Deployment, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Deployment)) - }) - return ret, err + return &deploymentLister{listers.New[*v1.Deployment](indexer, v1.Resource("deployment"))} } // Deployments returns an object that can list and get Deployments. func (s *deploymentLister) Deployments(namespace string) DeploymentNamespaceLister { - return deploymentNamespaceLister{indexer: s.indexer, namespace: namespace} + return deploymentNamespaceLister{listers.NewNamespaced[*v1.Deployment](s.ResourceIndexer, namespace)} } // DeploymentNamespaceLister helps list and get Deployments. @@ -74,26 +66,5 @@ type DeploymentNamespaceLister interface { // deploymentNamespaceLister implements the DeploymentNamespaceLister // interface. type deploymentNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Deployments in the indexer for a given namespace. -func (s deploymentNamespaceLister) List(selector labels.Selector) (ret []*v1.Deployment, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Deployment)) - }) - return ret, err -} - -// Get retrieves the Deployment from the indexer for a given namespace and name. -func (s deploymentNamespaceLister) Get(name string) (*v1.Deployment, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("deployment"), name) - } - return obj.(*v1.Deployment), nil + listers.ResourceIndexer[*v1.Deployment] } diff --git a/listers/apps/v1/replicaset.go b/listers/apps/v1/replicaset.go index 3ca7757eb9..244df1d33f 100644 --- a/listers/apps/v1/replicaset.go +++ b/listers/apps/v1/replicaset.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/apps/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type ReplicaSetLister interface { // replicaSetLister implements the ReplicaSetLister interface. type replicaSetLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.ReplicaSet] } // NewReplicaSetLister returns a new ReplicaSetLister. func NewReplicaSetLister(indexer cache.Indexer) ReplicaSetLister { - return &replicaSetLister{indexer: indexer} -} - -// List lists all ReplicaSets in the indexer. -func (s *replicaSetLister) List(selector labels.Selector) (ret []*v1.ReplicaSet, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ReplicaSet)) - }) - return ret, err + return &replicaSetLister{listers.New[*v1.ReplicaSet](indexer, v1.Resource("replicaset"))} } // ReplicaSets returns an object that can list and get ReplicaSets. func (s *replicaSetLister) ReplicaSets(namespace string) ReplicaSetNamespaceLister { - return replicaSetNamespaceLister{indexer: s.indexer, namespace: namespace} + return replicaSetNamespaceLister{listers.NewNamespaced[*v1.ReplicaSet](s.ResourceIndexer, namespace)} } // ReplicaSetNamespaceLister helps list and get ReplicaSets. @@ -74,26 +66,5 @@ type ReplicaSetNamespaceLister interface { // replicaSetNamespaceLister implements the ReplicaSetNamespaceLister // interface. type replicaSetNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ReplicaSets in the indexer for a given namespace. -func (s replicaSetNamespaceLister) List(selector labels.Selector) (ret []*v1.ReplicaSet, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ReplicaSet)) - }) - return ret, err -} - -// Get retrieves the ReplicaSet from the indexer for a given namespace and name. -func (s replicaSetNamespaceLister) Get(name string) (*v1.ReplicaSet, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("replicaset"), name) - } - return obj.(*v1.ReplicaSet), nil + listers.ResourceIndexer[*v1.ReplicaSet] } diff --git a/listers/apps/v1/statefulset.go b/listers/apps/v1/statefulset.go index f6899d5ff9..a8dc1b022a 100644 --- a/listers/apps/v1/statefulset.go +++ b/listers/apps/v1/statefulset.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/apps/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type StatefulSetLister interface { // statefulSetLister implements the StatefulSetLister interface. type statefulSetLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.StatefulSet] } // NewStatefulSetLister returns a new StatefulSetLister. func NewStatefulSetLister(indexer cache.Indexer) StatefulSetLister { - return &statefulSetLister{indexer: indexer} -} - -// List lists all StatefulSets in the indexer. -func (s *statefulSetLister) List(selector labels.Selector) (ret []*v1.StatefulSet, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.StatefulSet)) - }) - return ret, err + return &statefulSetLister{listers.New[*v1.StatefulSet](indexer, v1.Resource("statefulset"))} } // StatefulSets returns an object that can list and get StatefulSets. func (s *statefulSetLister) StatefulSets(namespace string) StatefulSetNamespaceLister { - return statefulSetNamespaceLister{indexer: s.indexer, namespace: namespace} + return statefulSetNamespaceLister{listers.NewNamespaced[*v1.StatefulSet](s.ResourceIndexer, namespace)} } // StatefulSetNamespaceLister helps list and get StatefulSets. @@ -74,26 +66,5 @@ type StatefulSetNamespaceLister interface { // statefulSetNamespaceLister implements the StatefulSetNamespaceLister // interface. type statefulSetNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all StatefulSets in the indexer for a given namespace. -func (s statefulSetNamespaceLister) List(selector labels.Selector) (ret []*v1.StatefulSet, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.StatefulSet)) - }) - return ret, err -} - -// Get retrieves the StatefulSet from the indexer for a given namespace and name. -func (s statefulSetNamespaceLister) Get(name string) (*v1.StatefulSet, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("statefulset"), name) - } - return obj.(*v1.StatefulSet), nil + listers.ResourceIndexer[*v1.StatefulSet] } diff --git a/listers/apps/v1beta1/controllerrevision.go b/listers/apps/v1beta1/controllerrevision.go index fc73de723f..c5e8fb3735 100644 --- a/listers/apps/v1beta1/controllerrevision.go +++ b/listers/apps/v1beta1/controllerrevision.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/apps/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type ControllerRevisionLister interface { // controllerRevisionLister implements the ControllerRevisionLister interface. type controllerRevisionLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.ControllerRevision] } // NewControllerRevisionLister returns a new ControllerRevisionLister. func NewControllerRevisionLister(indexer cache.Indexer) ControllerRevisionLister { - return &controllerRevisionLister{indexer: indexer} -} - -// List lists all ControllerRevisions in the indexer. -func (s *controllerRevisionLister) List(selector labels.Selector) (ret []*v1beta1.ControllerRevision, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.ControllerRevision)) - }) - return ret, err + return &controllerRevisionLister{listers.New[*v1beta1.ControllerRevision](indexer, v1beta1.Resource("controllerrevision"))} } // ControllerRevisions returns an object that can list and get ControllerRevisions. func (s *controllerRevisionLister) ControllerRevisions(namespace string) ControllerRevisionNamespaceLister { - return controllerRevisionNamespaceLister{indexer: s.indexer, namespace: namespace} + return controllerRevisionNamespaceLister{listers.NewNamespaced[*v1beta1.ControllerRevision](s.ResourceIndexer, namespace)} } // ControllerRevisionNamespaceLister helps list and get ControllerRevisions. @@ -74,26 +66,5 @@ type ControllerRevisionNamespaceLister interface { // controllerRevisionNamespaceLister implements the ControllerRevisionNamespaceLister // interface. type controllerRevisionNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ControllerRevisions in the indexer for a given namespace. -func (s controllerRevisionNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.ControllerRevision, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.ControllerRevision)) - }) - return ret, err -} - -// Get retrieves the ControllerRevision from the indexer for a given namespace and name. -func (s controllerRevisionNamespaceLister) Get(name string) (*v1beta1.ControllerRevision, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("controllerrevision"), name) - } - return obj.(*v1beta1.ControllerRevision), nil + listers.ResourceIndexer[*v1beta1.ControllerRevision] } diff --git a/listers/apps/v1beta1/deployment.go b/listers/apps/v1beta1/deployment.go index 3fb70794ca..1bc6d45ad0 100644 --- a/listers/apps/v1beta1/deployment.go +++ b/listers/apps/v1beta1/deployment.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/apps/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type DeploymentLister interface { // deploymentLister implements the DeploymentLister interface. type deploymentLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.Deployment] } // NewDeploymentLister returns a new DeploymentLister. func NewDeploymentLister(indexer cache.Indexer) DeploymentLister { - return &deploymentLister{indexer: indexer} -} - -// List lists all Deployments in the indexer. -func (s *deploymentLister) List(selector labels.Selector) (ret []*v1beta1.Deployment, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Deployment)) - }) - return ret, err + return &deploymentLister{listers.New[*v1beta1.Deployment](indexer, v1beta1.Resource("deployment"))} } // Deployments returns an object that can list and get Deployments. func (s *deploymentLister) Deployments(namespace string) DeploymentNamespaceLister { - return deploymentNamespaceLister{indexer: s.indexer, namespace: namespace} + return deploymentNamespaceLister{listers.NewNamespaced[*v1beta1.Deployment](s.ResourceIndexer, namespace)} } // DeploymentNamespaceLister helps list and get Deployments. @@ -74,26 +66,5 @@ type DeploymentNamespaceLister interface { // deploymentNamespaceLister implements the DeploymentNamespaceLister // interface. type deploymentNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Deployments in the indexer for a given namespace. -func (s deploymentNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Deployment, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Deployment)) - }) - return ret, err -} - -// Get retrieves the Deployment from the indexer for a given namespace and name. -func (s deploymentNamespaceLister) Get(name string) (*v1beta1.Deployment, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("deployment"), name) - } - return obj.(*v1beta1.Deployment), nil + listers.ResourceIndexer[*v1beta1.Deployment] } diff --git a/listers/apps/v1beta1/statefulset.go b/listers/apps/v1beta1/statefulset.go index e3556bc398..4bf103aef7 100644 --- a/listers/apps/v1beta1/statefulset.go +++ b/listers/apps/v1beta1/statefulset.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/apps/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type StatefulSetLister interface { // statefulSetLister implements the StatefulSetLister interface. type statefulSetLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.StatefulSet] } // NewStatefulSetLister returns a new StatefulSetLister. func NewStatefulSetLister(indexer cache.Indexer) StatefulSetLister { - return &statefulSetLister{indexer: indexer} -} - -// List lists all StatefulSets in the indexer. -func (s *statefulSetLister) List(selector labels.Selector) (ret []*v1beta1.StatefulSet, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.StatefulSet)) - }) - return ret, err + return &statefulSetLister{listers.New[*v1beta1.StatefulSet](indexer, v1beta1.Resource("statefulset"))} } // StatefulSets returns an object that can list and get StatefulSets. func (s *statefulSetLister) StatefulSets(namespace string) StatefulSetNamespaceLister { - return statefulSetNamespaceLister{indexer: s.indexer, namespace: namespace} + return statefulSetNamespaceLister{listers.NewNamespaced[*v1beta1.StatefulSet](s.ResourceIndexer, namespace)} } // StatefulSetNamespaceLister helps list and get StatefulSets. @@ -74,26 +66,5 @@ type StatefulSetNamespaceLister interface { // statefulSetNamespaceLister implements the StatefulSetNamespaceLister // interface. type statefulSetNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all StatefulSets in the indexer for a given namespace. -func (s statefulSetNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.StatefulSet, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.StatefulSet)) - }) - return ret, err -} - -// Get retrieves the StatefulSet from the indexer for a given namespace and name. -func (s statefulSetNamespaceLister) Get(name string) (*v1beta1.StatefulSet, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("statefulset"), name) - } - return obj.(*v1beta1.StatefulSet), nil + listers.ResourceIndexer[*v1beta1.StatefulSet] } diff --git a/listers/apps/v1beta2/controllerrevision.go b/listers/apps/v1beta2/controllerrevision.go index da2ce86005..de941bc691 100644 --- a/listers/apps/v1beta2/controllerrevision.go +++ b/listers/apps/v1beta2/controllerrevision.go @@ -20,8 +20,8 @@ package v1beta2 import ( v1beta2 "k8s.io/api/apps/v1beta2" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type ControllerRevisionLister interface { // controllerRevisionLister implements the ControllerRevisionLister interface. type controllerRevisionLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta2.ControllerRevision] } // NewControllerRevisionLister returns a new ControllerRevisionLister. func NewControllerRevisionLister(indexer cache.Indexer) ControllerRevisionLister { - return &controllerRevisionLister{indexer: indexer} -} - -// List lists all ControllerRevisions in the indexer. -func (s *controllerRevisionLister) List(selector labels.Selector) (ret []*v1beta2.ControllerRevision, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta2.ControllerRevision)) - }) - return ret, err + return &controllerRevisionLister{listers.New[*v1beta2.ControllerRevision](indexer, v1beta2.Resource("controllerrevision"))} } // ControllerRevisions returns an object that can list and get ControllerRevisions. func (s *controllerRevisionLister) ControllerRevisions(namespace string) ControllerRevisionNamespaceLister { - return controllerRevisionNamespaceLister{indexer: s.indexer, namespace: namespace} + return controllerRevisionNamespaceLister{listers.NewNamespaced[*v1beta2.ControllerRevision](s.ResourceIndexer, namespace)} } // ControllerRevisionNamespaceLister helps list and get ControllerRevisions. @@ -74,26 +66,5 @@ type ControllerRevisionNamespaceLister interface { // controllerRevisionNamespaceLister implements the ControllerRevisionNamespaceLister // interface. type controllerRevisionNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ControllerRevisions in the indexer for a given namespace. -func (s controllerRevisionNamespaceLister) List(selector labels.Selector) (ret []*v1beta2.ControllerRevision, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta2.ControllerRevision)) - }) - return ret, err -} - -// Get retrieves the ControllerRevision from the indexer for a given namespace and name. -func (s controllerRevisionNamespaceLister) Get(name string) (*v1beta2.ControllerRevision, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta2.Resource("controllerrevision"), name) - } - return obj.(*v1beta2.ControllerRevision), nil + listers.ResourceIndexer[*v1beta2.ControllerRevision] } diff --git a/listers/apps/v1beta2/daemonset.go b/listers/apps/v1beta2/daemonset.go index 4b7aedd758..37784fe888 100644 --- a/listers/apps/v1beta2/daemonset.go +++ b/listers/apps/v1beta2/daemonset.go @@ -20,8 +20,8 @@ package v1beta2 import ( v1beta2 "k8s.io/api/apps/v1beta2" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type DaemonSetLister interface { // daemonSetLister implements the DaemonSetLister interface. type daemonSetLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta2.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 []*v1beta2.DaemonSet, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta2.DaemonSet)) - }) - return ret, err + return &daemonSetLister{listers.New[*v1beta2.DaemonSet](indexer, v1beta2.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[*v1beta2.DaemonSet](s.ResourceIndexer, namespace)} } // DaemonSetNamespaceLister helps list and get DaemonSets. @@ -74,26 +66,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 []*v1beta2.DaemonSet, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta2.DaemonSet)) - }) - return ret, err -} - -// Get retrieves the DaemonSet from the indexer for a given namespace and name. -func (s daemonSetNamespaceLister) Get(name string) (*v1beta2.DaemonSet, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta2.Resource("daemonset"), name) - } - return obj.(*v1beta2.DaemonSet), nil + listers.ResourceIndexer[*v1beta2.DaemonSet] } diff --git a/listers/apps/v1beta2/deployment.go b/listers/apps/v1beta2/deployment.go index c2857bbc36..75acc1693e 100644 --- a/listers/apps/v1beta2/deployment.go +++ b/listers/apps/v1beta2/deployment.go @@ -20,8 +20,8 @@ package v1beta2 import ( v1beta2 "k8s.io/api/apps/v1beta2" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type DeploymentLister interface { // deploymentLister implements the DeploymentLister interface. type deploymentLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta2.Deployment] } // NewDeploymentLister returns a new DeploymentLister. func NewDeploymentLister(indexer cache.Indexer) DeploymentLister { - return &deploymentLister{indexer: indexer} -} - -// List lists all Deployments in the indexer. -func (s *deploymentLister) List(selector labels.Selector) (ret []*v1beta2.Deployment, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta2.Deployment)) - }) - return ret, err + return &deploymentLister{listers.New[*v1beta2.Deployment](indexer, v1beta2.Resource("deployment"))} } // Deployments returns an object that can list and get Deployments. func (s *deploymentLister) Deployments(namespace string) DeploymentNamespaceLister { - return deploymentNamespaceLister{indexer: s.indexer, namespace: namespace} + return deploymentNamespaceLister{listers.NewNamespaced[*v1beta2.Deployment](s.ResourceIndexer, namespace)} } // DeploymentNamespaceLister helps list and get Deployments. @@ -74,26 +66,5 @@ type DeploymentNamespaceLister interface { // deploymentNamespaceLister implements the DeploymentNamespaceLister // interface. type deploymentNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Deployments in the indexer for a given namespace. -func (s deploymentNamespaceLister) List(selector labels.Selector) (ret []*v1beta2.Deployment, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta2.Deployment)) - }) - return ret, err -} - -// Get retrieves the Deployment from the indexer for a given namespace and name. -func (s deploymentNamespaceLister) Get(name string) (*v1beta2.Deployment, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta2.Resource("deployment"), name) - } - return obj.(*v1beta2.Deployment), nil + listers.ResourceIndexer[*v1beta2.Deployment] } diff --git a/listers/apps/v1beta2/replicaset.go b/listers/apps/v1beta2/replicaset.go index 26b350ce8f..37ea97630e 100644 --- a/listers/apps/v1beta2/replicaset.go +++ b/listers/apps/v1beta2/replicaset.go @@ -20,8 +20,8 @@ package v1beta2 import ( v1beta2 "k8s.io/api/apps/v1beta2" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type ReplicaSetLister interface { // replicaSetLister implements the ReplicaSetLister interface. type replicaSetLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta2.ReplicaSet] } // NewReplicaSetLister returns a new ReplicaSetLister. func NewReplicaSetLister(indexer cache.Indexer) ReplicaSetLister { - return &replicaSetLister{indexer: indexer} -} - -// List lists all ReplicaSets in the indexer. -func (s *replicaSetLister) List(selector labels.Selector) (ret []*v1beta2.ReplicaSet, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta2.ReplicaSet)) - }) - return ret, err + return &replicaSetLister{listers.New[*v1beta2.ReplicaSet](indexer, v1beta2.Resource("replicaset"))} } // ReplicaSets returns an object that can list and get ReplicaSets. func (s *replicaSetLister) ReplicaSets(namespace string) ReplicaSetNamespaceLister { - return replicaSetNamespaceLister{indexer: s.indexer, namespace: namespace} + return replicaSetNamespaceLister{listers.NewNamespaced[*v1beta2.ReplicaSet](s.ResourceIndexer, namespace)} } // ReplicaSetNamespaceLister helps list and get ReplicaSets. @@ -74,26 +66,5 @@ type ReplicaSetNamespaceLister interface { // replicaSetNamespaceLister implements the ReplicaSetNamespaceLister // interface. type replicaSetNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ReplicaSets in the indexer for a given namespace. -func (s replicaSetNamespaceLister) List(selector labels.Selector) (ret []*v1beta2.ReplicaSet, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta2.ReplicaSet)) - }) - return ret, err -} - -// Get retrieves the ReplicaSet from the indexer for a given namespace and name. -func (s replicaSetNamespaceLister) Get(name string) (*v1beta2.ReplicaSet, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta2.Resource("replicaset"), name) - } - return obj.(*v1beta2.ReplicaSet), nil + listers.ResourceIndexer[*v1beta2.ReplicaSet] } diff --git a/listers/apps/v1beta2/statefulset.go b/listers/apps/v1beta2/statefulset.go index fbbaf0133f..cc48a1473c 100644 --- a/listers/apps/v1beta2/statefulset.go +++ b/listers/apps/v1beta2/statefulset.go @@ -20,8 +20,8 @@ package v1beta2 import ( v1beta2 "k8s.io/api/apps/v1beta2" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type StatefulSetLister interface { // statefulSetLister implements the StatefulSetLister interface. type statefulSetLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta2.StatefulSet] } // NewStatefulSetLister returns a new StatefulSetLister. func NewStatefulSetLister(indexer cache.Indexer) StatefulSetLister { - return &statefulSetLister{indexer: indexer} -} - -// List lists all StatefulSets in the indexer. -func (s *statefulSetLister) List(selector labels.Selector) (ret []*v1beta2.StatefulSet, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta2.StatefulSet)) - }) - return ret, err + return &statefulSetLister{listers.New[*v1beta2.StatefulSet](indexer, v1beta2.Resource("statefulset"))} } // StatefulSets returns an object that can list and get StatefulSets. func (s *statefulSetLister) StatefulSets(namespace string) StatefulSetNamespaceLister { - return statefulSetNamespaceLister{indexer: s.indexer, namespace: namespace} + return statefulSetNamespaceLister{listers.NewNamespaced[*v1beta2.StatefulSet](s.ResourceIndexer, namespace)} } // StatefulSetNamespaceLister helps list and get StatefulSets. @@ -74,26 +66,5 @@ type StatefulSetNamespaceLister interface { // statefulSetNamespaceLister implements the StatefulSetNamespaceLister // interface. type statefulSetNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all StatefulSets in the indexer for a given namespace. -func (s statefulSetNamespaceLister) List(selector labels.Selector) (ret []*v1beta2.StatefulSet, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta2.StatefulSet)) - }) - return ret, err -} - -// Get retrieves the StatefulSet from the indexer for a given namespace and name. -func (s statefulSetNamespaceLister) Get(name string) (*v1beta2.StatefulSet, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta2.Resource("statefulset"), name) - } - return obj.(*v1beta2.StatefulSet), nil + listers.ResourceIndexer[*v1beta2.StatefulSet] } diff --git a/listers/autoscaling/v1/horizontalpodautoscaler.go b/listers/autoscaling/v1/horizontalpodautoscaler.go index 8447f059d4..2cd4cc87bf 100644 --- a/listers/autoscaling/v1/horizontalpodautoscaler.go +++ b/listers/autoscaling/v1/horizontalpodautoscaler.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/autoscaling/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type HorizontalPodAutoscalerLister interface { // horizontalPodAutoscalerLister implements the HorizontalPodAutoscalerLister interface. type horizontalPodAutoscalerLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.HorizontalPodAutoscaler] } // NewHorizontalPodAutoscalerLister returns a new HorizontalPodAutoscalerLister. func NewHorizontalPodAutoscalerLister(indexer cache.Indexer) HorizontalPodAutoscalerLister { - return &horizontalPodAutoscalerLister{indexer: indexer} -} - -// List lists all HorizontalPodAutoscalers in the indexer. -func (s *horizontalPodAutoscalerLister) List(selector labels.Selector) (ret []*v1.HorizontalPodAutoscaler, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.HorizontalPodAutoscaler)) - }) - return ret, err + return &horizontalPodAutoscalerLister{listers.New[*v1.HorizontalPodAutoscaler](indexer, v1.Resource("horizontalpodautoscaler"))} } // HorizontalPodAutoscalers returns an object that can list and get HorizontalPodAutoscalers. func (s *horizontalPodAutoscalerLister) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerNamespaceLister { - return horizontalPodAutoscalerNamespaceLister{indexer: s.indexer, namespace: namespace} + return horizontalPodAutoscalerNamespaceLister{listers.NewNamespaced[*v1.HorizontalPodAutoscaler](s.ResourceIndexer, namespace)} } // HorizontalPodAutoscalerNamespaceLister helps list and get HorizontalPodAutoscalers. @@ -74,26 +66,5 @@ type HorizontalPodAutoscalerNamespaceLister interface { // horizontalPodAutoscalerNamespaceLister implements the HorizontalPodAutoscalerNamespaceLister // interface. type horizontalPodAutoscalerNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all HorizontalPodAutoscalers in the indexer for a given namespace. -func (s horizontalPodAutoscalerNamespaceLister) List(selector labels.Selector) (ret []*v1.HorizontalPodAutoscaler, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.HorizontalPodAutoscaler)) - }) - return ret, err -} - -// Get retrieves the HorizontalPodAutoscaler from the indexer for a given namespace and name. -func (s horizontalPodAutoscalerNamespaceLister) Get(name string) (*v1.HorizontalPodAutoscaler, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("horizontalpodautoscaler"), name) - } - return obj.(*v1.HorizontalPodAutoscaler), nil + listers.ResourceIndexer[*v1.HorizontalPodAutoscaler] } diff --git a/listers/autoscaling/v2/horizontalpodautoscaler.go b/listers/autoscaling/v2/horizontalpodautoscaler.go index a5cef27725..7c2806af21 100644 --- a/listers/autoscaling/v2/horizontalpodautoscaler.go +++ b/listers/autoscaling/v2/horizontalpodautoscaler.go @@ -20,8 +20,8 @@ package v2 import ( v2 "k8s.io/api/autoscaling/v2" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type HorizontalPodAutoscalerLister interface { // horizontalPodAutoscalerLister implements the HorizontalPodAutoscalerLister interface. type horizontalPodAutoscalerLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v2.HorizontalPodAutoscaler] } // NewHorizontalPodAutoscalerLister returns a new HorizontalPodAutoscalerLister. func NewHorizontalPodAutoscalerLister(indexer cache.Indexer) HorizontalPodAutoscalerLister { - return &horizontalPodAutoscalerLister{indexer: indexer} -} - -// List lists all HorizontalPodAutoscalers in the indexer. -func (s *horizontalPodAutoscalerLister) List(selector labels.Selector) (ret []*v2.HorizontalPodAutoscaler, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v2.HorizontalPodAutoscaler)) - }) - return ret, err + return &horizontalPodAutoscalerLister{listers.New[*v2.HorizontalPodAutoscaler](indexer, v2.Resource("horizontalpodautoscaler"))} } // HorizontalPodAutoscalers returns an object that can list and get HorizontalPodAutoscalers. func (s *horizontalPodAutoscalerLister) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerNamespaceLister { - return horizontalPodAutoscalerNamespaceLister{indexer: s.indexer, namespace: namespace} + return horizontalPodAutoscalerNamespaceLister{listers.NewNamespaced[*v2.HorizontalPodAutoscaler](s.ResourceIndexer, namespace)} } // HorizontalPodAutoscalerNamespaceLister helps list and get HorizontalPodAutoscalers. @@ -74,26 +66,5 @@ type HorizontalPodAutoscalerNamespaceLister interface { // horizontalPodAutoscalerNamespaceLister implements the HorizontalPodAutoscalerNamespaceLister // interface. type horizontalPodAutoscalerNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all HorizontalPodAutoscalers in the indexer for a given namespace. -func (s horizontalPodAutoscalerNamespaceLister) List(selector labels.Selector) (ret []*v2.HorizontalPodAutoscaler, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v2.HorizontalPodAutoscaler)) - }) - return ret, err -} - -// Get retrieves the HorizontalPodAutoscaler from the indexer for a given namespace and name. -func (s horizontalPodAutoscalerNamespaceLister) Get(name string) (*v2.HorizontalPodAutoscaler, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v2.Resource("horizontalpodautoscaler"), name) - } - return obj.(*v2.HorizontalPodAutoscaler), nil + listers.ResourceIndexer[*v2.HorizontalPodAutoscaler] } diff --git a/listers/autoscaling/v2beta1/horizontalpodautoscaler.go b/listers/autoscaling/v2beta1/horizontalpodautoscaler.go index f1804e995b..a2befd6062 100644 --- a/listers/autoscaling/v2beta1/horizontalpodautoscaler.go +++ b/listers/autoscaling/v2beta1/horizontalpodautoscaler.go @@ -20,8 +20,8 @@ package v2beta1 import ( v2beta1 "k8s.io/api/autoscaling/v2beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type HorizontalPodAutoscalerLister interface { // horizontalPodAutoscalerLister implements the HorizontalPodAutoscalerLister interface. type horizontalPodAutoscalerLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v2beta1.HorizontalPodAutoscaler] } // NewHorizontalPodAutoscalerLister returns a new HorizontalPodAutoscalerLister. func NewHorizontalPodAutoscalerLister(indexer cache.Indexer) HorizontalPodAutoscalerLister { - return &horizontalPodAutoscalerLister{indexer: indexer} -} - -// List lists all HorizontalPodAutoscalers in the indexer. -func (s *horizontalPodAutoscalerLister) List(selector labels.Selector) (ret []*v2beta1.HorizontalPodAutoscaler, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v2beta1.HorizontalPodAutoscaler)) - }) - return ret, err + return &horizontalPodAutoscalerLister{listers.New[*v2beta1.HorizontalPodAutoscaler](indexer, v2beta1.Resource("horizontalpodautoscaler"))} } // HorizontalPodAutoscalers returns an object that can list and get HorizontalPodAutoscalers. func (s *horizontalPodAutoscalerLister) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerNamespaceLister { - return horizontalPodAutoscalerNamespaceLister{indexer: s.indexer, namespace: namespace} + return horizontalPodAutoscalerNamespaceLister{listers.NewNamespaced[*v2beta1.HorizontalPodAutoscaler](s.ResourceIndexer, namespace)} } // HorizontalPodAutoscalerNamespaceLister helps list and get HorizontalPodAutoscalers. @@ -74,26 +66,5 @@ type HorizontalPodAutoscalerNamespaceLister interface { // horizontalPodAutoscalerNamespaceLister implements the HorizontalPodAutoscalerNamespaceLister // interface. type horizontalPodAutoscalerNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all HorizontalPodAutoscalers in the indexer for a given namespace. -func (s horizontalPodAutoscalerNamespaceLister) List(selector labels.Selector) (ret []*v2beta1.HorizontalPodAutoscaler, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v2beta1.HorizontalPodAutoscaler)) - }) - return ret, err -} - -// Get retrieves the HorizontalPodAutoscaler from the indexer for a given namespace and name. -func (s horizontalPodAutoscalerNamespaceLister) Get(name string) (*v2beta1.HorizontalPodAutoscaler, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v2beta1.Resource("horizontalpodautoscaler"), name) - } - return obj.(*v2beta1.HorizontalPodAutoscaler), nil + listers.ResourceIndexer[*v2beta1.HorizontalPodAutoscaler] } diff --git a/listers/autoscaling/v2beta2/horizontalpodautoscaler.go b/listers/autoscaling/v2beta2/horizontalpodautoscaler.go index b0dbaf9eb0..52bae849ba 100644 --- a/listers/autoscaling/v2beta2/horizontalpodautoscaler.go +++ b/listers/autoscaling/v2beta2/horizontalpodautoscaler.go @@ -20,8 +20,8 @@ package v2beta2 import ( v2beta2 "k8s.io/api/autoscaling/v2beta2" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type HorizontalPodAutoscalerLister interface { // horizontalPodAutoscalerLister implements the HorizontalPodAutoscalerLister interface. type horizontalPodAutoscalerLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v2beta2.HorizontalPodAutoscaler] } // NewHorizontalPodAutoscalerLister returns a new HorizontalPodAutoscalerLister. func NewHorizontalPodAutoscalerLister(indexer cache.Indexer) HorizontalPodAutoscalerLister { - return &horizontalPodAutoscalerLister{indexer: indexer} -} - -// List lists all HorizontalPodAutoscalers in the indexer. -func (s *horizontalPodAutoscalerLister) List(selector labels.Selector) (ret []*v2beta2.HorizontalPodAutoscaler, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v2beta2.HorizontalPodAutoscaler)) - }) - return ret, err + return &horizontalPodAutoscalerLister{listers.New[*v2beta2.HorizontalPodAutoscaler](indexer, v2beta2.Resource("horizontalpodautoscaler"))} } // HorizontalPodAutoscalers returns an object that can list and get HorizontalPodAutoscalers. func (s *horizontalPodAutoscalerLister) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerNamespaceLister { - return horizontalPodAutoscalerNamespaceLister{indexer: s.indexer, namespace: namespace} + return horizontalPodAutoscalerNamespaceLister{listers.NewNamespaced[*v2beta2.HorizontalPodAutoscaler](s.ResourceIndexer, namespace)} } // HorizontalPodAutoscalerNamespaceLister helps list and get HorizontalPodAutoscalers. @@ -74,26 +66,5 @@ type HorizontalPodAutoscalerNamespaceLister interface { // horizontalPodAutoscalerNamespaceLister implements the HorizontalPodAutoscalerNamespaceLister // interface. type horizontalPodAutoscalerNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all HorizontalPodAutoscalers in the indexer for a given namespace. -func (s horizontalPodAutoscalerNamespaceLister) List(selector labels.Selector) (ret []*v2beta2.HorizontalPodAutoscaler, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v2beta2.HorizontalPodAutoscaler)) - }) - return ret, err -} - -// Get retrieves the HorizontalPodAutoscaler from the indexer for a given namespace and name. -func (s horizontalPodAutoscalerNamespaceLister) Get(name string) (*v2beta2.HorizontalPodAutoscaler, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v2beta2.Resource("horizontalpodautoscaler"), name) - } - return obj.(*v2beta2.HorizontalPodAutoscaler), nil + listers.ResourceIndexer[*v2beta2.HorizontalPodAutoscaler] } diff --git a/listers/batch/v1/cronjob.go b/listers/batch/v1/cronjob.go index 8e49ed959f..a7a3abbfa3 100644 --- a/listers/batch/v1/cronjob.go +++ b/listers/batch/v1/cronjob.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/batch/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type CronJobLister interface { // cronJobLister implements the CronJobLister interface. type cronJobLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.CronJob] } // NewCronJobLister returns a new CronJobLister. func NewCronJobLister(indexer cache.Indexer) CronJobLister { - return &cronJobLister{indexer: indexer} -} - -// List lists all CronJobs in the indexer. -func (s *cronJobLister) List(selector labels.Selector) (ret []*v1.CronJob, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.CronJob)) - }) - return ret, err + return &cronJobLister{listers.New[*v1.CronJob](indexer, v1.Resource("cronjob"))} } // CronJobs returns an object that can list and get CronJobs. func (s *cronJobLister) CronJobs(namespace string) CronJobNamespaceLister { - return cronJobNamespaceLister{indexer: s.indexer, namespace: namespace} + return cronJobNamespaceLister{listers.NewNamespaced[*v1.CronJob](s.ResourceIndexer, namespace)} } // CronJobNamespaceLister helps list and get CronJobs. @@ -74,26 +66,5 @@ type CronJobNamespaceLister interface { // cronJobNamespaceLister implements the CronJobNamespaceLister // interface. type cronJobNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all CronJobs in the indexer for a given namespace. -func (s cronJobNamespaceLister) List(selector labels.Selector) (ret []*v1.CronJob, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.CronJob)) - }) - return ret, err -} - -// Get retrieves the CronJob from the indexer for a given namespace and name. -func (s cronJobNamespaceLister) Get(name string) (*v1.CronJob, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("cronjob"), name) - } - return obj.(*v1.CronJob), nil + listers.ResourceIndexer[*v1.CronJob] } diff --git a/listers/batch/v1/job.go b/listers/batch/v1/job.go index 3aba6b95fa..4078a9f7d8 100644 --- a/listers/batch/v1/job.go +++ b/listers/batch/v1/job.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/batch/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type JobLister interface { // jobLister implements the JobLister interface. type jobLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Job] } // NewJobLister returns a new JobLister. func NewJobLister(indexer cache.Indexer) JobLister { - return &jobLister{indexer: indexer} -} - -// List lists all Jobs in the indexer. -func (s *jobLister) List(selector labels.Selector) (ret []*v1.Job, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Job)) - }) - return ret, err + return &jobLister{listers.New[*v1.Job](indexer, v1.Resource("job"))} } // Jobs returns an object that can list and get Jobs. func (s *jobLister) Jobs(namespace string) JobNamespaceLister { - return jobNamespaceLister{indexer: s.indexer, namespace: namespace} + return jobNamespaceLister{listers.NewNamespaced[*v1.Job](s.ResourceIndexer, namespace)} } // JobNamespaceLister helps list and get Jobs. @@ -74,26 +66,5 @@ type JobNamespaceLister interface { // jobNamespaceLister implements the JobNamespaceLister // interface. type jobNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Jobs in the indexer for a given namespace. -func (s jobNamespaceLister) List(selector labels.Selector) (ret []*v1.Job, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Job)) - }) - return ret, err -} - -// Get retrieves the Job from the indexer for a given namespace and name. -func (s jobNamespaceLister) Get(name string) (*v1.Job, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("job"), name) - } - return obj.(*v1.Job), nil + listers.ResourceIndexer[*v1.Job] } diff --git a/listers/batch/v1beta1/cronjob.go b/listers/batch/v1beta1/cronjob.go index 4842d5e5a1..33ed8219e3 100644 --- a/listers/batch/v1beta1/cronjob.go +++ b/listers/batch/v1beta1/cronjob.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/batch/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type CronJobLister interface { // cronJobLister implements the CronJobLister interface. type cronJobLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.CronJob] } // NewCronJobLister returns a new CronJobLister. func NewCronJobLister(indexer cache.Indexer) CronJobLister { - return &cronJobLister{indexer: indexer} -} - -// List lists all CronJobs in the indexer. -func (s *cronJobLister) List(selector labels.Selector) (ret []*v1beta1.CronJob, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.CronJob)) - }) - return ret, err + return &cronJobLister{listers.New[*v1beta1.CronJob](indexer, v1beta1.Resource("cronjob"))} } // CronJobs returns an object that can list and get CronJobs. func (s *cronJobLister) CronJobs(namespace string) CronJobNamespaceLister { - return cronJobNamespaceLister{indexer: s.indexer, namespace: namespace} + return cronJobNamespaceLister{listers.NewNamespaced[*v1beta1.CronJob](s.ResourceIndexer, namespace)} } // CronJobNamespaceLister helps list and get CronJobs. @@ -74,26 +66,5 @@ type CronJobNamespaceLister interface { // cronJobNamespaceLister implements the CronJobNamespaceLister // interface. type cronJobNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all CronJobs in the indexer for a given namespace. -func (s cronJobNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.CronJob, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.CronJob)) - }) - return ret, err -} - -// Get retrieves the CronJob from the indexer for a given namespace and name. -func (s cronJobNamespaceLister) Get(name string) (*v1beta1.CronJob, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("cronjob"), name) - } - return obj.(*v1beta1.CronJob), nil + listers.ResourceIndexer[*v1beta1.CronJob] } diff --git a/listers/certificates/v1/certificatesigningrequest.go b/listers/certificates/v1/certificatesigningrequest.go index 0d04e118db..38e4a3a658 100644 --- a/listers/certificates/v1/certificatesigningrequest.go +++ b/listers/certificates/v1/certificatesigningrequest.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/certificates/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type CertificateSigningRequestLister interface { // certificateSigningRequestLister implements the CertificateSigningRequestLister interface. type certificateSigningRequestLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.CertificateSigningRequest] } // NewCertificateSigningRequestLister returns a new CertificateSigningRequestLister. func NewCertificateSigningRequestLister(indexer cache.Indexer) CertificateSigningRequestLister { - return &certificateSigningRequestLister{indexer: indexer} -} - -// List lists all CertificateSigningRequests in the indexer. -func (s *certificateSigningRequestLister) List(selector labels.Selector) (ret []*v1.CertificateSigningRequest, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.CertificateSigningRequest)) - }) - return ret, err -} - -// Get retrieves the CertificateSigningRequest from the index for a given name. -func (s *certificateSigningRequestLister) Get(name string) (*v1.CertificateSigningRequest, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("certificatesigningrequest"), name) - } - return obj.(*v1.CertificateSigningRequest), nil + return &certificateSigningRequestLister{listers.New[*v1.CertificateSigningRequest](indexer, v1.Resource("certificatesigningrequest"))} } diff --git a/listers/certificates/v1alpha1/clustertrustbundle.go b/listers/certificates/v1alpha1/clustertrustbundle.go index b8049a7618..88e5365f40 100644 --- a/listers/certificates/v1alpha1/clustertrustbundle.go +++ b/listers/certificates/v1alpha1/clustertrustbundle.go @@ -20,8 +20,8 @@ package v1alpha1 import ( v1alpha1 "k8s.io/api/certificates/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type ClusterTrustBundleLister interface { // clusterTrustBundleLister implements the ClusterTrustBundleLister interface. type clusterTrustBundleLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.ClusterTrustBundle] } // NewClusterTrustBundleLister returns a new ClusterTrustBundleLister. func NewClusterTrustBundleLister(indexer cache.Indexer) ClusterTrustBundleLister { - return &clusterTrustBundleLister{indexer: indexer} -} - -// List lists all ClusterTrustBundles in the indexer. -func (s *clusterTrustBundleLister) List(selector labels.Selector) (ret []*v1alpha1.ClusterTrustBundle, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.ClusterTrustBundle)) - }) - return ret, err -} - -// Get retrieves the ClusterTrustBundle from the index for a given name. -func (s *clusterTrustBundleLister) Get(name string) (*v1alpha1.ClusterTrustBundle, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("clustertrustbundle"), name) - } - return obj.(*v1alpha1.ClusterTrustBundle), nil + return &clusterTrustBundleLister{listers.New[*v1alpha1.ClusterTrustBundle](indexer, v1alpha1.Resource("clustertrustbundle"))} } diff --git a/listers/certificates/v1beta1/certificatesigningrequest.go b/listers/certificates/v1beta1/certificatesigningrequest.go index 471b5629b3..84b5ac4a90 100644 --- a/listers/certificates/v1beta1/certificatesigningrequest.go +++ b/listers/certificates/v1beta1/certificatesigningrequest.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/certificates/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type CertificateSigningRequestLister interface { // certificateSigningRequestLister implements the CertificateSigningRequestLister interface. type certificateSigningRequestLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.CertificateSigningRequest] } // NewCertificateSigningRequestLister returns a new CertificateSigningRequestLister. func NewCertificateSigningRequestLister(indexer cache.Indexer) CertificateSigningRequestLister { - return &certificateSigningRequestLister{indexer: indexer} -} - -// List lists all CertificateSigningRequests in the indexer. -func (s *certificateSigningRequestLister) List(selector labels.Selector) (ret []*v1beta1.CertificateSigningRequest, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.CertificateSigningRequest)) - }) - return ret, err -} - -// Get retrieves the CertificateSigningRequest from the index for a given name. -func (s *certificateSigningRequestLister) Get(name string) (*v1beta1.CertificateSigningRequest, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("certificatesigningrequest"), name) - } - return obj.(*v1beta1.CertificateSigningRequest), nil + return &certificateSigningRequestLister{listers.New[*v1beta1.CertificateSigningRequest](indexer, v1beta1.Resource("certificatesigningrequest"))} } diff --git a/listers/coordination/v1/lease.go b/listers/coordination/v1/lease.go index de366d0e11..b36d8800e3 100644 --- a/listers/coordination/v1/lease.go +++ b/listers/coordination/v1/lease.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/coordination/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type LeaseLister interface { // leaseLister implements the LeaseLister interface. type leaseLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Lease] } // NewLeaseLister returns a new LeaseLister. func NewLeaseLister(indexer cache.Indexer) LeaseLister { - return &leaseLister{indexer: indexer} -} - -// List lists all Leases in the indexer. -func (s *leaseLister) List(selector labels.Selector) (ret []*v1.Lease, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Lease)) - }) - return ret, err + return &leaseLister{listers.New[*v1.Lease](indexer, v1.Resource("lease"))} } // Leases returns an object that can list and get Leases. func (s *leaseLister) Leases(namespace string) LeaseNamespaceLister { - return leaseNamespaceLister{indexer: s.indexer, namespace: namespace} + return leaseNamespaceLister{listers.NewNamespaced[*v1.Lease](s.ResourceIndexer, namespace)} } // LeaseNamespaceLister helps list and get Leases. @@ -74,26 +66,5 @@ type LeaseNamespaceLister interface { // leaseNamespaceLister implements the LeaseNamespaceLister // interface. type leaseNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Leases in the indexer for a given namespace. -func (s leaseNamespaceLister) List(selector labels.Selector) (ret []*v1.Lease, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Lease)) - }) - return ret, err -} - -// Get retrieves the Lease from the indexer for a given namespace and name. -func (s leaseNamespaceLister) Get(name string) (*v1.Lease, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("lease"), name) - } - return obj.(*v1.Lease), nil + listers.ResourceIndexer[*v1.Lease] } diff --git a/listers/coordination/v1beta1/lease.go b/listers/coordination/v1beta1/lease.go index 8dfdc1e9bc..dbe132696a 100644 --- a/listers/coordination/v1beta1/lease.go +++ b/listers/coordination/v1beta1/lease.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/coordination/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type LeaseLister interface { // leaseLister implements the LeaseLister interface. type leaseLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.Lease] } // NewLeaseLister returns a new LeaseLister. func NewLeaseLister(indexer cache.Indexer) LeaseLister { - return &leaseLister{indexer: indexer} -} - -// List lists all Leases in the indexer. -func (s *leaseLister) List(selector labels.Selector) (ret []*v1beta1.Lease, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Lease)) - }) - return ret, err + return &leaseLister{listers.New[*v1beta1.Lease](indexer, v1beta1.Resource("lease"))} } // Leases returns an object that can list and get Leases. func (s *leaseLister) Leases(namespace string) LeaseNamespaceLister { - return leaseNamespaceLister{indexer: s.indexer, namespace: namespace} + return leaseNamespaceLister{listers.NewNamespaced[*v1beta1.Lease](s.ResourceIndexer, namespace)} } // LeaseNamespaceLister helps list and get Leases. @@ -74,26 +66,5 @@ type LeaseNamespaceLister interface { // leaseNamespaceLister implements the LeaseNamespaceLister // interface. type leaseNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Leases in the indexer for a given namespace. -func (s leaseNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Lease, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Lease)) - }) - return ret, err -} - -// Get retrieves the Lease from the indexer for a given namespace and name. -func (s leaseNamespaceLister) Get(name string) (*v1beta1.Lease, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("lease"), name) - } - return obj.(*v1beta1.Lease), nil + listers.ResourceIndexer[*v1beta1.Lease] } diff --git a/listers/core/v1/componentstatus.go b/listers/core/v1/componentstatus.go index 5fcdac3c76..9e3274b5a3 100644 --- a/listers/core/v1/componentstatus.go +++ b/listers/core/v1/componentstatus.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type ComponentStatusLister interface { // componentStatusLister implements the ComponentStatusLister interface. type componentStatusLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.ComponentStatus] } // NewComponentStatusLister returns a new ComponentStatusLister. func NewComponentStatusLister(indexer cache.Indexer) ComponentStatusLister { - return &componentStatusLister{indexer: indexer} -} - -// List lists all ComponentStatuses in the indexer. -func (s *componentStatusLister) List(selector labels.Selector) (ret []*v1.ComponentStatus, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ComponentStatus)) - }) - return ret, err -} - -// Get retrieves the ComponentStatus from the index for a given name. -func (s *componentStatusLister) Get(name string) (*v1.ComponentStatus, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("componentstatus"), name) - } - return obj.(*v1.ComponentStatus), nil + return &componentStatusLister{listers.New[*v1.ComponentStatus](indexer, v1.Resource("componentstatus"))} } diff --git a/listers/core/v1/configmap.go b/listers/core/v1/configmap.go index 6a410e47c4..0dde404f2f 100644 --- a/listers/core/v1/configmap.go +++ b/listers/core/v1/configmap.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type ConfigMapLister interface { // configMapLister implements the ConfigMapLister interface. type configMapLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.ConfigMap] } // NewConfigMapLister returns a new ConfigMapLister. func NewConfigMapLister(indexer cache.Indexer) ConfigMapLister { - return &configMapLister{indexer: indexer} -} - -// List lists all ConfigMaps in the indexer. -func (s *configMapLister) List(selector labels.Selector) (ret []*v1.ConfigMap, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ConfigMap)) - }) - return ret, err + return &configMapLister{listers.New[*v1.ConfigMap](indexer, v1.Resource("configmap"))} } // ConfigMaps returns an object that can list and get ConfigMaps. func (s *configMapLister) ConfigMaps(namespace string) ConfigMapNamespaceLister { - return configMapNamespaceLister{indexer: s.indexer, namespace: namespace} + return configMapNamespaceLister{listers.NewNamespaced[*v1.ConfigMap](s.ResourceIndexer, namespace)} } // ConfigMapNamespaceLister helps list and get ConfigMaps. @@ -74,26 +66,5 @@ type ConfigMapNamespaceLister interface { // configMapNamespaceLister implements the ConfigMapNamespaceLister // interface. type configMapNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ConfigMaps in the indexer for a given namespace. -func (s configMapNamespaceLister) List(selector labels.Selector) (ret []*v1.ConfigMap, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ConfigMap)) - }) - return ret, err -} - -// Get retrieves the ConfigMap from the indexer for a given namespace and name. -func (s configMapNamespaceLister) Get(name string) (*v1.ConfigMap, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("configmap"), name) - } - return obj.(*v1.ConfigMap), nil + listers.ResourceIndexer[*v1.ConfigMap] } diff --git a/listers/core/v1/endpoints.go b/listers/core/v1/endpoints.go index 4759ce808f..726b432559 100644 --- a/listers/core/v1/endpoints.go +++ b/listers/core/v1/endpoints.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type EndpointsLister interface { // endpointsLister implements the EndpointsLister interface. type endpointsLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Endpoints] } // NewEndpointsLister returns a new EndpointsLister. func NewEndpointsLister(indexer cache.Indexer) EndpointsLister { - return &endpointsLister{indexer: indexer} -} - -// List lists all Endpoints in the indexer. -func (s *endpointsLister) List(selector labels.Selector) (ret []*v1.Endpoints, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Endpoints)) - }) - return ret, err + return &endpointsLister{listers.New[*v1.Endpoints](indexer, v1.Resource("endpoints"))} } // Endpoints returns an object that can list and get Endpoints. func (s *endpointsLister) Endpoints(namespace string) EndpointsNamespaceLister { - return endpointsNamespaceLister{indexer: s.indexer, namespace: namespace} + return endpointsNamespaceLister{listers.NewNamespaced[*v1.Endpoints](s.ResourceIndexer, namespace)} } // EndpointsNamespaceLister helps list and get Endpoints. @@ -74,26 +66,5 @@ type EndpointsNamespaceLister interface { // endpointsNamespaceLister implements the EndpointsNamespaceLister // interface. type endpointsNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Endpoints in the indexer for a given namespace. -func (s endpointsNamespaceLister) List(selector labels.Selector) (ret []*v1.Endpoints, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Endpoints)) - }) - return ret, err -} - -// Get retrieves the Endpoints from the indexer for a given namespace and name. -func (s endpointsNamespaceLister) Get(name string) (*v1.Endpoints, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("endpoints"), name) - } - return obj.(*v1.Endpoints), nil + listers.ResourceIndexer[*v1.Endpoints] } diff --git a/listers/core/v1/event.go b/listers/core/v1/event.go index 4416e20120..5ab3a19321 100644 --- a/listers/core/v1/event.go +++ b/listers/core/v1/event.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type EventLister interface { // eventLister implements the EventLister interface. type eventLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Event] } // NewEventLister returns a new EventLister. func NewEventLister(indexer cache.Indexer) EventLister { - return &eventLister{indexer: indexer} -} - -// List lists all Events in the indexer. -func (s *eventLister) List(selector labels.Selector) (ret []*v1.Event, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Event)) - }) - return ret, err + return &eventLister{listers.New[*v1.Event](indexer, v1.Resource("event"))} } // Events returns an object that can list and get Events. func (s *eventLister) Events(namespace string) EventNamespaceLister { - return eventNamespaceLister{indexer: s.indexer, namespace: namespace} + return eventNamespaceLister{listers.NewNamespaced[*v1.Event](s.ResourceIndexer, namespace)} } // EventNamespaceLister helps list and get Events. @@ -74,26 +66,5 @@ type EventNamespaceLister interface { // eventNamespaceLister implements the EventNamespaceLister // interface. type eventNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Events in the indexer for a given namespace. -func (s eventNamespaceLister) List(selector labels.Selector) (ret []*v1.Event, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Event)) - }) - return ret, err -} - -// Get retrieves the Event from the indexer for a given namespace and name. -func (s eventNamespaceLister) Get(name string) (*v1.Event, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("event"), name) - } - return obj.(*v1.Event), nil + listers.ResourceIndexer[*v1.Event] } diff --git a/listers/core/v1/limitrange.go b/listers/core/v1/limitrange.go index d8fa569cd3..5c7593cfa9 100644 --- a/listers/core/v1/limitrange.go +++ b/listers/core/v1/limitrange.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type LimitRangeLister interface { // limitRangeLister implements the LimitRangeLister interface. type limitRangeLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.LimitRange] } // NewLimitRangeLister returns a new LimitRangeLister. func NewLimitRangeLister(indexer cache.Indexer) LimitRangeLister { - return &limitRangeLister{indexer: indexer} -} - -// List lists all LimitRanges in the indexer. -func (s *limitRangeLister) List(selector labels.Selector) (ret []*v1.LimitRange, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.LimitRange)) - }) - return ret, err + return &limitRangeLister{listers.New[*v1.LimitRange](indexer, v1.Resource("limitrange"))} } // LimitRanges returns an object that can list and get LimitRanges. func (s *limitRangeLister) LimitRanges(namespace string) LimitRangeNamespaceLister { - return limitRangeNamespaceLister{indexer: s.indexer, namespace: namespace} + return limitRangeNamespaceLister{listers.NewNamespaced[*v1.LimitRange](s.ResourceIndexer, namespace)} } // LimitRangeNamespaceLister helps list and get LimitRanges. @@ -74,26 +66,5 @@ type LimitRangeNamespaceLister interface { // limitRangeNamespaceLister implements the LimitRangeNamespaceLister // interface. type limitRangeNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all LimitRanges in the indexer for a given namespace. -func (s limitRangeNamespaceLister) List(selector labels.Selector) (ret []*v1.LimitRange, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.LimitRange)) - }) - return ret, err -} - -// Get retrieves the LimitRange from the indexer for a given namespace and name. -func (s limitRangeNamespaceLister) Get(name string) (*v1.LimitRange, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("limitrange"), name) - } - return obj.(*v1.LimitRange), nil + listers.ResourceIndexer[*v1.LimitRange] } diff --git a/listers/core/v1/namespace.go b/listers/core/v1/namespace.go index 454aa1a0a2..a016447cfe 100644 --- a/listers/core/v1/namespace.go +++ b/listers/core/v1/namespace.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type NamespaceLister interface { // namespaceLister implements the NamespaceLister interface. type namespaceLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Namespace] } // NewNamespaceLister returns a new NamespaceLister. func NewNamespaceLister(indexer cache.Indexer) NamespaceLister { - return &namespaceLister{indexer: indexer} -} - -// List lists all Namespaces in the indexer. -func (s *namespaceLister) List(selector labels.Selector) (ret []*v1.Namespace, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Namespace)) - }) - return ret, err -} - -// Get retrieves the Namespace from the index for a given name. -func (s *namespaceLister) Get(name string) (*v1.Namespace, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("namespace"), name) - } - return obj.(*v1.Namespace), nil + return &namespaceLister{listers.New[*v1.Namespace](indexer, v1.Resource("namespace"))} } diff --git a/listers/core/v1/node.go b/listers/core/v1/node.go index 596049857f..495c6d79d1 100644 --- a/listers/core/v1/node.go +++ b/listers/core/v1/node.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type NodeLister interface { // nodeLister implements the NodeLister interface. type nodeLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.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 []*v1.Node, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Node)) - }) - return ret, err -} - -// Get retrieves the Node from the index for a given name. -func (s *nodeLister) Get(name string) (*v1.Node, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("node"), name) - } - return obj.(*v1.Node), nil + return &nodeLister{listers.New[*v1.Node](indexer, v1.Resource("node"))} } diff --git a/listers/core/v1/persistentvolume.go b/listers/core/v1/persistentvolume.go index e7dfd4ac9f..17f19bb7a4 100644 --- a/listers/core/v1/persistentvolume.go +++ b/listers/core/v1/persistentvolume.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type PersistentVolumeLister interface { // persistentVolumeLister implements the PersistentVolumeLister interface. type persistentVolumeLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.PersistentVolume] } // NewPersistentVolumeLister returns a new PersistentVolumeLister. func NewPersistentVolumeLister(indexer cache.Indexer) PersistentVolumeLister { - return &persistentVolumeLister{indexer: indexer} -} - -// List lists all PersistentVolumes in the indexer. -func (s *persistentVolumeLister) List(selector labels.Selector) (ret []*v1.PersistentVolume, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.PersistentVolume)) - }) - return ret, err -} - -// Get retrieves the PersistentVolume from the index for a given name. -func (s *persistentVolumeLister) Get(name string) (*v1.PersistentVolume, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("persistentvolume"), name) - } - return obj.(*v1.PersistentVolume), nil + return &persistentVolumeLister{listers.New[*v1.PersistentVolume](indexer, v1.Resource("persistentvolume"))} } diff --git a/listers/core/v1/persistentvolumeclaim.go b/listers/core/v1/persistentvolumeclaim.go index fc71bb5a1f..ce9df90314 100644 --- a/listers/core/v1/persistentvolumeclaim.go +++ b/listers/core/v1/persistentvolumeclaim.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type PersistentVolumeClaimLister interface { // persistentVolumeClaimLister implements the PersistentVolumeClaimLister interface. type persistentVolumeClaimLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.PersistentVolumeClaim] } // NewPersistentVolumeClaimLister returns a new PersistentVolumeClaimLister. func NewPersistentVolumeClaimLister(indexer cache.Indexer) PersistentVolumeClaimLister { - return &persistentVolumeClaimLister{indexer: indexer} -} - -// List lists all PersistentVolumeClaims in the indexer. -func (s *persistentVolumeClaimLister) List(selector labels.Selector) (ret []*v1.PersistentVolumeClaim, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.PersistentVolumeClaim)) - }) - return ret, err + return &persistentVolumeClaimLister{listers.New[*v1.PersistentVolumeClaim](indexer, v1.Resource("persistentvolumeclaim"))} } // PersistentVolumeClaims returns an object that can list and get PersistentVolumeClaims. func (s *persistentVolumeClaimLister) PersistentVolumeClaims(namespace string) PersistentVolumeClaimNamespaceLister { - return persistentVolumeClaimNamespaceLister{indexer: s.indexer, namespace: namespace} + return persistentVolumeClaimNamespaceLister{listers.NewNamespaced[*v1.PersistentVolumeClaim](s.ResourceIndexer, namespace)} } // PersistentVolumeClaimNamespaceLister helps list and get PersistentVolumeClaims. @@ -74,26 +66,5 @@ type PersistentVolumeClaimNamespaceLister interface { // persistentVolumeClaimNamespaceLister implements the PersistentVolumeClaimNamespaceLister // interface. type persistentVolumeClaimNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all PersistentVolumeClaims in the indexer for a given namespace. -func (s persistentVolumeClaimNamespaceLister) List(selector labels.Selector) (ret []*v1.PersistentVolumeClaim, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.PersistentVolumeClaim)) - }) - return ret, err -} - -// Get retrieves the PersistentVolumeClaim from the indexer for a given namespace and name. -func (s persistentVolumeClaimNamespaceLister) Get(name string) (*v1.PersistentVolumeClaim, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("persistentvolumeclaim"), name) - } - return obj.(*v1.PersistentVolumeClaim), nil + listers.ResourceIndexer[*v1.PersistentVolumeClaim] } diff --git a/listers/core/v1/pod.go b/listers/core/v1/pod.go index ab8f0946c3..b17a8382a0 100644 --- a/listers/core/v1/pod.go +++ b/listers/core/v1/pod.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type PodLister interface { // podLister implements the PodLister interface. type podLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Pod] } // NewPodLister returns a new PodLister. func NewPodLister(indexer cache.Indexer) PodLister { - return &podLister{indexer: indexer} -} - -// List lists all Pods in the indexer. -func (s *podLister) List(selector labels.Selector) (ret []*v1.Pod, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Pod)) - }) - return ret, err + return &podLister{listers.New[*v1.Pod](indexer, v1.Resource("pod"))} } // Pods returns an object that can list and get Pods. func (s *podLister) Pods(namespace string) PodNamespaceLister { - return podNamespaceLister{indexer: s.indexer, namespace: namespace} + return podNamespaceLister{listers.NewNamespaced[*v1.Pod](s.ResourceIndexer, namespace)} } // PodNamespaceLister helps list and get Pods. @@ -74,26 +66,5 @@ type PodNamespaceLister interface { // podNamespaceLister implements the PodNamespaceLister // interface. type podNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Pods in the indexer for a given namespace. -func (s podNamespaceLister) List(selector labels.Selector) (ret []*v1.Pod, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Pod)) - }) - return ret, err -} - -// Get retrieves the Pod from the indexer for a given namespace and name. -func (s podNamespaceLister) Get(name string) (*v1.Pod, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("pod"), name) - } - return obj.(*v1.Pod), nil + listers.ResourceIndexer[*v1.Pod] } diff --git a/listers/core/v1/podtemplate.go b/listers/core/v1/podtemplate.go index 6c310045b7..8ac93148f5 100644 --- a/listers/core/v1/podtemplate.go +++ b/listers/core/v1/podtemplate.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type PodTemplateLister interface { // podTemplateLister implements the PodTemplateLister interface. type podTemplateLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.PodTemplate] } // NewPodTemplateLister returns a new PodTemplateLister. func NewPodTemplateLister(indexer cache.Indexer) PodTemplateLister { - return &podTemplateLister{indexer: indexer} -} - -// List lists all PodTemplates in the indexer. -func (s *podTemplateLister) List(selector labels.Selector) (ret []*v1.PodTemplate, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.PodTemplate)) - }) - return ret, err + return &podTemplateLister{listers.New[*v1.PodTemplate](indexer, v1.Resource("podtemplate"))} } // PodTemplates returns an object that can list and get PodTemplates. func (s *podTemplateLister) PodTemplates(namespace string) PodTemplateNamespaceLister { - return podTemplateNamespaceLister{indexer: s.indexer, namespace: namespace} + return podTemplateNamespaceLister{listers.NewNamespaced[*v1.PodTemplate](s.ResourceIndexer, namespace)} } // PodTemplateNamespaceLister helps list and get PodTemplates. @@ -74,26 +66,5 @@ type PodTemplateNamespaceLister interface { // podTemplateNamespaceLister implements the PodTemplateNamespaceLister // interface. type podTemplateNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all PodTemplates in the indexer for a given namespace. -func (s podTemplateNamespaceLister) List(selector labels.Selector) (ret []*v1.PodTemplate, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.PodTemplate)) - }) - return ret, err -} - -// Get retrieves the PodTemplate from the indexer for a given namespace and name. -func (s podTemplateNamespaceLister) Get(name string) (*v1.PodTemplate, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("podtemplate"), name) - } - return obj.(*v1.PodTemplate), nil + listers.ResourceIndexer[*v1.PodTemplate] } diff --git a/listers/core/v1/replicationcontroller.go b/listers/core/v1/replicationcontroller.go index e28e2ef768..8ce23fc09a 100644 --- a/listers/core/v1/replicationcontroller.go +++ b/listers/core/v1/replicationcontroller.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type ReplicationControllerLister interface { // replicationControllerLister implements the ReplicationControllerLister interface. type replicationControllerLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.ReplicationController] } // NewReplicationControllerLister returns a new ReplicationControllerLister. func NewReplicationControllerLister(indexer cache.Indexer) ReplicationControllerLister { - return &replicationControllerLister{indexer: indexer} -} - -// List lists all ReplicationControllers in the indexer. -func (s *replicationControllerLister) List(selector labels.Selector) (ret []*v1.ReplicationController, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ReplicationController)) - }) - return ret, err + return &replicationControllerLister{listers.New[*v1.ReplicationController](indexer, v1.Resource("replicationcontroller"))} } // ReplicationControllers returns an object that can list and get ReplicationControllers. func (s *replicationControllerLister) ReplicationControllers(namespace string) ReplicationControllerNamespaceLister { - return replicationControllerNamespaceLister{indexer: s.indexer, namespace: namespace} + return replicationControllerNamespaceLister{listers.NewNamespaced[*v1.ReplicationController](s.ResourceIndexer, namespace)} } // ReplicationControllerNamespaceLister helps list and get ReplicationControllers. @@ -74,26 +66,5 @@ type ReplicationControllerNamespaceLister interface { // replicationControllerNamespaceLister implements the ReplicationControllerNamespaceLister // interface. type replicationControllerNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ReplicationControllers in the indexer for a given namespace. -func (s replicationControllerNamespaceLister) List(selector labels.Selector) (ret []*v1.ReplicationController, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ReplicationController)) - }) - return ret, err -} - -// Get retrieves the ReplicationController from the indexer for a given namespace and name. -func (s replicationControllerNamespaceLister) Get(name string) (*v1.ReplicationController, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("replicationcontroller"), name) - } - return obj.(*v1.ReplicationController), nil + listers.ResourceIndexer[*v1.ReplicationController] } diff --git a/listers/core/v1/resourcequota.go b/listers/core/v1/resourcequota.go index 9c00b49d4f..4b46194a25 100644 --- a/listers/core/v1/resourcequota.go +++ b/listers/core/v1/resourcequota.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type ResourceQuotaLister interface { // resourceQuotaLister implements the ResourceQuotaLister interface. type resourceQuotaLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.ResourceQuota] } // NewResourceQuotaLister returns a new ResourceQuotaLister. func NewResourceQuotaLister(indexer cache.Indexer) ResourceQuotaLister { - return &resourceQuotaLister{indexer: indexer} -} - -// List lists all ResourceQuotas in the indexer. -func (s *resourceQuotaLister) List(selector labels.Selector) (ret []*v1.ResourceQuota, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ResourceQuota)) - }) - return ret, err + return &resourceQuotaLister{listers.New[*v1.ResourceQuota](indexer, v1.Resource("resourcequota"))} } // ResourceQuotas returns an object that can list and get ResourceQuotas. func (s *resourceQuotaLister) ResourceQuotas(namespace string) ResourceQuotaNamespaceLister { - return resourceQuotaNamespaceLister{indexer: s.indexer, namespace: namespace} + return resourceQuotaNamespaceLister{listers.NewNamespaced[*v1.ResourceQuota](s.ResourceIndexer, namespace)} } // ResourceQuotaNamespaceLister helps list and get ResourceQuotas. @@ -74,26 +66,5 @@ type ResourceQuotaNamespaceLister interface { // resourceQuotaNamespaceLister implements the ResourceQuotaNamespaceLister // interface. type resourceQuotaNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ResourceQuotas in the indexer for a given namespace. -func (s resourceQuotaNamespaceLister) List(selector labels.Selector) (ret []*v1.ResourceQuota, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ResourceQuota)) - }) - return ret, err -} - -// Get retrieves the ResourceQuota from the indexer for a given namespace and name. -func (s resourceQuotaNamespaceLister) Get(name string) (*v1.ResourceQuota, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("resourcequota"), name) - } - return obj.(*v1.ResourceQuota), nil + listers.ResourceIndexer[*v1.ResourceQuota] } diff --git a/listers/core/v1/secret.go b/listers/core/v1/secret.go index d386d4d5cb..47a0c9a084 100644 --- a/listers/core/v1/secret.go +++ b/listers/core/v1/secret.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type SecretLister interface { // secretLister implements the SecretLister interface. type secretLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Secret] } // NewSecretLister returns a new SecretLister. func NewSecretLister(indexer cache.Indexer) SecretLister { - return &secretLister{indexer: indexer} -} - -// List lists all Secrets in the indexer. -func (s *secretLister) List(selector labels.Selector) (ret []*v1.Secret, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Secret)) - }) - return ret, err + return &secretLister{listers.New[*v1.Secret](indexer, v1.Resource("secret"))} } // Secrets returns an object that can list and get Secrets. func (s *secretLister) Secrets(namespace string) SecretNamespaceLister { - return secretNamespaceLister{indexer: s.indexer, namespace: namespace} + return secretNamespaceLister{listers.NewNamespaced[*v1.Secret](s.ResourceIndexer, namespace)} } // SecretNamespaceLister helps list and get Secrets. @@ -74,26 +66,5 @@ type SecretNamespaceLister interface { // secretNamespaceLister implements the SecretNamespaceLister // interface. type secretNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Secrets in the indexer for a given namespace. -func (s secretNamespaceLister) List(selector labels.Selector) (ret []*v1.Secret, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Secret)) - }) - return ret, err -} - -// Get retrieves the Secret from the indexer for a given namespace and name. -func (s secretNamespaceLister) Get(name string) (*v1.Secret, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("secret"), name) - } - return obj.(*v1.Secret), nil + listers.ResourceIndexer[*v1.Secret] } diff --git a/listers/core/v1/service.go b/listers/core/v1/service.go index 51026d7b4b..536fb337f9 100644 --- a/listers/core/v1/service.go +++ b/listers/core/v1/service.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type ServiceLister interface { // serviceLister implements the ServiceLister interface. type serviceLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Service] } // NewServiceLister returns a new ServiceLister. func NewServiceLister(indexer cache.Indexer) ServiceLister { - return &serviceLister{indexer: indexer} -} - -// List lists all Services in the indexer. -func (s *serviceLister) List(selector labels.Selector) (ret []*v1.Service, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Service)) - }) - return ret, err + return &serviceLister{listers.New[*v1.Service](indexer, v1.Resource("service"))} } // Services returns an object that can list and get Services. func (s *serviceLister) Services(namespace string) ServiceNamespaceLister { - return serviceNamespaceLister{indexer: s.indexer, namespace: namespace} + return serviceNamespaceLister{listers.NewNamespaced[*v1.Service](s.ResourceIndexer, namespace)} } // ServiceNamespaceLister helps list and get Services. @@ -74,26 +66,5 @@ type ServiceNamespaceLister interface { // serviceNamespaceLister implements the ServiceNamespaceLister // interface. type serviceNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Services in the indexer for a given namespace. -func (s serviceNamespaceLister) List(selector labels.Selector) (ret []*v1.Service, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Service)) - }) - return ret, err -} - -// Get retrieves the Service from the indexer for a given namespace and name. -func (s serviceNamespaceLister) Get(name string) (*v1.Service, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("service"), name) - } - return obj.(*v1.Service), nil + listers.ResourceIndexer[*v1.Service] } diff --git a/listers/core/v1/serviceaccount.go b/listers/core/v1/serviceaccount.go index aa9554d8bb..8a4af4f4cb 100644 --- a/listers/core/v1/serviceaccount.go +++ b/listers/core/v1/serviceaccount.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type ServiceAccountLister interface { // serviceAccountLister implements the ServiceAccountLister interface. type serviceAccountLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.ServiceAccount] } // NewServiceAccountLister returns a new ServiceAccountLister. func NewServiceAccountLister(indexer cache.Indexer) ServiceAccountLister { - return &serviceAccountLister{indexer: indexer} -} - -// List lists all ServiceAccounts in the indexer. -func (s *serviceAccountLister) List(selector labels.Selector) (ret []*v1.ServiceAccount, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ServiceAccount)) - }) - return ret, err + return &serviceAccountLister{listers.New[*v1.ServiceAccount](indexer, v1.Resource("serviceaccount"))} } // ServiceAccounts returns an object that can list and get ServiceAccounts. func (s *serviceAccountLister) ServiceAccounts(namespace string) ServiceAccountNamespaceLister { - return serviceAccountNamespaceLister{indexer: s.indexer, namespace: namespace} + return serviceAccountNamespaceLister{listers.NewNamespaced[*v1.ServiceAccount](s.ResourceIndexer, namespace)} } // ServiceAccountNamespaceLister helps list and get ServiceAccounts. @@ -74,26 +66,5 @@ type ServiceAccountNamespaceLister interface { // serviceAccountNamespaceLister implements the ServiceAccountNamespaceLister // interface. type serviceAccountNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ServiceAccounts in the indexer for a given namespace. -func (s serviceAccountNamespaceLister) List(selector labels.Selector) (ret []*v1.ServiceAccount, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ServiceAccount)) - }) - return ret, err -} - -// Get retrieves the ServiceAccount from the indexer for a given namespace and name. -func (s serviceAccountNamespaceLister) Get(name string) (*v1.ServiceAccount, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("serviceaccount"), name) - } - return obj.(*v1.ServiceAccount), nil + listers.ResourceIndexer[*v1.ServiceAccount] } diff --git a/listers/discovery/v1/endpointslice.go b/listers/discovery/v1/endpointslice.go index 4dd46ff1bf..dcb18f19a8 100644 --- a/listers/discovery/v1/endpointslice.go +++ b/listers/discovery/v1/endpointslice.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/discovery/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type EndpointSliceLister interface { // endpointSliceLister implements the EndpointSliceLister interface. type endpointSliceLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.EndpointSlice] } // NewEndpointSliceLister returns a new EndpointSliceLister. func NewEndpointSliceLister(indexer cache.Indexer) EndpointSliceLister { - return &endpointSliceLister{indexer: indexer} -} - -// List lists all EndpointSlices in the indexer. -func (s *endpointSliceLister) List(selector labels.Selector) (ret []*v1.EndpointSlice, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.EndpointSlice)) - }) - return ret, err + return &endpointSliceLister{listers.New[*v1.EndpointSlice](indexer, v1.Resource("endpointslice"))} } // EndpointSlices returns an object that can list and get EndpointSlices. func (s *endpointSliceLister) EndpointSlices(namespace string) EndpointSliceNamespaceLister { - return endpointSliceNamespaceLister{indexer: s.indexer, namespace: namespace} + return endpointSliceNamespaceLister{listers.NewNamespaced[*v1.EndpointSlice](s.ResourceIndexer, namespace)} } // EndpointSliceNamespaceLister helps list and get EndpointSlices. @@ -74,26 +66,5 @@ type EndpointSliceNamespaceLister interface { // endpointSliceNamespaceLister implements the EndpointSliceNamespaceLister // interface. type endpointSliceNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all EndpointSlices in the indexer for a given namespace. -func (s endpointSliceNamespaceLister) List(selector labels.Selector) (ret []*v1.EndpointSlice, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.EndpointSlice)) - }) - return ret, err -} - -// Get retrieves the EndpointSlice from the indexer for a given namespace and name. -func (s endpointSliceNamespaceLister) Get(name string) (*v1.EndpointSlice, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("endpointslice"), name) - } - return obj.(*v1.EndpointSlice), nil + listers.ResourceIndexer[*v1.EndpointSlice] } diff --git a/listers/discovery/v1beta1/endpointslice.go b/listers/discovery/v1beta1/endpointslice.go index e92872d5f4..d3762f5c28 100644 --- a/listers/discovery/v1beta1/endpointslice.go +++ b/listers/discovery/v1beta1/endpointslice.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/discovery/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type EndpointSliceLister interface { // endpointSliceLister implements the EndpointSliceLister interface. type endpointSliceLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.EndpointSlice] } // NewEndpointSliceLister returns a new EndpointSliceLister. func NewEndpointSliceLister(indexer cache.Indexer) EndpointSliceLister { - return &endpointSliceLister{indexer: indexer} -} - -// List lists all EndpointSlices in the indexer. -func (s *endpointSliceLister) List(selector labels.Selector) (ret []*v1beta1.EndpointSlice, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.EndpointSlice)) - }) - return ret, err + return &endpointSliceLister{listers.New[*v1beta1.EndpointSlice](indexer, v1beta1.Resource("endpointslice"))} } // EndpointSlices returns an object that can list and get EndpointSlices. func (s *endpointSliceLister) EndpointSlices(namespace string) EndpointSliceNamespaceLister { - return endpointSliceNamespaceLister{indexer: s.indexer, namespace: namespace} + return endpointSliceNamespaceLister{listers.NewNamespaced[*v1beta1.EndpointSlice](s.ResourceIndexer, namespace)} } // EndpointSliceNamespaceLister helps list and get EndpointSlices. @@ -74,26 +66,5 @@ type EndpointSliceNamespaceLister interface { // endpointSliceNamespaceLister implements the EndpointSliceNamespaceLister // interface. type endpointSliceNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all EndpointSlices in the indexer for a given namespace. -func (s endpointSliceNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.EndpointSlice, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.EndpointSlice)) - }) - return ret, err -} - -// Get retrieves the EndpointSlice from the indexer for a given namespace and name. -func (s endpointSliceNamespaceLister) Get(name string) (*v1beta1.EndpointSlice, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("endpointslice"), name) - } - return obj.(*v1beta1.EndpointSlice), nil + listers.ResourceIndexer[*v1beta1.EndpointSlice] } diff --git a/listers/events/v1/event.go b/listers/events/v1/event.go index 4abe841e26..66e3c64669 100644 --- a/listers/events/v1/event.go +++ b/listers/events/v1/event.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/events/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type EventLister interface { // eventLister implements the EventLister interface. type eventLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Event] } // NewEventLister returns a new EventLister. func NewEventLister(indexer cache.Indexer) EventLister { - return &eventLister{indexer: indexer} -} - -// List lists all Events in the indexer. -func (s *eventLister) List(selector labels.Selector) (ret []*v1.Event, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Event)) - }) - return ret, err + return &eventLister{listers.New[*v1.Event](indexer, v1.Resource("event"))} } // Events returns an object that can list and get Events. func (s *eventLister) Events(namespace string) EventNamespaceLister { - return eventNamespaceLister{indexer: s.indexer, namespace: namespace} + return eventNamespaceLister{listers.NewNamespaced[*v1.Event](s.ResourceIndexer, namespace)} } // EventNamespaceLister helps list and get Events. @@ -74,26 +66,5 @@ type EventNamespaceLister interface { // eventNamespaceLister implements the EventNamespaceLister // interface. type eventNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Events in the indexer for a given namespace. -func (s eventNamespaceLister) List(selector labels.Selector) (ret []*v1.Event, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Event)) - }) - return ret, err -} - -// Get retrieves the Event from the indexer for a given namespace and name. -func (s eventNamespaceLister) Get(name string) (*v1.Event, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("event"), name) - } - return obj.(*v1.Event), nil + listers.ResourceIndexer[*v1.Event] } diff --git a/listers/events/v1beta1/event.go b/listers/events/v1beta1/event.go index 41a521be6f..3d51bb2656 100644 --- a/listers/events/v1beta1/event.go +++ b/listers/events/v1beta1/event.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/events/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type EventLister interface { // eventLister implements the EventLister interface. type eventLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.Event] } // NewEventLister returns a new EventLister. func NewEventLister(indexer cache.Indexer) EventLister { - return &eventLister{indexer: indexer} -} - -// List lists all Events in the indexer. -func (s *eventLister) List(selector labels.Selector) (ret []*v1beta1.Event, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Event)) - }) - return ret, err + return &eventLister{listers.New[*v1beta1.Event](indexer, v1beta1.Resource("event"))} } // Events returns an object that can list and get Events. func (s *eventLister) Events(namespace string) EventNamespaceLister { - return eventNamespaceLister{indexer: s.indexer, namespace: namespace} + return eventNamespaceLister{listers.NewNamespaced[*v1beta1.Event](s.ResourceIndexer, namespace)} } // EventNamespaceLister helps list and get Events. @@ -74,26 +66,5 @@ type EventNamespaceLister interface { // eventNamespaceLister implements the EventNamespaceLister // interface. type eventNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Events in the indexer for a given namespace. -func (s eventNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Event, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Event)) - }) - return ret, err -} - -// Get retrieves the Event from the indexer for a given namespace and name. -func (s eventNamespaceLister) Get(name string) (*v1beta1.Event, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("event"), name) - } - return obj.(*v1beta1.Event), nil + listers.ResourceIndexer[*v1beta1.Event] } diff --git a/listers/extensions/v1beta1/daemonset.go b/listers/extensions/v1beta1/daemonset.go index 900475410b..4510b42360 100644 --- a/listers/extensions/v1beta1/daemonset.go +++ b/listers/extensions/v1beta1/daemonset.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/extensions/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type DaemonSetLister interface { // daemonSetLister implements the DaemonSetLister interface. type daemonSetLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.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 []*v1beta1.DaemonSet, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.DaemonSet)) - }) - return ret, err + return &daemonSetLister{listers.New[*v1beta1.DaemonSet](indexer, v1beta1.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[*v1beta1.DaemonSet](s.ResourceIndexer, namespace)} } // DaemonSetNamespaceLister helps list and get DaemonSets. @@ -74,26 +66,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 []*v1beta1.DaemonSet, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.DaemonSet)) - }) - return ret, err -} - -// Get retrieves the DaemonSet from the indexer for a given namespace and name. -func (s daemonSetNamespaceLister) Get(name string) (*v1beta1.DaemonSet, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("daemonset"), name) - } - return obj.(*v1beta1.DaemonSet), nil + listers.ResourceIndexer[*v1beta1.DaemonSet] } diff --git a/listers/extensions/v1beta1/deployment.go b/listers/extensions/v1beta1/deployment.go index 42b5a07231..149047c973 100644 --- a/listers/extensions/v1beta1/deployment.go +++ b/listers/extensions/v1beta1/deployment.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/extensions/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type DeploymentLister interface { // deploymentLister implements the DeploymentLister interface. type deploymentLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.Deployment] } // NewDeploymentLister returns a new DeploymentLister. func NewDeploymentLister(indexer cache.Indexer) DeploymentLister { - return &deploymentLister{indexer: indexer} -} - -// List lists all Deployments in the indexer. -func (s *deploymentLister) List(selector labels.Selector) (ret []*v1beta1.Deployment, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Deployment)) - }) - return ret, err + return &deploymentLister{listers.New[*v1beta1.Deployment](indexer, v1beta1.Resource("deployment"))} } // Deployments returns an object that can list and get Deployments. func (s *deploymentLister) Deployments(namespace string) DeploymentNamespaceLister { - return deploymentNamespaceLister{indexer: s.indexer, namespace: namespace} + return deploymentNamespaceLister{listers.NewNamespaced[*v1beta1.Deployment](s.ResourceIndexer, namespace)} } // DeploymentNamespaceLister helps list and get Deployments. @@ -74,26 +66,5 @@ type DeploymentNamespaceLister interface { // deploymentNamespaceLister implements the DeploymentNamespaceLister // interface. type deploymentNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Deployments in the indexer for a given namespace. -func (s deploymentNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Deployment, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Deployment)) - }) - return ret, err -} - -// Get retrieves the Deployment from the indexer for a given namespace and name. -func (s deploymentNamespaceLister) Get(name string) (*v1beta1.Deployment, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("deployment"), name) - } - return obj.(*v1beta1.Deployment), nil + listers.ResourceIndexer[*v1beta1.Deployment] } diff --git a/listers/extensions/v1beta1/ingress.go b/listers/extensions/v1beta1/ingress.go index 1cb7677bd8..b714eebb35 100644 --- a/listers/extensions/v1beta1/ingress.go +++ b/listers/extensions/v1beta1/ingress.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/extensions/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type IngressLister interface { // ingressLister implements the IngressLister interface. type ingressLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.Ingress] } // NewIngressLister returns a new IngressLister. func NewIngressLister(indexer cache.Indexer) IngressLister { - return &ingressLister{indexer: indexer} -} - -// List lists all Ingresses in the indexer. -func (s *ingressLister) List(selector labels.Selector) (ret []*v1beta1.Ingress, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Ingress)) - }) - return ret, err + return &ingressLister{listers.New[*v1beta1.Ingress](indexer, v1beta1.Resource("ingress"))} } // Ingresses returns an object that can list and get Ingresses. func (s *ingressLister) Ingresses(namespace string) IngressNamespaceLister { - return ingressNamespaceLister{indexer: s.indexer, namespace: namespace} + return ingressNamespaceLister{listers.NewNamespaced[*v1beta1.Ingress](s.ResourceIndexer, namespace)} } // IngressNamespaceLister helps list and get Ingresses. @@ -74,26 +66,5 @@ type IngressNamespaceLister interface { // ingressNamespaceLister implements the IngressNamespaceLister // interface. type ingressNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Ingresses in the indexer for a given namespace. -func (s ingressNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Ingress, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Ingress)) - }) - return ret, err -} - -// Get retrieves the Ingress from the indexer for a given namespace and name. -func (s ingressNamespaceLister) Get(name string) (*v1beta1.Ingress, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("ingress"), name) - } - return obj.(*v1beta1.Ingress), nil + listers.ResourceIndexer[*v1beta1.Ingress] } diff --git a/listers/extensions/v1beta1/networkpolicy.go b/listers/extensions/v1beta1/networkpolicy.go index 84419a8e96..b31099c266 100644 --- a/listers/extensions/v1beta1/networkpolicy.go +++ b/listers/extensions/v1beta1/networkpolicy.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/extensions/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type NetworkPolicyLister interface { // networkPolicyLister implements the NetworkPolicyLister interface. type networkPolicyLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.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 []*v1beta1.NetworkPolicy, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.NetworkPolicy)) - }) - return ret, err + return &networkPolicyLister{listers.New[*v1beta1.NetworkPolicy](indexer, v1beta1.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[*v1beta1.NetworkPolicy](s.ResourceIndexer, namespace)} } // NetworkPolicyNamespaceLister helps list and get NetworkPolicies. @@ -74,26 +66,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 []*v1beta1.NetworkPolicy, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.NetworkPolicy)) - }) - return ret, err -} - -// Get retrieves the NetworkPolicy from the indexer for a given namespace and name. -func (s networkPolicyNamespaceLister) Get(name string) (*v1beta1.NetworkPolicy, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("networkpolicy"), name) - } - return obj.(*v1beta1.NetworkPolicy), nil + listers.ResourceIndexer[*v1beta1.NetworkPolicy] } diff --git a/listers/extensions/v1beta1/replicaset.go b/listers/extensions/v1beta1/replicaset.go index a5ec3229bc..604bee80ba 100644 --- a/listers/extensions/v1beta1/replicaset.go +++ b/listers/extensions/v1beta1/replicaset.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/extensions/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type ReplicaSetLister interface { // replicaSetLister implements the ReplicaSetLister interface. type replicaSetLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.ReplicaSet] } // NewReplicaSetLister returns a new ReplicaSetLister. func NewReplicaSetLister(indexer cache.Indexer) ReplicaSetLister { - return &replicaSetLister{indexer: indexer} -} - -// List lists all ReplicaSets in the indexer. -func (s *replicaSetLister) List(selector labels.Selector) (ret []*v1beta1.ReplicaSet, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.ReplicaSet)) - }) - return ret, err + return &replicaSetLister{listers.New[*v1beta1.ReplicaSet](indexer, v1beta1.Resource("replicaset"))} } // ReplicaSets returns an object that can list and get ReplicaSets. func (s *replicaSetLister) ReplicaSets(namespace string) ReplicaSetNamespaceLister { - return replicaSetNamespaceLister{indexer: s.indexer, namespace: namespace} + return replicaSetNamespaceLister{listers.NewNamespaced[*v1beta1.ReplicaSet](s.ResourceIndexer, namespace)} } // ReplicaSetNamespaceLister helps list and get ReplicaSets. @@ -74,26 +66,5 @@ type ReplicaSetNamespaceLister interface { // replicaSetNamespaceLister implements the ReplicaSetNamespaceLister // interface. type replicaSetNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ReplicaSets in the indexer for a given namespace. -func (s replicaSetNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.ReplicaSet, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.ReplicaSet)) - }) - return ret, err -} - -// Get retrieves the ReplicaSet from the indexer for a given namespace and name. -func (s replicaSetNamespaceLister) Get(name string) (*v1beta1.ReplicaSet, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("replicaset"), name) - } - return obj.(*v1beta1.ReplicaSet), nil + listers.ResourceIndexer[*v1beta1.ReplicaSet] } diff --git a/listers/flowcontrol/v1/flowschema.go b/listers/flowcontrol/v1/flowschema.go index 43ccd4e5ff..ba7e514874 100644 --- a/listers/flowcontrol/v1/flowschema.go +++ b/listers/flowcontrol/v1/flowschema.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/flowcontrol/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type FlowSchemaLister interface { // flowSchemaLister implements the FlowSchemaLister interface. type flowSchemaLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.FlowSchema] } // NewFlowSchemaLister returns a new FlowSchemaLister. func NewFlowSchemaLister(indexer cache.Indexer) FlowSchemaLister { - return &flowSchemaLister{indexer: indexer} -} - -// List lists all FlowSchemas in the indexer. -func (s *flowSchemaLister) List(selector labels.Selector) (ret []*v1.FlowSchema, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.FlowSchema)) - }) - return ret, err -} - -// Get retrieves the FlowSchema from the index for a given name. -func (s *flowSchemaLister) Get(name string) (*v1.FlowSchema, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("flowschema"), name) - } - return obj.(*v1.FlowSchema), nil + return &flowSchemaLister{listers.New[*v1.FlowSchema](indexer, v1.Resource("flowschema"))} } diff --git a/listers/flowcontrol/v1/prioritylevelconfiguration.go b/listers/flowcontrol/v1/prioritylevelconfiguration.go index 61189b9cf9..61f5b9fe6d 100644 --- a/listers/flowcontrol/v1/prioritylevelconfiguration.go +++ b/listers/flowcontrol/v1/prioritylevelconfiguration.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/flowcontrol/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type PriorityLevelConfigurationLister interface { // priorityLevelConfigurationLister implements the PriorityLevelConfigurationLister interface. type priorityLevelConfigurationLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.PriorityLevelConfiguration] } // NewPriorityLevelConfigurationLister returns a new PriorityLevelConfigurationLister. func NewPriorityLevelConfigurationLister(indexer cache.Indexer) PriorityLevelConfigurationLister { - return &priorityLevelConfigurationLister{indexer: indexer} -} - -// List lists all PriorityLevelConfigurations in the indexer. -func (s *priorityLevelConfigurationLister) List(selector labels.Selector) (ret []*v1.PriorityLevelConfiguration, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.PriorityLevelConfiguration)) - }) - return ret, err -} - -// Get retrieves the PriorityLevelConfiguration from the index for a given name. -func (s *priorityLevelConfigurationLister) Get(name string) (*v1.PriorityLevelConfiguration, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("prioritylevelconfiguration"), name) - } - return obj.(*v1.PriorityLevelConfiguration), nil + return &priorityLevelConfigurationLister{listers.New[*v1.PriorityLevelConfiguration](indexer, v1.Resource("prioritylevelconfiguration"))} } diff --git a/listers/flowcontrol/v1beta1/flowschema.go b/listers/flowcontrol/v1beta1/flowschema.go index 7927a8411e..59bca6ce4e 100644 --- a/listers/flowcontrol/v1beta1/flowschema.go +++ b/listers/flowcontrol/v1beta1/flowschema.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/flowcontrol/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type FlowSchemaLister interface { // flowSchemaLister implements the FlowSchemaLister interface. type flowSchemaLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.FlowSchema] } // NewFlowSchemaLister returns a new FlowSchemaLister. func NewFlowSchemaLister(indexer cache.Indexer) FlowSchemaLister { - return &flowSchemaLister{indexer: indexer} -} - -// List lists all FlowSchemas in the indexer. -func (s *flowSchemaLister) List(selector labels.Selector) (ret []*v1beta1.FlowSchema, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.FlowSchema)) - }) - return ret, err -} - -// Get retrieves the FlowSchema from the index for a given name. -func (s *flowSchemaLister) Get(name string) (*v1beta1.FlowSchema, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("flowschema"), name) - } - return obj.(*v1beta1.FlowSchema), nil + return &flowSchemaLister{listers.New[*v1beta1.FlowSchema](indexer, v1beta1.Resource("flowschema"))} } diff --git a/listers/flowcontrol/v1beta1/prioritylevelconfiguration.go b/listers/flowcontrol/v1beta1/prioritylevelconfiguration.go index c94aaa4c1d..902f7cc4bb 100644 --- a/listers/flowcontrol/v1beta1/prioritylevelconfiguration.go +++ b/listers/flowcontrol/v1beta1/prioritylevelconfiguration.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/flowcontrol/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type PriorityLevelConfigurationLister interface { // priorityLevelConfigurationLister implements the PriorityLevelConfigurationLister interface. type priorityLevelConfigurationLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.PriorityLevelConfiguration] } // NewPriorityLevelConfigurationLister returns a new PriorityLevelConfigurationLister. func NewPriorityLevelConfigurationLister(indexer cache.Indexer) PriorityLevelConfigurationLister { - return &priorityLevelConfigurationLister{indexer: indexer} -} - -// List lists all PriorityLevelConfigurations in the indexer. -func (s *priorityLevelConfigurationLister) List(selector labels.Selector) (ret []*v1beta1.PriorityLevelConfiguration, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.PriorityLevelConfiguration)) - }) - return ret, err -} - -// Get retrieves the PriorityLevelConfiguration from the index for a given name. -func (s *priorityLevelConfigurationLister) Get(name string) (*v1beta1.PriorityLevelConfiguration, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("prioritylevelconfiguration"), name) - } - return obj.(*v1beta1.PriorityLevelConfiguration), nil + return &priorityLevelConfigurationLister{listers.New[*v1beta1.PriorityLevelConfiguration](indexer, v1beta1.Resource("prioritylevelconfiguration"))} } diff --git a/listers/flowcontrol/v1beta2/flowschema.go b/listers/flowcontrol/v1beta2/flowschema.go index 2710f26306..721c5f6bdd 100644 --- a/listers/flowcontrol/v1beta2/flowschema.go +++ b/listers/flowcontrol/v1beta2/flowschema.go @@ -20,8 +20,8 @@ package v1beta2 import ( v1beta2 "k8s.io/api/flowcontrol/v1beta2" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type FlowSchemaLister interface { // flowSchemaLister implements the FlowSchemaLister interface. type flowSchemaLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta2.FlowSchema] } // NewFlowSchemaLister returns a new FlowSchemaLister. func NewFlowSchemaLister(indexer cache.Indexer) FlowSchemaLister { - return &flowSchemaLister{indexer: indexer} -} - -// List lists all FlowSchemas in the indexer. -func (s *flowSchemaLister) List(selector labels.Selector) (ret []*v1beta2.FlowSchema, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta2.FlowSchema)) - }) - return ret, err -} - -// Get retrieves the FlowSchema from the index for a given name. -func (s *flowSchemaLister) Get(name string) (*v1beta2.FlowSchema, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta2.Resource("flowschema"), name) - } - return obj.(*v1beta2.FlowSchema), nil + return &flowSchemaLister{listers.New[*v1beta2.FlowSchema](indexer, v1beta2.Resource("flowschema"))} } diff --git a/listers/flowcontrol/v1beta2/prioritylevelconfiguration.go b/listers/flowcontrol/v1beta2/prioritylevelconfiguration.go index 00ede00709..3e8a2134fc 100644 --- a/listers/flowcontrol/v1beta2/prioritylevelconfiguration.go +++ b/listers/flowcontrol/v1beta2/prioritylevelconfiguration.go @@ -20,8 +20,8 @@ package v1beta2 import ( v1beta2 "k8s.io/api/flowcontrol/v1beta2" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type PriorityLevelConfigurationLister interface { // priorityLevelConfigurationLister implements the PriorityLevelConfigurationLister interface. type priorityLevelConfigurationLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta2.PriorityLevelConfiguration] } // NewPriorityLevelConfigurationLister returns a new PriorityLevelConfigurationLister. func NewPriorityLevelConfigurationLister(indexer cache.Indexer) PriorityLevelConfigurationLister { - return &priorityLevelConfigurationLister{indexer: indexer} -} - -// List lists all PriorityLevelConfigurations in the indexer. -func (s *priorityLevelConfigurationLister) List(selector labels.Selector) (ret []*v1beta2.PriorityLevelConfiguration, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta2.PriorityLevelConfiguration)) - }) - return ret, err -} - -// Get retrieves the PriorityLevelConfiguration from the index for a given name. -func (s *priorityLevelConfigurationLister) Get(name string) (*v1beta2.PriorityLevelConfiguration, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta2.Resource("prioritylevelconfiguration"), name) - } - return obj.(*v1beta2.PriorityLevelConfiguration), nil + return &priorityLevelConfigurationLister{listers.New[*v1beta2.PriorityLevelConfiguration](indexer, v1beta2.Resource("prioritylevelconfiguration"))} } diff --git a/listers/flowcontrol/v1beta3/flowschema.go b/listers/flowcontrol/v1beta3/flowschema.go index ef01b5a76e..c5555fd64d 100644 --- a/listers/flowcontrol/v1beta3/flowschema.go +++ b/listers/flowcontrol/v1beta3/flowschema.go @@ -20,8 +20,8 @@ package v1beta3 import ( v1beta3 "k8s.io/api/flowcontrol/v1beta3" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type FlowSchemaLister interface { // flowSchemaLister implements the FlowSchemaLister interface. type flowSchemaLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta3.FlowSchema] } // NewFlowSchemaLister returns a new FlowSchemaLister. func NewFlowSchemaLister(indexer cache.Indexer) FlowSchemaLister { - return &flowSchemaLister{indexer: indexer} -} - -// List lists all FlowSchemas in the indexer. -func (s *flowSchemaLister) List(selector labels.Selector) (ret []*v1beta3.FlowSchema, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta3.FlowSchema)) - }) - return ret, err -} - -// Get retrieves the FlowSchema from the index for a given name. -func (s *flowSchemaLister) Get(name string) (*v1beta3.FlowSchema, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta3.Resource("flowschema"), name) - } - return obj.(*v1beta3.FlowSchema), nil + return &flowSchemaLister{listers.New[*v1beta3.FlowSchema](indexer, v1beta3.Resource("flowschema"))} } diff --git a/listers/flowcontrol/v1beta3/prioritylevelconfiguration.go b/listers/flowcontrol/v1beta3/prioritylevelconfiguration.go index d05613949f..9f7d89c548 100644 --- a/listers/flowcontrol/v1beta3/prioritylevelconfiguration.go +++ b/listers/flowcontrol/v1beta3/prioritylevelconfiguration.go @@ -20,8 +20,8 @@ package v1beta3 import ( v1beta3 "k8s.io/api/flowcontrol/v1beta3" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type PriorityLevelConfigurationLister interface { // priorityLevelConfigurationLister implements the PriorityLevelConfigurationLister interface. type priorityLevelConfigurationLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta3.PriorityLevelConfiguration] } // NewPriorityLevelConfigurationLister returns a new PriorityLevelConfigurationLister. func NewPriorityLevelConfigurationLister(indexer cache.Indexer) PriorityLevelConfigurationLister { - return &priorityLevelConfigurationLister{indexer: indexer} -} - -// List lists all PriorityLevelConfigurations in the indexer. -func (s *priorityLevelConfigurationLister) List(selector labels.Selector) (ret []*v1beta3.PriorityLevelConfiguration, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta3.PriorityLevelConfiguration)) - }) - return ret, err -} - -// Get retrieves the PriorityLevelConfiguration from the index for a given name. -func (s *priorityLevelConfigurationLister) Get(name string) (*v1beta3.PriorityLevelConfiguration, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta3.Resource("prioritylevelconfiguration"), name) - } - return obj.(*v1beta3.PriorityLevelConfiguration), nil + return &priorityLevelConfigurationLister{listers.New[*v1beta3.PriorityLevelConfiguration](indexer, v1beta3.Resource("prioritylevelconfiguration"))} } diff --git a/listers/imagepolicy/v1alpha1/imagereview.go b/listers/imagepolicy/v1alpha1/imagereview.go index cb0f7b7a13..843e6b68dd 100644 --- a/listers/imagepolicy/v1alpha1/imagereview.go +++ b/listers/imagepolicy/v1alpha1/imagereview.go @@ -20,8 +20,8 @@ package v1alpha1 import ( v1alpha1 "k8s.io/api/imagepolicy/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type ImageReviewLister interface { // imageReviewLister implements the ImageReviewLister interface. type imageReviewLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.ImageReview] } // NewImageReviewLister returns a new ImageReviewLister. func NewImageReviewLister(indexer cache.Indexer) ImageReviewLister { - return &imageReviewLister{indexer: indexer} -} - -// List lists all ImageReviews in the indexer. -func (s *imageReviewLister) List(selector labels.Selector) (ret []*v1alpha1.ImageReview, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.ImageReview)) - }) - return ret, err -} - -// Get retrieves the ImageReview from the index for a given name. -func (s *imageReviewLister) Get(name string) (*v1alpha1.ImageReview, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("imagereview"), name) - } - return obj.(*v1alpha1.ImageReview), nil + return &imageReviewLister{listers.New[*v1alpha1.ImageReview](indexer, v1alpha1.Resource("imagereview"))} } diff --git a/listers/networking/v1/ingress.go b/listers/networking/v1/ingress.go index 0f49d4f572..3007cd3492 100644 --- a/listers/networking/v1/ingress.go +++ b/listers/networking/v1/ingress.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/networking/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type IngressLister interface { // ingressLister implements the IngressLister interface. type ingressLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Ingress] } // NewIngressLister returns a new IngressLister. func NewIngressLister(indexer cache.Indexer) IngressLister { - return &ingressLister{indexer: indexer} -} - -// List lists all Ingresses in the indexer. -func (s *ingressLister) List(selector labels.Selector) (ret []*v1.Ingress, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Ingress)) - }) - return ret, err + return &ingressLister{listers.New[*v1.Ingress](indexer, v1.Resource("ingress"))} } // Ingresses returns an object that can list and get Ingresses. func (s *ingressLister) Ingresses(namespace string) IngressNamespaceLister { - return ingressNamespaceLister{indexer: s.indexer, namespace: namespace} + return ingressNamespaceLister{listers.NewNamespaced[*v1.Ingress](s.ResourceIndexer, namespace)} } // IngressNamespaceLister helps list and get Ingresses. @@ -74,26 +66,5 @@ type IngressNamespaceLister interface { // ingressNamespaceLister implements the IngressNamespaceLister // interface. type ingressNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Ingresses in the indexer for a given namespace. -func (s ingressNamespaceLister) List(selector labels.Selector) (ret []*v1.Ingress, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Ingress)) - }) - return ret, err -} - -// Get retrieves the Ingress from the indexer for a given namespace and name. -func (s ingressNamespaceLister) Get(name string) (*v1.Ingress, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("ingress"), name) - } - return obj.(*v1.Ingress), nil + listers.ResourceIndexer[*v1.Ingress] } diff --git a/listers/networking/v1/ingressclass.go b/listers/networking/v1/ingressclass.go index 1480cb13fd..a8efe5c5e3 100644 --- a/listers/networking/v1/ingressclass.go +++ b/listers/networking/v1/ingressclass.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/networking/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type IngressClassLister interface { // ingressClassLister implements the IngressClassLister interface. type ingressClassLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.IngressClass] } // NewIngressClassLister returns a new IngressClassLister. func NewIngressClassLister(indexer cache.Indexer) IngressClassLister { - return &ingressClassLister{indexer: indexer} -} - -// List lists all IngressClasses in the indexer. -func (s *ingressClassLister) List(selector labels.Selector) (ret []*v1.IngressClass, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.IngressClass)) - }) - return ret, err -} - -// Get retrieves the IngressClass from the index for a given name. -func (s *ingressClassLister) Get(name string) (*v1.IngressClass, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("ingressclass"), name) - } - return obj.(*v1.IngressClass), nil + return &ingressClassLister{listers.New[*v1.IngressClass](indexer, v1.Resource("ingressclass"))} } diff --git a/listers/networking/v1/networkpolicy.go b/listers/networking/v1/networkpolicy.go index 34cabf0577..9a3e3172ef 100644 --- a/listers/networking/v1/networkpolicy.go +++ b/listers/networking/v1/networkpolicy.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/networking/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type NetworkPolicyLister interface { // networkPolicyLister implements the NetworkPolicyLister interface. type networkPolicyLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.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 []*v1.NetworkPolicy, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.NetworkPolicy)) - }) - return ret, err + return &networkPolicyLister{listers.New[*v1.NetworkPolicy](indexer, v1.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[*v1.NetworkPolicy](s.ResourceIndexer, namespace)} } // NetworkPolicyNamespaceLister helps list and get NetworkPolicies. @@ -74,26 +66,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 []*v1.NetworkPolicy, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.NetworkPolicy)) - }) - return ret, err -} - -// Get retrieves the NetworkPolicy from the indexer for a given namespace and name. -func (s networkPolicyNamespaceLister) Get(name string) (*v1.NetworkPolicy, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("networkpolicy"), name) - } - return obj.(*v1.NetworkPolicy), nil + listers.ResourceIndexer[*v1.NetworkPolicy] } diff --git a/listers/networking/v1alpha1/ipaddress.go b/listers/networking/v1alpha1/ipaddress.go index b3dfe27971..749affd7b9 100644 --- a/listers/networking/v1alpha1/ipaddress.go +++ b/listers/networking/v1alpha1/ipaddress.go @@ -20,8 +20,8 @@ package v1alpha1 import ( v1alpha1 "k8s.io/api/networking/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,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/listers/networking/v1alpha1/servicecidr.go b/listers/networking/v1alpha1/servicecidr.go index 8bc2b10e68..8be2d11af4 100644 --- a/listers/networking/v1alpha1/servicecidr.go +++ b/listers/networking/v1alpha1/servicecidr.go @@ -20,8 +20,8 @@ package v1alpha1 import ( v1alpha1 "k8s.io/api/networking/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type ServiceCIDRLister interface { // serviceCIDRLister implements the ServiceCIDRLister interface. type serviceCIDRLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.ServiceCIDR] } // NewServiceCIDRLister returns a new ServiceCIDRLister. func NewServiceCIDRLister(indexer cache.Indexer) ServiceCIDRLister { - return &serviceCIDRLister{indexer: indexer} -} - -// List lists all ServiceCIDRs in the indexer. -func (s *serviceCIDRLister) List(selector labels.Selector) (ret []*v1alpha1.ServiceCIDR, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.ServiceCIDR)) - }) - return ret, err -} - -// Get retrieves the ServiceCIDR from the index for a given name. -func (s *serviceCIDRLister) Get(name string) (*v1alpha1.ServiceCIDR, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("servicecidr"), name) - } - return obj.(*v1alpha1.ServiceCIDR), nil + return &serviceCIDRLister{listers.New[*v1alpha1.ServiceCIDR](indexer, v1alpha1.Resource("servicecidr"))} } diff --git a/listers/networking/v1beta1/ingress.go b/listers/networking/v1beta1/ingress.go index b8f4d35580..b8fe99e240 100644 --- a/listers/networking/v1beta1/ingress.go +++ b/listers/networking/v1beta1/ingress.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/networking/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type IngressLister interface { // ingressLister implements the IngressLister interface. type ingressLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.Ingress] } // NewIngressLister returns a new IngressLister. func NewIngressLister(indexer cache.Indexer) IngressLister { - return &ingressLister{indexer: indexer} -} - -// List lists all Ingresses in the indexer. -func (s *ingressLister) List(selector labels.Selector) (ret []*v1beta1.Ingress, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Ingress)) - }) - return ret, err + return &ingressLister{listers.New[*v1beta1.Ingress](indexer, v1beta1.Resource("ingress"))} } // Ingresses returns an object that can list and get Ingresses. func (s *ingressLister) Ingresses(namespace string) IngressNamespaceLister { - return ingressNamespaceLister{indexer: s.indexer, namespace: namespace} + return ingressNamespaceLister{listers.NewNamespaced[*v1beta1.Ingress](s.ResourceIndexer, namespace)} } // IngressNamespaceLister helps list and get Ingresses. @@ -74,26 +66,5 @@ type IngressNamespaceLister interface { // ingressNamespaceLister implements the IngressNamespaceLister // interface. type ingressNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Ingresses in the indexer for a given namespace. -func (s ingressNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Ingress, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Ingress)) - }) - return ret, err -} - -// Get retrieves the Ingress from the indexer for a given namespace and name. -func (s ingressNamespaceLister) Get(name string) (*v1beta1.Ingress, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("ingress"), name) - } - return obj.(*v1beta1.Ingress), nil + listers.ResourceIndexer[*v1beta1.Ingress] } diff --git a/listers/networking/v1beta1/ingressclass.go b/listers/networking/v1beta1/ingressclass.go index ebcd6ba85b..a5e33525f6 100644 --- a/listers/networking/v1beta1/ingressclass.go +++ b/listers/networking/v1beta1/ingressclass.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/networking/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type IngressClassLister interface { // ingressClassLister implements the IngressClassLister interface. type ingressClassLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.IngressClass] } // NewIngressClassLister returns a new IngressClassLister. func NewIngressClassLister(indexer cache.Indexer) IngressClassLister { - return &ingressClassLister{indexer: indexer} -} - -// List lists all IngressClasses in the indexer. -func (s *ingressClassLister) List(selector labels.Selector) (ret []*v1beta1.IngressClass, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.IngressClass)) - }) - return ret, err -} - -// Get retrieves the IngressClass from the index for a given name. -func (s *ingressClassLister) Get(name string) (*v1beta1.IngressClass, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("ingressclass"), name) - } - return obj.(*v1beta1.IngressClass), nil + return &ingressClassLister{listers.New[*v1beta1.IngressClass](indexer, v1beta1.Resource("ingressclass"))} } diff --git a/listers/node/v1/runtimeclass.go b/listers/node/v1/runtimeclass.go index 6e00cf1a59..17b88687e2 100644 --- a/listers/node/v1/runtimeclass.go +++ b/listers/node/v1/runtimeclass.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/node/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type RuntimeClassLister interface { // runtimeClassLister implements the RuntimeClassLister interface. type runtimeClassLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.RuntimeClass] } // NewRuntimeClassLister returns a new RuntimeClassLister. func NewRuntimeClassLister(indexer cache.Indexer) RuntimeClassLister { - return &runtimeClassLister{indexer: indexer} -} - -// List lists all RuntimeClasses in the indexer. -func (s *runtimeClassLister) List(selector labels.Selector) (ret []*v1.RuntimeClass, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.RuntimeClass)) - }) - return ret, err -} - -// Get retrieves the RuntimeClass from the index for a given name. -func (s *runtimeClassLister) Get(name string) (*v1.RuntimeClass, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("runtimeclass"), name) - } - return obj.(*v1.RuntimeClass), nil + return &runtimeClassLister{listers.New[*v1.RuntimeClass](indexer, v1.Resource("runtimeclass"))} } diff --git a/listers/node/v1alpha1/runtimeclass.go b/listers/node/v1alpha1/runtimeclass.go index 31f3357990..1f6e06f489 100644 --- a/listers/node/v1alpha1/runtimeclass.go +++ b/listers/node/v1alpha1/runtimeclass.go @@ -20,8 +20,8 @@ package v1alpha1 import ( v1alpha1 "k8s.io/api/node/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type RuntimeClassLister interface { // runtimeClassLister implements the RuntimeClassLister interface. type runtimeClassLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.RuntimeClass] } // NewRuntimeClassLister returns a new RuntimeClassLister. func NewRuntimeClassLister(indexer cache.Indexer) RuntimeClassLister { - return &runtimeClassLister{indexer: indexer} -} - -// List lists all RuntimeClasses in the indexer. -func (s *runtimeClassLister) List(selector labels.Selector) (ret []*v1alpha1.RuntimeClass, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.RuntimeClass)) - }) - return ret, err -} - -// Get retrieves the RuntimeClass from the index for a given name. -func (s *runtimeClassLister) Get(name string) (*v1alpha1.RuntimeClass, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("runtimeclass"), name) - } - return obj.(*v1alpha1.RuntimeClass), nil + return &runtimeClassLister{listers.New[*v1alpha1.RuntimeClass](indexer, v1alpha1.Resource("runtimeclass"))} } diff --git a/listers/node/v1beta1/runtimeclass.go b/listers/node/v1beta1/runtimeclass.go index 7dbd6ab268..cd0cdf3c52 100644 --- a/listers/node/v1beta1/runtimeclass.go +++ b/listers/node/v1beta1/runtimeclass.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/node/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type RuntimeClassLister interface { // runtimeClassLister implements the RuntimeClassLister interface. type runtimeClassLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.RuntimeClass] } // NewRuntimeClassLister returns a new RuntimeClassLister. func NewRuntimeClassLister(indexer cache.Indexer) RuntimeClassLister { - return &runtimeClassLister{indexer: indexer} -} - -// List lists all RuntimeClasses in the indexer. -func (s *runtimeClassLister) List(selector labels.Selector) (ret []*v1beta1.RuntimeClass, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.RuntimeClass)) - }) - return ret, err -} - -// Get retrieves the RuntimeClass from the index for a given name. -func (s *runtimeClassLister) Get(name string) (*v1beta1.RuntimeClass, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("runtimeclass"), name) - } - return obj.(*v1beta1.RuntimeClass), nil + return &runtimeClassLister{listers.New[*v1beta1.RuntimeClass](indexer, v1beta1.Resource("runtimeclass"))} } diff --git a/listers/policy/v1/eviction.go b/listers/policy/v1/eviction.go index dc5ffa0740..83695668fa 100644 --- a/listers/policy/v1/eviction.go +++ b/listers/policy/v1/eviction.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/policy/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type EvictionLister interface { // evictionLister implements the EvictionLister interface. type evictionLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Eviction] } // NewEvictionLister returns a new EvictionLister. func NewEvictionLister(indexer cache.Indexer) EvictionLister { - return &evictionLister{indexer: indexer} -} - -// List lists all Evictions in the indexer. -func (s *evictionLister) List(selector labels.Selector) (ret []*v1.Eviction, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Eviction)) - }) - return ret, err + return &evictionLister{listers.New[*v1.Eviction](indexer, v1.Resource("eviction"))} } // Evictions returns an object that can list and get Evictions. func (s *evictionLister) Evictions(namespace string) EvictionNamespaceLister { - return evictionNamespaceLister{indexer: s.indexer, namespace: namespace} + return evictionNamespaceLister{listers.NewNamespaced[*v1.Eviction](s.ResourceIndexer, namespace)} } // EvictionNamespaceLister helps list and get Evictions. @@ -74,26 +66,5 @@ type EvictionNamespaceLister interface { // evictionNamespaceLister implements the EvictionNamespaceLister // interface. type evictionNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Evictions in the indexer for a given namespace. -func (s evictionNamespaceLister) List(selector labels.Selector) (ret []*v1.Eviction, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Eviction)) - }) - return ret, err -} - -// Get retrieves the Eviction from the indexer for a given namespace and name. -func (s evictionNamespaceLister) Get(name string) (*v1.Eviction, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("eviction"), name) - } - return obj.(*v1.Eviction), nil + listers.ResourceIndexer[*v1.Eviction] } diff --git a/listers/policy/v1/poddisruptionbudget.go b/listers/policy/v1/poddisruptionbudget.go index 8470d38bb2..38ed8144eb 100644 --- a/listers/policy/v1/poddisruptionbudget.go +++ b/listers/policy/v1/poddisruptionbudget.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/policy/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type PodDisruptionBudgetLister interface { // podDisruptionBudgetLister implements the PodDisruptionBudgetLister interface. type podDisruptionBudgetLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.PodDisruptionBudget] } // NewPodDisruptionBudgetLister returns a new PodDisruptionBudgetLister. func NewPodDisruptionBudgetLister(indexer cache.Indexer) PodDisruptionBudgetLister { - return &podDisruptionBudgetLister{indexer: indexer} -} - -// List lists all PodDisruptionBudgets in the indexer. -func (s *podDisruptionBudgetLister) List(selector labels.Selector) (ret []*v1.PodDisruptionBudget, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.PodDisruptionBudget)) - }) - return ret, err + return &podDisruptionBudgetLister{listers.New[*v1.PodDisruptionBudget](indexer, v1.Resource("poddisruptionbudget"))} } // PodDisruptionBudgets returns an object that can list and get PodDisruptionBudgets. func (s *podDisruptionBudgetLister) PodDisruptionBudgets(namespace string) PodDisruptionBudgetNamespaceLister { - return podDisruptionBudgetNamespaceLister{indexer: s.indexer, namespace: namespace} + return podDisruptionBudgetNamespaceLister{listers.NewNamespaced[*v1.PodDisruptionBudget](s.ResourceIndexer, namespace)} } // PodDisruptionBudgetNamespaceLister helps list and get PodDisruptionBudgets. @@ -74,26 +66,5 @@ type PodDisruptionBudgetNamespaceLister interface { // podDisruptionBudgetNamespaceLister implements the PodDisruptionBudgetNamespaceLister // interface. type podDisruptionBudgetNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all PodDisruptionBudgets in the indexer for a given namespace. -func (s podDisruptionBudgetNamespaceLister) List(selector labels.Selector) (ret []*v1.PodDisruptionBudget, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.PodDisruptionBudget)) - }) - return ret, err -} - -// Get retrieves the PodDisruptionBudget from the indexer for a given namespace and name. -func (s podDisruptionBudgetNamespaceLister) Get(name string) (*v1.PodDisruptionBudget, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("poddisruptionbudget"), name) - } - return obj.(*v1.PodDisruptionBudget), nil + listers.ResourceIndexer[*v1.PodDisruptionBudget] } diff --git a/listers/policy/v1beta1/eviction.go b/listers/policy/v1beta1/eviction.go index e1d40d0b32..0aff833524 100644 --- a/listers/policy/v1beta1/eviction.go +++ b/listers/policy/v1beta1/eviction.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/policy/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type EvictionLister interface { // evictionLister implements the EvictionLister interface. type evictionLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.Eviction] } // NewEvictionLister returns a new EvictionLister. func NewEvictionLister(indexer cache.Indexer) EvictionLister { - return &evictionLister{indexer: indexer} -} - -// List lists all Evictions in the indexer. -func (s *evictionLister) List(selector labels.Selector) (ret []*v1beta1.Eviction, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Eviction)) - }) - return ret, err + return &evictionLister{listers.New[*v1beta1.Eviction](indexer, v1beta1.Resource("eviction"))} } // Evictions returns an object that can list and get Evictions. func (s *evictionLister) Evictions(namespace string) EvictionNamespaceLister { - return evictionNamespaceLister{indexer: s.indexer, namespace: namespace} + return evictionNamespaceLister{listers.NewNamespaced[*v1beta1.Eviction](s.ResourceIndexer, namespace)} } // EvictionNamespaceLister helps list and get Evictions. @@ -74,26 +66,5 @@ type EvictionNamespaceLister interface { // evictionNamespaceLister implements the EvictionNamespaceLister // interface. type evictionNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Evictions in the indexer for a given namespace. -func (s evictionNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Eviction, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Eviction)) - }) - return ret, err -} - -// Get retrieves the Eviction from the indexer for a given namespace and name. -func (s evictionNamespaceLister) Get(name string) (*v1beta1.Eviction, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("eviction"), name) - } - return obj.(*v1beta1.Eviction), nil + listers.ResourceIndexer[*v1beta1.Eviction] } diff --git a/listers/policy/v1beta1/poddisruptionbudget.go b/listers/policy/v1beta1/poddisruptionbudget.go index aa08f813ee..55ae892e2b 100644 --- a/listers/policy/v1beta1/poddisruptionbudget.go +++ b/listers/policy/v1beta1/poddisruptionbudget.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/policy/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type PodDisruptionBudgetLister interface { // podDisruptionBudgetLister implements the PodDisruptionBudgetLister interface. type podDisruptionBudgetLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.PodDisruptionBudget] } // NewPodDisruptionBudgetLister returns a new PodDisruptionBudgetLister. func NewPodDisruptionBudgetLister(indexer cache.Indexer) PodDisruptionBudgetLister { - return &podDisruptionBudgetLister{indexer: indexer} -} - -// List lists all PodDisruptionBudgets in the indexer. -func (s *podDisruptionBudgetLister) List(selector labels.Selector) (ret []*v1beta1.PodDisruptionBudget, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.PodDisruptionBudget)) - }) - return ret, err + return &podDisruptionBudgetLister{listers.New[*v1beta1.PodDisruptionBudget](indexer, v1beta1.Resource("poddisruptionbudget"))} } // PodDisruptionBudgets returns an object that can list and get PodDisruptionBudgets. func (s *podDisruptionBudgetLister) PodDisruptionBudgets(namespace string) PodDisruptionBudgetNamespaceLister { - return podDisruptionBudgetNamespaceLister{indexer: s.indexer, namespace: namespace} + return podDisruptionBudgetNamespaceLister{listers.NewNamespaced[*v1beta1.PodDisruptionBudget](s.ResourceIndexer, namespace)} } // PodDisruptionBudgetNamespaceLister helps list and get PodDisruptionBudgets. @@ -74,26 +66,5 @@ type PodDisruptionBudgetNamespaceLister interface { // podDisruptionBudgetNamespaceLister implements the PodDisruptionBudgetNamespaceLister // interface. type podDisruptionBudgetNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all PodDisruptionBudgets in the indexer for a given namespace. -func (s podDisruptionBudgetNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.PodDisruptionBudget, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.PodDisruptionBudget)) - }) - return ret, err -} - -// Get retrieves the PodDisruptionBudget from the indexer for a given namespace and name. -func (s podDisruptionBudgetNamespaceLister) Get(name string) (*v1beta1.PodDisruptionBudget, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("poddisruptionbudget"), name) - } - return obj.(*v1beta1.PodDisruptionBudget), nil + listers.ResourceIndexer[*v1beta1.PodDisruptionBudget] } diff --git a/listers/rbac/v1/clusterrole.go b/listers/rbac/v1/clusterrole.go index 84dc003ca2..11a4cb4db4 100644 --- a/listers/rbac/v1/clusterrole.go +++ b/listers/rbac/v1/clusterrole.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/rbac/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type ClusterRoleLister interface { // clusterRoleLister implements the ClusterRoleLister interface. type clusterRoleLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.ClusterRole] } // NewClusterRoleLister returns a new ClusterRoleLister. func NewClusterRoleLister(indexer cache.Indexer) ClusterRoleLister { - return &clusterRoleLister{indexer: indexer} -} - -// List lists all ClusterRoles in the indexer. -func (s *clusterRoleLister) List(selector labels.Selector) (ret []*v1.ClusterRole, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ClusterRole)) - }) - return ret, err -} - -// Get retrieves the ClusterRole from the index for a given name. -func (s *clusterRoleLister) Get(name string) (*v1.ClusterRole, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("clusterrole"), name) - } - return obj.(*v1.ClusterRole), nil + return &clusterRoleLister{listers.New[*v1.ClusterRole](indexer, v1.Resource("clusterrole"))} } diff --git a/listers/rbac/v1/clusterrolebinding.go b/listers/rbac/v1/clusterrolebinding.go index ff061d4b2b..4c3583bb94 100644 --- a/listers/rbac/v1/clusterrolebinding.go +++ b/listers/rbac/v1/clusterrolebinding.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/rbac/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type ClusterRoleBindingLister interface { // clusterRoleBindingLister implements the ClusterRoleBindingLister interface. type clusterRoleBindingLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.ClusterRoleBinding] } // NewClusterRoleBindingLister returns a new ClusterRoleBindingLister. func NewClusterRoleBindingLister(indexer cache.Indexer) ClusterRoleBindingLister { - return &clusterRoleBindingLister{indexer: indexer} -} - -// List lists all ClusterRoleBindings in the indexer. -func (s *clusterRoleBindingLister) List(selector labels.Selector) (ret []*v1.ClusterRoleBinding, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.ClusterRoleBinding)) - }) - return ret, err -} - -// Get retrieves the ClusterRoleBinding from the index for a given name. -func (s *clusterRoleBindingLister) Get(name string) (*v1.ClusterRoleBinding, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("clusterrolebinding"), name) - } - return obj.(*v1.ClusterRoleBinding), nil + return &clusterRoleBindingLister{listers.New[*v1.ClusterRoleBinding](indexer, v1.Resource("clusterrolebinding"))} } diff --git a/listers/rbac/v1/role.go b/listers/rbac/v1/role.go index 503f013b52..3e94253215 100644 --- a/listers/rbac/v1/role.go +++ b/listers/rbac/v1/role.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/rbac/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type RoleLister interface { // roleLister implements the RoleLister interface. type roleLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.Role] } // NewRoleLister returns a new RoleLister. func NewRoleLister(indexer cache.Indexer) RoleLister { - return &roleLister{indexer: indexer} -} - -// List lists all Roles in the indexer. -func (s *roleLister) List(selector labels.Selector) (ret []*v1.Role, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Role)) - }) - return ret, err + return &roleLister{listers.New[*v1.Role](indexer, v1.Resource("role"))} } // Roles returns an object that can list and get Roles. func (s *roleLister) Roles(namespace string) RoleNamespaceLister { - return roleNamespaceLister{indexer: s.indexer, namespace: namespace} + return roleNamespaceLister{listers.NewNamespaced[*v1.Role](s.ResourceIndexer, namespace)} } // RoleNamespaceLister helps list and get Roles. @@ -74,26 +66,5 @@ type RoleNamespaceLister interface { // roleNamespaceLister implements the RoleNamespaceLister // interface. type roleNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Roles in the indexer for a given namespace. -func (s roleNamespaceLister) List(selector labels.Selector) (ret []*v1.Role, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Role)) - }) - return ret, err -} - -// Get retrieves the Role from the indexer for a given namespace and name. -func (s roleNamespaceLister) Get(name string) (*v1.Role, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("role"), name) - } - return obj.(*v1.Role), nil + listers.ResourceIndexer[*v1.Role] } diff --git a/listers/rbac/v1/rolebinding.go b/listers/rbac/v1/rolebinding.go index ea50c64136..1b3162a113 100644 --- a/listers/rbac/v1/rolebinding.go +++ b/listers/rbac/v1/rolebinding.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/rbac/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type RoleBindingLister interface { // roleBindingLister implements the RoleBindingLister interface. type roleBindingLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.RoleBinding] } // NewRoleBindingLister returns a new RoleBindingLister. func NewRoleBindingLister(indexer cache.Indexer) RoleBindingLister { - return &roleBindingLister{indexer: indexer} -} - -// List lists all RoleBindings in the indexer. -func (s *roleBindingLister) List(selector labels.Selector) (ret []*v1.RoleBinding, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.RoleBinding)) - }) - return ret, err + return &roleBindingLister{listers.New[*v1.RoleBinding](indexer, v1.Resource("rolebinding"))} } // RoleBindings returns an object that can list and get RoleBindings. func (s *roleBindingLister) RoleBindings(namespace string) RoleBindingNamespaceLister { - return roleBindingNamespaceLister{indexer: s.indexer, namespace: namespace} + return roleBindingNamespaceLister{listers.NewNamespaced[*v1.RoleBinding](s.ResourceIndexer, namespace)} } // RoleBindingNamespaceLister helps list and get RoleBindings. @@ -74,26 +66,5 @@ type RoleBindingNamespaceLister interface { // roleBindingNamespaceLister implements the RoleBindingNamespaceLister // interface. type roleBindingNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all RoleBindings in the indexer for a given namespace. -func (s roleBindingNamespaceLister) List(selector labels.Selector) (ret []*v1.RoleBinding, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.RoleBinding)) - }) - return ret, err -} - -// Get retrieves the RoleBinding from the indexer for a given namespace and name. -func (s roleBindingNamespaceLister) Get(name string) (*v1.RoleBinding, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("rolebinding"), name) - } - return obj.(*v1.RoleBinding), nil + listers.ResourceIndexer[*v1.RoleBinding] } diff --git a/listers/rbac/v1alpha1/clusterrole.go b/listers/rbac/v1alpha1/clusterrole.go index 181ea95a7d..5e5bbaa5a2 100644 --- a/listers/rbac/v1alpha1/clusterrole.go +++ b/listers/rbac/v1alpha1/clusterrole.go @@ -20,8 +20,8 @@ package v1alpha1 import ( v1alpha1 "k8s.io/api/rbac/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type ClusterRoleLister interface { // clusterRoleLister implements the ClusterRoleLister interface. type clusterRoleLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.ClusterRole] } // NewClusterRoleLister returns a new ClusterRoleLister. func NewClusterRoleLister(indexer cache.Indexer) ClusterRoleLister { - return &clusterRoleLister{indexer: indexer} -} - -// List lists all ClusterRoles in the indexer. -func (s *clusterRoleLister) List(selector labels.Selector) (ret []*v1alpha1.ClusterRole, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.ClusterRole)) - }) - return ret, err -} - -// Get retrieves the ClusterRole from the index for a given name. -func (s *clusterRoleLister) Get(name string) (*v1alpha1.ClusterRole, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("clusterrole"), name) - } - return obj.(*v1alpha1.ClusterRole), nil + return &clusterRoleLister{listers.New[*v1alpha1.ClusterRole](indexer, v1alpha1.Resource("clusterrole"))} } diff --git a/listers/rbac/v1alpha1/clusterrolebinding.go b/listers/rbac/v1alpha1/clusterrolebinding.go index 29d283b6cf..d825d0a2f4 100644 --- a/listers/rbac/v1alpha1/clusterrolebinding.go +++ b/listers/rbac/v1alpha1/clusterrolebinding.go @@ -20,8 +20,8 @@ package v1alpha1 import ( v1alpha1 "k8s.io/api/rbac/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type ClusterRoleBindingLister interface { // clusterRoleBindingLister implements the ClusterRoleBindingLister interface. type clusterRoleBindingLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.ClusterRoleBinding] } // NewClusterRoleBindingLister returns a new ClusterRoleBindingLister. func NewClusterRoleBindingLister(indexer cache.Indexer) ClusterRoleBindingLister { - return &clusterRoleBindingLister{indexer: indexer} -} - -// List lists all ClusterRoleBindings in the indexer. -func (s *clusterRoleBindingLister) List(selector labels.Selector) (ret []*v1alpha1.ClusterRoleBinding, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.ClusterRoleBinding)) - }) - return ret, err -} - -// Get retrieves the ClusterRoleBinding from the index for a given name. -func (s *clusterRoleBindingLister) Get(name string) (*v1alpha1.ClusterRoleBinding, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("clusterrolebinding"), name) - } - return obj.(*v1alpha1.ClusterRoleBinding), nil + return &clusterRoleBindingLister{listers.New[*v1alpha1.ClusterRoleBinding](indexer, v1alpha1.Resource("clusterrolebinding"))} } diff --git a/listers/rbac/v1alpha1/role.go b/listers/rbac/v1alpha1/role.go index 13a64137ae..f3d2b2838d 100644 --- a/listers/rbac/v1alpha1/role.go +++ b/listers/rbac/v1alpha1/role.go @@ -20,8 +20,8 @@ package v1alpha1 import ( v1alpha1 "k8s.io/api/rbac/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type RoleLister interface { // roleLister implements the RoleLister interface. type roleLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.Role] } // NewRoleLister returns a new RoleLister. func NewRoleLister(indexer cache.Indexer) RoleLister { - return &roleLister{indexer: indexer} -} - -// List lists all Roles in the indexer. -func (s *roleLister) List(selector labels.Selector) (ret []*v1alpha1.Role, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.Role)) - }) - return ret, err + return &roleLister{listers.New[*v1alpha1.Role](indexer, v1alpha1.Resource("role"))} } // Roles returns an object that can list and get Roles. func (s *roleLister) Roles(namespace string) RoleNamespaceLister { - return roleNamespaceLister{indexer: s.indexer, namespace: namespace} + return roleNamespaceLister{listers.NewNamespaced[*v1alpha1.Role](s.ResourceIndexer, namespace)} } // RoleNamespaceLister helps list and get Roles. @@ -74,26 +66,5 @@ type RoleNamespaceLister interface { // roleNamespaceLister implements the RoleNamespaceLister // interface. type roleNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Roles in the indexer for a given namespace. -func (s roleNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.Role, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.Role)) - }) - return ret, err -} - -// Get retrieves the Role from the indexer for a given namespace and name. -func (s roleNamespaceLister) Get(name string) (*v1alpha1.Role, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("role"), name) - } - return obj.(*v1alpha1.Role), nil + listers.ResourceIndexer[*v1alpha1.Role] } diff --git a/listers/rbac/v1alpha1/rolebinding.go b/listers/rbac/v1alpha1/rolebinding.go index 0ad3d0eba0..6d6f7b7005 100644 --- a/listers/rbac/v1alpha1/rolebinding.go +++ b/listers/rbac/v1alpha1/rolebinding.go @@ -20,8 +20,8 @@ package v1alpha1 import ( v1alpha1 "k8s.io/api/rbac/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type RoleBindingLister interface { // roleBindingLister implements the RoleBindingLister interface. type roleBindingLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.RoleBinding] } // NewRoleBindingLister returns a new RoleBindingLister. func NewRoleBindingLister(indexer cache.Indexer) RoleBindingLister { - return &roleBindingLister{indexer: indexer} -} - -// List lists all RoleBindings in the indexer. -func (s *roleBindingLister) List(selector labels.Selector) (ret []*v1alpha1.RoleBinding, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.RoleBinding)) - }) - return ret, err + return &roleBindingLister{listers.New[*v1alpha1.RoleBinding](indexer, v1alpha1.Resource("rolebinding"))} } // RoleBindings returns an object that can list and get RoleBindings. func (s *roleBindingLister) RoleBindings(namespace string) RoleBindingNamespaceLister { - return roleBindingNamespaceLister{indexer: s.indexer, namespace: namespace} + return roleBindingNamespaceLister{listers.NewNamespaced[*v1alpha1.RoleBinding](s.ResourceIndexer, namespace)} } // RoleBindingNamespaceLister helps list and get RoleBindings. @@ -74,26 +66,5 @@ type RoleBindingNamespaceLister interface { // roleBindingNamespaceLister implements the RoleBindingNamespaceLister // interface. type roleBindingNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all RoleBindings in the indexer for a given namespace. -func (s roleBindingNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.RoleBinding, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.RoleBinding)) - }) - return ret, err -} - -// Get retrieves the RoleBinding from the indexer for a given namespace and name. -func (s roleBindingNamespaceLister) Get(name string) (*v1alpha1.RoleBinding, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("rolebinding"), name) - } - return obj.(*v1alpha1.RoleBinding), nil + listers.ResourceIndexer[*v1alpha1.RoleBinding] } diff --git a/listers/rbac/v1beta1/clusterrole.go b/listers/rbac/v1beta1/clusterrole.go index bf6cd99cb1..bade032628 100644 --- a/listers/rbac/v1beta1/clusterrole.go +++ b/listers/rbac/v1beta1/clusterrole.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/rbac/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type ClusterRoleLister interface { // clusterRoleLister implements the ClusterRoleLister interface. type clusterRoleLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.ClusterRole] } // NewClusterRoleLister returns a new ClusterRoleLister. func NewClusterRoleLister(indexer cache.Indexer) ClusterRoleLister { - return &clusterRoleLister{indexer: indexer} -} - -// List lists all ClusterRoles in the indexer. -func (s *clusterRoleLister) List(selector labels.Selector) (ret []*v1beta1.ClusterRole, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.ClusterRole)) - }) - return ret, err -} - -// Get retrieves the ClusterRole from the index for a given name. -func (s *clusterRoleLister) Get(name string) (*v1beta1.ClusterRole, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("clusterrole"), name) - } - return obj.(*v1beta1.ClusterRole), nil + return &clusterRoleLister{listers.New[*v1beta1.ClusterRole](indexer, v1beta1.Resource("clusterrole"))} } diff --git a/listers/rbac/v1beta1/clusterrolebinding.go b/listers/rbac/v1beta1/clusterrolebinding.go index 00bab2330b..1f4d391bef 100644 --- a/listers/rbac/v1beta1/clusterrolebinding.go +++ b/listers/rbac/v1beta1/clusterrolebinding.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/rbac/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type ClusterRoleBindingLister interface { // clusterRoleBindingLister implements the ClusterRoleBindingLister interface. type clusterRoleBindingLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.ClusterRoleBinding] } // NewClusterRoleBindingLister returns a new ClusterRoleBindingLister. func NewClusterRoleBindingLister(indexer cache.Indexer) ClusterRoleBindingLister { - return &clusterRoleBindingLister{indexer: indexer} -} - -// List lists all ClusterRoleBindings in the indexer. -func (s *clusterRoleBindingLister) List(selector labels.Selector) (ret []*v1beta1.ClusterRoleBinding, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.ClusterRoleBinding)) - }) - return ret, err -} - -// Get retrieves the ClusterRoleBinding from the index for a given name. -func (s *clusterRoleBindingLister) Get(name string) (*v1beta1.ClusterRoleBinding, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("clusterrolebinding"), name) - } - return obj.(*v1beta1.ClusterRoleBinding), nil + return &clusterRoleBindingLister{listers.New[*v1beta1.ClusterRoleBinding](indexer, v1beta1.Resource("clusterrolebinding"))} } diff --git a/listers/rbac/v1beta1/role.go b/listers/rbac/v1beta1/role.go index 9cd9b9042d..71666a9a03 100644 --- a/listers/rbac/v1beta1/role.go +++ b/listers/rbac/v1beta1/role.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/rbac/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type RoleLister interface { // roleLister implements the RoleLister interface. type roleLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.Role] } // NewRoleLister returns a new RoleLister. func NewRoleLister(indexer cache.Indexer) RoleLister { - return &roleLister{indexer: indexer} -} - -// List lists all Roles in the indexer. -func (s *roleLister) List(selector labels.Selector) (ret []*v1beta1.Role, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Role)) - }) - return ret, err + return &roleLister{listers.New[*v1beta1.Role](indexer, v1beta1.Resource("role"))} } // Roles returns an object that can list and get Roles. func (s *roleLister) Roles(namespace string) RoleNamespaceLister { - return roleNamespaceLister{indexer: s.indexer, namespace: namespace} + return roleNamespaceLister{listers.NewNamespaced[*v1beta1.Role](s.ResourceIndexer, namespace)} } // RoleNamespaceLister helps list and get Roles. @@ -74,26 +66,5 @@ type RoleNamespaceLister interface { // roleNamespaceLister implements the RoleNamespaceLister // interface. type roleNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Roles in the indexer for a given namespace. -func (s roleNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Role, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Role)) - }) - return ret, err -} - -// Get retrieves the Role from the indexer for a given namespace and name. -func (s roleNamespaceLister) Get(name string) (*v1beta1.Role, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("role"), name) - } - return obj.(*v1beta1.Role), nil + listers.ResourceIndexer[*v1beta1.Role] } diff --git a/listers/rbac/v1beta1/rolebinding.go b/listers/rbac/v1beta1/rolebinding.go index 7c7c91bf3f..00f8542cbd 100644 --- a/listers/rbac/v1beta1/rolebinding.go +++ b/listers/rbac/v1beta1/rolebinding.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/rbac/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type RoleBindingLister interface { // roleBindingLister implements the RoleBindingLister interface. type roleBindingLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.RoleBinding] } // NewRoleBindingLister returns a new RoleBindingLister. func NewRoleBindingLister(indexer cache.Indexer) RoleBindingLister { - return &roleBindingLister{indexer: indexer} -} - -// List lists all RoleBindings in the indexer. -func (s *roleBindingLister) List(selector labels.Selector) (ret []*v1beta1.RoleBinding, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.RoleBinding)) - }) - return ret, err + return &roleBindingLister{listers.New[*v1beta1.RoleBinding](indexer, v1beta1.Resource("rolebinding"))} } // RoleBindings returns an object that can list and get RoleBindings. func (s *roleBindingLister) RoleBindings(namespace string) RoleBindingNamespaceLister { - return roleBindingNamespaceLister{indexer: s.indexer, namespace: namespace} + return roleBindingNamespaceLister{listers.NewNamespaced[*v1beta1.RoleBinding](s.ResourceIndexer, namespace)} } // RoleBindingNamespaceLister helps list and get RoleBindings. @@ -74,26 +66,5 @@ type RoleBindingNamespaceLister interface { // roleBindingNamespaceLister implements the RoleBindingNamespaceLister // interface. type roleBindingNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all RoleBindings in the indexer for a given namespace. -func (s roleBindingNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.RoleBinding, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.RoleBinding)) - }) - return ret, err -} - -// Get retrieves the RoleBinding from the indexer for a given namespace and name. -func (s roleBindingNamespaceLister) Get(name string) (*v1beta1.RoleBinding, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("rolebinding"), name) - } - return obj.(*v1beta1.RoleBinding), nil + listers.ResourceIndexer[*v1beta1.RoleBinding] } diff --git a/listers/resource/v1alpha2/podschedulingcontext.go b/listers/resource/v1alpha2/podschedulingcontext.go index c50b3f8890..9aca7bfbf9 100644 --- a/listers/resource/v1alpha2/podschedulingcontext.go +++ b/listers/resource/v1alpha2/podschedulingcontext.go @@ -20,8 +20,8 @@ package v1alpha2 import ( v1alpha2 "k8s.io/api/resource/v1alpha2" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type PodSchedulingContextLister interface { // podSchedulingContextLister implements the PodSchedulingContextLister interface. type podSchedulingContextLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha2.PodSchedulingContext] } // NewPodSchedulingContextLister returns a new PodSchedulingContextLister. func NewPodSchedulingContextLister(indexer cache.Indexer) PodSchedulingContextLister { - return &podSchedulingContextLister{indexer: indexer} -} - -// List lists all PodSchedulingContexts in the indexer. -func (s *podSchedulingContextLister) List(selector labels.Selector) (ret []*v1alpha2.PodSchedulingContext, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.PodSchedulingContext)) - }) - return ret, err + return &podSchedulingContextLister{listers.New[*v1alpha2.PodSchedulingContext](indexer, v1alpha2.Resource("podschedulingcontext"))} } // PodSchedulingContexts returns an object that can list and get PodSchedulingContexts. func (s *podSchedulingContextLister) PodSchedulingContexts(namespace string) PodSchedulingContextNamespaceLister { - return podSchedulingContextNamespaceLister{indexer: s.indexer, namespace: namespace} + return podSchedulingContextNamespaceLister{listers.NewNamespaced[*v1alpha2.PodSchedulingContext](s.ResourceIndexer, namespace)} } // PodSchedulingContextNamespaceLister helps list and get PodSchedulingContexts. @@ -74,26 +66,5 @@ type PodSchedulingContextNamespaceLister interface { // podSchedulingContextNamespaceLister implements the PodSchedulingContextNamespaceLister // interface. type podSchedulingContextNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all PodSchedulingContexts in the indexer for a given namespace. -func (s podSchedulingContextNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.PodSchedulingContext, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.PodSchedulingContext)) - }) - return ret, err -} - -// Get retrieves the PodSchedulingContext from the indexer for a given namespace and name. -func (s podSchedulingContextNamespaceLister) Get(name string) (*v1alpha2.PodSchedulingContext, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("podschedulingcontext"), name) - } - return obj.(*v1alpha2.PodSchedulingContext), nil + listers.ResourceIndexer[*v1alpha2.PodSchedulingContext] } diff --git a/listers/resource/v1alpha2/resourceclaim.go b/listers/resource/v1alpha2/resourceclaim.go index 273f16af31..8d789314db 100644 --- a/listers/resource/v1alpha2/resourceclaim.go +++ b/listers/resource/v1alpha2/resourceclaim.go @@ -20,8 +20,8 @@ package v1alpha2 import ( v1alpha2 "k8s.io/api/resource/v1alpha2" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type ResourceClaimLister interface { // resourceClaimLister implements the ResourceClaimLister interface. type resourceClaimLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha2.ResourceClaim] } // NewResourceClaimLister returns a new ResourceClaimLister. func NewResourceClaimLister(indexer cache.Indexer) ResourceClaimLister { - return &resourceClaimLister{indexer: indexer} -} - -// List lists all ResourceClaims in the indexer. -func (s *resourceClaimLister) List(selector labels.Selector) (ret []*v1alpha2.ResourceClaim, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.ResourceClaim)) - }) - return ret, err + return &resourceClaimLister{listers.New[*v1alpha2.ResourceClaim](indexer, v1alpha2.Resource("resourceclaim"))} } // ResourceClaims returns an object that can list and get ResourceClaims. func (s *resourceClaimLister) ResourceClaims(namespace string) ResourceClaimNamespaceLister { - return resourceClaimNamespaceLister{indexer: s.indexer, namespace: namespace} + return resourceClaimNamespaceLister{listers.NewNamespaced[*v1alpha2.ResourceClaim](s.ResourceIndexer, namespace)} } // ResourceClaimNamespaceLister helps list and get ResourceClaims. @@ -74,26 +66,5 @@ type ResourceClaimNamespaceLister interface { // resourceClaimNamespaceLister implements the ResourceClaimNamespaceLister // interface. type resourceClaimNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ResourceClaims in the indexer for a given namespace. -func (s resourceClaimNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.ResourceClaim, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.ResourceClaim)) - }) - return ret, err -} - -// Get retrieves the ResourceClaim from the indexer for a given namespace and name. -func (s resourceClaimNamespaceLister) Get(name string) (*v1alpha2.ResourceClaim, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("resourceclaim"), name) - } - return obj.(*v1alpha2.ResourceClaim), nil + listers.ResourceIndexer[*v1alpha2.ResourceClaim] } diff --git a/listers/resource/v1alpha2/resourceclaimparameters.go b/listers/resource/v1alpha2/resourceclaimparameters.go index 1a561ef7a5..ad751a6cee 100644 --- a/listers/resource/v1alpha2/resourceclaimparameters.go +++ b/listers/resource/v1alpha2/resourceclaimparameters.go @@ -20,8 +20,8 @@ package v1alpha2 import ( v1alpha2 "k8s.io/api/resource/v1alpha2" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type ResourceClaimParametersLister interface { // resourceClaimParametersLister implements the ResourceClaimParametersLister interface. type resourceClaimParametersLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha2.ResourceClaimParameters] } // NewResourceClaimParametersLister returns a new ResourceClaimParametersLister. func NewResourceClaimParametersLister(indexer cache.Indexer) ResourceClaimParametersLister { - return &resourceClaimParametersLister{indexer: indexer} -} - -// List lists all ResourceClaimParameters in the indexer. -func (s *resourceClaimParametersLister) List(selector labels.Selector) (ret []*v1alpha2.ResourceClaimParameters, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.ResourceClaimParameters)) - }) - return ret, err + return &resourceClaimParametersLister{listers.New[*v1alpha2.ResourceClaimParameters](indexer, v1alpha2.Resource("resourceclaimparameters"))} } // ResourceClaimParameters returns an object that can list and get ResourceClaimParameters. func (s *resourceClaimParametersLister) ResourceClaimParameters(namespace string) ResourceClaimParametersNamespaceLister { - return resourceClaimParametersNamespaceLister{indexer: s.indexer, namespace: namespace} + return resourceClaimParametersNamespaceLister{listers.NewNamespaced[*v1alpha2.ResourceClaimParameters](s.ResourceIndexer, namespace)} } // ResourceClaimParametersNamespaceLister helps list and get ResourceClaimParameters. @@ -74,26 +66,5 @@ type ResourceClaimParametersNamespaceLister interface { // resourceClaimParametersNamespaceLister implements the ResourceClaimParametersNamespaceLister // interface. type resourceClaimParametersNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ResourceClaimParameters in the indexer for a given namespace. -func (s resourceClaimParametersNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.ResourceClaimParameters, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.ResourceClaimParameters)) - }) - return ret, err -} - -// Get retrieves the ResourceClaimParameters from the indexer for a given namespace and name. -func (s resourceClaimParametersNamespaceLister) Get(name string) (*v1alpha2.ResourceClaimParameters, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("resourceclaimparameters"), name) - } - return obj.(*v1alpha2.ResourceClaimParameters), nil + listers.ResourceIndexer[*v1alpha2.ResourceClaimParameters] } diff --git a/listers/resource/v1alpha2/resourceclaimtemplate.go b/listers/resource/v1alpha2/resourceclaimtemplate.go index 91a488b174..7ad1c769fa 100644 --- a/listers/resource/v1alpha2/resourceclaimtemplate.go +++ b/listers/resource/v1alpha2/resourceclaimtemplate.go @@ -20,8 +20,8 @@ package v1alpha2 import ( v1alpha2 "k8s.io/api/resource/v1alpha2" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type ResourceClaimTemplateLister interface { // resourceClaimTemplateLister implements the ResourceClaimTemplateLister interface. type resourceClaimTemplateLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha2.ResourceClaimTemplate] } // NewResourceClaimTemplateLister returns a new ResourceClaimTemplateLister. func NewResourceClaimTemplateLister(indexer cache.Indexer) ResourceClaimTemplateLister { - return &resourceClaimTemplateLister{indexer: indexer} -} - -// List lists all ResourceClaimTemplates in the indexer. -func (s *resourceClaimTemplateLister) List(selector labels.Selector) (ret []*v1alpha2.ResourceClaimTemplate, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.ResourceClaimTemplate)) - }) - return ret, err + return &resourceClaimTemplateLister{listers.New[*v1alpha2.ResourceClaimTemplate](indexer, v1alpha2.Resource("resourceclaimtemplate"))} } // ResourceClaimTemplates returns an object that can list and get ResourceClaimTemplates. func (s *resourceClaimTemplateLister) ResourceClaimTemplates(namespace string) ResourceClaimTemplateNamespaceLister { - return resourceClaimTemplateNamespaceLister{indexer: s.indexer, namespace: namespace} + return resourceClaimTemplateNamespaceLister{listers.NewNamespaced[*v1alpha2.ResourceClaimTemplate](s.ResourceIndexer, namespace)} } // ResourceClaimTemplateNamespaceLister helps list and get ResourceClaimTemplates. @@ -74,26 +66,5 @@ type ResourceClaimTemplateNamespaceLister interface { // resourceClaimTemplateNamespaceLister implements the ResourceClaimTemplateNamespaceLister // interface. type resourceClaimTemplateNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ResourceClaimTemplates in the indexer for a given namespace. -func (s resourceClaimTemplateNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.ResourceClaimTemplate, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.ResourceClaimTemplate)) - }) - return ret, err -} - -// Get retrieves the ResourceClaimTemplate from the indexer for a given namespace and name. -func (s resourceClaimTemplateNamespaceLister) Get(name string) (*v1alpha2.ResourceClaimTemplate, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("resourceclaimtemplate"), name) - } - return obj.(*v1alpha2.ResourceClaimTemplate), nil + listers.ResourceIndexer[*v1alpha2.ResourceClaimTemplate] } diff --git a/listers/resource/v1alpha2/resourceclass.go b/listers/resource/v1alpha2/resourceclass.go index eeb2fc3379..ecbe18a767 100644 --- a/listers/resource/v1alpha2/resourceclass.go +++ b/listers/resource/v1alpha2/resourceclass.go @@ -20,8 +20,8 @@ package v1alpha2 import ( v1alpha2 "k8s.io/api/resource/v1alpha2" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type ResourceClassLister interface { // resourceClassLister implements the ResourceClassLister interface. type resourceClassLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha2.ResourceClass] } // NewResourceClassLister returns a new ResourceClassLister. func NewResourceClassLister(indexer cache.Indexer) ResourceClassLister { - return &resourceClassLister{indexer: indexer} -} - -// List lists all ResourceClasses in the indexer. -func (s *resourceClassLister) List(selector labels.Selector) (ret []*v1alpha2.ResourceClass, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.ResourceClass)) - }) - return ret, err -} - -// Get retrieves the ResourceClass from the index for a given name. -func (s *resourceClassLister) Get(name string) (*v1alpha2.ResourceClass, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("resourceclass"), name) - } - return obj.(*v1alpha2.ResourceClass), nil + return &resourceClassLister{listers.New[*v1alpha2.ResourceClass](indexer, v1alpha2.Resource("resourceclass"))} } diff --git a/listers/resource/v1alpha2/resourceclassparameters.go b/listers/resource/v1alpha2/resourceclassparameters.go index 26fb95e6d2..f731bfe133 100644 --- a/listers/resource/v1alpha2/resourceclassparameters.go +++ b/listers/resource/v1alpha2/resourceclassparameters.go @@ -20,8 +20,8 @@ package v1alpha2 import ( v1alpha2 "k8s.io/api/resource/v1alpha2" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type ResourceClassParametersLister interface { // resourceClassParametersLister implements the ResourceClassParametersLister interface. type resourceClassParametersLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha2.ResourceClassParameters] } // NewResourceClassParametersLister returns a new ResourceClassParametersLister. func NewResourceClassParametersLister(indexer cache.Indexer) ResourceClassParametersLister { - return &resourceClassParametersLister{indexer: indexer} -} - -// List lists all ResourceClassParameters in the indexer. -func (s *resourceClassParametersLister) List(selector labels.Selector) (ret []*v1alpha2.ResourceClassParameters, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.ResourceClassParameters)) - }) - return ret, err + return &resourceClassParametersLister{listers.New[*v1alpha2.ResourceClassParameters](indexer, v1alpha2.Resource("resourceclassparameters"))} } // ResourceClassParameters returns an object that can list and get ResourceClassParameters. func (s *resourceClassParametersLister) ResourceClassParameters(namespace string) ResourceClassParametersNamespaceLister { - return resourceClassParametersNamespaceLister{indexer: s.indexer, namespace: namespace} + return resourceClassParametersNamespaceLister{listers.NewNamespaced[*v1alpha2.ResourceClassParameters](s.ResourceIndexer, namespace)} } // ResourceClassParametersNamespaceLister helps list and get ResourceClassParameters. @@ -74,26 +66,5 @@ type ResourceClassParametersNamespaceLister interface { // resourceClassParametersNamespaceLister implements the ResourceClassParametersNamespaceLister // interface. type resourceClassParametersNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all ResourceClassParameters in the indexer for a given namespace. -func (s resourceClassParametersNamespaceLister) List(selector labels.Selector) (ret []*v1alpha2.ResourceClassParameters, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.ResourceClassParameters)) - }) - return ret, err -} - -// Get retrieves the ResourceClassParameters from the indexer for a given namespace and name. -func (s resourceClassParametersNamespaceLister) Get(name string) (*v1alpha2.ResourceClassParameters, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("resourceclassparameters"), name) - } - return obj.(*v1alpha2.ResourceClassParameters), nil + listers.ResourceIndexer[*v1alpha2.ResourceClassParameters] } diff --git a/listers/resource/v1alpha2/resourceslice.go b/listers/resource/v1alpha2/resourceslice.go index 4301cea2e3..c5937df827 100644 --- a/listers/resource/v1alpha2/resourceslice.go +++ b/listers/resource/v1alpha2/resourceslice.go @@ -20,8 +20,8 @@ package v1alpha2 import ( v1alpha2 "k8s.io/api/resource/v1alpha2" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type ResourceSliceLister interface { // resourceSliceLister implements the ResourceSliceLister interface. type resourceSliceLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha2.ResourceSlice] } // NewResourceSliceLister returns a new ResourceSliceLister. func NewResourceSliceLister(indexer cache.Indexer) ResourceSliceLister { - return &resourceSliceLister{indexer: indexer} -} - -// List lists all ResourceSlices in the indexer. -func (s *resourceSliceLister) List(selector labels.Selector) (ret []*v1alpha2.ResourceSlice, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha2.ResourceSlice)) - }) - return ret, err -} - -// Get retrieves the ResourceSlice from the index for a given name. -func (s *resourceSliceLister) Get(name string) (*v1alpha2.ResourceSlice, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha2.Resource("resourceslice"), name) - } - return obj.(*v1alpha2.ResourceSlice), nil + return &resourceSliceLister{listers.New[*v1alpha2.ResourceSlice](indexer, v1alpha2.Resource("resourceslice"))} } diff --git a/listers/scheduling/v1/priorityclass.go b/listers/scheduling/v1/priorityclass.go index 4da84ccf8a..b9179b5685 100644 --- a/listers/scheduling/v1/priorityclass.go +++ b/listers/scheduling/v1/priorityclass.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/scheduling/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type PriorityClassLister interface { // priorityClassLister implements the PriorityClassLister interface. type priorityClassLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.PriorityClass] } // NewPriorityClassLister returns a new PriorityClassLister. func NewPriorityClassLister(indexer cache.Indexer) PriorityClassLister { - return &priorityClassLister{indexer: indexer} -} - -// List lists all PriorityClasses in the indexer. -func (s *priorityClassLister) List(selector labels.Selector) (ret []*v1.PriorityClass, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.PriorityClass)) - }) - return ret, err -} - -// Get retrieves the PriorityClass from the index for a given name. -func (s *priorityClassLister) Get(name string) (*v1.PriorityClass, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("priorityclass"), name) - } - return obj.(*v1.PriorityClass), nil + return &priorityClassLister{listers.New[*v1.PriorityClass](indexer, v1.Resource("priorityclass"))} } diff --git a/listers/scheduling/v1alpha1/priorityclass.go b/listers/scheduling/v1alpha1/priorityclass.go index 3d25dc80af..776ad5ae25 100644 --- a/listers/scheduling/v1alpha1/priorityclass.go +++ b/listers/scheduling/v1alpha1/priorityclass.go @@ -20,8 +20,8 @@ package v1alpha1 import ( v1alpha1 "k8s.io/api/scheduling/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type PriorityClassLister interface { // priorityClassLister implements the PriorityClassLister interface. type priorityClassLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.PriorityClass] } // NewPriorityClassLister returns a new PriorityClassLister. func NewPriorityClassLister(indexer cache.Indexer) PriorityClassLister { - return &priorityClassLister{indexer: indexer} -} - -// List lists all PriorityClasses in the indexer. -func (s *priorityClassLister) List(selector labels.Selector) (ret []*v1alpha1.PriorityClass, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.PriorityClass)) - }) - return ret, err -} - -// Get retrieves the PriorityClass from the index for a given name. -func (s *priorityClassLister) Get(name string) (*v1alpha1.PriorityClass, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("priorityclass"), name) - } - return obj.(*v1alpha1.PriorityClass), nil + return &priorityClassLister{listers.New[*v1alpha1.PriorityClass](indexer, v1alpha1.Resource("priorityclass"))} } diff --git a/listers/scheduling/v1beta1/priorityclass.go b/listers/scheduling/v1beta1/priorityclass.go index c848d035af..966064e5d6 100644 --- a/listers/scheduling/v1beta1/priorityclass.go +++ b/listers/scheduling/v1beta1/priorityclass.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/scheduling/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type PriorityClassLister interface { // priorityClassLister implements the PriorityClassLister interface. type priorityClassLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.PriorityClass] } // NewPriorityClassLister returns a new PriorityClassLister. func NewPriorityClassLister(indexer cache.Indexer) PriorityClassLister { - return &priorityClassLister{indexer: indexer} -} - -// List lists all PriorityClasses in the indexer. -func (s *priorityClassLister) List(selector labels.Selector) (ret []*v1beta1.PriorityClass, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.PriorityClass)) - }) - return ret, err -} - -// Get retrieves the PriorityClass from the index for a given name. -func (s *priorityClassLister) Get(name string) (*v1beta1.PriorityClass, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("priorityclass"), name) - } - return obj.(*v1beta1.PriorityClass), nil + return &priorityClassLister{listers.New[*v1beta1.PriorityClass](indexer, v1beta1.Resource("priorityclass"))} } diff --git a/listers/storage/v1/csidriver.go b/listers/storage/v1/csidriver.go index 4e8ab90900..db64f45887 100644 --- a/listers/storage/v1/csidriver.go +++ b/listers/storage/v1/csidriver.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type CSIDriverLister interface { // cSIDriverLister implements the CSIDriverLister interface. type cSIDriverLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.CSIDriver] } // NewCSIDriverLister returns a new CSIDriverLister. func NewCSIDriverLister(indexer cache.Indexer) CSIDriverLister { - return &cSIDriverLister{indexer: indexer} -} - -// List lists all CSIDrivers in the indexer. -func (s *cSIDriverLister) List(selector labels.Selector) (ret []*v1.CSIDriver, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.CSIDriver)) - }) - return ret, err -} - -// Get retrieves the CSIDriver from the index for a given name. -func (s *cSIDriverLister) Get(name string) (*v1.CSIDriver, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("csidriver"), name) - } - return obj.(*v1.CSIDriver), nil + return &cSIDriverLister{listers.New[*v1.CSIDriver](indexer, v1.Resource("csidriver"))} } diff --git a/listers/storage/v1/csinode.go b/listers/storage/v1/csinode.go index 93f869572c..5bfd2a43ae 100644 --- a/listers/storage/v1/csinode.go +++ b/listers/storage/v1/csinode.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type CSINodeLister interface { // cSINodeLister implements the CSINodeLister interface. type cSINodeLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.CSINode] } // NewCSINodeLister returns a new CSINodeLister. func NewCSINodeLister(indexer cache.Indexer) CSINodeLister { - return &cSINodeLister{indexer: indexer} -} - -// List lists all CSINodes in the indexer. -func (s *cSINodeLister) List(selector labels.Selector) (ret []*v1.CSINode, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.CSINode)) - }) - return ret, err -} - -// Get retrieves the CSINode from the index for a given name. -func (s *cSINodeLister) Get(name string) (*v1.CSINode, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("csinode"), name) - } - return obj.(*v1.CSINode), nil + return &cSINodeLister{listers.New[*v1.CSINode](indexer, v1.Resource("csinode"))} } diff --git a/listers/storage/v1/csistoragecapacity.go b/listers/storage/v1/csistoragecapacity.go index a72328c9a3..c2acfa1153 100644 --- a/listers/storage/v1/csistoragecapacity.go +++ b/listers/storage/v1/csistoragecapacity.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type CSIStorageCapacityLister interface { // cSIStorageCapacityLister implements the CSIStorageCapacityLister interface. type cSIStorageCapacityLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.CSIStorageCapacity] } // NewCSIStorageCapacityLister returns a new CSIStorageCapacityLister. func NewCSIStorageCapacityLister(indexer cache.Indexer) CSIStorageCapacityLister { - return &cSIStorageCapacityLister{indexer: indexer} -} - -// List lists all CSIStorageCapacities in the indexer. -func (s *cSIStorageCapacityLister) List(selector labels.Selector) (ret []*v1.CSIStorageCapacity, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.CSIStorageCapacity)) - }) - return ret, err + return &cSIStorageCapacityLister{listers.New[*v1.CSIStorageCapacity](indexer, v1.Resource("csistoragecapacity"))} } // CSIStorageCapacities returns an object that can list and get CSIStorageCapacities. func (s *cSIStorageCapacityLister) CSIStorageCapacities(namespace string) CSIStorageCapacityNamespaceLister { - return cSIStorageCapacityNamespaceLister{indexer: s.indexer, namespace: namespace} + return cSIStorageCapacityNamespaceLister{listers.NewNamespaced[*v1.CSIStorageCapacity](s.ResourceIndexer, namespace)} } // CSIStorageCapacityNamespaceLister helps list and get CSIStorageCapacities. @@ -74,26 +66,5 @@ type CSIStorageCapacityNamespaceLister interface { // cSIStorageCapacityNamespaceLister implements the CSIStorageCapacityNamespaceLister // interface. type cSIStorageCapacityNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all CSIStorageCapacities in the indexer for a given namespace. -func (s cSIStorageCapacityNamespaceLister) List(selector labels.Selector) (ret []*v1.CSIStorageCapacity, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.CSIStorageCapacity)) - }) - return ret, err -} - -// Get retrieves the CSIStorageCapacity from the indexer for a given namespace and name. -func (s cSIStorageCapacityNamespaceLister) Get(name string) (*v1.CSIStorageCapacity, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("csistoragecapacity"), name) - } - return obj.(*v1.CSIStorageCapacity), nil + listers.ResourceIndexer[*v1.CSIStorageCapacity] } diff --git a/listers/storage/v1/storageclass.go b/listers/storage/v1/storageclass.go index ffa3d19f50..fc37594446 100644 --- a/listers/storage/v1/storageclass.go +++ b/listers/storage/v1/storageclass.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type StorageClassLister interface { // storageClassLister implements the StorageClassLister interface. type storageClassLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.StorageClass] } // NewStorageClassLister returns a new StorageClassLister. func NewStorageClassLister(indexer cache.Indexer) StorageClassLister { - return &storageClassLister{indexer: indexer} -} - -// List lists all StorageClasses in the indexer. -func (s *storageClassLister) List(selector labels.Selector) (ret []*v1.StorageClass, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.StorageClass)) - }) - return ret, err -} - -// Get retrieves the StorageClass from the index for a given name. -func (s *storageClassLister) Get(name string) (*v1.StorageClass, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("storageclass"), name) - } - return obj.(*v1.StorageClass), nil + return &storageClassLister{listers.New[*v1.StorageClass](indexer, v1.Resource("storageclass"))} } diff --git a/listers/storage/v1/volumeattachment.go b/listers/storage/v1/volumeattachment.go index fbc735c939..44754d6f25 100644 --- a/listers/storage/v1/volumeattachment.go +++ b/listers/storage/v1/volumeattachment.go @@ -20,8 +20,8 @@ package v1 import ( v1 "k8s.io/api/storage/v1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type VolumeAttachmentLister interface { // volumeAttachmentLister implements the VolumeAttachmentLister interface. type volumeAttachmentLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1.VolumeAttachment] } // NewVolumeAttachmentLister returns a new VolumeAttachmentLister. func NewVolumeAttachmentLister(indexer cache.Indexer) VolumeAttachmentLister { - return &volumeAttachmentLister{indexer: indexer} -} - -// List lists all VolumeAttachments in the indexer. -func (s *volumeAttachmentLister) List(selector labels.Selector) (ret []*v1.VolumeAttachment, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.VolumeAttachment)) - }) - return ret, err -} - -// Get retrieves the VolumeAttachment from the index for a given name. -func (s *volumeAttachmentLister) Get(name string) (*v1.VolumeAttachment, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("volumeattachment"), name) - } - return obj.(*v1.VolumeAttachment), nil + return &volumeAttachmentLister{listers.New[*v1.VolumeAttachment](indexer, v1.Resource("volumeattachment"))} } diff --git a/listers/storage/v1alpha1/csistoragecapacity.go b/listers/storage/v1alpha1/csistoragecapacity.go index 0c1b5f2647..7f75aae2cd 100644 --- a/listers/storage/v1alpha1/csistoragecapacity.go +++ b/listers/storage/v1alpha1/csistoragecapacity.go @@ -20,8 +20,8 @@ package v1alpha1 import ( v1alpha1 "k8s.io/api/storage/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type CSIStorageCapacityLister interface { // cSIStorageCapacityLister implements the CSIStorageCapacityLister interface. type cSIStorageCapacityLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.CSIStorageCapacity] } // NewCSIStorageCapacityLister returns a new CSIStorageCapacityLister. func NewCSIStorageCapacityLister(indexer cache.Indexer) CSIStorageCapacityLister { - return &cSIStorageCapacityLister{indexer: indexer} -} - -// List lists all CSIStorageCapacities in the indexer. -func (s *cSIStorageCapacityLister) List(selector labels.Selector) (ret []*v1alpha1.CSIStorageCapacity, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.CSIStorageCapacity)) - }) - return ret, err + return &cSIStorageCapacityLister{listers.New[*v1alpha1.CSIStorageCapacity](indexer, v1alpha1.Resource("csistoragecapacity"))} } // CSIStorageCapacities returns an object that can list and get CSIStorageCapacities. func (s *cSIStorageCapacityLister) CSIStorageCapacities(namespace string) CSIStorageCapacityNamespaceLister { - return cSIStorageCapacityNamespaceLister{indexer: s.indexer, namespace: namespace} + return cSIStorageCapacityNamespaceLister{listers.NewNamespaced[*v1alpha1.CSIStorageCapacity](s.ResourceIndexer, namespace)} } // CSIStorageCapacityNamespaceLister helps list and get CSIStorageCapacities. @@ -74,26 +66,5 @@ type CSIStorageCapacityNamespaceLister interface { // cSIStorageCapacityNamespaceLister implements the CSIStorageCapacityNamespaceLister // interface. type cSIStorageCapacityNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all CSIStorageCapacities in the indexer for a given namespace. -func (s cSIStorageCapacityNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.CSIStorageCapacity, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.CSIStorageCapacity)) - }) - return ret, err -} - -// Get retrieves the CSIStorageCapacity from the indexer for a given namespace and name. -func (s cSIStorageCapacityNamespaceLister) Get(name string) (*v1alpha1.CSIStorageCapacity, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("csistoragecapacity"), name) - } - return obj.(*v1alpha1.CSIStorageCapacity), nil + listers.ResourceIndexer[*v1alpha1.CSIStorageCapacity] } diff --git a/listers/storage/v1alpha1/volumeattachment.go b/listers/storage/v1alpha1/volumeattachment.go index 3d5e2b7b71..122864ffef 100644 --- a/listers/storage/v1alpha1/volumeattachment.go +++ b/listers/storage/v1alpha1/volumeattachment.go @@ -20,8 +20,8 @@ package v1alpha1 import ( v1alpha1 "k8s.io/api/storage/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type VolumeAttachmentLister interface { // volumeAttachmentLister implements the VolumeAttachmentLister interface. type volumeAttachmentLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.VolumeAttachment] } // NewVolumeAttachmentLister returns a new VolumeAttachmentLister. func NewVolumeAttachmentLister(indexer cache.Indexer) VolumeAttachmentLister { - return &volumeAttachmentLister{indexer: indexer} -} - -// List lists all VolumeAttachments in the indexer. -func (s *volumeAttachmentLister) List(selector labels.Selector) (ret []*v1alpha1.VolumeAttachment, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.VolumeAttachment)) - }) - return ret, err -} - -// Get retrieves the VolumeAttachment from the index for a given name. -func (s *volumeAttachmentLister) Get(name string) (*v1alpha1.VolumeAttachment, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("volumeattachment"), name) - } - return obj.(*v1alpha1.VolumeAttachment), nil + return &volumeAttachmentLister{listers.New[*v1alpha1.VolumeAttachment](indexer, v1alpha1.Resource("volumeattachment"))} } diff --git a/listers/storage/v1alpha1/volumeattributesclass.go b/listers/storage/v1alpha1/volumeattributesclass.go index f30b4a89ba..5d8ae09d7c 100644 --- a/listers/storage/v1alpha1/volumeattributesclass.go +++ b/listers/storage/v1alpha1/volumeattributesclass.go @@ -20,8 +20,8 @@ package v1alpha1 import ( v1alpha1 "k8s.io/api/storage/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type VolumeAttributesClassLister interface { // volumeAttributesClassLister implements the VolumeAttributesClassLister interface. type volumeAttributesClassLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.VolumeAttributesClass] } // NewVolumeAttributesClassLister returns a new VolumeAttributesClassLister. func NewVolumeAttributesClassLister(indexer cache.Indexer) VolumeAttributesClassLister { - return &volumeAttributesClassLister{indexer: indexer} -} - -// List lists all VolumeAttributesClasses in the indexer. -func (s *volumeAttributesClassLister) List(selector labels.Selector) (ret []*v1alpha1.VolumeAttributesClass, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.VolumeAttributesClass)) - }) - return ret, err -} - -// Get retrieves the VolumeAttributesClass from the index for a given name. -func (s *volumeAttributesClassLister) Get(name string) (*v1alpha1.VolumeAttributesClass, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("volumeattributesclass"), name) - } - return obj.(*v1alpha1.VolumeAttributesClass), nil + return &volumeAttributesClassLister{listers.New[*v1alpha1.VolumeAttributesClass](indexer, v1alpha1.Resource("volumeattributesclass"))} } diff --git a/listers/storage/v1beta1/csidriver.go b/listers/storage/v1beta1/csidriver.go index c6787aa01b..6600386749 100644 --- a/listers/storage/v1beta1/csidriver.go +++ b/listers/storage/v1beta1/csidriver.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/storage/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type CSIDriverLister interface { // cSIDriverLister implements the CSIDriverLister interface. type cSIDriverLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.CSIDriver] } // NewCSIDriverLister returns a new CSIDriverLister. func NewCSIDriverLister(indexer cache.Indexer) CSIDriverLister { - return &cSIDriverLister{indexer: indexer} -} - -// List lists all CSIDrivers in the indexer. -func (s *cSIDriverLister) List(selector labels.Selector) (ret []*v1beta1.CSIDriver, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.CSIDriver)) - }) - return ret, err -} - -// Get retrieves the CSIDriver from the index for a given name. -func (s *cSIDriverLister) Get(name string) (*v1beta1.CSIDriver, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("csidriver"), name) - } - return obj.(*v1beta1.CSIDriver), nil + return &cSIDriverLister{listers.New[*v1beta1.CSIDriver](indexer, v1beta1.Resource("csidriver"))} } diff --git a/listers/storage/v1beta1/csinode.go b/listers/storage/v1beta1/csinode.go index 809efaa369..2c29ccabf3 100644 --- a/listers/storage/v1beta1/csinode.go +++ b/listers/storage/v1beta1/csinode.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/storage/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type CSINodeLister interface { // cSINodeLister implements the CSINodeLister interface. type cSINodeLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.CSINode] } // NewCSINodeLister returns a new CSINodeLister. func NewCSINodeLister(indexer cache.Indexer) CSINodeLister { - return &cSINodeLister{indexer: indexer} -} - -// List lists all CSINodes in the indexer. -func (s *cSINodeLister) List(selector labels.Selector) (ret []*v1beta1.CSINode, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.CSINode)) - }) - return ret, err -} - -// Get retrieves the CSINode from the index for a given name. -func (s *cSINodeLister) Get(name string) (*v1beta1.CSINode, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("csinode"), name) - } - return obj.(*v1beta1.CSINode), nil + return &cSINodeLister{listers.New[*v1beta1.CSINode](indexer, v1beta1.Resource("csinode"))} } diff --git a/listers/storage/v1beta1/csistoragecapacity.go b/listers/storage/v1beta1/csistoragecapacity.go index 4680ffb7c8..365304df12 100644 --- a/listers/storage/v1beta1/csistoragecapacity.go +++ b/listers/storage/v1beta1/csistoragecapacity.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/storage/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -38,25 +38,17 @@ type CSIStorageCapacityLister interface { // cSIStorageCapacityLister implements the CSIStorageCapacityLister interface. type cSIStorageCapacityLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.CSIStorageCapacity] } // NewCSIStorageCapacityLister returns a new CSIStorageCapacityLister. func NewCSIStorageCapacityLister(indexer cache.Indexer) CSIStorageCapacityLister { - return &cSIStorageCapacityLister{indexer: indexer} -} - -// List lists all CSIStorageCapacities in the indexer. -func (s *cSIStorageCapacityLister) List(selector labels.Selector) (ret []*v1beta1.CSIStorageCapacity, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.CSIStorageCapacity)) - }) - return ret, err + return &cSIStorageCapacityLister{listers.New[*v1beta1.CSIStorageCapacity](indexer, v1beta1.Resource("csistoragecapacity"))} } // CSIStorageCapacities returns an object that can list and get CSIStorageCapacities. func (s *cSIStorageCapacityLister) CSIStorageCapacities(namespace string) CSIStorageCapacityNamespaceLister { - return cSIStorageCapacityNamespaceLister{indexer: s.indexer, namespace: namespace} + return cSIStorageCapacityNamespaceLister{listers.NewNamespaced[*v1beta1.CSIStorageCapacity](s.ResourceIndexer, namespace)} } // CSIStorageCapacityNamespaceLister helps list and get CSIStorageCapacities. @@ -74,26 +66,5 @@ type CSIStorageCapacityNamespaceLister interface { // cSIStorageCapacityNamespaceLister implements the CSIStorageCapacityNamespaceLister // interface. type cSIStorageCapacityNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all CSIStorageCapacities in the indexer for a given namespace. -func (s cSIStorageCapacityNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.CSIStorageCapacity, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.CSIStorageCapacity)) - }) - return ret, err -} - -// Get retrieves the CSIStorageCapacity from the indexer for a given namespace and name. -func (s cSIStorageCapacityNamespaceLister) Get(name string) (*v1beta1.CSIStorageCapacity, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("csistoragecapacity"), name) - } - return obj.(*v1beta1.CSIStorageCapacity), nil + listers.ResourceIndexer[*v1beta1.CSIStorageCapacity] } diff --git a/listers/storage/v1beta1/storageclass.go b/listers/storage/v1beta1/storageclass.go index eb7b8315c6..070c061bc5 100644 --- a/listers/storage/v1beta1/storageclass.go +++ b/listers/storage/v1beta1/storageclass.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/storage/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type StorageClassLister interface { // storageClassLister implements the StorageClassLister interface. type storageClassLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.StorageClass] } // NewStorageClassLister returns a new StorageClassLister. func NewStorageClassLister(indexer cache.Indexer) StorageClassLister { - return &storageClassLister{indexer: indexer} -} - -// List lists all StorageClasses in the indexer. -func (s *storageClassLister) List(selector labels.Selector) (ret []*v1beta1.StorageClass, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.StorageClass)) - }) - return ret, err -} - -// Get retrieves the StorageClass from the index for a given name. -func (s *storageClassLister) Get(name string) (*v1beta1.StorageClass, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("storageclass"), name) - } - return obj.(*v1beta1.StorageClass), nil + return &storageClassLister{listers.New[*v1beta1.StorageClass](indexer, v1beta1.Resource("storageclass"))} } diff --git a/listers/storage/v1beta1/volumeattachment.go b/listers/storage/v1beta1/volumeattachment.go index bab2d317c7..d437c1eaeb 100644 --- a/listers/storage/v1beta1/volumeattachment.go +++ b/listers/storage/v1beta1/volumeattachment.go @@ -20,8 +20,8 @@ package v1beta1 import ( v1beta1 "k8s.io/api/storage/v1beta1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type VolumeAttachmentLister interface { // volumeAttachmentLister implements the VolumeAttachmentLister interface. type volumeAttachmentLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1beta1.VolumeAttachment] } // NewVolumeAttachmentLister returns a new VolumeAttachmentLister. func NewVolumeAttachmentLister(indexer cache.Indexer) VolumeAttachmentLister { - return &volumeAttachmentLister{indexer: indexer} -} - -// List lists all VolumeAttachments in the indexer. -func (s *volumeAttachmentLister) List(selector labels.Selector) (ret []*v1beta1.VolumeAttachment, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VolumeAttachment)) - }) - return ret, err -} - -// Get retrieves the VolumeAttachment from the index for a given name. -func (s *volumeAttachmentLister) Get(name string) (*v1beta1.VolumeAttachment, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("volumeattachment"), name) - } - return obj.(*v1beta1.VolumeAttachment), nil + return &volumeAttachmentLister{listers.New[*v1beta1.VolumeAttachment](indexer, v1beta1.Resource("volumeattachment"))} } diff --git a/listers/storagemigration/v1alpha1/storageversionmigration.go b/listers/storagemigration/v1alpha1/storageversionmigration.go index b65bf25324..794dba25c8 100644 --- a/listers/storagemigration/v1alpha1/storageversionmigration.go +++ b/listers/storagemigration/v1alpha1/storageversionmigration.go @@ -20,8 +20,8 @@ package v1alpha1 import ( v1alpha1 "k8s.io/api/storagemigration/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" ) @@ -39,30 +39,10 @@ type StorageVersionMigrationLister interface { // storageVersionMigrationLister implements the StorageVersionMigrationLister interface. type storageVersionMigrationLister struct { - indexer cache.Indexer + listers.ResourceIndexer[*v1alpha1.StorageVersionMigration] } // NewStorageVersionMigrationLister returns a new StorageVersionMigrationLister. func NewStorageVersionMigrationLister(indexer cache.Indexer) StorageVersionMigrationLister { - return &storageVersionMigrationLister{indexer: indexer} -} - -// List lists all StorageVersionMigrations in the indexer. -func (s *storageVersionMigrationLister) List(selector labels.Selector) (ret []*v1alpha1.StorageVersionMigration, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.StorageVersionMigration)) - }) - return ret, err -} - -// Get retrieves the StorageVersionMigration from the index for a given name. -func (s *storageVersionMigrationLister) Get(name string) (*v1alpha1.StorageVersionMigration, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("storageversionmigration"), name) - } - return obj.(*v1alpha1.StorageVersionMigration), nil + return &storageVersionMigrationLister{listers.New[*v1alpha1.StorageVersionMigration](indexer, v1alpha1.Resource("storageversionmigration"))} } From a1be94abc307ca59f9fa919650ec4ae5d534ae01 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Mon, 8 Jan 2024 16:43:26 +0100 Subject: [PATCH 004/159] client-go/rest: introduce watchlist Kubernetes-commit: ad3d138cda76fc0267da5131fa3ff7906e2ddf76 --- rest/request.go | 146 ++++++++++++++ rest/request_watchlist_test.go | 356 +++++++++++++++++++++++++++++++++ 2 files changed, 502 insertions(+) create mode 100644 rest/request_watchlist_test.go diff --git a/rest/request.go b/rest/request.go index 850e57daeb..f5a9f68ca4 100644 --- a/rest/request.go +++ b/rest/request.go @@ -37,12 +37,15 @@ import ( "golang.org/x/net/http2" "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/conversion" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer/streaming" "k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/pkg/watch" + clientfeatures "k8s.io/client-go/features" restclientwatch "k8s.io/client-go/rest/watch" "k8s.io/client-go/tools/metrics" "k8s.io/client-go/util/flowcontrol" @@ -768,6 +771,142 @@ func (r *Request) Watch(ctx context.Context) (watch.Interface, error) { } } +type WatchListResult struct { + // err holds any errors we might have received + // during streaming. + err error + + // items hold the collected data + items []runtime.Object + + // initialEventsEndBookmarkRV holds the resource version + // extracted from the bookmark event that marks + // the end of the stream. + initialEventsEndBookmarkRV string + + // gv represents the API version + // it is used to construct the final list response + // normally this information is filled by the server + gv schema.GroupVersion +} + +func (r WatchListResult) Into(obj runtime.Object) error { + if r.err != nil { + return r.err + } + + listPtr, err := meta.GetItemsPtr(obj) + if err != nil { + return err + } + listVal, err := conversion.EnforcePtr(listPtr) + if err != nil { + return err + } + if listVal.Kind() != reflect.Slice { + return fmt.Errorf("need a pointer to slice, got %v", listVal.Kind()) + } + + if len(r.items) == 0 { + listVal.Set(reflect.MakeSlice(listVal.Type(), 0, 0)) + } else { + listVal.Set(reflect.MakeSlice(listVal.Type(), len(r.items), len(r.items))) + for i, o := range r.items { + if listVal.Type().Elem() != reflect.TypeOf(o).Elem() { + return fmt.Errorf("received object type = %v at index = %d, doesn't match the list item type = %v", reflect.TypeOf(o).Elem(), i, listVal.Type().Elem()) + } + listVal.Index(i).Set(reflect.ValueOf(o).Elem()) + } + } + + listMeta, err := meta.ListAccessor(obj) + if err != nil { + return err + } + listMeta.SetResourceVersion(r.initialEventsEndBookmarkRV) + + typeMeta, err := meta.TypeAccessor(obj) + if err != nil { + return err + } + version := r.gv.String() + typeMeta.SetAPIVersion(version) + typeMeta.SetKind(reflect.TypeOf(obj).Elem().Name()) + + return nil +} + +// WatchList establishes a stream to get a consistent snapshot of data +// from the server as described in https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/3157-watch-list#proposal +// +// Note that the watchlist requires properly setting the ListOptions +// otherwise it just establishes a regular watch with the server. +// Check the documentation https://kubernetes.io/docs/reference/using-api/api-concepts/#streaming-lists +// to see what parameters are currently required. +func (r *Request) WatchList(ctx context.Context) WatchListResult { + if !clientfeatures.FeatureGates().Enabled(clientfeatures.WatchListClient) { + return WatchListResult{err: fmt.Errorf("%q feature gate is not enabled", clientfeatures.WatchListClient)} + } + // TODO(#115478): consider validating request parameters (i.e sendInitialEvents). + // Most users use the generated client, which handles the proper setting of parameters. + // We don't have validation for other methods (e.g., the Watch) + // thus, for symmetry, we haven't added additional checks for the WatchList method. + w, err := r.Watch(ctx) + if err != nil { + return WatchListResult{err: err} + } + return r.handleWatchList(ctx, w) +} + +// handleWatchList holds the actual logic for easier unit testing. +// Note that this function will close the passed watch. +func (r *Request) handleWatchList(ctx context.Context, w watch.Interface) WatchListResult { + defer w.Stop() + var lastKey string + var items []runtime.Object + + for { + select { + case <-ctx.Done(): + return WatchListResult{err: ctx.Err()} + case event, ok := <-w.ResultChan(): + if !ok { + return WatchListResult{err: fmt.Errorf("unexpected watch close")} + } + if event.Type == watch.Error { + return WatchListResult{err: errors.FromObject(event.Object)} + } + meta, err := meta.Accessor(event.Object) + if err != nil { + return WatchListResult{err: fmt.Errorf("failed to parse watch event: %#v", event)} + } + + switch event.Type { + case watch.Added: + // the following check ensures that the response is ordered. + // earlier servers had a bug that caused them to not sort the output. + // in such cases, return an error which can trigger fallback logic. + key := objectKeyFromMeta(meta) + if len(lastKey) > 0 && lastKey > key { + return WatchListResult{err: fmt.Errorf("cannot add the obj (%#v) with the key = %s, as it violates the ordering guarantees provided by the watchlist feature in beta phase, lastInsertedKey was = %s", event.Object, key, lastKey)} + } + items = append(items, event.Object) + lastKey = key + case watch.Bookmark: + if meta.GetAnnotations()[metav1.InitialEventsAnnotationKey] == "true" { + return WatchListResult{ + items: items, + initialEventsEndBookmarkRV: meta.GetResourceVersion(), + gv: r.c.content.GroupVersion, + } + } + default: + return WatchListResult{err: fmt.Errorf("unexpected watch event %#v, expected to only receive watch.Added and watch.Bookmark events", event)} + } + } + } +} + func (r *Request) newStreamWatcher(resp *http.Response) (watch.Interface, error) { contentType := resp.Header.Get("Content-Type") mediaType, params, err := mime.ParseMediaType(contentType) @@ -1470,3 +1609,10 @@ func ValidatePathSegmentName(name string, prefix bool) []string { } return IsValidPathSegmentName(name) } + +func objectKeyFromMeta(objMeta metav1.Object) string { + if len(objMeta.GetNamespace()) > 0 { + return fmt.Sprintf("%s/%s", objMeta.GetNamespace(), objMeta.GetName()) + } + return objMeta.GetName() +} diff --git a/rest/request_watchlist_test.go b/rest/request_watchlist_test.go new file mode 100644 index 0000000000..4ebfe81bb0 --- /dev/null +++ b/rest/request_watchlist_test.go @@ -0,0 +1,356 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package rest + +import ( + "context" + "fmt" + "regexp" + "testing" + + "github.com/google/go-cmp/cmp" + + v1 "k8s.io/api/core/v1" + apiequality "k8s.io/apimachinery/pkg/api/equality" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/watch" +) + +func TestWatchListResult(t *testing.T) { + scenarios := []struct { + name string + target WatchListResult + result runtime.Object + + expectedResult *v1.PodList + expectedErr error + }{ + { + name: "not a pointer", + result: fakeObj{}, + expectedErr: fmt.Errorf("rest.fakeObj is not a list: expected pointer, but got rest.fakeObj type"), + }, + { + name: "nil input won't panic", + result: nil, + expectedErr: fmt.Errorf(" is not a list: expected pointer, but got invalid kind"), + }, + { + name: "not a list", + result: &v1.Pod{}, + expectedErr: fmt.Errorf("*v1.Pod is not a list: no Items field in this object"), + }, + { + name: "an err is always returned", + result: nil, + target: WatchListResult{err: fmt.Errorf("dummy err")}, + expectedErr: fmt.Errorf("dummy err"), + }, + { + name: "empty list", + result: &v1.PodList{}, + expectedResult: &v1.PodList{ + TypeMeta: metav1.TypeMeta{Kind: "PodList"}, + Items: []v1.Pod{}, + }, + }, + { + name: "gv is applied", + result: &v1.PodList{}, + target: WatchListResult{gv: schema.GroupVersion{Group: "g", Version: "v"}}, + expectedResult: &v1.PodList{ + TypeMeta: metav1.TypeMeta{Kind: "PodList", APIVersion: "g/v"}, + Items: []v1.Pod{}, + }, + }, + { + name: "gv is applied, empty group", + result: &v1.PodList{}, + target: WatchListResult{gv: schema.GroupVersion{Version: "v"}}, + expectedResult: &v1.PodList{ + TypeMeta: metav1.TypeMeta{Kind: "PodList", APIVersion: "v"}, + Items: []v1.Pod{}, + }, + }, + { + name: "rv is applied", + result: &v1.PodList{}, + target: WatchListResult{initialEventsEndBookmarkRV: "100"}, + expectedResult: &v1.PodList{ + TypeMeta: metav1.TypeMeta{Kind: "PodList"}, + ListMeta: metav1.ListMeta{ResourceVersion: "100"}, + Items: []v1.Pod{}, + }, + }, + { + name: "items are applied", + result: &v1.PodList{}, + target: WatchListResult{items: []runtime.Object{makePod(1), makePod(2)}}, + expectedResult: &v1.PodList{ + TypeMeta: metav1.TypeMeta{Kind: "PodList"}, + Items: []v1.Pod{*makePod(1), *makePod(2)}, + }, + }, + { + name: "type mismatch", + result: &v1.PodList{}, + target: WatchListResult{items: []runtime.Object{makeNamespace("1")}}, + expectedErr: fmt.Errorf("received object type = v1.Namespace at index = 0, doesn't match the list item type = v1.Pod"), + }, + } + for _, scenario := range scenarios { + t.Run(scenario.name, func(t *testing.T) { + err := scenario.target.Into(scenario.result) + if scenario.expectedErr != nil && err == nil { + t.Fatalf("expected an error = %v, got nil", scenario.expectedErr) + } + if scenario.expectedErr == nil && err != nil { + t.Fatalf("didn't expect an error, got = %v", err) + } + if err != nil { + if scenario.expectedErr.Error() != err.Error() { + t.Fatalf("unexpected err = %v, expected = %v", err, scenario.expectedErr) + } + return + } + if !apiequality.Semantic.DeepEqual(scenario.expectedResult, scenario.result) { + t.Errorf("diff: %v", cmp.Diff(scenario.expectedResult, scenario.result)) + } + }) + } +} + +func TestWatchListSuccess(t *testing.T) { + scenarios := []struct { + name string + gv schema.GroupVersion + watchEvents []watch.Event + expectedResult *v1.PodList + }{ + { + name: "happy path", + // Note that the APIVersion for the core API group is "v1" (not "core/v1"). + // We fake "core/v1" here to test if the Group part is properly + // recognized and set on the resulting object. + gv: schema.GroupVersion{Group: "core", Version: "v1"}, + watchEvents: []watch.Event{ + {Type: watch.Added, Object: makePod(1)}, + {Type: watch.Added, Object: makePod(2)}, + {Type: watch.Bookmark, Object: makeBookmarkEvent(5)}, + }, + expectedResult: &v1.PodList{ + TypeMeta: metav1.TypeMeta{ + APIVersion: "core/v1", + Kind: "PodList", + }, + ListMeta: metav1.ListMeta{ResourceVersion: "5"}, + Items: []v1.Pod{*makePod(1), *makePod(2)}, + }, + }, + { + name: "APIVersion with only version provided is properly set", + gv: schema.GroupVersion{Version: "v1"}, + watchEvents: []watch.Event{ + {Type: watch.Added, Object: makePod(1)}, + {Type: watch.Bookmark, Object: makeBookmarkEvent(5)}, + }, + expectedResult: &v1.PodList{ + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "PodList", + }, + ListMeta: metav1.ListMeta{ResourceVersion: "5"}, + Items: []v1.Pod{*makePod(1)}, + }, + }, + { + name: "only the bookmark", + gv: schema.GroupVersion{Version: "v1"}, + watchEvents: []watch.Event{ + {Type: watch.Bookmark, Object: makeBookmarkEvent(5)}, + }, + expectedResult: &v1.PodList{ + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "PodList", + }, + ListMeta: metav1.ListMeta{ResourceVersion: "5"}, + Items: []v1.Pod{}, + }, + }, + } + for _, scenario := range scenarios { + t.Run(scenario.name, func(t *testing.T) { + ctx := context.Background() + fakeWatcher := watch.NewFake() + target := &Request{ + c: &RESTClient{ + content: ClientContentConfig{ + GroupVersion: scenario.gv, + }, + }, + } + + go func(watchEvents []watch.Event) { + for _, watchEvent := range watchEvents { + fakeWatcher.Action(watchEvent.Type, watchEvent.Object) + } + }(scenario.watchEvents) + + res := target.handleWatchList(ctx, fakeWatcher) + if res.err != nil { + t.Fatal(res.err) + } + + result := &v1.PodList{} + if err := res.Into(result); err != nil { + t.Fatal(err) + } + if !apiequality.Semantic.DeepEqual(scenario.expectedResult, result) { + t.Errorf("diff: %v", cmp.Diff(scenario.expectedResult, result)) + } + if !fakeWatcher.IsStopped() { + t.Fatalf("the watcher wasn't stopped") + } + }) + } +} + +func TestWatchListFailure(t *testing.T) { + scenarios := []struct { + name string + ctx context.Context + watcher *watch.FakeWatcher + watchEvents []watch.Event + + expectedError error + }{ + { + name: "request stop", + ctx: func() context.Context { + ctx, ctxCancel := context.WithCancel(context.TODO()) + ctxCancel() + return ctx + }(), + watcher: watch.NewFake(), + expectedError: fmt.Errorf("context canceled"), + }, + { + name: "stop watcher", + ctx: context.TODO(), + watcher: func() *watch.FakeWatcher { + w := watch.NewFake() + w.Stop() + return w + }(), + expectedError: fmt.Errorf("unexpected watch close"), + }, + { + name: "stop on watch.Error", + ctx: context.TODO(), + watcher: watch.NewFake(), + watchEvents: []watch.Event{{Type: watch.Error, Object: &apierrors.NewInternalError(fmt.Errorf("dummy errror")).ErrStatus}}, + expectedError: fmt.Errorf("Internal error occurred: dummy errror"), + }, + { + name: "incorrect watch type (Deleted)", + ctx: context.TODO(), + watcher: watch.NewFake(), + watchEvents: []watch.Event{{Type: watch.Deleted, Object: makePod(1)}}, + expectedError: fmt.Errorf("unexpected watch event .*, expected to only receive watch.Added and watch.Bookmark events"), + }, + { + name: "incorrect watch type (Modified)", + ctx: context.TODO(), + watcher: watch.NewFake(), + watchEvents: []watch.Event{{Type: watch.Modified, Object: makePod(1)}}, + expectedError: fmt.Errorf("unexpected watch event .*, expected to only receive watch.Added and watch.Bookmark events"), + }, + { + name: "unordered input returns an error", + ctx: context.TODO(), + watcher: watch.NewFake(), + watchEvents: []watch.Event{{Type: watch.Added, Object: makePod(3)}, {Type: watch.Added, Object: makePod(1)}}, + expectedError: fmt.Errorf("cannot add the obj .* with the key = ns/pod-1, as it violates the ordering guarantees provided by the watchlist feature in beta phase, lastInsertedKey was = ns/pod-3"), + }, + } + + for _, scenario := range scenarios { + t.Run(scenario.name, func(t *testing.T) { + target := &Request{} + go func(w *watch.FakeWatcher, watchEvents []watch.Event) { + for _, event := range watchEvents { + w.Action(event.Type, event.Object) + } + }(scenario.watcher, scenario.watchEvents) + + res := target.handleWatchList(scenario.ctx, scenario.watcher) + resErr := res.Into(nil) + if resErr == nil { + t.Fatal("expected to get an error, got nil") + } + matched, err := regexp.MatchString(scenario.expectedError.Error(), resErr.Error()) + if err != nil { + t.Fatal(err) + } + if !matched { + t.Fatalf("unexpected err = %v, expected = %v", resErr, scenario.expectedError) + } + if !scenario.watcher.IsStopped() { + t.Fatalf("the watcher wasn't stopped") + } + }) + } +} + +func makePod(rv uint64) *v1.Pod { + return &v1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: fmt.Sprintf("pod-%d", rv), + Namespace: "ns", + ResourceVersion: fmt.Sprintf("%d", rv), + Annotations: map[string]string{}, + }, + } +} + +func makeNamespace(name string) *v1.Namespace { + return &v1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: name}} +} + +func makeBookmarkEvent(rv uint64) *v1.Pod { + return &v1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + ResourceVersion: fmt.Sprintf("%d", rv), + Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "true"}, + }, + } +} + +type fakeObj struct { +} + +func (f fakeObj) GetObjectKind() schema.ObjectKind { + return schema.EmptyObjectKind +} + +func (f fakeObj) DeepCopyObject() runtime.Object { + return fakeObj{} +} From 3d4f98db0e40e6bf0a0d6e48d4ef2e37365f6ba3 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Sat, 20 Jan 2024 10:20:43 -0500 Subject: [PATCH 005/159] Regenerate fake clients Kubernetes-commit: 17ab25b121d05355700f39628d5d45ab3da446f8 --- .../fake/fake_mutatingwebhookconfiguration.go | 30 ++++++---- .../v1/fake/fake_validatingadmissionpolicy.go | 42 ++++++++------ .../fake_validatingadmissionpolicybinding.go | 30 ++++++---- .../fake_validatingwebhookconfiguration.go | 30 ++++++---- .../fake/fake_validatingadmissionpolicy.go | 42 ++++++++------ .../fake_validatingadmissionpolicybinding.go | 30 ++++++---- .../fake/fake_mutatingwebhookconfiguration.go | 30 ++++++---- .../fake/fake_validatingadmissionpolicy.go | 42 ++++++++------ .../fake_validatingadmissionpolicybinding.go | 30 ++++++---- .../fake_validatingwebhookconfiguration.go | 30 ++++++---- .../v1alpha1/fake/fake_storageversion.go | 42 ++++++++------ .../apps/v1/fake/fake_controllerrevision.go | 30 ++++++---- .../typed/apps/v1/fake/fake_daemonset.go | 42 ++++++++------ .../typed/apps/v1/fake/fake_deployment.go | 55 +++++++++++-------- .../typed/apps/v1/fake/fake_replicaset.go | 55 +++++++++++-------- .../typed/apps/v1/fake/fake_statefulset.go | 55 +++++++++++-------- .../v1beta1/fake/fake_controllerrevision.go | 30 ++++++---- .../apps/v1beta1/fake/fake_deployment.go | 42 ++++++++------ .../apps/v1beta1/fake/fake_statefulset.go | 42 ++++++++------ .../v1beta2/fake/fake_controllerrevision.go | 30 ++++++---- .../typed/apps/v1beta2/fake/fake_daemonset.go | 42 ++++++++------ .../apps/v1beta2/fake/fake_deployment.go | 42 ++++++++------ .../apps/v1beta2/fake/fake_replicaset.go | 42 ++++++++------ .../apps/v1beta2/fake/fake_statefulset.go | 55 +++++++++++-------- .../v1/fake/fake_selfsubjectreview.go | 5 +- .../v1/fake/fake_tokenreview.go | 5 +- .../v1alpha1/fake/fake_selfsubjectreview.go | 5 +- .../v1beta1/fake/fake_selfsubjectreview.go | 5 +- .../v1beta1/fake/fake_tokenreview.go | 5 +- .../v1/fake/fake_localsubjectaccessreview.go | 5 +- .../v1/fake/fake_selfsubjectaccessreview.go | 5 +- .../v1/fake/fake_selfsubjectrulesreview.go | 5 +- .../v1/fake/fake_subjectaccessreview.go | 5 +- .../fake/fake_localsubjectaccessreview.go | 5 +- .../fake/fake_selfsubjectaccessreview.go | 5 +- .../fake/fake_selfsubjectrulesreview.go | 5 +- .../v1beta1/fake/fake_subjectaccessreview.go | 5 +- .../v1/fake/fake_horizontalpodautoscaler.go | 42 ++++++++------ .../v2/fake/fake_horizontalpodautoscaler.go | 42 ++++++++------ .../fake/fake_horizontalpodautoscaler.go | 42 ++++++++------ .../fake/fake_horizontalpodautoscaler.go | 42 ++++++++------ .../typed/batch/v1/fake/fake_cronjob.go | 42 ++++++++------ kubernetes/typed/batch/v1/fake/fake_job.go | 42 ++++++++------ .../typed/batch/v1beta1/fake/fake_cronjob.go | 42 ++++++++------ .../v1/fake/fake_certificatesigningrequest.go | 47 +++++++++------- .../v1alpha1/fake/fake_clustertrustbundle.go | 30 ++++++---- .../fake/fake_certificatesigningrequest.go | 42 ++++++++------ .../typed/coordination/v1/fake/fake_lease.go | 30 ++++++---- .../coordination/v1beta1/fake/fake_lease.go | 30 ++++++---- .../core/v1/fake/fake_componentstatus.go | 30 ++++++---- .../typed/core/v1/fake/fake_configmap.go | 30 ++++++---- .../typed/core/v1/fake/fake_endpoints.go | 30 ++++++---- kubernetes/typed/core/v1/fake/fake_event.go | 30 ++++++---- .../typed/core/v1/fake/fake_limitrange.go | 30 ++++++---- .../typed/core/v1/fake/fake_namespace.go | 42 ++++++++------ kubernetes/typed/core/v1/fake/fake_node.go | 42 ++++++++------ .../core/v1/fake/fake_persistentvolume.go | 42 ++++++++------ .../v1/fake/fake_persistentvolumeclaim.go | 42 ++++++++------ kubernetes/typed/core/v1/fake/fake_pod.go | 45 +++++++++------ .../typed/core/v1/fake/fake_podtemplate.go | 30 ++++++---- .../v1/fake/fake_replicationcontroller.go | 50 ++++++++++------- .../typed/core/v1/fake/fake_resourcequota.go | 42 ++++++++------ kubernetes/typed/core/v1/fake/fake_secret.go | 30 ++++++---- kubernetes/typed/core/v1/fake/fake_service.go | 42 ++++++++------ .../typed/core/v1/fake/fake_serviceaccount.go | 35 +++++++----- .../discovery/v1/fake/fake_endpointslice.go | 30 ++++++---- .../v1beta1/fake/fake_endpointslice.go | 30 ++++++---- kubernetes/typed/events/v1/fake/fake_event.go | 30 ++++++---- .../typed/events/v1beta1/fake/fake_event.go | 30 ++++++---- .../extensions/v1beta1/fake/fake_daemonset.go | 42 ++++++++------ .../v1beta1/fake/fake_deployment.go | 55 +++++++++++-------- .../extensions/v1beta1/fake/fake_ingress.go | 42 ++++++++------ .../v1beta1/fake/fake_networkpolicy.go | 30 ++++++---- .../v1beta1/fake/fake_replicaset.go | 55 +++++++++++-------- .../flowcontrol/v1/fake/fake_flowschema.go | 42 ++++++++------ .../fake/fake_prioritylevelconfiguration.go | 42 ++++++++------ .../v1beta1/fake/fake_flowschema.go | 42 ++++++++------ .../fake/fake_prioritylevelconfiguration.go | 42 ++++++++------ .../v1beta2/fake/fake_flowschema.go | 42 ++++++++------ .../fake/fake_prioritylevelconfiguration.go | 42 ++++++++------ .../v1beta3/fake/fake_flowschema.go | 42 ++++++++------ .../fake/fake_prioritylevelconfiguration.go | 42 ++++++++------ .../typed/networking/v1/fake/fake_ingress.go | 42 ++++++++------ .../networking/v1/fake/fake_ingressclass.go | 30 ++++++---- .../networking/v1/fake/fake_networkpolicy.go | 30 ++++++---- .../v1alpha1/fake/fake_ipaddress.go | 30 ++++++---- .../v1alpha1/fake/fake_servicecidr.go | 42 ++++++++------ .../networking/v1beta1/fake/fake_ingress.go | 42 ++++++++------ .../v1beta1/fake/fake_ingressclass.go | 30 ++++++---- .../typed/node/v1/fake/fake_runtimeclass.go | 30 ++++++---- .../node/v1alpha1/fake/fake_runtimeclass.go | 30 ++++++---- .../node/v1beta1/fake/fake_runtimeclass.go | 30 ++++++---- .../v1/fake/fake_poddisruptionbudget.go | 42 ++++++++------ .../v1beta1/fake/fake_poddisruptionbudget.go | 42 ++++++++------ .../typed/rbac/v1/fake/fake_clusterrole.go | 30 ++++++---- .../rbac/v1/fake/fake_clusterrolebinding.go | 30 ++++++---- kubernetes/typed/rbac/v1/fake/fake_role.go | 30 ++++++---- .../typed/rbac/v1/fake/fake_rolebinding.go | 30 ++++++---- .../rbac/v1alpha1/fake/fake_clusterrole.go | 30 ++++++---- .../v1alpha1/fake/fake_clusterrolebinding.go | 30 ++++++---- .../typed/rbac/v1alpha1/fake/fake_role.go | 30 ++++++---- .../rbac/v1alpha1/fake/fake_rolebinding.go | 30 ++++++---- .../rbac/v1beta1/fake/fake_clusterrole.go | 30 ++++++---- .../v1beta1/fake/fake_clusterrolebinding.go | 30 ++++++---- .../typed/rbac/v1beta1/fake/fake_role.go | 30 ++++++---- .../rbac/v1beta1/fake/fake_rolebinding.go | 30 ++++++---- .../fake/fake_podschedulingcontext.go | 42 ++++++++------ .../v1alpha2/fake/fake_resourceclaim.go | 42 ++++++++------ .../fake/fake_resourceclaimparameters.go | 30 ++++++---- .../fake/fake_resourceclaimtemplate.go | 30 ++++++---- .../v1alpha2/fake/fake_resourceclass.go | 30 ++++++---- .../fake/fake_resourceclassparameters.go | 30 ++++++---- .../v1alpha2/fake/fake_resourceslice.go | 30 ++++++---- .../scheduling/v1/fake/fake_priorityclass.go | 30 ++++++---- .../v1alpha1/fake/fake_priorityclass.go | 30 ++++++---- .../v1beta1/fake/fake_priorityclass.go | 30 ++++++---- .../typed/storage/v1/fake/fake_csidriver.go | 30 ++++++---- .../typed/storage/v1/fake/fake_csinode.go | 30 ++++++---- .../v1/fake/fake_csistoragecapacity.go | 30 ++++++---- .../storage/v1/fake/fake_storageclass.go | 30 ++++++---- .../storage/v1/fake/fake_volumeattachment.go | 42 ++++++++------ .../v1alpha1/fake/fake_csistoragecapacity.go | 30 ++++++---- .../v1alpha1/fake/fake_volumeattachment.go | 42 ++++++++------ .../fake/fake_volumeattributesclass.go | 30 ++++++---- .../storage/v1beta1/fake/fake_csidriver.go | 30 ++++++---- .../storage/v1beta1/fake/fake_csinode.go | 30 ++++++---- .../v1beta1/fake/fake_csistoragecapacity.go | 30 ++++++---- .../storage/v1beta1/fake/fake_storageclass.go | 30 ++++++---- .../v1beta1/fake/fake_volumeattachment.go | 42 ++++++++------ .../fake/fake_storageversionmigration.go | 42 ++++++++------ 130 files changed, 2584 insertions(+), 1738 deletions(-) diff --git a/kubernetes/typed/admissionregistration/v1/fake/fake_mutatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1/fake/fake_mutatingwebhookconfiguration.go index b88598b715..b2036825df 100644 --- a/kubernetes/typed/admissionregistration/v1/fake/fake_mutatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1/fake/fake_mutatingwebhookconfiguration.go @@ -43,20 +43,22 @@ var mutatingwebhookconfigurationsKind = v1.SchemeGroupVersion.WithKind("Mutating // Get takes name of the mutatingWebhookConfiguration, and returns the corresponding mutatingWebhookConfiguration object, and an error if there is any. func (c *FakeMutatingWebhookConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.MutatingWebhookConfiguration, err error) { + emptyResult := &v1.MutatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(mutatingwebhookconfigurationsResource, name), &v1.MutatingWebhookConfiguration{}) + Invokes(testing.NewRootGetAction(mutatingwebhookconfigurationsResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.MutatingWebhookConfiguration), err } // List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. func (c *FakeMutatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.MutatingWebhookConfigurationList, err error) { + emptyResult := &v1.MutatingWebhookConfigurationList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), &v1.MutatingWebhookConfigurationList{}) + Invokes(testing.NewRootListAction(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeMutatingWebhookConfigurations) Watch(ctx context.Context, opts meta // Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. func (c *FakeMutatingWebhookConfigurations) Create(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.CreateOptions) (result *v1.MutatingWebhookConfiguration, err error) { + emptyResult := &v1.MutatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), &v1.MutatingWebhookConfiguration{}) + Invokes(testing.NewRootCreateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.MutatingWebhookConfiguration), err } // Update takes the representation of a mutatingWebhookConfiguration and updates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. func (c *FakeMutatingWebhookConfigurations) Update(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.UpdateOptions) (result *v1.MutatingWebhookConfiguration, err error) { + emptyResult := &v1.MutatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), &v1.MutatingWebhookConfiguration{}) + Invokes(testing.NewRootUpdateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.MutatingWebhookConfiguration), err } @@ -115,10 +119,11 @@ func (c *FakeMutatingWebhookConfigurations) DeleteCollection(ctx context.Context // Patch applies the patch and returns the patched mutatingWebhookConfiguration. func (c *FakeMutatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.MutatingWebhookConfiguration, err error) { + emptyResult := &v1.MutatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, name, pt, data, subresources...), &v1.MutatingWebhookConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.MutatingWebhookConfiguration), err } @@ -136,10 +141,11 @@ func (c *FakeMutatingWebhookConfigurations) Apply(ctx context.Context, mutatingW if name == nil { return nil, fmt.Errorf("mutatingWebhookConfiguration.Name must be provided to Apply") } + emptyResult := &v1.MutatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), &v1.MutatingWebhookConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.MutatingWebhookConfiguration), err } diff --git a/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicy.go b/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicy.go index c947e6572f..f7ef06681d 100644 --- a/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicy.go +++ b/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicy.go @@ -43,20 +43,22 @@ var validatingadmissionpoliciesKind = v1.SchemeGroupVersion.WithKind("Validating // Get takes name of the validatingAdmissionPolicy, and returns the corresponding validatingAdmissionPolicy object, and an error if there is any. func (c *FakeValidatingAdmissionPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ValidatingAdmissionPolicy, err error) { + emptyResult := &v1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(validatingadmissionpoliciesResource, name), &v1.ValidatingAdmissionPolicy{}) + Invokes(testing.NewRootGetAction(validatingadmissionpoliciesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicy), err } // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. func (c *FakeValidatingAdmissionPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyList, err error) { + emptyResult := &v1.ValidatingAdmissionPolicyList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), &v1.ValidatingAdmissionPolicyList{}) + Invokes(testing.NewRootListAction(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,31 +82,34 @@ func (c *FakeValidatingAdmissionPolicies) Watch(ctx context.Context, opts metav1 // Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. func (c *FakeValidatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.CreateOptions) (result *v1.ValidatingAdmissionPolicy, err error) { + emptyResult := &v1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), &v1.ValidatingAdmissionPolicy{}) + Invokes(testing.NewRootCreateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicy), err } // Update takes the representation of a validatingAdmissionPolicy and updates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. func (c *FakeValidatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.UpdateOptions) (result *v1.ValidatingAdmissionPolicy, err error) { + emptyResult := &v1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), &v1.ValidatingAdmissionPolicy{}) + Invokes(testing.NewRootUpdateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicy), 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 *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.UpdateOptions) (*v1.ValidatingAdmissionPolicy, error) { +func (c *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.UpdateOptions) (result *v1.ValidatingAdmissionPolicy, err error) { + emptyResult := &v1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy), &v1.ValidatingAdmissionPolicy{}) + Invokes(testing.NewRootUpdateSubresourceAction(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicy), err } @@ -126,10 +131,11 @@ func (c *FakeValidatingAdmissionPolicies) DeleteCollection(ctx context.Context, // Patch applies the patch and returns the patched validatingAdmissionPolicy. func (c *FakeValidatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingAdmissionPolicy, err error) { + emptyResult := &v1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, name, pt, data, subresources...), &v1.ValidatingAdmissionPolicy{}) + Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicy), err } @@ -147,10 +153,11 @@ func (c *FakeValidatingAdmissionPolicies) Apply(ctx context.Context, validatingA if name == nil { return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") } + emptyResult := &v1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data), &v1.ValidatingAdmissionPolicy{}) + Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicy), err } @@ -169,10 +176,11 @@ func (c *FakeValidatingAdmissionPolicies) ApplyStatus(ctx context.Context, valid if name == nil { return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") } + emptyResult := &v1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, "status"), &v1.ValidatingAdmissionPolicy{}) + Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicy), err } diff --git a/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicybinding.go b/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicybinding.go index 9ace735930..b6cd66fc09 100644 --- a/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicybinding.go +++ b/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicybinding.go @@ -43,20 +43,22 @@ var validatingadmissionpolicybindingsKind = v1.SchemeGroupVersion.WithKind("Vali // Get takes name of the validatingAdmissionPolicyBinding, and returns the corresponding validatingAdmissionPolicyBinding object, and an error if there is any. func (c *FakeValidatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) { + emptyResult := &v1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(validatingadmissionpolicybindingsResource, name), &v1.ValidatingAdmissionPolicyBinding{}) + Invokes(testing.NewRootGetAction(validatingadmissionpolicybindingsResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicyBinding), err } // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. func (c *FakeValidatingAdmissionPolicyBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyBindingList, err error) { + emptyResult := &v1.ValidatingAdmissionPolicyBindingList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), &v1.ValidatingAdmissionPolicyBindingList{}) + Invokes(testing.NewRootListAction(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeValidatingAdmissionPolicyBindings) Watch(ctx context.Context, opts // Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. func (c *FakeValidatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1.ValidatingAdmissionPolicyBinding, opts metav1.CreateOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) { + emptyResult := &v1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), &v1.ValidatingAdmissionPolicyBinding{}) + Invokes(testing.NewRootCreateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicyBinding), err } // Update takes the representation of a validatingAdmissionPolicyBinding and updates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. func (c *FakeValidatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1.ValidatingAdmissionPolicyBinding, opts metav1.UpdateOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) { + emptyResult := &v1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), &v1.ValidatingAdmissionPolicyBinding{}) + Invokes(testing.NewRootUpdateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicyBinding), err } @@ -115,10 +119,11 @@ func (c *FakeValidatingAdmissionPolicyBindings) DeleteCollection(ctx context.Con // Patch applies the patch and returns the patched validatingAdmissionPolicyBinding. func (c *FakeValidatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingAdmissionPolicyBinding, err error) { + emptyResult := &v1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, name, pt, data, subresources...), &v1.ValidatingAdmissionPolicyBinding{}) + Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicyBinding), err } @@ -136,10 +141,11 @@ func (c *FakeValidatingAdmissionPolicyBindings) Apply(ctx context.Context, valid if name == nil { return nil, fmt.Errorf("validatingAdmissionPolicyBinding.Name must be provided to Apply") } + emptyResult := &v1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data), &v1.ValidatingAdmissionPolicyBinding{}) + Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ValidatingAdmissionPolicyBinding), err } diff --git a/kubernetes/typed/admissionregistration/v1/fake/fake_validatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1/fake/fake_validatingwebhookconfiguration.go index a6951c736e..afd5879d28 100644 --- a/kubernetes/typed/admissionregistration/v1/fake/fake_validatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1/fake/fake_validatingwebhookconfiguration.go @@ -43,20 +43,22 @@ var validatingwebhookconfigurationsKind = v1.SchemeGroupVersion.WithKind("Valida // Get takes name of the validatingWebhookConfiguration, and returns the corresponding validatingWebhookConfiguration object, and an error if there is any. func (c *FakeValidatingWebhookConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ValidatingWebhookConfiguration, err error) { + emptyResult := &v1.ValidatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(validatingwebhookconfigurationsResource, name), &v1.ValidatingWebhookConfiguration{}) + Invokes(testing.NewRootGetAction(validatingwebhookconfigurationsResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ValidatingWebhookConfiguration), err } // List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. func (c *FakeValidatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingWebhookConfigurationList, err error) { + emptyResult := &v1.ValidatingWebhookConfigurationList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), &v1.ValidatingWebhookConfigurationList{}) + Invokes(testing.NewRootListAction(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeValidatingWebhookConfigurations) Watch(ctx context.Context, opts me // Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. func (c *FakeValidatingWebhookConfigurations) Create(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.CreateOptions) (result *v1.ValidatingWebhookConfiguration, err error) { + emptyResult := &v1.ValidatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), &v1.ValidatingWebhookConfiguration{}) + Invokes(testing.NewRootCreateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ValidatingWebhookConfiguration), err } // Update takes the representation of a validatingWebhookConfiguration and updates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. func (c *FakeValidatingWebhookConfigurations) Update(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.UpdateOptions) (result *v1.ValidatingWebhookConfiguration, err error) { + emptyResult := &v1.ValidatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), &v1.ValidatingWebhookConfiguration{}) + Invokes(testing.NewRootUpdateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ValidatingWebhookConfiguration), err } @@ -115,10 +119,11 @@ func (c *FakeValidatingWebhookConfigurations) DeleteCollection(ctx context.Conte // Patch applies the patch and returns the patched validatingWebhookConfiguration. func (c *FakeValidatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingWebhookConfiguration, err error) { + emptyResult := &v1.ValidatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, name, pt, data, subresources...), &v1.ValidatingWebhookConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ValidatingWebhookConfiguration), err } @@ -136,10 +141,11 @@ func (c *FakeValidatingWebhookConfigurations) Apply(ctx context.Context, validat if name == nil { return nil, fmt.Errorf("validatingWebhookConfiguration.Name must be provided to Apply") } + emptyResult := &v1.ValidatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), &v1.ValidatingWebhookConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ValidatingWebhookConfiguration), err } diff --git a/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicy.go b/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicy.go index f4358ce46c..fd8a17b2fd 100644 --- a/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicy.go +++ b/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicy.go @@ -43,20 +43,22 @@ var validatingadmissionpoliciesKind = v1alpha1.SchemeGroupVersion.WithKind("Vali // Get takes name of the validatingAdmissionPolicy, and returns the corresponding validatingAdmissionPolicy object, and an error if there is any. func (c *FakeValidatingAdmissionPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { + emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(validatingadmissionpoliciesResource, name), &v1alpha1.ValidatingAdmissionPolicy{}) + Invokes(testing.NewRootGetAction(validatingadmissionpoliciesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicy), err } // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. func (c *FakeValidatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyList, err error) { + emptyResult := &v1alpha1.ValidatingAdmissionPolicyList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), &v1alpha1.ValidatingAdmissionPolicyList{}) + Invokes(testing.NewRootListAction(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,31 +82,34 @@ func (c *FakeValidatingAdmissionPolicies) Watch(ctx context.Context, opts v1.Lis // Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. func (c *FakeValidatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.CreateOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { + emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), &v1alpha1.ValidatingAdmissionPolicy{}) + Invokes(testing.NewRootCreateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicy), err } // Update takes the representation of a validatingAdmissionPolicy and updates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. func (c *FakeValidatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { + emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), &v1alpha1.ValidatingAdmissionPolicy{}) + Invokes(testing.NewRootUpdateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicy), 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 *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (*v1alpha1.ValidatingAdmissionPolicy, error) { +func (c *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { + emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy), &v1alpha1.ValidatingAdmissionPolicy{}) + Invokes(testing.NewRootUpdateSubresourceAction(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicy), err } @@ -126,10 +131,11 @@ func (c *FakeValidatingAdmissionPolicies) DeleteCollection(ctx context.Context, // Patch applies the patch and returns the patched validatingAdmissionPolicy. func (c *FakeValidatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { + emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, name, pt, data, subresources...), &v1alpha1.ValidatingAdmissionPolicy{}) + Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicy), err } @@ -147,10 +153,11 @@ func (c *FakeValidatingAdmissionPolicies) Apply(ctx context.Context, validatingA if name == nil { return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") } + emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data), &v1alpha1.ValidatingAdmissionPolicy{}) + Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicy), err } @@ -169,10 +176,11 @@ func (c *FakeValidatingAdmissionPolicies) ApplyStatus(ctx context.Context, valid if name == nil { return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") } + emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.ValidatingAdmissionPolicy{}) + Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicy), err } diff --git a/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicybinding.go b/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicybinding.go index c520655f9d..ca6d25235a 100644 --- a/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicybinding.go +++ b/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicybinding.go @@ -43,20 +43,22 @@ var validatingadmissionpolicybindingsKind = v1alpha1.SchemeGroupVersion.WithKind // Get takes name of the validatingAdmissionPolicyBinding, and returns the corresponding validatingAdmissionPolicyBinding object, and an error if there is any. func (c *FakeValidatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { + emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(validatingadmissionpolicybindingsResource, name), &v1alpha1.ValidatingAdmissionPolicyBinding{}) + Invokes(testing.NewRootGetAction(validatingadmissionpolicybindingsResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err } // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. func (c *FakeValidatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyBindingList, err error) { + emptyResult := &v1alpha1.ValidatingAdmissionPolicyBindingList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), &v1alpha1.ValidatingAdmissionPolicyBindingList{}) + Invokes(testing.NewRootListAction(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeValidatingAdmissionPolicyBindings) Watch(ctx context.Context, opts // Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. func (c *FakeValidatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1alpha1.ValidatingAdmissionPolicyBinding, opts v1.CreateOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { + emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), &v1alpha1.ValidatingAdmissionPolicyBinding{}) + Invokes(testing.NewRootCreateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err } // Update takes the representation of a validatingAdmissionPolicyBinding and updates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. func (c *FakeValidatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1alpha1.ValidatingAdmissionPolicyBinding, opts v1.UpdateOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { + emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), &v1alpha1.ValidatingAdmissionPolicyBinding{}) + Invokes(testing.NewRootUpdateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err } @@ -115,10 +119,11 @@ func (c *FakeValidatingAdmissionPolicyBindings) DeleteCollection(ctx context.Con // Patch applies the patch and returns the patched validatingAdmissionPolicyBinding. func (c *FakeValidatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { + emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, name, pt, data, subresources...), &v1alpha1.ValidatingAdmissionPolicyBinding{}) + Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err } @@ -136,10 +141,11 @@ func (c *FakeValidatingAdmissionPolicyBindings) Apply(ctx context.Context, valid if name == nil { return nil, fmt.Errorf("validatingAdmissionPolicyBinding.Name must be provided to Apply") } + emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data), &v1alpha1.ValidatingAdmissionPolicyBinding{}) + Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err } diff --git a/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go index 9d85aff37f..aa864b12fd 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go @@ -43,20 +43,22 @@ var mutatingwebhookconfigurationsKind = v1beta1.SchemeGroupVersion.WithKind("Mut // Get takes name of the mutatingWebhookConfiguration, and returns the corresponding mutatingWebhookConfiguration object, and an error if there is any. func (c *FakeMutatingWebhookConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { + emptyResult := &v1beta1.MutatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(mutatingwebhookconfigurationsResource, name), &v1beta1.MutatingWebhookConfiguration{}) + Invokes(testing.NewRootGetAction(mutatingwebhookconfigurationsResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.MutatingWebhookConfiguration), err } // List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. func (c *FakeMutatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MutatingWebhookConfigurationList, err error) { + emptyResult := &v1beta1.MutatingWebhookConfigurationList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), &v1beta1.MutatingWebhookConfigurationList{}) + Invokes(testing.NewRootListAction(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeMutatingWebhookConfigurations) Watch(ctx context.Context, opts v1.L // Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. func (c *FakeMutatingWebhookConfigurations) Create(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.CreateOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { + emptyResult := &v1beta1.MutatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), &v1beta1.MutatingWebhookConfiguration{}) + Invokes(testing.NewRootCreateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.MutatingWebhookConfiguration), err } // Update takes the representation of a mutatingWebhookConfiguration and updates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. func (c *FakeMutatingWebhookConfigurations) Update(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.UpdateOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { + emptyResult := &v1beta1.MutatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), &v1beta1.MutatingWebhookConfiguration{}) + Invokes(testing.NewRootUpdateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.MutatingWebhookConfiguration), err } @@ -115,10 +119,11 @@ func (c *FakeMutatingWebhookConfigurations) DeleteCollection(ctx context.Context // Patch applies the patch and returns the patched mutatingWebhookConfiguration. func (c *FakeMutatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MutatingWebhookConfiguration, err error) { + emptyResult := &v1beta1.MutatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, name, pt, data, subresources...), &v1beta1.MutatingWebhookConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.MutatingWebhookConfiguration), err } @@ -136,10 +141,11 @@ func (c *FakeMutatingWebhookConfigurations) Apply(ctx context.Context, mutatingW if name == nil { return nil, fmt.Errorf("mutatingWebhookConfiguration.Name must be provided to Apply") } + emptyResult := &v1beta1.MutatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), &v1beta1.MutatingWebhookConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.MutatingWebhookConfiguration), err } diff --git a/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicy.go b/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicy.go index 90cb4ff6ca..024fdec052 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicy.go +++ b/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicy.go @@ -43,20 +43,22 @@ var validatingadmissionpoliciesKind = v1beta1.SchemeGroupVersion.WithKind("Valid // Get takes name of the validatingAdmissionPolicy, and returns the corresponding validatingAdmissionPolicy object, and an error if there is any. func (c *FakeValidatingAdmissionPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { + emptyResult := &v1beta1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(validatingadmissionpoliciesResource, name), &v1beta1.ValidatingAdmissionPolicy{}) + Invokes(testing.NewRootGetAction(validatingadmissionpoliciesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicy), err } // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. func (c *FakeValidatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyList, err error) { + emptyResult := &v1beta1.ValidatingAdmissionPolicyList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), &v1beta1.ValidatingAdmissionPolicyList{}) + Invokes(testing.NewRootListAction(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,31 +82,34 @@ func (c *FakeValidatingAdmissionPolicies) Watch(ctx context.Context, opts v1.Lis // Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. func (c *FakeValidatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.CreateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { + emptyResult := &v1beta1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), &v1beta1.ValidatingAdmissionPolicy{}) + Invokes(testing.NewRootCreateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicy), err } // Update takes the representation of a validatingAdmissionPolicy and updates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. func (c *FakeValidatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { + emptyResult := &v1beta1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), &v1beta1.ValidatingAdmissionPolicy{}) + Invokes(testing.NewRootUpdateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicy), 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 *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (*v1beta1.ValidatingAdmissionPolicy, error) { +func (c *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { + emptyResult := &v1beta1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy), &v1beta1.ValidatingAdmissionPolicy{}) + Invokes(testing.NewRootUpdateSubresourceAction(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicy), err } @@ -126,10 +131,11 @@ func (c *FakeValidatingAdmissionPolicies) DeleteCollection(ctx context.Context, // Patch applies the patch and returns the patched validatingAdmissionPolicy. func (c *FakeValidatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingAdmissionPolicy, err error) { + emptyResult := &v1beta1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, name, pt, data, subresources...), &v1beta1.ValidatingAdmissionPolicy{}) + Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicy), err } @@ -147,10 +153,11 @@ func (c *FakeValidatingAdmissionPolicies) Apply(ctx context.Context, validatingA if name == nil { return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") } + emptyResult := &v1beta1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data), &v1beta1.ValidatingAdmissionPolicy{}) + Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicy), err } @@ -169,10 +176,11 @@ func (c *FakeValidatingAdmissionPolicies) ApplyStatus(ctx context.Context, valid if name == nil { return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") } + emptyResult := &v1beta1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, "status"), &v1beta1.ValidatingAdmissionPolicy{}) + Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicy), err } diff --git a/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicybinding.go b/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicybinding.go index f771f81f30..9d6ff51530 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicybinding.go +++ b/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicybinding.go @@ -43,20 +43,22 @@ var validatingadmissionpolicybindingsKind = v1beta1.SchemeGroupVersion.WithKind( // Get takes name of the validatingAdmissionPolicyBinding, and returns the corresponding validatingAdmissionPolicyBinding object, and an error if there is any. func (c *FakeValidatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { + emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(validatingadmissionpolicybindingsResource, name), &v1beta1.ValidatingAdmissionPolicyBinding{}) + Invokes(testing.NewRootGetAction(validatingadmissionpolicybindingsResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err } // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. func (c *FakeValidatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyBindingList, err error) { + emptyResult := &v1beta1.ValidatingAdmissionPolicyBindingList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), &v1beta1.ValidatingAdmissionPolicyBindingList{}) + Invokes(testing.NewRootListAction(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeValidatingAdmissionPolicyBindings) Watch(ctx context.Context, opts // Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. func (c *FakeValidatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1beta1.ValidatingAdmissionPolicyBinding, opts v1.CreateOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { + emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), &v1beta1.ValidatingAdmissionPolicyBinding{}) + Invokes(testing.NewRootCreateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err } // Update takes the representation of a validatingAdmissionPolicyBinding and updates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. func (c *FakeValidatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1beta1.ValidatingAdmissionPolicyBinding, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { + emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), &v1beta1.ValidatingAdmissionPolicyBinding{}) + Invokes(testing.NewRootUpdateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err } @@ -115,10 +119,11 @@ func (c *FakeValidatingAdmissionPolicyBindings) DeleteCollection(ctx context.Con // Patch applies the patch and returns the patched validatingAdmissionPolicyBinding. func (c *FakeValidatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { + emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, name, pt, data, subresources...), &v1beta1.ValidatingAdmissionPolicyBinding{}) + Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err } @@ -136,10 +141,11 @@ func (c *FakeValidatingAdmissionPolicyBindings) Apply(ctx context.Context, valid if name == nil { return nil, fmt.Errorf("validatingAdmissionPolicyBinding.Name must be provided to Apply") } + emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data), &v1beta1.ValidatingAdmissionPolicyBinding{}) + Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err } diff --git a/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go index 41e3a7c1ee..2c76bb9ac2 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go @@ -43,20 +43,22 @@ var validatingwebhookconfigurationsKind = v1beta1.SchemeGroupVersion.WithKind("V // Get takes name of the validatingWebhookConfiguration, and returns the corresponding validatingWebhookConfiguration object, and an error if there is any. func (c *FakeValidatingWebhookConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { + emptyResult := &v1beta1.ValidatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(validatingwebhookconfigurationsResource, name), &v1beta1.ValidatingWebhookConfiguration{}) + Invokes(testing.NewRootGetAction(validatingwebhookconfigurationsResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ValidatingWebhookConfiguration), err } // List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. func (c *FakeValidatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingWebhookConfigurationList, err error) { + emptyResult := &v1beta1.ValidatingWebhookConfigurationList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), &v1beta1.ValidatingWebhookConfigurationList{}) + Invokes(testing.NewRootListAction(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeValidatingWebhookConfigurations) Watch(ctx context.Context, opts v1 // Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. func (c *FakeValidatingWebhookConfigurations) Create(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.CreateOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { + emptyResult := &v1beta1.ValidatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), &v1beta1.ValidatingWebhookConfiguration{}) + Invokes(testing.NewRootCreateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ValidatingWebhookConfiguration), err } // Update takes the representation of a validatingWebhookConfiguration and updates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. func (c *FakeValidatingWebhookConfigurations) Update(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.UpdateOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { + emptyResult := &v1beta1.ValidatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), &v1beta1.ValidatingWebhookConfiguration{}) + Invokes(testing.NewRootUpdateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ValidatingWebhookConfiguration), err } @@ -115,10 +119,11 @@ func (c *FakeValidatingWebhookConfigurations) DeleteCollection(ctx context.Conte // Patch applies the patch and returns the patched validatingWebhookConfiguration. func (c *FakeValidatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingWebhookConfiguration, err error) { + emptyResult := &v1beta1.ValidatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, name, pt, data, subresources...), &v1beta1.ValidatingWebhookConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ValidatingWebhookConfiguration), err } @@ -136,10 +141,11 @@ func (c *FakeValidatingWebhookConfigurations) Apply(ctx context.Context, validat if name == nil { return nil, fmt.Errorf("validatingWebhookConfiguration.Name must be provided to Apply") } + emptyResult := &v1beta1.ValidatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), &v1beta1.ValidatingWebhookConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ValidatingWebhookConfiguration), err } diff --git a/kubernetes/typed/apiserverinternal/v1alpha1/fake/fake_storageversion.go b/kubernetes/typed/apiserverinternal/v1alpha1/fake/fake_storageversion.go index 738c68038b..bf66e0f3b0 100644 --- a/kubernetes/typed/apiserverinternal/v1alpha1/fake/fake_storageversion.go +++ b/kubernetes/typed/apiserverinternal/v1alpha1/fake/fake_storageversion.go @@ -43,20 +43,22 @@ var storageversionsKind = v1alpha1.SchemeGroupVersion.WithKind("StorageVersion") // Get takes name of the storageVersion, and returns the corresponding storageVersion object, and an error if there is any. func (c *FakeStorageVersions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.StorageVersion, err error) { + emptyResult := &v1alpha1.StorageVersion{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(storageversionsResource, name), &v1alpha1.StorageVersion{}) + Invokes(testing.NewRootGetAction(storageversionsResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.StorageVersion), err } // List takes label and field selectors, and returns the list of StorageVersions that match those selectors. func (c *FakeStorageVersions) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionList, err error) { + emptyResult := &v1alpha1.StorageVersionList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(storageversionsResource, storageversionsKind, opts), &v1alpha1.StorageVersionList{}) + Invokes(testing.NewRootListAction(storageversionsResource, storageversionsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,31 +82,34 @@ func (c *FakeStorageVersions) Watch(ctx context.Context, opts v1.ListOptions) (w // Create takes the representation of a storageVersion and creates it. Returns the server's representation of the storageVersion, and an error, if there is any. func (c *FakeStorageVersions) Create(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.CreateOptions) (result *v1alpha1.StorageVersion, err error) { + emptyResult := &v1alpha1.StorageVersion{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(storageversionsResource, storageVersion), &v1alpha1.StorageVersion{}) + Invokes(testing.NewRootCreateAction(storageversionsResource, storageVersion), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.StorageVersion), err } // Update takes the representation of a storageVersion and updates it. Returns the server's representation of the storageVersion, and an error, if there is any. func (c *FakeStorageVersions) Update(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.UpdateOptions) (result *v1alpha1.StorageVersion, err error) { + emptyResult := &v1alpha1.StorageVersion{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(storageversionsResource, storageVersion), &v1alpha1.StorageVersion{}) + Invokes(testing.NewRootUpdateAction(storageversionsResource, storageVersion), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.StorageVersion), 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 *FakeStorageVersions) UpdateStatus(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.UpdateOptions) (*v1alpha1.StorageVersion, error) { +func (c *FakeStorageVersions) UpdateStatus(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.UpdateOptions) (result *v1alpha1.StorageVersion, err error) { + emptyResult := &v1alpha1.StorageVersion{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(storageversionsResource, "status", storageVersion), &v1alpha1.StorageVersion{}) + Invokes(testing.NewRootUpdateSubresourceAction(storageversionsResource, "status", storageVersion), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.StorageVersion), err } @@ -126,10 +131,11 @@ func (c *FakeStorageVersions) DeleteCollection(ctx context.Context, opts v1.Dele // Patch applies the patch and returns the patched storageVersion. func (c *FakeStorageVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.StorageVersion, err error) { + emptyResult := &v1alpha1.StorageVersion{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(storageversionsResource, name, pt, data, subresources...), &v1alpha1.StorageVersion{}) + Invokes(testing.NewRootPatchSubresourceAction(storageversionsResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.StorageVersion), err } @@ -147,10 +153,11 @@ func (c *FakeStorageVersions) Apply(ctx context.Context, storageVersion *apiserv if name == nil { return nil, fmt.Errorf("storageVersion.Name must be provided to Apply") } + emptyResult := &v1alpha1.StorageVersion{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(storageversionsResource, *name, types.ApplyPatchType, data), &v1alpha1.StorageVersion{}) + Invokes(testing.NewRootPatchSubresourceAction(storageversionsResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.StorageVersion), err } @@ -169,10 +176,11 @@ func (c *FakeStorageVersions) ApplyStatus(ctx context.Context, storageVersion *a if name == nil { return nil, fmt.Errorf("storageVersion.Name must be provided to Apply") } + emptyResult := &v1alpha1.StorageVersion{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(storageversionsResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.StorageVersion{}) + Invokes(testing.NewRootPatchSubresourceAction(storageversionsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.StorageVersion), err } diff --git a/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go b/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go index f691ba9acd..1c12443299 100644 --- a/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go +++ b/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go @@ -44,22 +44,24 @@ var controllerrevisionsKind = v1.SchemeGroupVersion.WithKind("ControllerRevision // Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any. func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ControllerRevision, err error) { + emptyResult := &v1.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewGetAction(controllerrevisionsResource, c.ns, name), &v1.ControllerRevision{}) + Invokes(testing.NewGetAction(controllerrevisionsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ControllerRevision), err } // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. func (c *FakeControllerRevisions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ControllerRevisionList, err error) { + emptyResult := &v1.ControllerRevisionList{} obj, err := c.Fake. - Invokes(testing.NewListAction(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), &v1.ControllerRevisionList{}) + Invokes(testing.NewListAction(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeControllerRevisions) Watch(ctx context.Context, opts metav1.ListOpt // Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any. func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.CreateOptions) (result *v1.ControllerRevision, err error) { + emptyResult := &v1.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(controllerrevisionsResource, c.ns, controllerRevision), &v1.ControllerRevision{}) + Invokes(testing.NewCreateAction(controllerrevisionsResource, c.ns, controllerRevision), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ControllerRevision), err } // Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any. func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.UpdateOptions) (result *v1.ControllerRevision, err error) { + emptyResult := &v1.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(controllerrevisionsResource, c.ns, controllerRevision), &v1.ControllerRevision{}) + Invokes(testing.NewUpdateAction(controllerrevisionsResource, c.ns, controllerRevision), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ControllerRevision), err } @@ -122,11 +126,12 @@ func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts met // Patch applies the patch and returns the patched controllerRevision. func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ControllerRevision, err error) { + emptyResult := &v1.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, name, pt, data, subresources...), &v1.ControllerRevision{}) + Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ControllerRevision), err } @@ -144,11 +149,12 @@ func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision if name == nil { return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply") } + emptyResult := &v1.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data), &v1.ControllerRevision{}) + Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ControllerRevision), err } diff --git a/kubernetes/typed/apps/v1/fake/fake_daemonset.go b/kubernetes/typed/apps/v1/fake/fake_daemonset.go index 3e0df72352..c1b1d79483 100644 --- a/kubernetes/typed/apps/v1/fake/fake_daemonset.go +++ b/kubernetes/typed/apps/v1/fake/fake_daemonset.go @@ -44,22 +44,24 @@ var daemonsetsKind = v1.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 metav1.GetOptions) (result *v1.DaemonSet, err error) { + emptyResult := &v1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewGetAction(daemonsetsResource, c.ns, name), &v1.DaemonSet{}) + Invokes(testing.NewGetAction(daemonsetsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.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 metav1.ListOptions) (result *v1.DaemonSetList, err error) { + emptyResult := &v1.DaemonSetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(daemonsetsResource, daemonsetsKind, c.ns, opts), &v1.DaemonSetList{}) + Invokes(testing.NewListAction(daemonsetsResource, daemonsetsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeDaemonSets) Watch(ctx context.Context, opts metav1.ListOptions) (wa // 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 *v1.DaemonSet, opts metav1.CreateOptions) (result *v1.DaemonSet, err error) { + emptyResult := &v1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(daemonsetsResource, c.ns, daemonSet), &v1.DaemonSet{}) + Invokes(testing.NewCreateAction(daemonsetsResource, c.ns, daemonSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.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 *v1.DaemonSet, opts metav1.UpdateOptions) (result *v1.DaemonSet, err error) { + emptyResult := &v1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), &v1.DaemonSet{}) + Invokes(testing.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.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 *v1.DaemonSet, opts metav1.UpdateOptions) (*v1.DaemonSet, error) { +func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (result *v1.DaemonSet, err error) { + emptyResult := &v1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), &v1.DaemonSet{}) + Invokes(testing.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DaemonSet), err } @@ -134,11 +139,12 @@ func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, opts metav1.Delet // Patch applies the patch and returns the patched daemonSet. func (c *FakeDaemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DaemonSet, err error) { + emptyResult := &v1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, pt, data, subresources...), &v1.DaemonSet{}) + Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DaemonSet), err } @@ -156,11 +162,12 @@ func (c *FakeDaemonSets) Apply(ctx context.Context, daemonSet *appsv1.DaemonSetA if name == nil { return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") } + emptyResult := &v1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data), &v1.DaemonSet{}) + Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DaemonSet), err } @@ -179,11 +186,12 @@ func (c *FakeDaemonSets) ApplyStatus(ctx context.Context, daemonSet *appsv1.Daem if name == nil { return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") } + emptyResult := &v1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.DaemonSet{}) + Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.DaemonSet), err } diff --git a/kubernetes/typed/apps/v1/fake/fake_deployment.go b/kubernetes/typed/apps/v1/fake/fake_deployment.go index da1896fe60..c903e3f7be 100644 --- a/kubernetes/typed/apps/v1/fake/fake_deployment.go +++ b/kubernetes/typed/apps/v1/fake/fake_deployment.go @@ -46,22 +46,24 @@ var deploymentsKind = v1.SchemeGroupVersion.WithKind("Deployment") // Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. func (c *FakeDeployments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Deployment, err error) { + emptyResult := &v1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), &v1.Deployment{}) + Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Deployment), err } // List takes label and field selectors, and returns the list of Deployments that match those selectors. func (c *FakeDeployments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DeploymentList, err error) { + emptyResult := &v1.DeploymentList{} obj, err := c.Fake. - Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), &v1.DeploymentList{}) + Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -86,34 +88,37 @@ func (c *FakeDeployments) Watch(ctx context.Context, opts metav1.ListOptions) (w // Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. func (c *FakeDeployments) Create(ctx context.Context, deployment *v1.Deployment, opts metav1.CreateOptions) (result *v1.Deployment, err error) { + emptyResult := &v1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), &v1.Deployment{}) + Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Deployment), err } // Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. func (c *FakeDeployments) Update(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (result *v1.Deployment, err error) { + emptyResult := &v1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), &v1.Deployment{}) + Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Deployment), 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 *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (*v1.Deployment, error) { +func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (result *v1.Deployment, err error) { + emptyResult := &v1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), &v1.Deployment{}) + Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Deployment), err } @@ -136,11 +141,12 @@ func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts metav1.Dele // Patch applies the patch and returns the patched deployment. func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Deployment, err error) { + emptyResult := &v1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), &v1.Deployment{}) + Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Deployment), err } @@ -158,11 +164,12 @@ func (c *FakeDeployments) Apply(ctx context.Context, deployment *appsv1.Deployme if name == nil { return nil, fmt.Errorf("deployment.Name must be provided to Apply") } + emptyResult := &v1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), &v1.Deployment{}) + Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Deployment), err } @@ -181,33 +188,36 @@ func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1.De if name == nil { return nil, fmt.Errorf("deployment.Name must be provided to Apply") } + emptyResult := &v1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.Deployment{}) + Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Deployment), err } // GetScale takes name of the deployment, and returns the corresponding scale object, and an error if there is any. func (c *FakeDeployments) GetScale(ctx context.Context, deploymentName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { + emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewGetSubresourceAction(deploymentsResource, c.ns, "scale", deploymentName), &autoscalingv1.Scale{}) + Invokes(testing.NewGetSubresourceAction(deploymentsResource, c.ns, "scale", deploymentName), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*autoscalingv1.Scale), err } // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *FakeDeployments) UpdateScale(ctx context.Context, deploymentName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { + emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "scale", c.ns, scale), &autoscalingv1.Scale{}) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*autoscalingv1.Scale), err } @@ -222,11 +232,12 @@ func (c *FakeDeployments) ApplyScale(ctx context.Context, deploymentName string, if err != nil { return nil, err } + emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, deploymentName, types.ApplyPatchType, data, "status"), &autoscalingv1.Scale{}) + Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, deploymentName, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*autoscalingv1.Scale), err } diff --git a/kubernetes/typed/apps/v1/fake/fake_replicaset.go b/kubernetes/typed/apps/v1/fake/fake_replicaset.go index dedf19b42f..5df759dace 100644 --- a/kubernetes/typed/apps/v1/fake/fake_replicaset.go +++ b/kubernetes/typed/apps/v1/fake/fake_replicaset.go @@ -46,22 +46,24 @@ var replicasetsKind = v1.SchemeGroupVersion.WithKind("ReplicaSet") // Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any. func (c *FakeReplicaSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ReplicaSet, err error) { + emptyResult := &v1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewGetAction(replicasetsResource, c.ns, name), &v1.ReplicaSet{}) + Invokes(testing.NewGetAction(replicasetsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ReplicaSet), err } // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. func (c *FakeReplicaSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicaSetList, err error) { + emptyResult := &v1.ReplicaSetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(replicasetsResource, replicasetsKind, c.ns, opts), &v1.ReplicaSetList{}) + Invokes(testing.NewListAction(replicasetsResource, replicasetsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -86,34 +88,37 @@ func (c *FakeReplicaSets) Watch(ctx context.Context, opts metav1.ListOptions) (w // Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any. func (c *FakeReplicaSets) Create(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.CreateOptions) (result *v1.ReplicaSet, err error) { + emptyResult := &v1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(replicasetsResource, c.ns, replicaSet), &v1.ReplicaSet{}) + Invokes(testing.NewCreateAction(replicasetsResource, c.ns, replicaSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ReplicaSet), err } // Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any. func (c *FakeReplicaSets) Update(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (result *v1.ReplicaSet, err error) { + emptyResult := &v1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(replicasetsResource, c.ns, replicaSet), &v1.ReplicaSet{}) + Invokes(testing.NewUpdateAction(replicasetsResource, c.ns, replicaSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ReplicaSet), 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 *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (*v1.ReplicaSet, error) { +func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (result *v1.ReplicaSet, err error) { + emptyResult := &v1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), &v1.ReplicaSet{}) + Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ReplicaSet), err } @@ -136,11 +141,12 @@ func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts metav1.Dele // Patch applies the patch and returns the patched replicaSet. func (c *FakeReplicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ReplicaSet, err error) { + emptyResult := &v1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, pt, data, subresources...), &v1.ReplicaSet{}) + Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ReplicaSet), err } @@ -158,11 +164,12 @@ func (c *FakeReplicaSets) Apply(ctx context.Context, replicaSet *appsv1.ReplicaS if name == nil { return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") } + emptyResult := &v1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data), &v1.ReplicaSet{}) + Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ReplicaSet), err } @@ -181,33 +188,36 @@ func (c *FakeReplicaSets) ApplyStatus(ctx context.Context, replicaSet *appsv1.Re if name == nil { return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") } + emptyResult := &v1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.ReplicaSet{}) + Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ReplicaSet), err } // GetScale takes name of the replicaSet, and returns the corresponding scale object, and an error if there is any. func (c *FakeReplicaSets) GetScale(ctx context.Context, replicaSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { + emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewGetSubresourceAction(replicasetsResource, c.ns, "scale", replicaSetName), &autoscalingv1.Scale{}) + Invokes(testing.NewGetSubresourceAction(replicasetsResource, c.ns, "scale", replicaSetName), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*autoscalingv1.Scale), err } // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *FakeReplicaSets) UpdateScale(ctx context.Context, replicaSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { + emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "scale", c.ns, scale), &autoscalingv1.Scale{}) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*autoscalingv1.Scale), err } @@ -222,11 +232,12 @@ func (c *FakeReplicaSets) ApplyScale(ctx context.Context, replicaSetName string, if err != nil { return nil, err } + emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, replicaSetName, types.ApplyPatchType, data, "status"), &autoscalingv1.Scale{}) + Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, replicaSetName, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*autoscalingv1.Scale), err } diff --git a/kubernetes/typed/apps/v1/fake/fake_statefulset.go b/kubernetes/typed/apps/v1/fake/fake_statefulset.go index f1d7d96e8d..89848d56a9 100644 --- a/kubernetes/typed/apps/v1/fake/fake_statefulset.go +++ b/kubernetes/typed/apps/v1/fake/fake_statefulset.go @@ -46,22 +46,24 @@ var statefulsetsKind = v1.SchemeGroupVersion.WithKind("StatefulSet") // Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any. func (c *FakeStatefulSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.StatefulSet, err error) { + emptyResult := &v1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewGetAction(statefulsetsResource, c.ns, name), &v1.StatefulSet{}) + Invokes(testing.NewGetAction(statefulsetsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.StatefulSet), err } // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. func (c *FakeStatefulSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.StatefulSetList, err error) { + emptyResult := &v1.StatefulSetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(statefulsetsResource, statefulsetsKind, c.ns, opts), &v1.StatefulSetList{}) + Invokes(testing.NewListAction(statefulsetsResource, statefulsetsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -86,34 +88,37 @@ func (c *FakeStatefulSets) Watch(ctx context.Context, opts metav1.ListOptions) ( // Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any. func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.CreateOptions) (result *v1.StatefulSet, err error) { + emptyResult := &v1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(statefulsetsResource, c.ns, statefulSet), &v1.StatefulSet{}) + Invokes(testing.NewCreateAction(statefulsetsResource, c.ns, statefulSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.StatefulSet), err } // Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any. func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (result *v1.StatefulSet, err error) { + emptyResult := &v1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), &v1.StatefulSet{}) + Invokes(testing.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.StatefulSet), 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 *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (*v1.StatefulSet, error) { +func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (result *v1.StatefulSet, err error) { + emptyResult := &v1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "status", c.ns, statefulSet), &v1.StatefulSet{}) + Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "status", c.ns, statefulSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.StatefulSet), err } @@ -136,11 +141,12 @@ func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts metav1.Del // Patch applies the patch and returns the patched statefulSet. func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.StatefulSet, err error) { + emptyResult := &v1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, pt, data, subresources...), &v1.StatefulSet{}) + Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.StatefulSet), err } @@ -158,11 +164,12 @@ func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *appsv1.Statef if name == nil { return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") } + emptyResult := &v1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data), &v1.StatefulSet{}) + Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.StatefulSet), err } @@ -181,33 +188,36 @@ func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1. if name == nil { return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") } + emptyResult := &v1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.StatefulSet{}) + Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.StatefulSet), err } // GetScale takes name of the statefulSet, and returns the corresponding scale object, and an error if there is any. func (c *FakeStatefulSets) GetScale(ctx context.Context, statefulSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { + emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewGetSubresourceAction(statefulsetsResource, c.ns, "scale", statefulSetName), &autoscalingv1.Scale{}) + Invokes(testing.NewGetSubresourceAction(statefulsetsResource, c.ns, "scale", statefulSetName), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*autoscalingv1.Scale), err } // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *FakeStatefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { + emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "scale", c.ns, scale), &autoscalingv1.Scale{}) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*autoscalingv1.Scale), err } @@ -222,11 +232,12 @@ func (c *FakeStatefulSets) ApplyScale(ctx context.Context, statefulSetName strin if err != nil { return nil, err } + emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, "status"), &autoscalingv1.Scale{}) + Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*autoscalingv1.Scale), err } diff --git a/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go b/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go index 1954c94703..d427737361 100644 --- a/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go +++ b/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go @@ -44,22 +44,24 @@ var controllerrevisionsKind = v1beta1.SchemeGroupVersion.WithKind("ControllerRev // Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any. func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ControllerRevision, err error) { + emptyResult := &v1beta1.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewGetAction(controllerrevisionsResource, c.ns, name), &v1beta1.ControllerRevision{}) + Invokes(testing.NewGetAction(controllerrevisionsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ControllerRevision), err } // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. func (c *FakeControllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ControllerRevisionList, err error) { + emptyResult := &v1beta1.ControllerRevisionList{} obj, err := c.Fake. - Invokes(testing.NewListAction(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), &v1beta1.ControllerRevisionList{}) + Invokes(testing.NewListAction(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeControllerRevisions) Watch(ctx context.Context, opts v1.ListOptions // Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any. func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.CreateOptions) (result *v1beta1.ControllerRevision, err error) { + emptyResult := &v1beta1.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(controllerrevisionsResource, c.ns, controllerRevision), &v1beta1.ControllerRevision{}) + Invokes(testing.NewCreateAction(controllerrevisionsResource, c.ns, controllerRevision), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ControllerRevision), err } // Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any. func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.UpdateOptions) (result *v1beta1.ControllerRevision, err error) { + emptyResult := &v1beta1.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(controllerrevisionsResource, c.ns, controllerRevision), &v1beta1.ControllerRevision{}) + Invokes(testing.NewUpdateAction(controllerrevisionsResource, c.ns, controllerRevision), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ControllerRevision), err } @@ -122,11 +126,12 @@ func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts v1. // Patch applies the patch and returns the patched controllerRevision. func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ControllerRevision, err error) { + emptyResult := &v1beta1.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, name, pt, data, subresources...), &v1beta1.ControllerRevision{}) + Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ControllerRevision), err } @@ -144,11 +149,12 @@ func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision if name == nil { return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply") } + emptyResult := &v1beta1.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.ControllerRevision{}) + Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ControllerRevision), err } diff --git a/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go b/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go index 9614852f74..f45355a08b 100644 --- a/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go +++ b/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go @@ -44,22 +44,24 @@ var deploymentsKind = v1beta1.SchemeGroupVersion.WithKind("Deployment") // Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. func (c *FakeDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Deployment, err error) { + emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), &v1beta1.Deployment{}) + Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Deployment), err } // List takes label and field selectors, and returns the list of Deployments that match those selectors. func (c *FakeDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { + emptyResult := &v1beta1.DeploymentList{} obj, err := c.Fake. - Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), &v1beta1.DeploymentList{}) + Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch // Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. func (c *FakeDeployments) Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (result *v1beta1.Deployment, err error) { + emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), &v1beta1.Deployment{}) + Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Deployment), err } // Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. func (c *FakeDeployments) Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { + emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), &v1beta1.Deployment{}) + Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Deployment), 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 *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (*v1beta1.Deployment, error) { +func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { + emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), &v1beta1.Deployment{}) + Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Deployment), err } @@ -134,11 +139,12 @@ func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOp // Patch applies the patch and returns the patched deployment. func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Deployment, err error) { + emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), &v1beta1.Deployment{}) + Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Deployment), err } @@ -156,11 +162,12 @@ func (c *FakeDeployments) Apply(ctx context.Context, deployment *appsv1beta1.Dep if name == nil { return nil, fmt.Errorf("deployment.Name must be provided to Apply") } + emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.Deployment{}) + Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Deployment), err } @@ -179,11 +186,12 @@ func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1bet if name == nil { return nil, fmt.Errorf("deployment.Name must be provided to Apply") } + emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.Deployment{}) + Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Deployment), err } diff --git a/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go b/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go index 2124515cfe..ea6b517de7 100644 --- a/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go +++ b/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go @@ -44,22 +44,24 @@ var statefulsetsKind = v1beta1.SchemeGroupVersion.WithKind("StatefulSet") // Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any. func (c *FakeStatefulSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.StatefulSet, err error) { + emptyResult := &v1beta1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewGetAction(statefulsetsResource, c.ns, name), &v1beta1.StatefulSet{}) + Invokes(testing.NewGetAction(statefulsetsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.StatefulSet), err } // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. func (c *FakeStatefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) { + emptyResult := &v1beta1.StatefulSetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(statefulsetsResource, statefulsetsKind, c.ns, opts), &v1beta1.StatefulSetList{}) + Invokes(testing.NewListAction(statefulsetsResource, statefulsetsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeStatefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watc // Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any. func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.CreateOptions) (result *v1beta1.StatefulSet, err error) { + emptyResult := &v1beta1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(statefulsetsResource, c.ns, statefulSet), &v1beta1.StatefulSet{}) + Invokes(testing.NewCreateAction(statefulsetsResource, c.ns, statefulSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.StatefulSet), err } // Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any. func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (result *v1beta1.StatefulSet, err error) { + emptyResult := &v1beta1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), &v1beta1.StatefulSet{}) + Invokes(testing.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.StatefulSet), 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 *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (*v1beta1.StatefulSet, error) { +func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (result *v1beta1.StatefulSet, err error) { + emptyResult := &v1beta1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "status", c.ns, statefulSet), &v1beta1.StatefulSet{}) + Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "status", c.ns, statefulSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.StatefulSet), err } @@ -134,11 +139,12 @@ func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteO // Patch applies the patch and returns the patched statefulSet. func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StatefulSet, err error) { + emptyResult := &v1beta1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, pt, data, subresources...), &v1beta1.StatefulSet{}) + Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.StatefulSet), err } @@ -156,11 +162,12 @@ func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *appsv1beta1.S if name == nil { return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") } + emptyResult := &v1beta1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.StatefulSet{}) + Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.StatefulSet), err } @@ -179,11 +186,12 @@ func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1b if name == nil { return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") } + emptyResult := &v1beta1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.StatefulSet{}) + Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.StatefulSet), err } diff --git a/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go b/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go index 1bf7fb3314..5e8ca6df2c 100644 --- a/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go +++ b/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go @@ -44,22 +44,24 @@ var controllerrevisionsKind = v1beta2.SchemeGroupVersion.WithKind("ControllerRev // Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any. func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ControllerRevision, err error) { + emptyResult := &v1beta2.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewGetAction(controllerrevisionsResource, c.ns, name), &v1beta2.ControllerRevision{}) + Invokes(testing.NewGetAction(controllerrevisionsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.ControllerRevision), err } // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. func (c *FakeControllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) { + emptyResult := &v1beta2.ControllerRevisionList{} obj, err := c.Fake. - Invokes(testing.NewListAction(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), &v1beta2.ControllerRevisionList{}) + Invokes(testing.NewListAction(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeControllerRevisions) Watch(ctx context.Context, opts v1.ListOptions // Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any. func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.CreateOptions) (result *v1beta2.ControllerRevision, err error) { + emptyResult := &v1beta2.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(controllerrevisionsResource, c.ns, controllerRevision), &v1beta2.ControllerRevision{}) + Invokes(testing.NewCreateAction(controllerrevisionsResource, c.ns, controllerRevision), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.ControllerRevision), err } // Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any. func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.UpdateOptions) (result *v1beta2.ControllerRevision, err error) { + emptyResult := &v1beta2.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(controllerrevisionsResource, c.ns, controllerRevision), &v1beta2.ControllerRevision{}) + Invokes(testing.NewUpdateAction(controllerrevisionsResource, c.ns, controllerRevision), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.ControllerRevision), err } @@ -122,11 +126,12 @@ func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts v1. // Patch applies the patch and returns the patched controllerRevision. func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ControllerRevision, err error) { + emptyResult := &v1beta2.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, name, pt, data, subresources...), &v1beta2.ControllerRevision{}) + Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.ControllerRevision), err } @@ -144,11 +149,12 @@ func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision if name == nil { return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply") } + emptyResult := &v1beta2.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta2.ControllerRevision{}) + Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.ControllerRevision), err } diff --git a/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go b/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go index 8f5cfa5a8a..b554c22498 100644 --- a/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go +++ b/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go @@ -44,22 +44,24 @@ var daemonsetsKind = v1beta2.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 *v1beta2.DaemonSet, err error) { + emptyResult := &v1beta2.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewGetAction(daemonsetsResource, c.ns, name), &v1beta2.DaemonSet{}) + Invokes(testing.NewGetAction(daemonsetsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.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 *v1beta2.DaemonSetList, err error) { + emptyResult := &v1beta2.DaemonSetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(daemonsetsResource, daemonsetsKind, c.ns, opts), &v1beta2.DaemonSetList{}) + Invokes(testing.NewListAction(daemonsetsResource, daemonsetsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeDaemonSets) Watch(ctx context.Context, opts v1.ListOptions) (watch. // 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 *v1beta2.DaemonSet, opts v1.CreateOptions) (result *v1beta2.DaemonSet, err error) { + emptyResult := &v1beta2.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(daemonsetsResource, c.ns, daemonSet), &v1beta2.DaemonSet{}) + Invokes(testing.NewCreateAction(daemonsetsResource, c.ns, daemonSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.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 *v1beta2.DaemonSet, opts v1.UpdateOptions) (result *v1beta2.DaemonSet, err error) { + emptyResult := &v1beta2.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), &v1beta2.DaemonSet{}) + Invokes(testing.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.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 *v1beta2.DaemonSet, opts v1.UpdateOptions) (*v1beta2.DaemonSet, error) { +func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (result *v1beta2.DaemonSet, err error) { + emptyResult := &v1beta2.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), &v1beta2.DaemonSet{}) + Invokes(testing.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.DaemonSet), err } @@ -134,11 +139,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 *v1beta2.DaemonSet, err error) { + emptyResult := &v1beta2.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, pt, data, subresources...), &v1beta2.DaemonSet{}) + Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.DaemonSet), err } @@ -156,11 +162,12 @@ func (c *FakeDaemonSets) Apply(ctx context.Context, daemonSet *appsv1beta2.Daemo if name == nil { return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") } + emptyResult := &v1beta2.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta2.DaemonSet{}) + Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.DaemonSet), err } @@ -179,11 +186,12 @@ func (c *FakeDaemonSets) ApplyStatus(ctx context.Context, daemonSet *appsv1beta2 if name == nil { return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") } + emptyResult := &v1beta2.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta2.DaemonSet{}) + Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.DaemonSet), err } diff --git a/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go b/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go index c9e8ab48bb..c2a10e8efd 100644 --- a/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go +++ b/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go @@ -44,22 +44,24 @@ var deploymentsKind = v1beta2.SchemeGroupVersion.WithKind("Deployment") // Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. func (c *FakeDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.Deployment, err error) { + emptyResult := &v1beta2.Deployment{} obj, err := c.Fake. - Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), &v1beta2.Deployment{}) + Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.Deployment), err } // List takes label and field selectors, and returns the list of Deployments that match those selectors. func (c *FakeDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DeploymentList, err error) { + emptyResult := &v1beta2.DeploymentList{} obj, err := c.Fake. - Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), &v1beta2.DeploymentList{}) + Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch // Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. func (c *FakeDeployments) Create(ctx context.Context, deployment *v1beta2.Deployment, opts v1.CreateOptions) (result *v1beta2.Deployment, err error) { + emptyResult := &v1beta2.Deployment{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), &v1beta2.Deployment{}) + Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.Deployment), err } // Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. func (c *FakeDeployments) Update(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (result *v1beta2.Deployment, err error) { + emptyResult := &v1beta2.Deployment{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), &v1beta2.Deployment{}) + Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.Deployment), 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 *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (*v1beta2.Deployment, error) { +func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (result *v1beta2.Deployment, err error) { + emptyResult := &v1beta2.Deployment{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), &v1beta2.Deployment{}) + Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.Deployment), err } @@ -134,11 +139,12 @@ func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOp // Patch applies the patch and returns the patched deployment. func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Deployment, err error) { + emptyResult := &v1beta2.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), &v1beta2.Deployment{}) + Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.Deployment), err } @@ -156,11 +162,12 @@ func (c *FakeDeployments) Apply(ctx context.Context, deployment *appsv1beta2.Dep if name == nil { return nil, fmt.Errorf("deployment.Name must be provided to Apply") } + emptyResult := &v1beta2.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta2.Deployment{}) + Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.Deployment), err } @@ -179,11 +186,12 @@ func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1bet if name == nil { return nil, fmt.Errorf("deployment.Name must be provided to Apply") } + emptyResult := &v1beta2.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta2.Deployment{}) + Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.Deployment), err } diff --git a/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go b/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go index 46e1a78a7a..5af517d446 100644 --- a/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go +++ b/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go @@ -44,22 +44,24 @@ var replicasetsKind = v1beta2.SchemeGroupVersion.WithKind("ReplicaSet") // Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any. func (c *FakeReplicaSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ReplicaSet, err error) { + emptyResult := &v1beta2.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewGetAction(replicasetsResource, c.ns, name), &v1beta2.ReplicaSet{}) + Invokes(testing.NewGetAction(replicasetsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.ReplicaSet), err } // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. func (c *FakeReplicaSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ReplicaSetList, err error) { + emptyResult := &v1beta2.ReplicaSetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(replicasetsResource, replicasetsKind, c.ns, opts), &v1beta2.ReplicaSetList{}) + Invokes(testing.NewListAction(replicasetsResource, replicasetsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeReplicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch // Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any. func (c *FakeReplicaSets) Create(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.CreateOptions) (result *v1beta2.ReplicaSet, err error) { + emptyResult := &v1beta2.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(replicasetsResource, c.ns, replicaSet), &v1beta2.ReplicaSet{}) + Invokes(testing.NewCreateAction(replicasetsResource, c.ns, replicaSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.ReplicaSet), err } // Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any. func (c *FakeReplicaSets) Update(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (result *v1beta2.ReplicaSet, err error) { + emptyResult := &v1beta2.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(replicasetsResource, c.ns, replicaSet), &v1beta2.ReplicaSet{}) + Invokes(testing.NewUpdateAction(replicasetsResource, c.ns, replicaSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.ReplicaSet), 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 *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (*v1beta2.ReplicaSet, error) { +func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (result *v1beta2.ReplicaSet, err error) { + emptyResult := &v1beta2.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), &v1beta2.ReplicaSet{}) + Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.ReplicaSet), err } @@ -134,11 +139,12 @@ func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOp // Patch applies the patch and returns the patched replicaSet. func (c *FakeReplicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ReplicaSet, err error) { + emptyResult := &v1beta2.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, pt, data, subresources...), &v1beta2.ReplicaSet{}) + Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.ReplicaSet), err } @@ -156,11 +162,12 @@ func (c *FakeReplicaSets) Apply(ctx context.Context, replicaSet *appsv1beta2.Rep if name == nil { return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") } + emptyResult := &v1beta2.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta2.ReplicaSet{}) + Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.ReplicaSet), err } @@ -179,11 +186,12 @@ func (c *FakeReplicaSets) ApplyStatus(ctx context.Context, replicaSet *appsv1bet if name == nil { return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") } + emptyResult := &v1beta2.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta2.ReplicaSet{}) + Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.ReplicaSet), err } diff --git a/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go b/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go index 684f799256..a439fe9dbb 100644 --- a/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go +++ b/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go @@ -44,22 +44,24 @@ var statefulsetsKind = v1beta2.SchemeGroupVersion.WithKind("StatefulSet") // Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any. func (c *FakeStatefulSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.StatefulSet, err error) { + emptyResult := &v1beta2.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewGetAction(statefulsetsResource, c.ns, name), &v1beta2.StatefulSet{}) + Invokes(testing.NewGetAction(statefulsetsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.StatefulSet), err } // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. func (c *FakeStatefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.StatefulSetList, err error) { + emptyResult := &v1beta2.StatefulSetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(statefulsetsResource, statefulsetsKind, c.ns, opts), &v1beta2.StatefulSetList{}) + Invokes(testing.NewListAction(statefulsetsResource, statefulsetsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeStatefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watc // Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any. func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.CreateOptions) (result *v1beta2.StatefulSet, err error) { + emptyResult := &v1beta2.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(statefulsetsResource, c.ns, statefulSet), &v1beta2.StatefulSet{}) + Invokes(testing.NewCreateAction(statefulsetsResource, c.ns, statefulSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.StatefulSet), err } // Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any. func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (result *v1beta2.StatefulSet, err error) { + emptyResult := &v1beta2.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), &v1beta2.StatefulSet{}) + Invokes(testing.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.StatefulSet), 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 *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (*v1beta2.StatefulSet, error) { +func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (result *v1beta2.StatefulSet, err error) { + emptyResult := &v1beta2.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "status", c.ns, statefulSet), &v1beta2.StatefulSet{}) + Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "status", c.ns, statefulSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.StatefulSet), err } @@ -134,11 +139,12 @@ func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteO // Patch applies the patch and returns the patched statefulSet. func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.StatefulSet, err error) { + emptyResult := &v1beta2.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, pt, data, subresources...), &v1beta2.StatefulSet{}) + Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.StatefulSet), err } @@ -156,11 +162,12 @@ func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *appsv1beta2.S if name == nil { return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") } + emptyResult := &v1beta2.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta2.StatefulSet{}) + Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.StatefulSet), err } @@ -179,33 +186,36 @@ func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1b if name == nil { return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") } + emptyResult := &v1beta2.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta2.StatefulSet{}) + Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.StatefulSet), err } // GetScale takes name of the statefulSet, and returns the corresponding scale object, and an error if there is any. func (c *FakeStatefulSets) GetScale(ctx context.Context, statefulSetName string, options v1.GetOptions) (result *v1beta2.Scale, err error) { + emptyResult := &v1beta2.Scale{} obj, err := c.Fake. - Invokes(testing.NewGetSubresourceAction(statefulsetsResource, c.ns, "scale", statefulSetName), &v1beta2.Scale{}) + Invokes(testing.NewGetSubresourceAction(statefulsetsResource, c.ns, "scale", statefulSetName), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.Scale), err } // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *FakeStatefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *v1beta2.Scale, opts v1.UpdateOptions) (result *v1beta2.Scale, err error) { + emptyResult := &v1beta2.Scale{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "scale", c.ns, scale), &v1beta2.Scale{}) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.Scale), err } @@ -220,11 +230,12 @@ func (c *FakeStatefulSets) ApplyScale(ctx context.Context, statefulSetName strin if err != nil { return nil, err } + emptyResult := &v1beta2.Scale{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, "status"), &v1beta2.Scale{}) + Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.Scale), err } diff --git a/kubernetes/typed/authentication/v1/fake/fake_selfsubjectreview.go b/kubernetes/typed/authentication/v1/fake/fake_selfsubjectreview.go index e683b3eaaa..158b7f8051 100644 --- a/kubernetes/typed/authentication/v1/fake/fake_selfsubjectreview.go +++ b/kubernetes/typed/authentication/v1/fake/fake_selfsubjectreview.go @@ -37,10 +37,11 @@ var selfsubjectreviewsKind = v1.SchemeGroupVersion.WithKind("SelfSubjectReview") // Create takes the representation of a selfSubjectReview and creates it. Returns the server's representation of the selfSubjectReview, and an error, if there is any. func (c *FakeSelfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1.SelfSubjectReview, opts metav1.CreateOptions) (result *v1.SelfSubjectReview, err error) { + emptyResult := &v1.SelfSubjectReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(selfsubjectreviewsResource, selfSubjectReview), &v1.SelfSubjectReview{}) + Invokes(testing.NewRootCreateAction(selfsubjectreviewsResource, selfSubjectReview), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SelfSubjectReview), err } diff --git a/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go b/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go index 500e87d065..656bd8f07a 100644 --- a/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go +++ b/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go @@ -37,10 +37,11 @@ var tokenreviewsKind = v1.SchemeGroupVersion.WithKind("TokenReview") // Create takes the representation of a tokenReview and creates it. Returns the server's representation of the tokenReview, and an error, if there is any. func (c *FakeTokenReviews) Create(ctx context.Context, tokenReview *v1.TokenReview, opts metav1.CreateOptions) (result *v1.TokenReview, err error) { + emptyResult := &v1.TokenReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(tokenreviewsResource, tokenReview), &v1.TokenReview{}) + Invokes(testing.NewRootCreateAction(tokenreviewsResource, tokenReview), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.TokenReview), err } diff --git a/kubernetes/typed/authentication/v1alpha1/fake/fake_selfsubjectreview.go b/kubernetes/typed/authentication/v1alpha1/fake/fake_selfsubjectreview.go index a20b3dd764..5252eedaab 100644 --- a/kubernetes/typed/authentication/v1alpha1/fake/fake_selfsubjectreview.go +++ b/kubernetes/typed/authentication/v1alpha1/fake/fake_selfsubjectreview.go @@ -37,10 +37,11 @@ var selfsubjectreviewsKind = v1alpha1.SchemeGroupVersion.WithKind("SelfSubjectRe // Create takes the representation of a selfSubjectReview and creates it. Returns the server's representation of the selfSubjectReview, and an error, if there is any. func (c *FakeSelfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1alpha1.SelfSubjectReview, opts v1.CreateOptions) (result *v1alpha1.SelfSubjectReview, err error) { + emptyResult := &v1alpha1.SelfSubjectReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(selfsubjectreviewsResource, selfSubjectReview), &v1alpha1.SelfSubjectReview{}) + Invokes(testing.NewRootCreateAction(selfsubjectreviewsResource, selfSubjectReview), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.SelfSubjectReview), err } diff --git a/kubernetes/typed/authentication/v1beta1/fake/fake_selfsubjectreview.go b/kubernetes/typed/authentication/v1beta1/fake/fake_selfsubjectreview.go index 4a9db85cf5..eedfebb6f9 100644 --- a/kubernetes/typed/authentication/v1beta1/fake/fake_selfsubjectreview.go +++ b/kubernetes/typed/authentication/v1beta1/fake/fake_selfsubjectreview.go @@ -37,10 +37,11 @@ var selfsubjectreviewsKind = v1beta1.SchemeGroupVersion.WithKind("SelfSubjectRev // Create takes the representation of a selfSubjectReview and creates it. Returns the server's representation of the selfSubjectReview, and an error, if there is any. func (c *FakeSelfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1beta1.SelfSubjectReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectReview, err error) { + emptyResult := &v1beta1.SelfSubjectReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(selfsubjectreviewsResource, selfSubjectReview), &v1beta1.SelfSubjectReview{}) + Invokes(testing.NewRootCreateAction(selfsubjectreviewsResource, selfSubjectReview), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.SelfSubjectReview), err } diff --git a/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go b/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go index b1988a67a3..cd1f1333aa 100644 --- a/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go +++ b/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go @@ -37,10 +37,11 @@ var tokenreviewsKind = v1beta1.SchemeGroupVersion.WithKind("TokenReview") // Create takes the representation of a tokenReview and creates it. Returns the server's representation of the tokenReview, and an error, if there is any. func (c *FakeTokenReviews) Create(ctx context.Context, tokenReview *v1beta1.TokenReview, opts v1.CreateOptions) (result *v1beta1.TokenReview, err error) { + emptyResult := &v1beta1.TokenReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(tokenreviewsResource, tokenReview), &v1beta1.TokenReview{}) + Invokes(testing.NewRootCreateAction(tokenreviewsResource, tokenReview), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.TokenReview), err } diff --git a/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview.go b/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview.go index 43ea05328c..491116f6e3 100644 --- a/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview.go +++ b/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview.go @@ -38,11 +38,12 @@ var localsubjectaccessreviewsKind = v1.SchemeGroupVersion.WithKind("LocalSubject // Create takes the representation of a localSubjectAccessReview and creates it. Returns the server's representation of the localSubjectAccessReview, and an error, if there is any. func (c *FakeLocalSubjectAccessReviews) Create(ctx context.Context, localSubjectAccessReview *v1.LocalSubjectAccessReview, opts metav1.CreateOptions) (result *v1.LocalSubjectAccessReview, err error) { + emptyResult := &v1.LocalSubjectAccessReview{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(localsubjectaccessreviewsResource, c.ns, localSubjectAccessReview), &v1.LocalSubjectAccessReview{}) + Invokes(testing.NewCreateAction(localsubjectaccessreviewsResource, c.ns, localSubjectAccessReview), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.LocalSubjectAccessReview), err } diff --git a/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview.go b/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview.go index 27642266d6..e2f1377f30 100644 --- a/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview.go +++ b/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview.go @@ -37,10 +37,11 @@ var selfsubjectaccessreviewsKind = v1.SchemeGroupVersion.WithKind("SelfSubjectAc // Create takes the representation of a selfSubjectAccessReview and creates it. Returns the server's representation of the selfSubjectAccessReview, and an error, if there is any. func (c *FakeSelfSubjectAccessReviews) Create(ctx context.Context, selfSubjectAccessReview *v1.SelfSubjectAccessReview, opts metav1.CreateOptions) (result *v1.SelfSubjectAccessReview, err error) { + emptyResult := &v1.SelfSubjectAccessReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(selfsubjectaccessreviewsResource, selfSubjectAccessReview), &v1.SelfSubjectAccessReview{}) + Invokes(testing.NewRootCreateAction(selfsubjectaccessreviewsResource, selfSubjectAccessReview), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SelfSubjectAccessReview), err } diff --git a/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview.go b/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview.go index cd6c682d16..39edde853c 100644 --- a/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview.go +++ b/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview.go @@ -37,10 +37,11 @@ var selfsubjectrulesreviewsKind = v1.SchemeGroupVersion.WithKind("SelfSubjectRul // Create takes the representation of a selfSubjectRulesReview and creates it. Returns the server's representation of the selfSubjectRulesReview, and an error, if there is any. func (c *FakeSelfSubjectRulesReviews) Create(ctx context.Context, selfSubjectRulesReview *v1.SelfSubjectRulesReview, opts metav1.CreateOptions) (result *v1.SelfSubjectRulesReview, err error) { + emptyResult := &v1.SelfSubjectRulesReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(selfsubjectrulesreviewsResource, selfSubjectRulesReview), &v1.SelfSubjectRulesReview{}) + Invokes(testing.NewRootCreateAction(selfsubjectrulesreviewsResource, selfSubjectRulesReview), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SelfSubjectRulesReview), err } diff --git a/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview.go b/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview.go index 09dab64807..c22cb26132 100644 --- a/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview.go +++ b/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview.go @@ -37,10 +37,11 @@ var subjectaccessreviewsKind = v1.SchemeGroupVersion.WithKind("SubjectAccessRevi // Create takes the representation of a subjectAccessReview and creates it. Returns the server's representation of the subjectAccessReview, and an error, if there is any. func (c *FakeSubjectAccessReviews) Create(ctx context.Context, subjectAccessReview *v1.SubjectAccessReview, opts metav1.CreateOptions) (result *v1.SubjectAccessReview, err error) { + emptyResult := &v1.SubjectAccessReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(subjectaccessreviewsResource, subjectAccessReview), &v1.SubjectAccessReview{}) + Invokes(testing.NewRootCreateAction(subjectaccessreviewsResource, subjectAccessReview), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.SubjectAccessReview), err } diff --git a/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go b/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go index 104e979d19..95ccfe7956 100644 --- a/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go +++ b/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go @@ -38,11 +38,12 @@ var localsubjectaccessreviewsKind = v1beta1.SchemeGroupVersion.WithKind("LocalSu // Create takes the representation of a localSubjectAccessReview and creates it. Returns the server's representation of the localSubjectAccessReview, and an error, if there is any. func (c *FakeLocalSubjectAccessReviews) Create(ctx context.Context, localSubjectAccessReview *v1beta1.LocalSubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.LocalSubjectAccessReview, err error) { + emptyResult := &v1beta1.LocalSubjectAccessReview{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(localsubjectaccessreviewsResource, c.ns, localSubjectAccessReview), &v1beta1.LocalSubjectAccessReview{}) + Invokes(testing.NewCreateAction(localsubjectaccessreviewsResource, c.ns, localSubjectAccessReview), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.LocalSubjectAccessReview), err } diff --git a/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go b/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go index 517e48b760..1547c17d00 100644 --- a/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go +++ b/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go @@ -37,10 +37,11 @@ var selfsubjectaccessreviewsKind = v1beta1.SchemeGroupVersion.WithKind("SelfSubj // Create takes the representation of a selfSubjectAccessReview and creates it. Returns the server's representation of the selfSubjectAccessReview, and an error, if there is any. func (c *FakeSelfSubjectAccessReviews) Create(ctx context.Context, selfSubjectAccessReview *v1beta1.SelfSubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectAccessReview, err error) { + emptyResult := &v1beta1.SelfSubjectAccessReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(selfsubjectaccessreviewsResource, selfSubjectAccessReview), &v1beta1.SelfSubjectAccessReview{}) + Invokes(testing.NewRootCreateAction(selfsubjectaccessreviewsResource, selfSubjectAccessReview), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.SelfSubjectAccessReview), err } diff --git a/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview.go b/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview.go index 3aed050fcf..cfc11b5422 100644 --- a/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview.go +++ b/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview.go @@ -37,10 +37,11 @@ var selfsubjectrulesreviewsKind = v1beta1.SchemeGroupVersion.WithKind("SelfSubje // Create takes the representation of a selfSubjectRulesReview and creates it. Returns the server's representation of the selfSubjectRulesReview, and an error, if there is any. func (c *FakeSelfSubjectRulesReviews) Create(ctx context.Context, selfSubjectRulesReview *v1beta1.SelfSubjectRulesReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectRulesReview, err error) { + emptyResult := &v1beta1.SelfSubjectRulesReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(selfsubjectrulesreviewsResource, selfSubjectRulesReview), &v1beta1.SelfSubjectRulesReview{}) + Invokes(testing.NewRootCreateAction(selfsubjectrulesreviewsResource, selfSubjectRulesReview), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.SelfSubjectRulesReview), err } diff --git a/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go b/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go index e9bfa521a2..972d49e4d6 100644 --- a/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go +++ b/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go @@ -37,10 +37,11 @@ var subjectaccessreviewsKind = v1beta1.SchemeGroupVersion.WithKind("SubjectAcces // Create takes the representation of a subjectAccessReview and creates it. Returns the server's representation of the subjectAccessReview, and an error, if there is any. func (c *FakeSubjectAccessReviews) Create(ctx context.Context, subjectAccessReview *v1beta1.SubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.SubjectAccessReview, err error) { + emptyResult := &v1beta1.SubjectAccessReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(subjectaccessreviewsResource, subjectAccessReview), &v1beta1.SubjectAccessReview{}) + Invokes(testing.NewRootCreateAction(subjectaccessreviewsResource, subjectAccessReview), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.SubjectAccessReview), err } diff --git a/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go index a2c95b7539..fe661a3326 100644 --- a/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go @@ -44,22 +44,24 @@ var horizontalpodautoscalersKind = v1.SchemeGroupVersion.WithKind("HorizontalPod // Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HorizontalPodAutoscaler, err error) { + emptyResult := &v1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &v1.HorizontalPodAutoscaler{}) + Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.HorizontalPodAutoscaler), err } // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) { + emptyResult := &v1.HorizontalPodAutoscalerList{} obj, err := c.Fake. - Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), &v1.HorizontalPodAutoscalerList{}) + Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts metav1.Li // Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.CreateOptions) (result *v1.HorizontalPodAutoscaler, err error) { + emptyResult := &v1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v1.HorizontalPodAutoscaler{}) + Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.HorizontalPodAutoscaler), err } // Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (result *v1.HorizontalPodAutoscaler, err error) { + emptyResult := &v1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v1.HorizontalPodAutoscaler{}) + Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.HorizontalPodAutoscaler), 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 *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*v1.HorizontalPodAutoscaler, error) { +func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (result *v1.HorizontalPodAutoscaler, err error) { + emptyResult := &v1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), &v1.HorizontalPodAutoscaler{}) + Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.HorizontalPodAutoscaler), err } @@ -134,11 +139,12 @@ func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opt // Patch applies the patch and returns the patched horizontalPodAutoscaler. func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) { + emptyResult := &v1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), &v1.HorizontalPodAutoscaler{}) + Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.HorizontalPodAutoscaler), err } @@ -156,11 +162,12 @@ func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodA if name == nil { return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") } + emptyResult := &v1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), &v1.HorizontalPodAutoscaler{}) + Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.HorizontalPodAutoscaler), err } @@ -179,11 +186,12 @@ func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizont if name == nil { return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") } + emptyResult := &v1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.HorizontalPodAutoscaler{}) + Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.HorizontalPodAutoscaler), err } diff --git a/kubernetes/typed/autoscaling/v2/fake/fake_horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v2/fake/fake_horizontalpodautoscaler.go index cfcc208232..57ce30f171 100644 --- a/kubernetes/typed/autoscaling/v2/fake/fake_horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v2/fake/fake_horizontalpodautoscaler.go @@ -44,22 +44,24 @@ var horizontalpodautoscalersKind = v2.SchemeGroupVersion.WithKind("HorizontalPod // Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.HorizontalPodAutoscaler, err error) { + emptyResult := &v2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &v2.HorizontalPodAutoscaler{}) + Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2.HorizontalPodAutoscaler), err } // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2.HorizontalPodAutoscalerList, err error) { + emptyResult := &v2.HorizontalPodAutoscalerList{} obj, err := c.Fake. - Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), &v2.HorizontalPodAutoscalerList{}) + Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOp // Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *v2.HorizontalPodAutoscaler, err error) { + emptyResult := &v2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v2.HorizontalPodAutoscaler{}) + Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2.HorizontalPodAutoscaler), err } // Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2.HorizontalPodAutoscaler, err error) { + emptyResult := &v2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v2.HorizontalPodAutoscaler{}) + Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2.HorizontalPodAutoscaler), 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 *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2.HorizontalPodAutoscaler, error) { +func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2.HorizontalPodAutoscaler, err error) { + emptyResult := &v2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), &v2.HorizontalPodAutoscaler{}) + Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2.HorizontalPodAutoscaler), err } @@ -134,11 +139,12 @@ func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opt // Patch applies the patch and returns the patched horizontalPodAutoscaler. func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.HorizontalPodAutoscaler, err error) { + emptyResult := &v2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), &v2.HorizontalPodAutoscaler{}) + Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2.HorizontalPodAutoscaler), err } @@ -156,11 +162,12 @@ func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodA if name == nil { return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") } + emptyResult := &v2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), &v2.HorizontalPodAutoscaler{}) + Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2.HorizontalPodAutoscaler), err } @@ -179,11 +186,12 @@ func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizont if name == nil { return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") } + emptyResult := &v2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v2.HorizontalPodAutoscaler{}) + Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2.HorizontalPodAutoscaler), err } diff --git a/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go index 0b2658e642..ad81314bfb 100644 --- a/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go @@ -44,22 +44,24 @@ var horizontalpodautoscalersKind = v2beta1.SchemeGroupVersion.WithKind("Horizont // Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { + emptyResult := &v2beta1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &v2beta1.HorizontalPodAutoscaler{}) + Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2beta1.HorizontalPodAutoscaler), err } // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta1.HorizontalPodAutoscalerList, err error) { + emptyResult := &v2beta1.HorizontalPodAutoscalerList{} obj, err := c.Fake. - Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), &v2beta1.HorizontalPodAutoscalerList{}) + Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOp // Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { + emptyResult := &v2beta1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v2beta1.HorizontalPodAutoscaler{}) + Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2beta1.HorizontalPodAutoscaler), err } // Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { + emptyResult := &v2beta1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v2beta1.HorizontalPodAutoscaler{}) + Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2beta1.HorizontalPodAutoscaler), 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 *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta1.HorizontalPodAutoscaler, error) { +func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { + emptyResult := &v2beta1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), &v2beta1.HorizontalPodAutoscaler{}) + Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2beta1.HorizontalPodAutoscaler), err } @@ -134,11 +139,12 @@ func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opt // Patch applies the patch and returns the patched horizontalPodAutoscaler. func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta1.HorizontalPodAutoscaler, err error) { + emptyResult := &v2beta1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), &v2beta1.HorizontalPodAutoscaler{}) + Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2beta1.HorizontalPodAutoscaler), err } @@ -156,11 +162,12 @@ func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodA if name == nil { return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") } + emptyResult := &v2beta1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), &v2beta1.HorizontalPodAutoscaler{}) + Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2beta1.HorizontalPodAutoscaler), err } @@ -179,11 +186,12 @@ func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizont if name == nil { return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") } + emptyResult := &v2beta1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v2beta1.HorizontalPodAutoscaler{}) + Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2beta1.HorizontalPodAutoscaler), err } diff --git a/kubernetes/typed/autoscaling/v2beta2/fake/fake_horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v2beta2/fake/fake_horizontalpodautoscaler.go index 0a7c93c3d3..becd8eeb89 100644 --- a/kubernetes/typed/autoscaling/v2beta2/fake/fake_horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v2beta2/fake/fake_horizontalpodautoscaler.go @@ -44,22 +44,24 @@ var horizontalpodautoscalersKind = v2beta2.SchemeGroupVersion.WithKind("Horizont // Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { + emptyResult := &v2beta2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), &v2beta2.HorizontalPodAutoscaler{}) + Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2beta2.HorizontalPodAutoscaler), err } // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta2.HorizontalPodAutoscalerList, err error) { + emptyResult := &v2beta2.HorizontalPodAutoscalerList{} obj, err := c.Fake. - Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), &v2beta2.HorizontalPodAutoscalerList{}) + Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOp // Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { + emptyResult := &v2beta2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v2beta2.HorizontalPodAutoscaler{}) + Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2beta2.HorizontalPodAutoscaler), err } // Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { + emptyResult := &v2beta2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), &v2beta2.HorizontalPodAutoscaler{}) + Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2beta2.HorizontalPodAutoscaler), 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 *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta2.HorizontalPodAutoscaler, error) { +func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { + emptyResult := &v2beta2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), &v2beta2.HorizontalPodAutoscaler{}) + Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2beta2.HorizontalPodAutoscaler), err } @@ -134,11 +139,12 @@ func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opt // Patch applies the patch and returns the patched horizontalPodAutoscaler. func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta2.HorizontalPodAutoscaler, err error) { + emptyResult := &v2beta2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), &v2beta2.HorizontalPodAutoscaler{}) + Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2beta2.HorizontalPodAutoscaler), err } @@ -156,11 +162,12 @@ func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodA if name == nil { return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") } + emptyResult := &v2beta2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), &v2beta2.HorizontalPodAutoscaler{}) + Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2beta2.HorizontalPodAutoscaler), err } @@ -179,11 +186,12 @@ func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizont if name == nil { return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") } + emptyResult := &v2beta2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v2beta2.HorizontalPodAutoscaler{}) + Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v2beta2.HorizontalPodAutoscaler), err } diff --git a/kubernetes/typed/batch/v1/fake/fake_cronjob.go b/kubernetes/typed/batch/v1/fake/fake_cronjob.go index 0cbcce6d81..e14fbf68c6 100644 --- a/kubernetes/typed/batch/v1/fake/fake_cronjob.go +++ b/kubernetes/typed/batch/v1/fake/fake_cronjob.go @@ -44,22 +44,24 @@ var cronjobsKind = v1.SchemeGroupVersion.WithKind("CronJob") // Get takes name of the cronJob, and returns the corresponding cronJob object, and an error if there is any. func (c *FakeCronJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CronJob, err error) { + emptyResult := &v1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewGetAction(cronjobsResource, c.ns, name), &v1.CronJob{}) + Invokes(testing.NewGetAction(cronjobsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CronJob), err } // List takes label and field selectors, and returns the list of CronJobs that match those selectors. func (c *FakeCronJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CronJobList, err error) { + emptyResult := &v1.CronJobList{} obj, err := c.Fake. - Invokes(testing.NewListAction(cronjobsResource, cronjobsKind, c.ns, opts), &v1.CronJobList{}) + Invokes(testing.NewListAction(cronjobsResource, cronjobsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeCronJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watc // Create takes the representation of a cronJob and creates it. Returns the server's representation of the cronJob, and an error, if there is any. func (c *FakeCronJobs) Create(ctx context.Context, cronJob *v1.CronJob, opts metav1.CreateOptions) (result *v1.CronJob, err error) { + emptyResult := &v1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(cronjobsResource, c.ns, cronJob), &v1.CronJob{}) + Invokes(testing.NewCreateAction(cronjobsResource, c.ns, cronJob), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CronJob), err } // Update takes the representation of a cronJob and updates it. Returns the server's representation of the cronJob, and an error, if there is any. func (c *FakeCronJobs) Update(ctx context.Context, cronJob *v1.CronJob, opts metav1.UpdateOptions) (result *v1.CronJob, err error) { + emptyResult := &v1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(cronjobsResource, c.ns, cronJob), &v1.CronJob{}) + Invokes(testing.NewUpdateAction(cronjobsResource, c.ns, cronJob), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CronJob), 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 *FakeCronJobs) UpdateStatus(ctx context.Context, cronJob *v1.CronJob, opts metav1.UpdateOptions) (*v1.CronJob, error) { +func (c *FakeCronJobs) UpdateStatus(ctx context.Context, cronJob *v1.CronJob, opts metav1.UpdateOptions) (result *v1.CronJob, err error) { + emptyResult := &v1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(cronjobsResource, "status", c.ns, cronJob), &v1.CronJob{}) + Invokes(testing.NewUpdateSubresourceAction(cronjobsResource, "status", c.ns, cronJob), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CronJob), err } @@ -134,11 +139,12 @@ func (c *FakeCronJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteO // Patch applies the patch and returns the patched cronJob. func (c *FakeCronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CronJob, err error) { + emptyResult := &v1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, name, pt, data, subresources...), &v1.CronJob{}) + Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CronJob), err } @@ -156,11 +162,12 @@ func (c *FakeCronJobs) Apply(ctx context.Context, cronJob *batchv1.CronJobApplyC if name == nil { return nil, fmt.Errorf("cronJob.Name must be provided to Apply") } + emptyResult := &v1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data), &v1.CronJob{}) + Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CronJob), err } @@ -179,11 +186,12 @@ func (c *FakeCronJobs) ApplyStatus(ctx context.Context, cronJob *batchv1.CronJob if name == nil { return nil, fmt.Errorf("cronJob.Name must be provided to Apply") } + emptyResult := &v1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.CronJob{}) + Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CronJob), err } diff --git a/kubernetes/typed/batch/v1/fake/fake_job.go b/kubernetes/typed/batch/v1/fake/fake_job.go index cf1a913bdf..b13d5f7367 100644 --- a/kubernetes/typed/batch/v1/fake/fake_job.go +++ b/kubernetes/typed/batch/v1/fake/fake_job.go @@ -44,22 +44,24 @@ var jobsKind = v1.SchemeGroupVersion.WithKind("Job") // Get takes name of the job, and returns the corresponding job object, and an error if there is any. func (c *FakeJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Job, err error) { + emptyResult := &v1.Job{} obj, err := c.Fake. - Invokes(testing.NewGetAction(jobsResource, c.ns, name), &v1.Job{}) + Invokes(testing.NewGetAction(jobsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Job), err } // List takes label and field selectors, and returns the list of Jobs that match those selectors. func (c *FakeJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.JobList, err error) { + emptyResult := &v1.JobList{} obj, err := c.Fake. - Invokes(testing.NewListAction(jobsResource, jobsKind, c.ns, opts), &v1.JobList{}) + Invokes(testing.NewListAction(jobsResource, jobsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.In // Create takes the representation of a job and creates it. Returns the server's representation of the job, and an error, if there is any. func (c *FakeJobs) Create(ctx context.Context, job *v1.Job, opts metav1.CreateOptions) (result *v1.Job, err error) { + emptyResult := &v1.Job{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(jobsResource, c.ns, job), &v1.Job{}) + Invokes(testing.NewCreateAction(jobsResource, c.ns, job), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Job), err } // Update takes the representation of a job and updates it. Returns the server's representation of the job, and an error, if there is any. func (c *FakeJobs) Update(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (result *v1.Job, err error) { + emptyResult := &v1.Job{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(jobsResource, c.ns, job), &v1.Job{}) + Invokes(testing.NewUpdateAction(jobsResource, c.ns, job), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Job), 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 *FakeJobs) UpdateStatus(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (*v1.Job, error) { +func (c *FakeJobs) UpdateStatus(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (result *v1.Job, err error) { + emptyResult := &v1.Job{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(jobsResource, "status", c.ns, job), &v1.Job{}) + Invokes(testing.NewUpdateSubresourceAction(jobsResource, "status", c.ns, job), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Job), err } @@ -134,11 +139,12 @@ func (c *FakeJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptio // Patch applies the patch and returns the patched job. func (c *FakeJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Job, err error) { + emptyResult := &v1.Job{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, name, pt, data, subresources...), &v1.Job{}) + Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Job), err } @@ -156,11 +162,12 @@ func (c *FakeJobs) Apply(ctx context.Context, job *batchv1.JobApplyConfiguration if name == nil { return nil, fmt.Errorf("job.Name must be provided to Apply") } + emptyResult := &v1.Job{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, *name, types.ApplyPatchType, data), &v1.Job{}) + Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Job), err } @@ -179,11 +186,12 @@ func (c *FakeJobs) ApplyStatus(ctx context.Context, job *batchv1.JobApplyConfigu if name == nil { return nil, fmt.Errorf("job.Name must be provided to Apply") } + emptyResult := &v1.Job{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.Job{}) + Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Job), err } diff --git a/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go b/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go index 9d078f55a9..a624e8daac 100644 --- a/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go +++ b/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go @@ -44,22 +44,24 @@ var cronjobsKind = v1beta1.SchemeGroupVersion.WithKind("CronJob") // Get takes name of the cronJob, and returns the corresponding cronJob object, and an error if there is any. func (c *FakeCronJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CronJob, err error) { + emptyResult := &v1beta1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewGetAction(cronjobsResource, c.ns, name), &v1beta1.CronJob{}) + Invokes(testing.NewGetAction(cronjobsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CronJob), err } // List takes label and field selectors, and returns the list of CronJobs that match those selectors. func (c *FakeCronJobs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CronJobList, err error) { + emptyResult := &v1beta1.CronJobList{} obj, err := c.Fake. - Invokes(testing.NewListAction(cronjobsResource, cronjobsKind, c.ns, opts), &v1beta1.CronJobList{}) + Invokes(testing.NewListAction(cronjobsResource, cronjobsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeCronJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.In // Create takes the representation of a cronJob and creates it. Returns the server's representation of the cronJob, and an error, if there is any. func (c *FakeCronJobs) Create(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.CreateOptions) (result *v1beta1.CronJob, err error) { + emptyResult := &v1beta1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(cronjobsResource, c.ns, cronJob), &v1beta1.CronJob{}) + Invokes(testing.NewCreateAction(cronjobsResource, c.ns, cronJob), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CronJob), err } // Update takes the representation of a cronJob and updates it. Returns the server's representation of the cronJob, and an error, if there is any. func (c *FakeCronJobs) Update(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (result *v1beta1.CronJob, err error) { + emptyResult := &v1beta1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(cronjobsResource, c.ns, cronJob), &v1beta1.CronJob{}) + Invokes(testing.NewUpdateAction(cronjobsResource, c.ns, cronJob), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CronJob), 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 *FakeCronJobs) UpdateStatus(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (*v1beta1.CronJob, error) { +func (c *FakeCronJobs) UpdateStatus(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (result *v1beta1.CronJob, err error) { + emptyResult := &v1beta1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(cronjobsResource, "status", c.ns, cronJob), &v1beta1.CronJob{}) + Invokes(testing.NewUpdateSubresourceAction(cronjobsResource, "status", c.ns, cronJob), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CronJob), err } @@ -134,11 +139,12 @@ func (c *FakeCronJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptio // Patch applies the patch and returns the patched cronJob. func (c *FakeCronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CronJob, err error) { + emptyResult := &v1beta1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, name, pt, data, subresources...), &v1beta1.CronJob{}) + Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CronJob), err } @@ -156,11 +162,12 @@ func (c *FakeCronJobs) Apply(ctx context.Context, cronJob *batchv1beta1.CronJobA if name == nil { return nil, fmt.Errorf("cronJob.Name must be provided to Apply") } + emptyResult := &v1beta1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.CronJob{}) + Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CronJob), err } @@ -179,11 +186,12 @@ func (c *FakeCronJobs) ApplyStatus(ctx context.Context, cronJob *batchv1beta1.Cr if name == nil { return nil, fmt.Errorf("cronJob.Name must be provided to Apply") } + emptyResult := &v1beta1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.CronJob{}) + Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CronJob), err } diff --git a/kubernetes/typed/certificates/v1/fake/fake_certificatesigningrequest.go b/kubernetes/typed/certificates/v1/fake/fake_certificatesigningrequest.go index adb7db0bf6..a46be0352d 100644 --- a/kubernetes/typed/certificates/v1/fake/fake_certificatesigningrequest.go +++ b/kubernetes/typed/certificates/v1/fake/fake_certificatesigningrequest.go @@ -43,20 +43,22 @@ var certificatesigningrequestsKind = v1.SchemeGroupVersion.WithKind("Certificate // Get takes name of the certificateSigningRequest, and returns the corresponding certificateSigningRequest object, and an error if there is any. func (c *FakeCertificateSigningRequests) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CertificateSigningRequest, err error) { + emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(certificatesigningrequestsResource, name), &v1.CertificateSigningRequest{}) + Invokes(testing.NewRootGetAction(certificatesigningrequestsResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CertificateSigningRequest), err } // List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. func (c *FakeCertificateSigningRequests) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CertificateSigningRequestList, err error) { + emptyResult := &v1.CertificateSigningRequestList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(certificatesigningrequestsResource, certificatesigningrequestsKind, opts), &v1.CertificateSigningRequestList{}) + Invokes(testing.NewRootListAction(certificatesigningrequestsResource, certificatesigningrequestsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,31 +82,34 @@ func (c *FakeCertificateSigningRequests) Watch(ctx context.Context, opts metav1. // Create takes the representation of a certificateSigningRequest and creates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. func (c *FakeCertificateSigningRequests) Create(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.CreateOptions) (result *v1.CertificateSigningRequest, err error) { + emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(certificatesigningrequestsResource, certificateSigningRequest), &v1.CertificateSigningRequest{}) + Invokes(testing.NewRootCreateAction(certificatesigningrequestsResource, certificateSigningRequest), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CertificateSigningRequest), err } // Update takes the representation of a certificateSigningRequest and updates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. func (c *FakeCertificateSigningRequests) Update(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (result *v1.CertificateSigningRequest, err error) { + emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(certificatesigningrequestsResource, certificateSigningRequest), &v1.CertificateSigningRequest{}) + Invokes(testing.NewRootUpdateAction(certificatesigningrequestsResource, certificateSigningRequest), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CertificateSigningRequest), 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 *FakeCertificateSigningRequests) UpdateStatus(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (*v1.CertificateSigningRequest, error) { +func (c *FakeCertificateSigningRequests) UpdateStatus(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (result *v1.CertificateSigningRequest, err error) { + emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(certificatesigningrequestsResource, "status", certificateSigningRequest), &v1.CertificateSigningRequest{}) + Invokes(testing.NewRootUpdateSubresourceAction(certificatesigningrequestsResource, "status", certificateSigningRequest), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CertificateSigningRequest), err } @@ -126,10 +131,11 @@ func (c *FakeCertificateSigningRequests) DeleteCollection(ctx context.Context, o // Patch applies the patch and returns the patched certificateSigningRequest. func (c *FakeCertificateSigningRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CertificateSigningRequest, err error) { + emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, name, pt, data, subresources...), &v1.CertificateSigningRequest{}) + Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CertificateSigningRequest), err } @@ -147,10 +153,11 @@ func (c *FakeCertificateSigningRequests) Apply(ctx context.Context, certificateS if name == nil { return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply") } + emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, *name, types.ApplyPatchType, data), &v1.CertificateSigningRequest{}) + Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CertificateSigningRequest), err } @@ -169,20 +176,22 @@ func (c *FakeCertificateSigningRequests) ApplyStatus(ctx context.Context, certif if name == nil { return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply") } + emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, *name, types.ApplyPatchType, data, "status"), &v1.CertificateSigningRequest{}) + Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CertificateSigningRequest), err } // UpdateApproval takes the representation of a certificateSigningRequest and updates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. func (c *FakeCertificateSigningRequests) UpdateApproval(ctx context.Context, certificateSigningRequestName string, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (result *v1.CertificateSigningRequest, err error) { + emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(certificatesigningrequestsResource, "approval", certificateSigningRequest), &v1.CertificateSigningRequest{}) + Invokes(testing.NewRootUpdateSubresourceAction(certificatesigningrequestsResource, "approval", certificateSigningRequest), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CertificateSigningRequest), err } diff --git a/kubernetes/typed/certificates/v1alpha1/fake/fake_clustertrustbundle.go b/kubernetes/typed/certificates/v1alpha1/fake/fake_clustertrustbundle.go index 2f849cbd7d..39a1e0643d 100644 --- a/kubernetes/typed/certificates/v1alpha1/fake/fake_clustertrustbundle.go +++ b/kubernetes/typed/certificates/v1alpha1/fake/fake_clustertrustbundle.go @@ -43,20 +43,22 @@ var clustertrustbundlesKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterTrust // Get takes name of the clusterTrustBundle, and returns the corresponding clusterTrustBundle object, and an error if there is any. func (c *FakeClusterTrustBundles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterTrustBundle, err error) { + emptyResult := &v1alpha1.ClusterTrustBundle{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clustertrustbundlesResource, name), &v1alpha1.ClusterTrustBundle{}) + Invokes(testing.NewRootGetAction(clustertrustbundlesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ClusterTrustBundle), err } // List takes label and field selectors, and returns the list of ClusterTrustBundles that match those selectors. func (c *FakeClusterTrustBundles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterTrustBundleList, err error) { + emptyResult := &v1alpha1.ClusterTrustBundleList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(clustertrustbundlesResource, clustertrustbundlesKind, opts), &v1alpha1.ClusterTrustBundleList{}) + Invokes(testing.NewRootListAction(clustertrustbundlesResource, clustertrustbundlesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeClusterTrustBundles) Watch(ctx context.Context, opts v1.ListOptions // Create takes the representation of a clusterTrustBundle and creates it. Returns the server's representation of the clusterTrustBundle, and an error, if there is any. func (c *FakeClusterTrustBundles) Create(ctx context.Context, clusterTrustBundle *v1alpha1.ClusterTrustBundle, opts v1.CreateOptions) (result *v1alpha1.ClusterTrustBundle, err error) { + emptyResult := &v1alpha1.ClusterTrustBundle{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clustertrustbundlesResource, clusterTrustBundle), &v1alpha1.ClusterTrustBundle{}) + Invokes(testing.NewRootCreateAction(clustertrustbundlesResource, clusterTrustBundle), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ClusterTrustBundle), err } // Update takes the representation of a clusterTrustBundle and updates it. Returns the server's representation of the clusterTrustBundle, and an error, if there is any. func (c *FakeClusterTrustBundles) Update(ctx context.Context, clusterTrustBundle *v1alpha1.ClusterTrustBundle, opts v1.UpdateOptions) (result *v1alpha1.ClusterTrustBundle, err error) { + emptyResult := &v1alpha1.ClusterTrustBundle{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clustertrustbundlesResource, clusterTrustBundle), &v1alpha1.ClusterTrustBundle{}) + Invokes(testing.NewRootUpdateAction(clustertrustbundlesResource, clusterTrustBundle), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ClusterTrustBundle), err } @@ -115,10 +119,11 @@ func (c *FakeClusterTrustBundles) DeleteCollection(ctx context.Context, opts v1. // Patch applies the patch and returns the patched clusterTrustBundle. func (c *FakeClusterTrustBundles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterTrustBundle, err error) { + emptyResult := &v1alpha1.ClusterTrustBundle{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clustertrustbundlesResource, name, pt, data, subresources...), &v1alpha1.ClusterTrustBundle{}) + Invokes(testing.NewRootPatchSubresourceAction(clustertrustbundlesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ClusterTrustBundle), err } @@ -136,10 +141,11 @@ func (c *FakeClusterTrustBundles) Apply(ctx context.Context, clusterTrustBundle if name == nil { return nil, fmt.Errorf("clusterTrustBundle.Name must be provided to Apply") } + emptyResult := &v1alpha1.ClusterTrustBundle{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clustertrustbundlesResource, *name, types.ApplyPatchType, data), &v1alpha1.ClusterTrustBundle{}) + Invokes(testing.NewRootPatchSubresourceAction(clustertrustbundlesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ClusterTrustBundle), err } diff --git a/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go b/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go index 76bb38e7bf..7fdbdf8785 100644 --- a/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go +++ b/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go @@ -43,20 +43,22 @@ var certificatesigningrequestsKind = v1beta1.SchemeGroupVersion.WithKind("Certif // Get takes name of the certificateSigningRequest, and returns the corresponding certificateSigningRequest object, and an error if there is any. func (c *FakeCertificateSigningRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CertificateSigningRequest, err error) { + emptyResult := &v1beta1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(certificatesigningrequestsResource, name), &v1beta1.CertificateSigningRequest{}) + Invokes(testing.NewRootGetAction(certificatesigningrequestsResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CertificateSigningRequest), err } // List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. func (c *FakeCertificateSigningRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CertificateSigningRequestList, err error) { + emptyResult := &v1beta1.CertificateSigningRequestList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(certificatesigningrequestsResource, certificatesigningrequestsKind, opts), &v1beta1.CertificateSigningRequestList{}) + Invokes(testing.NewRootListAction(certificatesigningrequestsResource, certificatesigningrequestsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,31 +82,34 @@ func (c *FakeCertificateSigningRequests) Watch(ctx context.Context, opts v1.List // Create takes the representation of a certificateSigningRequest and creates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. func (c *FakeCertificateSigningRequests) Create(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.CreateOptions) (result *v1beta1.CertificateSigningRequest, err error) { + emptyResult := &v1beta1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(certificatesigningrequestsResource, certificateSigningRequest), &v1beta1.CertificateSigningRequest{}) + Invokes(testing.NewRootCreateAction(certificatesigningrequestsResource, certificateSigningRequest), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CertificateSigningRequest), err } // Update takes the representation of a certificateSigningRequest and updates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. func (c *FakeCertificateSigningRequests) Update(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (result *v1beta1.CertificateSigningRequest, err error) { + emptyResult := &v1beta1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(certificatesigningrequestsResource, certificateSigningRequest), &v1beta1.CertificateSigningRequest{}) + Invokes(testing.NewRootUpdateAction(certificatesigningrequestsResource, certificateSigningRequest), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CertificateSigningRequest), 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 *FakeCertificateSigningRequests) UpdateStatus(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (*v1beta1.CertificateSigningRequest, error) { +func (c *FakeCertificateSigningRequests) UpdateStatus(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (result *v1beta1.CertificateSigningRequest, err error) { + emptyResult := &v1beta1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(certificatesigningrequestsResource, "status", certificateSigningRequest), &v1beta1.CertificateSigningRequest{}) + Invokes(testing.NewRootUpdateSubresourceAction(certificatesigningrequestsResource, "status", certificateSigningRequest), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CertificateSigningRequest), err } @@ -126,10 +131,11 @@ func (c *FakeCertificateSigningRequests) DeleteCollection(ctx context.Context, o // Patch applies the patch and returns the patched certificateSigningRequest. func (c *FakeCertificateSigningRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CertificateSigningRequest, err error) { + emptyResult := &v1beta1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, name, pt, data, subresources...), &v1beta1.CertificateSigningRequest{}) + Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CertificateSigningRequest), err } @@ -147,10 +153,11 @@ func (c *FakeCertificateSigningRequests) Apply(ctx context.Context, certificateS if name == nil { return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply") } + emptyResult := &v1beta1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, *name, types.ApplyPatchType, data), &v1beta1.CertificateSigningRequest{}) + Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CertificateSigningRequest), err } @@ -169,10 +176,11 @@ func (c *FakeCertificateSigningRequests) ApplyStatus(ctx context.Context, certif if name == nil { return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply") } + emptyResult := &v1beta1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, *name, types.ApplyPatchType, data, "status"), &v1beta1.CertificateSigningRequest{}) + Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CertificateSigningRequest), err } diff --git a/kubernetes/typed/coordination/v1/fake/fake_lease.go b/kubernetes/typed/coordination/v1/fake/fake_lease.go index 6dc7c4c17f..1649eba8ff 100644 --- a/kubernetes/typed/coordination/v1/fake/fake_lease.go +++ b/kubernetes/typed/coordination/v1/fake/fake_lease.go @@ -44,22 +44,24 @@ var leasesKind = v1.SchemeGroupVersion.WithKind("Lease") // Get takes name of the lease, and returns the corresponding lease object, and an error if there is any. func (c *FakeLeases) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Lease, err error) { + emptyResult := &v1.Lease{} obj, err := c.Fake. - Invokes(testing.NewGetAction(leasesResource, c.ns, name), &v1.Lease{}) + Invokes(testing.NewGetAction(leasesResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Lease), err } // List takes label and field selectors, and returns the list of Leases that match those selectors. func (c *FakeLeases) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LeaseList, err error) { + emptyResult := &v1.LeaseList{} obj, err := c.Fake. - Invokes(testing.NewListAction(leasesResource, leasesKind, c.ns, opts), &v1.LeaseList{}) + Invokes(testing.NewListAction(leasesResource, leasesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeLeases) Watch(ctx context.Context, opts metav1.ListOptions) (watch. // Create takes the representation of a lease and creates it. Returns the server's representation of the lease, and an error, if there is any. func (c *FakeLeases) Create(ctx context.Context, lease *v1.Lease, opts metav1.CreateOptions) (result *v1.Lease, err error) { + emptyResult := &v1.Lease{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(leasesResource, c.ns, lease), &v1.Lease{}) + Invokes(testing.NewCreateAction(leasesResource, c.ns, lease), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Lease), err } // Update takes the representation of a lease and updates it. Returns the server's representation of the lease, and an error, if there is any. func (c *FakeLeases) Update(ctx context.Context, lease *v1.Lease, opts metav1.UpdateOptions) (result *v1.Lease, err error) { + emptyResult := &v1.Lease{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(leasesResource, c.ns, lease), &v1.Lease{}) + Invokes(testing.NewUpdateAction(leasesResource, c.ns, lease), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Lease), err } @@ -122,11 +126,12 @@ func (c *FakeLeases) DeleteCollection(ctx context.Context, opts metav1.DeleteOpt // Patch applies the patch and returns the patched lease. func (c *FakeLeases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Lease, err error) { + emptyResult := &v1.Lease{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(leasesResource, c.ns, name, pt, data, subresources...), &v1.Lease{}) + Invokes(testing.NewPatchSubresourceAction(leasesResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Lease), err } @@ -144,11 +149,12 @@ func (c *FakeLeases) Apply(ctx context.Context, lease *coordinationv1.LeaseApply if name == nil { return nil, fmt.Errorf("lease.Name must be provided to Apply") } + emptyResult := &v1.Lease{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(leasesResource, c.ns, *name, types.ApplyPatchType, data), &v1.Lease{}) + Invokes(testing.NewPatchSubresourceAction(leasesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Lease), err } diff --git a/kubernetes/typed/coordination/v1beta1/fake/fake_lease.go b/kubernetes/typed/coordination/v1beta1/fake/fake_lease.go index 9a4a0d7eb9..e15737b067 100644 --- a/kubernetes/typed/coordination/v1beta1/fake/fake_lease.go +++ b/kubernetes/typed/coordination/v1beta1/fake/fake_lease.go @@ -44,22 +44,24 @@ var leasesKind = v1beta1.SchemeGroupVersion.WithKind("Lease") // Get takes name of the lease, and returns the corresponding lease object, and an error if there is any. func (c *FakeLeases) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Lease, err error) { + emptyResult := &v1beta1.Lease{} obj, err := c.Fake. - Invokes(testing.NewGetAction(leasesResource, c.ns, name), &v1beta1.Lease{}) + Invokes(testing.NewGetAction(leasesResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Lease), err } // List takes label and field selectors, and returns the list of Leases that match those selectors. func (c *FakeLeases) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.LeaseList, err error) { + emptyResult := &v1beta1.LeaseList{} obj, err := c.Fake. - Invokes(testing.NewListAction(leasesResource, leasesKind, c.ns, opts), &v1beta1.LeaseList{}) + Invokes(testing.NewListAction(leasesResource, leasesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeLeases) Watch(ctx context.Context, opts v1.ListOptions) (watch.Inte // Create takes the representation of a lease and creates it. Returns the server's representation of the lease, and an error, if there is any. func (c *FakeLeases) Create(ctx context.Context, lease *v1beta1.Lease, opts v1.CreateOptions) (result *v1beta1.Lease, err error) { + emptyResult := &v1beta1.Lease{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(leasesResource, c.ns, lease), &v1beta1.Lease{}) + Invokes(testing.NewCreateAction(leasesResource, c.ns, lease), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Lease), err } // Update takes the representation of a lease and updates it. Returns the server's representation of the lease, and an error, if there is any. func (c *FakeLeases) Update(ctx context.Context, lease *v1beta1.Lease, opts v1.UpdateOptions) (result *v1beta1.Lease, err error) { + emptyResult := &v1beta1.Lease{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(leasesResource, c.ns, lease), &v1beta1.Lease{}) + Invokes(testing.NewUpdateAction(leasesResource, c.ns, lease), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Lease), err } @@ -122,11 +126,12 @@ func (c *FakeLeases) DeleteCollection(ctx context.Context, opts v1.DeleteOptions // Patch applies the patch and returns the patched lease. func (c *FakeLeases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Lease, err error) { + emptyResult := &v1beta1.Lease{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(leasesResource, c.ns, name, pt, data, subresources...), &v1beta1.Lease{}) + Invokes(testing.NewPatchSubresourceAction(leasesResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Lease), err } @@ -144,11 +149,12 @@ func (c *FakeLeases) Apply(ctx context.Context, lease *coordinationv1beta1.Lease if name == nil { return nil, fmt.Errorf("lease.Name must be provided to Apply") } + emptyResult := &v1beta1.Lease{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(leasesResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.Lease{}) + Invokes(testing.NewPatchSubresourceAction(leasesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Lease), err } diff --git a/kubernetes/typed/core/v1/fake/fake_componentstatus.go b/kubernetes/typed/core/v1/fake/fake_componentstatus.go index 39d4c3282e..2d8cd6c19c 100644 --- a/kubernetes/typed/core/v1/fake/fake_componentstatus.go +++ b/kubernetes/typed/core/v1/fake/fake_componentstatus.go @@ -43,20 +43,22 @@ var componentstatusesKind = v1.SchemeGroupVersion.WithKind("ComponentStatus") // Get takes name of the componentStatus, and returns the corresponding componentStatus object, and an error if there is any. func (c *FakeComponentStatuses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ComponentStatus, err error) { + emptyResult := &v1.ComponentStatus{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(componentstatusesResource, name), &v1.ComponentStatus{}) + Invokes(testing.NewRootGetAction(componentstatusesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ComponentStatus), err } // List takes label and field selectors, and returns the list of ComponentStatuses that match those selectors. func (c *FakeComponentStatuses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ComponentStatusList, err error) { + emptyResult := &v1.ComponentStatusList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(componentstatusesResource, componentstatusesKind, opts), &v1.ComponentStatusList{}) + Invokes(testing.NewRootListAction(componentstatusesResource, componentstatusesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeComponentStatuses) Watch(ctx context.Context, opts metav1.ListOptio // Create takes the representation of a componentStatus and creates it. Returns the server's representation of the componentStatus, and an error, if there is any. func (c *FakeComponentStatuses) Create(ctx context.Context, componentStatus *v1.ComponentStatus, opts metav1.CreateOptions) (result *v1.ComponentStatus, err error) { + emptyResult := &v1.ComponentStatus{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(componentstatusesResource, componentStatus), &v1.ComponentStatus{}) + Invokes(testing.NewRootCreateAction(componentstatusesResource, componentStatus), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ComponentStatus), err } // Update takes the representation of a componentStatus and updates it. Returns the server's representation of the componentStatus, and an error, if there is any. func (c *FakeComponentStatuses) Update(ctx context.Context, componentStatus *v1.ComponentStatus, opts metav1.UpdateOptions) (result *v1.ComponentStatus, err error) { + emptyResult := &v1.ComponentStatus{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(componentstatusesResource, componentStatus), &v1.ComponentStatus{}) + Invokes(testing.NewRootUpdateAction(componentstatusesResource, componentStatus), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ComponentStatus), err } @@ -115,10 +119,11 @@ func (c *FakeComponentStatuses) DeleteCollection(ctx context.Context, opts metav // Patch applies the patch and returns the patched componentStatus. func (c *FakeComponentStatuses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ComponentStatus, err error) { + emptyResult := &v1.ComponentStatus{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(componentstatusesResource, name, pt, data, subresources...), &v1.ComponentStatus{}) + Invokes(testing.NewRootPatchSubresourceAction(componentstatusesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ComponentStatus), err } @@ -136,10 +141,11 @@ func (c *FakeComponentStatuses) Apply(ctx context.Context, componentStatus *core if name == nil { return nil, fmt.Errorf("componentStatus.Name must be provided to Apply") } + emptyResult := &v1.ComponentStatus{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(componentstatusesResource, *name, types.ApplyPatchType, data), &v1.ComponentStatus{}) + Invokes(testing.NewRootPatchSubresourceAction(componentstatusesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ComponentStatus), err } diff --git a/kubernetes/typed/core/v1/fake/fake_configmap.go b/kubernetes/typed/core/v1/fake/fake_configmap.go index 6e8a38bd8f..37ad42be68 100644 --- a/kubernetes/typed/core/v1/fake/fake_configmap.go +++ b/kubernetes/typed/core/v1/fake/fake_configmap.go @@ -44,22 +44,24 @@ var configmapsKind = v1.SchemeGroupVersion.WithKind("ConfigMap") // Get takes name of the configMap, and returns the corresponding configMap object, and an error if there is any. func (c *FakeConfigMaps) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ConfigMap, err error) { + emptyResult := &v1.ConfigMap{} obj, err := c.Fake. - Invokes(testing.NewGetAction(configmapsResource, c.ns, name), &v1.ConfigMap{}) + Invokes(testing.NewGetAction(configmapsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ConfigMap), err } // List takes label and field selectors, and returns the list of ConfigMaps that match those selectors. func (c *FakeConfigMaps) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ConfigMapList, err error) { + emptyResult := &v1.ConfigMapList{} obj, err := c.Fake. - Invokes(testing.NewListAction(configmapsResource, configmapsKind, c.ns, opts), &v1.ConfigMapList{}) + Invokes(testing.NewListAction(configmapsResource, configmapsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeConfigMaps) Watch(ctx context.Context, opts metav1.ListOptions) (wa // Create takes the representation of a configMap and creates it. Returns the server's representation of the configMap, and an error, if there is any. func (c *FakeConfigMaps) Create(ctx context.Context, configMap *v1.ConfigMap, opts metav1.CreateOptions) (result *v1.ConfigMap, err error) { + emptyResult := &v1.ConfigMap{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(configmapsResource, c.ns, configMap), &v1.ConfigMap{}) + Invokes(testing.NewCreateAction(configmapsResource, c.ns, configMap), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ConfigMap), err } // Update takes the representation of a configMap and updates it. Returns the server's representation of the configMap, and an error, if there is any. func (c *FakeConfigMaps) Update(ctx context.Context, configMap *v1.ConfigMap, opts metav1.UpdateOptions) (result *v1.ConfigMap, err error) { + emptyResult := &v1.ConfigMap{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(configmapsResource, c.ns, configMap), &v1.ConfigMap{}) + Invokes(testing.NewUpdateAction(configmapsResource, c.ns, configMap), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ConfigMap), err } @@ -122,11 +126,12 @@ func (c *FakeConfigMaps) DeleteCollection(ctx context.Context, opts metav1.Delet // Patch applies the patch and returns the patched configMap. func (c *FakeConfigMaps) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ConfigMap, err error) { + emptyResult := &v1.ConfigMap{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(configmapsResource, c.ns, name, pt, data, subresources...), &v1.ConfigMap{}) + Invokes(testing.NewPatchSubresourceAction(configmapsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ConfigMap), err } @@ -144,11 +149,12 @@ func (c *FakeConfigMaps) Apply(ctx context.Context, configMap *corev1.ConfigMapA if name == nil { return nil, fmt.Errorf("configMap.Name must be provided to Apply") } + emptyResult := &v1.ConfigMap{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(configmapsResource, c.ns, *name, types.ApplyPatchType, data), &v1.ConfigMap{}) + Invokes(testing.NewPatchSubresourceAction(configmapsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ConfigMap), err } diff --git a/kubernetes/typed/core/v1/fake/fake_endpoints.go b/kubernetes/typed/core/v1/fake/fake_endpoints.go index 6b2f6c249e..aa221b2da8 100644 --- a/kubernetes/typed/core/v1/fake/fake_endpoints.go +++ b/kubernetes/typed/core/v1/fake/fake_endpoints.go @@ -44,22 +44,24 @@ var endpointsKind = v1.SchemeGroupVersion.WithKind("Endpoints") // Get takes name of the endpoints, and returns the corresponding endpoints object, and an error if there is any. func (c *FakeEndpoints) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Endpoints, err error) { + emptyResult := &v1.Endpoints{} obj, err := c.Fake. - Invokes(testing.NewGetAction(endpointsResource, c.ns, name), &v1.Endpoints{}) + Invokes(testing.NewGetAction(endpointsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Endpoints), err } // List takes label and field selectors, and returns the list of Endpoints that match those selectors. func (c *FakeEndpoints) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointsList, err error) { + emptyResult := &v1.EndpointsList{} obj, err := c.Fake. - Invokes(testing.NewListAction(endpointsResource, endpointsKind, c.ns, opts), &v1.EndpointsList{}) + Invokes(testing.NewListAction(endpointsResource, endpointsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeEndpoints) Watch(ctx context.Context, opts metav1.ListOptions) (wat // Create takes the representation of a endpoints and creates it. Returns the server's representation of the endpoints, and an error, if there is any. func (c *FakeEndpoints) Create(ctx context.Context, endpoints *v1.Endpoints, opts metav1.CreateOptions) (result *v1.Endpoints, err error) { + emptyResult := &v1.Endpoints{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(endpointsResource, c.ns, endpoints), &v1.Endpoints{}) + Invokes(testing.NewCreateAction(endpointsResource, c.ns, endpoints), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Endpoints), err } // Update takes the representation of a endpoints and updates it. Returns the server's representation of the endpoints, and an error, if there is any. func (c *FakeEndpoints) Update(ctx context.Context, endpoints *v1.Endpoints, opts metav1.UpdateOptions) (result *v1.Endpoints, err error) { + emptyResult := &v1.Endpoints{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(endpointsResource, c.ns, endpoints), &v1.Endpoints{}) + Invokes(testing.NewUpdateAction(endpointsResource, c.ns, endpoints), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Endpoints), err } @@ -122,11 +126,12 @@ func (c *FakeEndpoints) DeleteCollection(ctx context.Context, opts metav1.Delete // Patch applies the patch and returns the patched endpoints. func (c *FakeEndpoints) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Endpoints, err error) { + emptyResult := &v1.Endpoints{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(endpointsResource, c.ns, name, pt, data, subresources...), &v1.Endpoints{}) + Invokes(testing.NewPatchSubresourceAction(endpointsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Endpoints), err } @@ -144,11 +149,12 @@ func (c *FakeEndpoints) Apply(ctx context.Context, endpoints *corev1.EndpointsAp if name == nil { return nil, fmt.Errorf("endpoints.Name must be provided to Apply") } + emptyResult := &v1.Endpoints{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(endpointsResource, c.ns, *name, types.ApplyPatchType, data), &v1.Endpoints{}) + Invokes(testing.NewPatchSubresourceAction(endpointsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Endpoints), err } diff --git a/kubernetes/typed/core/v1/fake/fake_event.go b/kubernetes/typed/core/v1/fake/fake_event.go index 9ad879b394..9bb0f5fb23 100644 --- a/kubernetes/typed/core/v1/fake/fake_event.go +++ b/kubernetes/typed/core/v1/fake/fake_event.go @@ -44,22 +44,24 @@ var eventsKind = v1.SchemeGroupVersion.WithKind("Event") // Get takes name of the event, and returns the corresponding event object, and an error if there is any. func (c *FakeEvents) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Event, err error) { + emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewGetAction(eventsResource, c.ns, name), &v1.Event{}) + Invokes(testing.NewGetAction(eventsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Event), err } // List takes label and field selectors, and returns the list of Events that match those selectors. func (c *FakeEvents) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { + emptyResult := &v1.EventList{} obj, err := c.Fake. - Invokes(testing.NewListAction(eventsResource, eventsKind, c.ns, opts), &v1.EventList{}) + Invokes(testing.NewListAction(eventsResource, eventsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeEvents) Watch(ctx context.Context, opts metav1.ListOptions) (watch. // Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any. func (c *FakeEvents) Create(ctx context.Context, event *v1.Event, opts metav1.CreateOptions) (result *v1.Event, err error) { + emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(eventsResource, c.ns, event), &v1.Event{}) + Invokes(testing.NewCreateAction(eventsResource, c.ns, event), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Event), err } // Update takes the representation of a event and updates it. Returns the server's representation of the event, and an error, if there is any. func (c *FakeEvents) Update(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (result *v1.Event, err error) { + emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(eventsResource, c.ns, event), &v1.Event{}) + Invokes(testing.NewUpdateAction(eventsResource, c.ns, event), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Event), err } @@ -122,11 +126,12 @@ func (c *FakeEvents) DeleteCollection(ctx context.Context, opts metav1.DeleteOpt // Patch applies the patch and returns the patched event. func (c *FakeEvents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Event, err error) { + emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, name, pt, data, subresources...), &v1.Event{}) + Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Event), err } @@ -144,11 +149,12 @@ func (c *FakeEvents) Apply(ctx context.Context, event *corev1.EventApplyConfigur if name == nil { return nil, fmt.Errorf("event.Name must be provided to Apply") } + emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, *name, types.ApplyPatchType, data), &v1.Event{}) + Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Event), err } diff --git a/kubernetes/typed/core/v1/fake/fake_limitrange.go b/kubernetes/typed/core/v1/fake/fake_limitrange.go index f18b5741c3..03b1ca032d 100644 --- a/kubernetes/typed/core/v1/fake/fake_limitrange.go +++ b/kubernetes/typed/core/v1/fake/fake_limitrange.go @@ -44,22 +44,24 @@ var limitrangesKind = v1.SchemeGroupVersion.WithKind("LimitRange") // Get takes name of the limitRange, and returns the corresponding limitRange object, and an error if there is any. func (c *FakeLimitRanges) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.LimitRange, err error) { + emptyResult := &v1.LimitRange{} obj, err := c.Fake. - Invokes(testing.NewGetAction(limitrangesResource, c.ns, name), &v1.LimitRange{}) + Invokes(testing.NewGetAction(limitrangesResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.LimitRange), err } // List takes label and field selectors, and returns the list of LimitRanges that match those selectors. func (c *FakeLimitRanges) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LimitRangeList, err error) { + emptyResult := &v1.LimitRangeList{} obj, err := c.Fake. - Invokes(testing.NewListAction(limitrangesResource, limitrangesKind, c.ns, opts), &v1.LimitRangeList{}) + Invokes(testing.NewListAction(limitrangesResource, limitrangesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeLimitRanges) Watch(ctx context.Context, opts metav1.ListOptions) (w // Create takes the representation of a limitRange and creates it. Returns the server's representation of the limitRange, and an error, if there is any. func (c *FakeLimitRanges) Create(ctx context.Context, limitRange *v1.LimitRange, opts metav1.CreateOptions) (result *v1.LimitRange, err error) { + emptyResult := &v1.LimitRange{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(limitrangesResource, c.ns, limitRange), &v1.LimitRange{}) + Invokes(testing.NewCreateAction(limitrangesResource, c.ns, limitRange), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.LimitRange), err } // Update takes the representation of a limitRange and updates it. Returns the server's representation of the limitRange, and an error, if there is any. func (c *FakeLimitRanges) Update(ctx context.Context, limitRange *v1.LimitRange, opts metav1.UpdateOptions) (result *v1.LimitRange, err error) { + emptyResult := &v1.LimitRange{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(limitrangesResource, c.ns, limitRange), &v1.LimitRange{}) + Invokes(testing.NewUpdateAction(limitrangesResource, c.ns, limitRange), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.LimitRange), err } @@ -122,11 +126,12 @@ func (c *FakeLimitRanges) DeleteCollection(ctx context.Context, opts metav1.Dele // Patch applies the patch and returns the patched limitRange. func (c *FakeLimitRanges) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LimitRange, err error) { + emptyResult := &v1.LimitRange{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(limitrangesResource, c.ns, name, pt, data, subresources...), &v1.LimitRange{}) + Invokes(testing.NewPatchSubresourceAction(limitrangesResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.LimitRange), err } @@ -144,11 +149,12 @@ func (c *FakeLimitRanges) Apply(ctx context.Context, limitRange *corev1.LimitRan if name == nil { return nil, fmt.Errorf("limitRange.Name must be provided to Apply") } + emptyResult := &v1.LimitRange{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(limitrangesResource, c.ns, *name, types.ApplyPatchType, data), &v1.LimitRange{}) + Invokes(testing.NewPatchSubresourceAction(limitrangesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.LimitRange), err } diff --git a/kubernetes/typed/core/v1/fake/fake_namespace.go b/kubernetes/typed/core/v1/fake/fake_namespace.go index 52fcff591e..7a28220d20 100644 --- a/kubernetes/typed/core/v1/fake/fake_namespace.go +++ b/kubernetes/typed/core/v1/fake/fake_namespace.go @@ -43,20 +43,22 @@ var namespacesKind = v1.SchemeGroupVersion.WithKind("Namespace") // Get takes name of the namespace, and returns the corresponding namespace object, and an error if there is any. func (c *FakeNamespaces) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Namespace, err error) { + emptyResult := &v1.Namespace{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(namespacesResource, name), &v1.Namespace{}) + Invokes(testing.NewRootGetAction(namespacesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Namespace), err } // List takes label and field selectors, and returns the list of Namespaces that match those selectors. func (c *FakeNamespaces) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NamespaceList, err error) { + emptyResult := &v1.NamespaceList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(namespacesResource, namespacesKind, opts), &v1.NamespaceList{}) + Invokes(testing.NewRootListAction(namespacesResource, namespacesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,31 +82,34 @@ func (c *FakeNamespaces) Watch(ctx context.Context, opts metav1.ListOptions) (wa // Create takes the representation of a namespace and creates it. Returns the server's representation of the namespace, and an error, if there is any. func (c *FakeNamespaces) Create(ctx context.Context, namespace *v1.Namespace, opts metav1.CreateOptions) (result *v1.Namespace, err error) { + emptyResult := &v1.Namespace{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(namespacesResource, namespace), &v1.Namespace{}) + Invokes(testing.NewRootCreateAction(namespacesResource, namespace), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Namespace), err } // Update takes the representation of a namespace and updates it. Returns the server's representation of the namespace, and an error, if there is any. func (c *FakeNamespaces) Update(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (result *v1.Namespace, err error) { + emptyResult := &v1.Namespace{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(namespacesResource, namespace), &v1.Namespace{}) + Invokes(testing.NewRootUpdateAction(namespacesResource, namespace), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Namespace), 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 *FakeNamespaces) UpdateStatus(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (*v1.Namespace, error) { +func (c *FakeNamespaces) UpdateStatus(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (result *v1.Namespace, err error) { + emptyResult := &v1.Namespace{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(namespacesResource, "status", namespace), &v1.Namespace{}) + Invokes(testing.NewRootUpdateSubresourceAction(namespacesResource, "status", namespace), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Namespace), err } @@ -118,10 +123,11 @@ func (c *FakeNamespaces) Delete(ctx context.Context, name string, opts metav1.De // Patch applies the patch and returns the patched namespace. func (c *FakeNamespaces) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Namespace, err error) { + emptyResult := &v1.Namespace{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(namespacesResource, name, pt, data, subresources...), &v1.Namespace{}) + Invokes(testing.NewRootPatchSubresourceAction(namespacesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Namespace), err } @@ -139,10 +145,11 @@ func (c *FakeNamespaces) Apply(ctx context.Context, namespace *corev1.NamespaceA if name == nil { return nil, fmt.Errorf("namespace.Name must be provided to Apply") } + emptyResult := &v1.Namespace{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(namespacesResource, *name, types.ApplyPatchType, data), &v1.Namespace{}) + Invokes(testing.NewRootPatchSubresourceAction(namespacesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Namespace), err } @@ -161,10 +168,11 @@ func (c *FakeNamespaces) ApplyStatus(ctx context.Context, namespace *corev1.Name if name == nil { return nil, fmt.Errorf("namespace.Name must be provided to Apply") } + emptyResult := &v1.Namespace{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(namespacesResource, *name, types.ApplyPatchType, data, "status"), &v1.Namespace{}) + Invokes(testing.NewRootPatchSubresourceAction(namespacesResource, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Namespace), err } diff --git a/kubernetes/typed/core/v1/fake/fake_node.go b/kubernetes/typed/core/v1/fake/fake_node.go index 5df40f8d11..538f0ab0c5 100644 --- a/kubernetes/typed/core/v1/fake/fake_node.go +++ b/kubernetes/typed/core/v1/fake/fake_node.go @@ -43,20 +43,22 @@ var nodesKind = v1.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 metav1.GetOptions) (result *v1.Node, err error) { + emptyResult := &v1.Node{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(nodesResource, name), &v1.Node{}) + Invokes(testing.NewRootGetAction(nodesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.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 metav1.ListOptions) (result *v1.NodeList, err error) { + emptyResult := &v1.NodeList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(nodesResource, nodesKind, opts), &v1.NodeList{}) + Invokes(testing.NewRootListAction(nodesResource, nodesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,31 +82,34 @@ func (c *FakeNodes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.I // 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 *v1.Node, opts metav1.CreateOptions) (result *v1.Node, err error) { + emptyResult := &v1.Node{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(nodesResource, node), &v1.Node{}) + Invokes(testing.NewRootCreateAction(nodesResource, node), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.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 *v1.Node, opts metav1.UpdateOptions) (result *v1.Node, err error) { + emptyResult := &v1.Node{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(nodesResource, node), &v1.Node{}) + Invokes(testing.NewRootUpdateAction(nodesResource, node), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.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 *v1.Node, opts metav1.UpdateOptions) (*v1.Node, error) { +func (c *FakeNodes) UpdateStatus(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (result *v1.Node, err error) { + emptyResult := &v1.Node{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(nodesResource, "status", node), &v1.Node{}) + Invokes(testing.NewRootUpdateSubresourceAction(nodesResource, "status", node), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Node), err } @@ -126,10 +131,11 @@ func (c *FakeNodes) DeleteCollection(ctx context.Context, opts metav1.DeleteOpti // Patch applies the patch and returns the patched node. func (c *FakeNodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Node, err error) { + emptyResult := &v1.Node{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(nodesResource, name, pt, data, subresources...), &v1.Node{}) + Invokes(testing.NewRootPatchSubresourceAction(nodesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Node), err } @@ -147,10 +153,11 @@ func (c *FakeNodes) Apply(ctx context.Context, node *corev1.NodeApplyConfigurati if name == nil { return nil, fmt.Errorf("node.Name must be provided to Apply") } + emptyResult := &v1.Node{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(nodesResource, *name, types.ApplyPatchType, data), &v1.Node{}) + Invokes(testing.NewRootPatchSubresourceAction(nodesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Node), err } @@ -169,10 +176,11 @@ func (c *FakeNodes) ApplyStatus(ctx context.Context, node *corev1.NodeApplyConfi if name == nil { return nil, fmt.Errorf("node.Name must be provided to Apply") } + emptyResult := &v1.Node{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(nodesResource, *name, types.ApplyPatchType, data, "status"), &v1.Node{}) + Invokes(testing.NewRootPatchSubresourceAction(nodesResource, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Node), err } diff --git a/kubernetes/typed/core/v1/fake/fake_persistentvolume.go b/kubernetes/typed/core/v1/fake/fake_persistentvolume.go index 5b06d0b192..2d5b0714cf 100644 --- a/kubernetes/typed/core/v1/fake/fake_persistentvolume.go +++ b/kubernetes/typed/core/v1/fake/fake_persistentvolume.go @@ -43,20 +43,22 @@ var persistentvolumesKind = v1.SchemeGroupVersion.WithKind("PersistentVolume") // Get takes name of the persistentVolume, and returns the corresponding persistentVolume object, and an error if there is any. func (c *FakePersistentVolumes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PersistentVolume, err error) { + emptyResult := &v1.PersistentVolume{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(persistentvolumesResource, name), &v1.PersistentVolume{}) + Invokes(testing.NewRootGetAction(persistentvolumesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PersistentVolume), err } // List takes label and field selectors, and returns the list of PersistentVolumes that match those selectors. func (c *FakePersistentVolumes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeList, err error) { + emptyResult := &v1.PersistentVolumeList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(persistentvolumesResource, persistentvolumesKind, opts), &v1.PersistentVolumeList{}) + Invokes(testing.NewRootListAction(persistentvolumesResource, persistentvolumesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,31 +82,34 @@ func (c *FakePersistentVolumes) Watch(ctx context.Context, opts metav1.ListOptio // Create takes the representation of a persistentVolume and creates it. Returns the server's representation of the persistentVolume, and an error, if there is any. func (c *FakePersistentVolumes) Create(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.CreateOptions) (result *v1.PersistentVolume, err error) { + emptyResult := &v1.PersistentVolume{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(persistentvolumesResource, persistentVolume), &v1.PersistentVolume{}) + Invokes(testing.NewRootCreateAction(persistentvolumesResource, persistentVolume), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PersistentVolume), err } // Update takes the representation of a persistentVolume and updates it. Returns the server's representation of the persistentVolume, and an error, if there is any. func (c *FakePersistentVolumes) Update(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.UpdateOptions) (result *v1.PersistentVolume, err error) { + emptyResult := &v1.PersistentVolume{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(persistentvolumesResource, persistentVolume), &v1.PersistentVolume{}) + Invokes(testing.NewRootUpdateAction(persistentvolumesResource, persistentVolume), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PersistentVolume), 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 *FakePersistentVolumes) UpdateStatus(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.UpdateOptions) (*v1.PersistentVolume, error) { +func (c *FakePersistentVolumes) UpdateStatus(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.UpdateOptions) (result *v1.PersistentVolume, err error) { + emptyResult := &v1.PersistentVolume{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(persistentvolumesResource, "status", persistentVolume), &v1.PersistentVolume{}) + Invokes(testing.NewRootUpdateSubresourceAction(persistentvolumesResource, "status", persistentVolume), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PersistentVolume), err } @@ -126,10 +131,11 @@ func (c *FakePersistentVolumes) DeleteCollection(ctx context.Context, opts metav // Patch applies the patch and returns the patched persistentVolume. func (c *FakePersistentVolumes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PersistentVolume, err error) { + emptyResult := &v1.PersistentVolume{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(persistentvolumesResource, name, pt, data, subresources...), &v1.PersistentVolume{}) + Invokes(testing.NewRootPatchSubresourceAction(persistentvolumesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PersistentVolume), err } @@ -147,10 +153,11 @@ func (c *FakePersistentVolumes) Apply(ctx context.Context, persistentVolume *cor if name == nil { return nil, fmt.Errorf("persistentVolume.Name must be provided to Apply") } + emptyResult := &v1.PersistentVolume{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(persistentvolumesResource, *name, types.ApplyPatchType, data), &v1.PersistentVolume{}) + Invokes(testing.NewRootPatchSubresourceAction(persistentvolumesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PersistentVolume), err } @@ -169,10 +176,11 @@ func (c *FakePersistentVolumes) ApplyStatus(ctx context.Context, persistentVolum if name == nil { return nil, fmt.Errorf("persistentVolume.Name must be provided to Apply") } + emptyResult := &v1.PersistentVolume{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(persistentvolumesResource, *name, types.ApplyPatchType, data, "status"), &v1.PersistentVolume{}) + Invokes(testing.NewRootPatchSubresourceAction(persistentvolumesResource, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PersistentVolume), err } diff --git a/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go b/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go index b860e53674..67295ce42d 100644 --- a/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go +++ b/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go @@ -44,22 +44,24 @@ var persistentvolumeclaimsKind = v1.SchemeGroupVersion.WithKind("PersistentVolum // Get takes name of the persistentVolumeClaim, and returns the corresponding persistentVolumeClaim object, and an error if there is any. func (c *FakePersistentVolumeClaims) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PersistentVolumeClaim, err error) { + emptyResult := &v1.PersistentVolumeClaim{} obj, err := c.Fake. - Invokes(testing.NewGetAction(persistentvolumeclaimsResource, c.ns, name), &v1.PersistentVolumeClaim{}) + Invokes(testing.NewGetAction(persistentvolumeclaimsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PersistentVolumeClaim), err } // List takes label and field selectors, and returns the list of PersistentVolumeClaims that match those selectors. func (c *FakePersistentVolumeClaims) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeClaimList, err error) { + emptyResult := &v1.PersistentVolumeClaimList{} obj, err := c.Fake. - Invokes(testing.NewListAction(persistentvolumeclaimsResource, persistentvolumeclaimsKind, c.ns, opts), &v1.PersistentVolumeClaimList{}) + Invokes(testing.NewListAction(persistentvolumeclaimsResource, persistentvolumeclaimsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakePersistentVolumeClaims) Watch(ctx context.Context, opts metav1.List // Create takes the representation of a persistentVolumeClaim and creates it. Returns the server's representation of the persistentVolumeClaim, and an error, if there is any. func (c *FakePersistentVolumeClaims) Create(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.CreateOptions) (result *v1.PersistentVolumeClaim, err error) { + emptyResult := &v1.PersistentVolumeClaim{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(persistentvolumeclaimsResource, c.ns, persistentVolumeClaim), &v1.PersistentVolumeClaim{}) + Invokes(testing.NewCreateAction(persistentvolumeclaimsResource, c.ns, persistentVolumeClaim), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PersistentVolumeClaim), err } // Update takes the representation of a persistentVolumeClaim and updates it. Returns the server's representation of the persistentVolumeClaim, and an error, if there is any. func (c *FakePersistentVolumeClaims) Update(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.UpdateOptions) (result *v1.PersistentVolumeClaim, err error) { + emptyResult := &v1.PersistentVolumeClaim{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(persistentvolumeclaimsResource, c.ns, persistentVolumeClaim), &v1.PersistentVolumeClaim{}) + Invokes(testing.NewUpdateAction(persistentvolumeclaimsResource, c.ns, persistentVolumeClaim), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PersistentVolumeClaim), 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 *FakePersistentVolumeClaims) UpdateStatus(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.UpdateOptions) (*v1.PersistentVolumeClaim, error) { +func (c *FakePersistentVolumeClaims) UpdateStatus(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.UpdateOptions) (result *v1.PersistentVolumeClaim, err error) { + emptyResult := &v1.PersistentVolumeClaim{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(persistentvolumeclaimsResource, "status", c.ns, persistentVolumeClaim), &v1.PersistentVolumeClaim{}) + Invokes(testing.NewUpdateSubresourceAction(persistentvolumeclaimsResource, "status", c.ns, persistentVolumeClaim), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PersistentVolumeClaim), err } @@ -134,11 +139,12 @@ func (c *FakePersistentVolumeClaims) DeleteCollection(ctx context.Context, opts // Patch applies the patch and returns the patched persistentVolumeClaim. func (c *FakePersistentVolumeClaims) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PersistentVolumeClaim, err error) { + emptyResult := &v1.PersistentVolumeClaim{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(persistentvolumeclaimsResource, c.ns, name, pt, data, subresources...), &v1.PersistentVolumeClaim{}) + Invokes(testing.NewPatchSubresourceAction(persistentvolumeclaimsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PersistentVolumeClaim), err } @@ -156,11 +162,12 @@ func (c *FakePersistentVolumeClaims) Apply(ctx context.Context, persistentVolume if name == nil { return nil, fmt.Errorf("persistentVolumeClaim.Name must be provided to Apply") } + emptyResult := &v1.PersistentVolumeClaim{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(persistentvolumeclaimsResource, c.ns, *name, types.ApplyPatchType, data), &v1.PersistentVolumeClaim{}) + Invokes(testing.NewPatchSubresourceAction(persistentvolumeclaimsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PersistentVolumeClaim), err } @@ -179,11 +186,12 @@ func (c *FakePersistentVolumeClaims) ApplyStatus(ctx context.Context, persistent if name == nil { return nil, fmt.Errorf("persistentVolumeClaim.Name must be provided to Apply") } + emptyResult := &v1.PersistentVolumeClaim{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(persistentvolumeclaimsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.PersistentVolumeClaim{}) + Invokes(testing.NewPatchSubresourceAction(persistentvolumeclaimsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PersistentVolumeClaim), err } diff --git a/kubernetes/typed/core/v1/fake/fake_pod.go b/kubernetes/typed/core/v1/fake/fake_pod.go index 23634c7d07..839f985a73 100644 --- a/kubernetes/typed/core/v1/fake/fake_pod.go +++ b/kubernetes/typed/core/v1/fake/fake_pod.go @@ -44,22 +44,24 @@ var podsKind = v1.SchemeGroupVersion.WithKind("Pod") // Get takes name of the pod, and returns the corresponding pod object, and an error if there is any. func (c *FakePods) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Pod, err error) { + emptyResult := &v1.Pod{} obj, err := c.Fake. - Invokes(testing.NewGetAction(podsResource, c.ns, name), &v1.Pod{}) + Invokes(testing.NewGetAction(podsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Pod), err } // List takes label and field selectors, and returns the list of Pods that match those selectors. func (c *FakePods) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodList, err error) { + emptyResult := &v1.PodList{} obj, err := c.Fake. - Invokes(testing.NewListAction(podsResource, podsKind, c.ns, opts), &v1.PodList{}) + Invokes(testing.NewListAction(podsResource, podsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakePods) Watch(ctx context.Context, opts metav1.ListOptions) (watch.In // Create takes the representation of a pod and creates it. Returns the server's representation of the pod, and an error, if there is any. func (c *FakePods) Create(ctx context.Context, pod *v1.Pod, opts metav1.CreateOptions) (result *v1.Pod, err error) { + emptyResult := &v1.Pod{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(podsResource, c.ns, pod), &v1.Pod{}) + Invokes(testing.NewCreateAction(podsResource, c.ns, pod), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Pod), err } // Update takes the representation of a pod and updates it. Returns the server's representation of the pod, and an error, if there is any. func (c *FakePods) Update(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) { + emptyResult := &v1.Pod{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(podsResource, c.ns, pod), &v1.Pod{}) + Invokes(testing.NewUpdateAction(podsResource, c.ns, pod), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Pod), 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 *FakePods) UpdateStatus(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (*v1.Pod, error) { +func (c *FakePods) UpdateStatus(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) { + emptyResult := &v1.Pod{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(podsResource, "status", c.ns, pod), &v1.Pod{}) + Invokes(testing.NewUpdateSubresourceAction(podsResource, "status", c.ns, pod), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Pod), err } @@ -134,11 +139,12 @@ func (c *FakePods) DeleteCollection(ctx context.Context, opts metav1.DeleteOptio // Patch applies the patch and returns the patched pod. func (c *FakePods) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Pod, err error) { + emptyResult := &v1.Pod{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(podsResource, c.ns, name, pt, data, subresources...), &v1.Pod{}) + Invokes(testing.NewPatchSubresourceAction(podsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Pod), err } @@ -156,11 +162,12 @@ func (c *FakePods) Apply(ctx context.Context, pod *corev1.PodApplyConfiguration, if name == nil { return nil, fmt.Errorf("pod.Name must be provided to Apply") } + emptyResult := &v1.Pod{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(podsResource, c.ns, *name, types.ApplyPatchType, data), &v1.Pod{}) + Invokes(testing.NewPatchSubresourceAction(podsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Pod), err } @@ -179,22 +186,24 @@ func (c *FakePods) ApplyStatus(ctx context.Context, pod *corev1.PodApplyConfigur if name == nil { return nil, fmt.Errorf("pod.Name must be provided to Apply") } + emptyResult := &v1.Pod{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(podsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.Pod{}) + Invokes(testing.NewPatchSubresourceAction(podsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Pod), err } // UpdateEphemeralContainers takes the representation of a pod and updates it. Returns the server's representation of the pod, and an error, if there is any. func (c *FakePods) UpdateEphemeralContainers(ctx context.Context, podName string, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) { + emptyResult := &v1.Pod{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(podsResource, "ephemeralcontainers", c.ns, pod), &v1.Pod{}) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Pod), err } diff --git a/kubernetes/typed/core/v1/fake/fake_podtemplate.go b/kubernetes/typed/core/v1/fake/fake_podtemplate.go index 9fa97ab402..7f00b22f5d 100644 --- a/kubernetes/typed/core/v1/fake/fake_podtemplate.go +++ b/kubernetes/typed/core/v1/fake/fake_podtemplate.go @@ -44,22 +44,24 @@ var podtemplatesKind = v1.SchemeGroupVersion.WithKind("PodTemplate") // Get takes name of the podTemplate, and returns the corresponding podTemplate object, and an error if there is any. func (c *FakePodTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PodTemplate, err error) { + emptyResult := &v1.PodTemplate{} obj, err := c.Fake. - Invokes(testing.NewGetAction(podtemplatesResource, c.ns, name), &v1.PodTemplate{}) + Invokes(testing.NewGetAction(podtemplatesResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PodTemplate), err } // List takes label and field selectors, and returns the list of PodTemplates that match those selectors. func (c *FakePodTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodTemplateList, err error) { + emptyResult := &v1.PodTemplateList{} obj, err := c.Fake. - Invokes(testing.NewListAction(podtemplatesResource, podtemplatesKind, c.ns, opts), &v1.PodTemplateList{}) + Invokes(testing.NewListAction(podtemplatesResource, podtemplatesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakePodTemplates) Watch(ctx context.Context, opts metav1.ListOptions) ( // Create takes the representation of a podTemplate and creates it. Returns the server's representation of the podTemplate, and an error, if there is any. func (c *FakePodTemplates) Create(ctx context.Context, podTemplate *v1.PodTemplate, opts metav1.CreateOptions) (result *v1.PodTemplate, err error) { + emptyResult := &v1.PodTemplate{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(podtemplatesResource, c.ns, podTemplate), &v1.PodTemplate{}) + Invokes(testing.NewCreateAction(podtemplatesResource, c.ns, podTemplate), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PodTemplate), err } // Update takes the representation of a podTemplate and updates it. Returns the server's representation of the podTemplate, and an error, if there is any. func (c *FakePodTemplates) Update(ctx context.Context, podTemplate *v1.PodTemplate, opts metav1.UpdateOptions) (result *v1.PodTemplate, err error) { + emptyResult := &v1.PodTemplate{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(podtemplatesResource, c.ns, podTemplate), &v1.PodTemplate{}) + Invokes(testing.NewUpdateAction(podtemplatesResource, c.ns, podTemplate), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PodTemplate), err } @@ -122,11 +126,12 @@ func (c *FakePodTemplates) DeleteCollection(ctx context.Context, opts metav1.Del // Patch applies the patch and returns the patched podTemplate. func (c *FakePodTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodTemplate, err error) { + emptyResult := &v1.PodTemplate{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(podtemplatesResource, c.ns, name, pt, data, subresources...), &v1.PodTemplate{}) + Invokes(testing.NewPatchSubresourceAction(podtemplatesResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PodTemplate), err } @@ -144,11 +149,12 @@ func (c *FakePodTemplates) Apply(ctx context.Context, podTemplate *corev1.PodTem if name == nil { return nil, fmt.Errorf("podTemplate.Name must be provided to Apply") } + emptyResult := &v1.PodTemplate{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(podtemplatesResource, c.ns, *name, types.ApplyPatchType, data), &v1.PodTemplate{}) + Invokes(testing.NewPatchSubresourceAction(podtemplatesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PodTemplate), err } diff --git a/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go b/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go index 1e469c9b1a..25d10d17bd 100644 --- a/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go +++ b/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go @@ -45,22 +45,24 @@ var replicationcontrollersKind = v1.SchemeGroupVersion.WithKind("ReplicationCont // Get takes name of the replicationController, and returns the corresponding replicationController object, and an error if there is any. func (c *FakeReplicationControllers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ReplicationController, err error) { + emptyResult := &v1.ReplicationController{} obj, err := c.Fake. - Invokes(testing.NewGetAction(replicationcontrollersResource, c.ns, name), &v1.ReplicationController{}) + Invokes(testing.NewGetAction(replicationcontrollersResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ReplicationController), err } // List takes label and field selectors, and returns the list of ReplicationControllers that match those selectors. func (c *FakeReplicationControllers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicationControllerList, err error) { + emptyResult := &v1.ReplicationControllerList{} obj, err := c.Fake. - Invokes(testing.NewListAction(replicationcontrollersResource, replicationcontrollersKind, c.ns, opts), &v1.ReplicationControllerList{}) + Invokes(testing.NewListAction(replicationcontrollersResource, replicationcontrollersKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -85,34 +87,37 @@ func (c *FakeReplicationControllers) Watch(ctx context.Context, opts metav1.List // Create takes the representation of a replicationController and creates it. Returns the server's representation of the replicationController, and an error, if there is any. func (c *FakeReplicationControllers) Create(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.CreateOptions) (result *v1.ReplicationController, err error) { + emptyResult := &v1.ReplicationController{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(replicationcontrollersResource, c.ns, replicationController), &v1.ReplicationController{}) + Invokes(testing.NewCreateAction(replicationcontrollersResource, c.ns, replicationController), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ReplicationController), err } // Update takes the representation of a replicationController and updates it. Returns the server's representation of the replicationController, and an error, if there is any. func (c *FakeReplicationControllers) Update(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.UpdateOptions) (result *v1.ReplicationController, err error) { + emptyResult := &v1.ReplicationController{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(replicationcontrollersResource, c.ns, replicationController), &v1.ReplicationController{}) + Invokes(testing.NewUpdateAction(replicationcontrollersResource, c.ns, replicationController), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ReplicationController), 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 *FakeReplicationControllers) UpdateStatus(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.UpdateOptions) (*v1.ReplicationController, error) { +func (c *FakeReplicationControllers) UpdateStatus(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.UpdateOptions) (result *v1.ReplicationController, err error) { + emptyResult := &v1.ReplicationController{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(replicationcontrollersResource, "status", c.ns, replicationController), &v1.ReplicationController{}) + Invokes(testing.NewUpdateSubresourceAction(replicationcontrollersResource, "status", c.ns, replicationController), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ReplicationController), err } @@ -135,11 +140,12 @@ func (c *FakeReplicationControllers) DeleteCollection(ctx context.Context, opts // Patch applies the patch and returns the patched replicationController. func (c *FakeReplicationControllers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ReplicationController, err error) { + emptyResult := &v1.ReplicationController{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicationcontrollersResource, c.ns, name, pt, data, subresources...), &v1.ReplicationController{}) + Invokes(testing.NewPatchSubresourceAction(replicationcontrollersResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ReplicationController), err } @@ -157,11 +163,12 @@ func (c *FakeReplicationControllers) Apply(ctx context.Context, replicationContr if name == nil { return nil, fmt.Errorf("replicationController.Name must be provided to Apply") } + emptyResult := &v1.ReplicationController{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicationcontrollersResource, c.ns, *name, types.ApplyPatchType, data), &v1.ReplicationController{}) + Invokes(testing.NewPatchSubresourceAction(replicationcontrollersResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ReplicationController), err } @@ -180,33 +187,36 @@ func (c *FakeReplicationControllers) ApplyStatus(ctx context.Context, replicatio if name == nil { return nil, fmt.Errorf("replicationController.Name must be provided to Apply") } + emptyResult := &v1.ReplicationController{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicationcontrollersResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.ReplicationController{}) + Invokes(testing.NewPatchSubresourceAction(replicationcontrollersResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ReplicationController), err } // GetScale takes name of the replicationController, and returns the corresponding scale object, and an error if there is any. func (c *FakeReplicationControllers) GetScale(ctx context.Context, replicationControllerName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { + emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewGetSubresourceAction(replicationcontrollersResource, c.ns, "scale", replicationControllerName), &autoscalingv1.Scale{}) + Invokes(testing.NewGetSubresourceAction(replicationcontrollersResource, c.ns, "scale", replicationControllerName), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*autoscalingv1.Scale), err } // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *FakeReplicationControllers) UpdateScale(ctx context.Context, replicationControllerName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { + emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(replicationcontrollersResource, "scale", c.ns, scale), &autoscalingv1.Scale{}) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*autoscalingv1.Scale), err } diff --git a/kubernetes/typed/core/v1/fake/fake_resourcequota.go b/kubernetes/typed/core/v1/fake/fake_resourcequota.go index 87664985ce..298b155f9c 100644 --- a/kubernetes/typed/core/v1/fake/fake_resourcequota.go +++ b/kubernetes/typed/core/v1/fake/fake_resourcequota.go @@ -44,22 +44,24 @@ var resourcequotasKind = v1.SchemeGroupVersion.WithKind("ResourceQuota") // Get takes name of the resourceQuota, and returns the corresponding resourceQuota object, and an error if there is any. func (c *FakeResourceQuotas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ResourceQuota, err error) { + emptyResult := &v1.ResourceQuota{} obj, err := c.Fake. - Invokes(testing.NewGetAction(resourcequotasResource, c.ns, name), &v1.ResourceQuota{}) + Invokes(testing.NewGetAction(resourcequotasResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ResourceQuota), err } // List takes label and field selectors, and returns the list of ResourceQuotas that match those selectors. func (c *FakeResourceQuotas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ResourceQuotaList, err error) { + emptyResult := &v1.ResourceQuotaList{} obj, err := c.Fake. - Invokes(testing.NewListAction(resourcequotasResource, resourcequotasKind, c.ns, opts), &v1.ResourceQuotaList{}) + Invokes(testing.NewListAction(resourcequotasResource, resourcequotasKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeResourceQuotas) Watch(ctx context.Context, opts metav1.ListOptions) // Create takes the representation of a resourceQuota and creates it. Returns the server's representation of the resourceQuota, and an error, if there is any. func (c *FakeResourceQuotas) Create(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.CreateOptions) (result *v1.ResourceQuota, err error) { + emptyResult := &v1.ResourceQuota{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(resourcequotasResource, c.ns, resourceQuota), &v1.ResourceQuota{}) + Invokes(testing.NewCreateAction(resourcequotasResource, c.ns, resourceQuota), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ResourceQuota), err } // Update takes the representation of a resourceQuota and updates it. Returns the server's representation of the resourceQuota, and an error, if there is any. func (c *FakeResourceQuotas) Update(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.UpdateOptions) (result *v1.ResourceQuota, err error) { + emptyResult := &v1.ResourceQuota{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(resourcequotasResource, c.ns, resourceQuota), &v1.ResourceQuota{}) + Invokes(testing.NewUpdateAction(resourcequotasResource, c.ns, resourceQuota), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ResourceQuota), err } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeResourceQuotas) UpdateStatus(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.UpdateOptions) (*v1.ResourceQuota, error) { +func (c *FakeResourceQuotas) UpdateStatus(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.UpdateOptions) (result *v1.ResourceQuota, err error) { + emptyResult := &v1.ResourceQuota{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(resourcequotasResource, "status", c.ns, resourceQuota), &v1.ResourceQuota{}) + Invokes(testing.NewUpdateSubresourceAction(resourcequotasResource, "status", c.ns, resourceQuota), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ResourceQuota), err } @@ -134,11 +139,12 @@ func (c *FakeResourceQuotas) DeleteCollection(ctx context.Context, opts metav1.D // Patch applies the patch and returns the patched resourceQuota. func (c *FakeResourceQuotas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ResourceQuota, err error) { + emptyResult := &v1.ResourceQuota{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourcequotasResource, c.ns, name, pt, data, subresources...), &v1.ResourceQuota{}) + Invokes(testing.NewPatchSubresourceAction(resourcequotasResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ResourceQuota), err } @@ -156,11 +162,12 @@ func (c *FakeResourceQuotas) Apply(ctx context.Context, resourceQuota *corev1.Re if name == nil { return nil, fmt.Errorf("resourceQuota.Name must be provided to Apply") } + emptyResult := &v1.ResourceQuota{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourcequotasResource, c.ns, *name, types.ApplyPatchType, data), &v1.ResourceQuota{}) + Invokes(testing.NewPatchSubresourceAction(resourcequotasResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ResourceQuota), err } @@ -179,11 +186,12 @@ func (c *FakeResourceQuotas) ApplyStatus(ctx context.Context, resourceQuota *cor if name == nil { return nil, fmt.Errorf("resourceQuota.Name must be provided to Apply") } + emptyResult := &v1.ResourceQuota{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourcequotasResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.ResourceQuota{}) + Invokes(testing.NewPatchSubresourceAction(resourcequotasResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ResourceQuota), err } diff --git a/kubernetes/typed/core/v1/fake/fake_secret.go b/kubernetes/typed/core/v1/fake/fake_secret.go index 90035a7037..e5dbb6bf18 100644 --- a/kubernetes/typed/core/v1/fake/fake_secret.go +++ b/kubernetes/typed/core/v1/fake/fake_secret.go @@ -44,22 +44,24 @@ var secretsKind = v1.SchemeGroupVersion.WithKind("Secret") // Get takes name of the secret, and returns the corresponding secret object, and an error if there is any. func (c *FakeSecrets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Secret, err error) { + emptyResult := &v1.Secret{} obj, err := c.Fake. - Invokes(testing.NewGetAction(secretsResource, c.ns, name), &v1.Secret{}) + Invokes(testing.NewGetAction(secretsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Secret), err } // List takes label and field selectors, and returns the list of Secrets that match those selectors. func (c *FakeSecrets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SecretList, err error) { + emptyResult := &v1.SecretList{} obj, err := c.Fake. - Invokes(testing.NewListAction(secretsResource, secretsKind, c.ns, opts), &v1.SecretList{}) + Invokes(testing.NewListAction(secretsResource, secretsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeSecrets) Watch(ctx context.Context, opts metav1.ListOptions) (watch // Create takes the representation of a secret and creates it. Returns the server's representation of the secret, and an error, if there is any. func (c *FakeSecrets) Create(ctx context.Context, secret *v1.Secret, opts metav1.CreateOptions) (result *v1.Secret, err error) { + emptyResult := &v1.Secret{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(secretsResource, c.ns, secret), &v1.Secret{}) + Invokes(testing.NewCreateAction(secretsResource, c.ns, secret), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Secret), err } // Update takes the representation of a secret and updates it. Returns the server's representation of the secret, and an error, if there is any. func (c *FakeSecrets) Update(ctx context.Context, secret *v1.Secret, opts metav1.UpdateOptions) (result *v1.Secret, err error) { + emptyResult := &v1.Secret{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(secretsResource, c.ns, secret), &v1.Secret{}) + Invokes(testing.NewUpdateAction(secretsResource, c.ns, secret), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Secret), err } @@ -122,11 +126,12 @@ func (c *FakeSecrets) DeleteCollection(ctx context.Context, opts metav1.DeleteOp // Patch applies the patch and returns the patched secret. func (c *FakeSecrets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Secret, err error) { + emptyResult := &v1.Secret{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(secretsResource, c.ns, name, pt, data, subresources...), &v1.Secret{}) + Invokes(testing.NewPatchSubresourceAction(secretsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Secret), err } @@ -144,11 +149,12 @@ func (c *FakeSecrets) Apply(ctx context.Context, secret *corev1.SecretApplyConfi if name == nil { return nil, fmt.Errorf("secret.Name must be provided to Apply") } + emptyResult := &v1.Secret{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(secretsResource, c.ns, *name, types.ApplyPatchType, data), &v1.Secret{}) + Invokes(testing.NewPatchSubresourceAction(secretsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Secret), err } diff --git a/kubernetes/typed/core/v1/fake/fake_service.go b/kubernetes/typed/core/v1/fake/fake_service.go index 514ab19e39..064abc18fd 100644 --- a/kubernetes/typed/core/v1/fake/fake_service.go +++ b/kubernetes/typed/core/v1/fake/fake_service.go @@ -44,22 +44,24 @@ var servicesKind = v1.SchemeGroupVersion.WithKind("Service") // Get takes name of the service, and returns the corresponding service object, and an error if there is any. func (c *FakeServices) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Service, err error) { + emptyResult := &v1.Service{} obj, err := c.Fake. - Invokes(testing.NewGetAction(servicesResource, c.ns, name), &v1.Service{}) + Invokes(testing.NewGetAction(servicesResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Service), err } // List takes label and field selectors, and returns the list of Services that match those selectors. func (c *FakeServices) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceList, err error) { + emptyResult := &v1.ServiceList{} obj, err := c.Fake. - Invokes(testing.NewListAction(servicesResource, servicesKind, c.ns, opts), &v1.ServiceList{}) + Invokes(testing.NewListAction(servicesResource, servicesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeServices) Watch(ctx context.Context, opts metav1.ListOptions) (watc // Create takes the representation of a service and creates it. Returns the server's representation of the service, and an error, if there is any. func (c *FakeServices) Create(ctx context.Context, service *v1.Service, opts metav1.CreateOptions) (result *v1.Service, err error) { + emptyResult := &v1.Service{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(servicesResource, c.ns, service), &v1.Service{}) + Invokes(testing.NewCreateAction(servicesResource, c.ns, service), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Service), err } // Update takes the representation of a service and updates it. Returns the server's representation of the service, and an error, if there is any. func (c *FakeServices) Update(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (result *v1.Service, err error) { + emptyResult := &v1.Service{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(servicesResource, c.ns, service), &v1.Service{}) + Invokes(testing.NewUpdateAction(servicesResource, c.ns, service), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Service), 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 *FakeServices) UpdateStatus(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (*v1.Service, error) { +func (c *FakeServices) UpdateStatus(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (result *v1.Service, err error) { + emptyResult := &v1.Service{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(servicesResource, "status", c.ns, service), &v1.Service{}) + Invokes(testing.NewUpdateSubresourceAction(servicesResource, "status", c.ns, service), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Service), err } @@ -126,11 +131,12 @@ func (c *FakeServices) Delete(ctx context.Context, name string, opts metav1.Dele // Patch applies the patch and returns the patched service. func (c *FakeServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Service, err error) { + emptyResult := &v1.Service{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(servicesResource, c.ns, name, pt, data, subresources...), &v1.Service{}) + Invokes(testing.NewPatchSubresourceAction(servicesResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Service), err } @@ -148,11 +154,12 @@ func (c *FakeServices) Apply(ctx context.Context, service *corev1.ServiceApplyCo if name == nil { return nil, fmt.Errorf("service.Name must be provided to Apply") } + emptyResult := &v1.Service{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(servicesResource, c.ns, *name, types.ApplyPatchType, data), &v1.Service{}) + Invokes(testing.NewPatchSubresourceAction(servicesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Service), err } @@ -171,11 +178,12 @@ func (c *FakeServices) ApplyStatus(ctx context.Context, service *corev1.ServiceA if name == nil { return nil, fmt.Errorf("service.Name must be provided to Apply") } + emptyResult := &v1.Service{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(servicesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.Service{}) + Invokes(testing.NewPatchSubresourceAction(servicesResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Service), err } diff --git a/kubernetes/typed/core/v1/fake/fake_serviceaccount.go b/kubernetes/typed/core/v1/fake/fake_serviceaccount.go index 115ff07123..1ff5bbcbaa 100644 --- a/kubernetes/typed/core/v1/fake/fake_serviceaccount.go +++ b/kubernetes/typed/core/v1/fake/fake_serviceaccount.go @@ -45,22 +45,24 @@ var serviceaccountsKind = v1.SchemeGroupVersion.WithKind("ServiceAccount") // Get takes name of the serviceAccount, and returns the corresponding serviceAccount object, and an error if there is any. func (c *FakeServiceAccounts) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceAccount, err error) { + emptyResult := &v1.ServiceAccount{} obj, err := c.Fake. - Invokes(testing.NewGetAction(serviceaccountsResource, c.ns, name), &v1.ServiceAccount{}) + Invokes(testing.NewGetAction(serviceaccountsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ServiceAccount), err } // List takes label and field selectors, and returns the list of ServiceAccounts that match those selectors. func (c *FakeServiceAccounts) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceAccountList, err error) { + emptyResult := &v1.ServiceAccountList{} obj, err := c.Fake. - Invokes(testing.NewListAction(serviceaccountsResource, serviceaccountsKind, c.ns, opts), &v1.ServiceAccountList{}) + Invokes(testing.NewListAction(serviceaccountsResource, serviceaccountsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -85,22 +87,24 @@ func (c *FakeServiceAccounts) Watch(ctx context.Context, opts metav1.ListOptions // Create takes the representation of a serviceAccount and creates it. Returns the server's representation of the serviceAccount, and an error, if there is any. func (c *FakeServiceAccounts) Create(ctx context.Context, serviceAccount *v1.ServiceAccount, opts metav1.CreateOptions) (result *v1.ServiceAccount, err error) { + emptyResult := &v1.ServiceAccount{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(serviceaccountsResource, c.ns, serviceAccount), &v1.ServiceAccount{}) + Invokes(testing.NewCreateAction(serviceaccountsResource, c.ns, serviceAccount), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ServiceAccount), err } // Update takes the representation of a serviceAccount and updates it. Returns the server's representation of the serviceAccount, and an error, if there is any. func (c *FakeServiceAccounts) Update(ctx context.Context, serviceAccount *v1.ServiceAccount, opts metav1.UpdateOptions) (result *v1.ServiceAccount, err error) { + emptyResult := &v1.ServiceAccount{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(serviceaccountsResource, c.ns, serviceAccount), &v1.ServiceAccount{}) + Invokes(testing.NewUpdateAction(serviceaccountsResource, c.ns, serviceAccount), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ServiceAccount), err } @@ -123,11 +127,12 @@ func (c *FakeServiceAccounts) DeleteCollection(ctx context.Context, opts metav1. // Patch applies the patch and returns the patched serviceAccount. func (c *FakeServiceAccounts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceAccount, err error) { + emptyResult := &v1.ServiceAccount{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(serviceaccountsResource, c.ns, name, pt, data, subresources...), &v1.ServiceAccount{}) + Invokes(testing.NewPatchSubresourceAction(serviceaccountsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ServiceAccount), err } @@ -145,22 +150,24 @@ func (c *FakeServiceAccounts) Apply(ctx context.Context, serviceAccount *corev1. if name == nil { return nil, fmt.Errorf("serviceAccount.Name must be provided to Apply") } + emptyResult := &v1.ServiceAccount{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(serviceaccountsResource, c.ns, *name, types.ApplyPatchType, data), &v1.ServiceAccount{}) + Invokes(testing.NewPatchSubresourceAction(serviceaccountsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ServiceAccount), err } // CreateToken takes the representation of a tokenRequest and creates it. Returns the server's representation of the tokenRequest, and an error, if there is any. func (c *FakeServiceAccounts) CreateToken(ctx context.Context, serviceAccountName string, tokenRequest *authenticationv1.TokenRequest, opts metav1.CreateOptions) (result *authenticationv1.TokenRequest, err error) { + emptyResult := &authenticationv1.TokenRequest{} obj, err := c.Fake. - Invokes(testing.NewCreateSubresourceAction(serviceaccountsResource, serviceAccountName, "token", c.ns, tokenRequest), &authenticationv1.TokenRequest{}) + Invokes(testing.NewCreateSubresourceAction(serviceaccountsResource, serviceAccountName, "token", c.ns, tokenRequest), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*authenticationv1.TokenRequest), err } diff --git a/kubernetes/typed/discovery/v1/fake/fake_endpointslice.go b/kubernetes/typed/discovery/v1/fake/fake_endpointslice.go index d159b5ea9e..843e966062 100644 --- a/kubernetes/typed/discovery/v1/fake/fake_endpointslice.go +++ b/kubernetes/typed/discovery/v1/fake/fake_endpointslice.go @@ -44,22 +44,24 @@ var endpointslicesKind = v1.SchemeGroupVersion.WithKind("EndpointSlice") // Get takes name of the endpointSlice, and returns the corresponding endpointSlice object, and an error if there is any. func (c *FakeEndpointSlices) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.EndpointSlice, err error) { + emptyResult := &v1.EndpointSlice{} obj, err := c.Fake. - Invokes(testing.NewGetAction(endpointslicesResource, c.ns, name), &v1.EndpointSlice{}) + Invokes(testing.NewGetAction(endpointslicesResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.EndpointSlice), err } // List takes label and field selectors, and returns the list of EndpointSlices that match those selectors. func (c *FakeEndpointSlices) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointSliceList, err error) { + emptyResult := &v1.EndpointSliceList{} obj, err := c.Fake. - Invokes(testing.NewListAction(endpointslicesResource, endpointslicesKind, c.ns, opts), &v1.EndpointSliceList{}) + Invokes(testing.NewListAction(endpointslicesResource, endpointslicesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeEndpointSlices) Watch(ctx context.Context, opts metav1.ListOptions) // Create takes the representation of a endpointSlice and creates it. Returns the server's representation of the endpointSlice, and an error, if there is any. func (c *FakeEndpointSlices) Create(ctx context.Context, endpointSlice *v1.EndpointSlice, opts metav1.CreateOptions) (result *v1.EndpointSlice, err error) { + emptyResult := &v1.EndpointSlice{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(endpointslicesResource, c.ns, endpointSlice), &v1.EndpointSlice{}) + Invokes(testing.NewCreateAction(endpointslicesResource, c.ns, endpointSlice), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.EndpointSlice), err } // Update takes the representation of a endpointSlice and updates it. Returns the server's representation of the endpointSlice, and an error, if there is any. func (c *FakeEndpointSlices) Update(ctx context.Context, endpointSlice *v1.EndpointSlice, opts metav1.UpdateOptions) (result *v1.EndpointSlice, err error) { + emptyResult := &v1.EndpointSlice{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(endpointslicesResource, c.ns, endpointSlice), &v1.EndpointSlice{}) + Invokes(testing.NewUpdateAction(endpointslicesResource, c.ns, endpointSlice), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.EndpointSlice), err } @@ -122,11 +126,12 @@ func (c *FakeEndpointSlices) DeleteCollection(ctx context.Context, opts metav1.D // Patch applies the patch and returns the patched endpointSlice. func (c *FakeEndpointSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.EndpointSlice, err error) { + emptyResult := &v1.EndpointSlice{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(endpointslicesResource, c.ns, name, pt, data, subresources...), &v1.EndpointSlice{}) + Invokes(testing.NewPatchSubresourceAction(endpointslicesResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.EndpointSlice), err } @@ -144,11 +149,12 @@ func (c *FakeEndpointSlices) Apply(ctx context.Context, endpointSlice *discovery if name == nil { return nil, fmt.Errorf("endpointSlice.Name must be provided to Apply") } + emptyResult := &v1.EndpointSlice{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(endpointslicesResource, c.ns, *name, types.ApplyPatchType, data), &v1.EndpointSlice{}) + Invokes(testing.NewPatchSubresourceAction(endpointslicesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.EndpointSlice), err } diff --git a/kubernetes/typed/discovery/v1beta1/fake/fake_endpointslice.go b/kubernetes/typed/discovery/v1beta1/fake/fake_endpointslice.go index 2683718113..48b2aa90af 100644 --- a/kubernetes/typed/discovery/v1beta1/fake/fake_endpointslice.go +++ b/kubernetes/typed/discovery/v1beta1/fake/fake_endpointslice.go @@ -44,22 +44,24 @@ var endpointslicesKind = v1beta1.SchemeGroupVersion.WithKind("EndpointSlice") // Get takes name of the endpointSlice, and returns the corresponding endpointSlice object, and an error if there is any. func (c *FakeEndpointSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.EndpointSlice, err error) { + emptyResult := &v1beta1.EndpointSlice{} obj, err := c.Fake. - Invokes(testing.NewGetAction(endpointslicesResource, c.ns, name), &v1beta1.EndpointSlice{}) + Invokes(testing.NewGetAction(endpointslicesResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.EndpointSlice), err } // List takes label and field selectors, and returns the list of EndpointSlices that match those selectors. func (c *FakeEndpointSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EndpointSliceList, err error) { + emptyResult := &v1beta1.EndpointSliceList{} obj, err := c.Fake. - Invokes(testing.NewListAction(endpointslicesResource, endpointslicesKind, c.ns, opts), &v1beta1.EndpointSliceList{}) + Invokes(testing.NewListAction(endpointslicesResource, endpointslicesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeEndpointSlices) Watch(ctx context.Context, opts v1.ListOptions) (wa // Create takes the representation of a endpointSlice and creates it. Returns the server's representation of the endpointSlice, and an error, if there is any. func (c *FakeEndpointSlices) Create(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.CreateOptions) (result *v1beta1.EndpointSlice, err error) { + emptyResult := &v1beta1.EndpointSlice{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(endpointslicesResource, c.ns, endpointSlice), &v1beta1.EndpointSlice{}) + Invokes(testing.NewCreateAction(endpointslicesResource, c.ns, endpointSlice), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.EndpointSlice), err } // Update takes the representation of a endpointSlice and updates it. Returns the server's representation of the endpointSlice, and an error, if there is any. func (c *FakeEndpointSlices) Update(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.UpdateOptions) (result *v1beta1.EndpointSlice, err error) { + emptyResult := &v1beta1.EndpointSlice{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(endpointslicesResource, c.ns, endpointSlice), &v1beta1.EndpointSlice{}) + Invokes(testing.NewUpdateAction(endpointslicesResource, c.ns, endpointSlice), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.EndpointSlice), err } @@ -122,11 +126,12 @@ func (c *FakeEndpointSlices) DeleteCollection(ctx context.Context, opts v1.Delet // Patch applies the patch and returns the patched endpointSlice. func (c *FakeEndpointSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.EndpointSlice, err error) { + emptyResult := &v1beta1.EndpointSlice{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(endpointslicesResource, c.ns, name, pt, data, subresources...), &v1beta1.EndpointSlice{}) + Invokes(testing.NewPatchSubresourceAction(endpointslicesResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.EndpointSlice), err } @@ -144,11 +149,12 @@ func (c *FakeEndpointSlices) Apply(ctx context.Context, endpointSlice *discovery if name == nil { return nil, fmt.Errorf("endpointSlice.Name must be provided to Apply") } + emptyResult := &v1beta1.EndpointSlice{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(endpointslicesResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.EndpointSlice{}) + Invokes(testing.NewPatchSubresourceAction(endpointslicesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.EndpointSlice), err } diff --git a/kubernetes/typed/events/v1/fake/fake_event.go b/kubernetes/typed/events/v1/fake/fake_event.go index 0928781f1e..4207d2d6bf 100644 --- a/kubernetes/typed/events/v1/fake/fake_event.go +++ b/kubernetes/typed/events/v1/fake/fake_event.go @@ -44,22 +44,24 @@ var eventsKind = v1.SchemeGroupVersion.WithKind("Event") // Get takes name of the event, and returns the corresponding event object, and an error if there is any. func (c *FakeEvents) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Event, err error) { + emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewGetAction(eventsResource, c.ns, name), &v1.Event{}) + Invokes(testing.NewGetAction(eventsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Event), err } // List takes label and field selectors, and returns the list of Events that match those selectors. func (c *FakeEvents) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { + emptyResult := &v1.EventList{} obj, err := c.Fake. - Invokes(testing.NewListAction(eventsResource, eventsKind, c.ns, opts), &v1.EventList{}) + Invokes(testing.NewListAction(eventsResource, eventsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeEvents) Watch(ctx context.Context, opts metav1.ListOptions) (watch. // Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any. func (c *FakeEvents) Create(ctx context.Context, event *v1.Event, opts metav1.CreateOptions) (result *v1.Event, err error) { + emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(eventsResource, c.ns, event), &v1.Event{}) + Invokes(testing.NewCreateAction(eventsResource, c.ns, event), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Event), err } // Update takes the representation of a event and updates it. Returns the server's representation of the event, and an error, if there is any. func (c *FakeEvents) Update(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (result *v1.Event, err error) { + emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(eventsResource, c.ns, event), &v1.Event{}) + Invokes(testing.NewUpdateAction(eventsResource, c.ns, event), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Event), err } @@ -122,11 +126,12 @@ func (c *FakeEvents) DeleteCollection(ctx context.Context, opts metav1.DeleteOpt // Patch applies the patch and returns the patched event. func (c *FakeEvents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Event, err error) { + emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, name, pt, data, subresources...), &v1.Event{}) + Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Event), err } @@ -144,11 +149,12 @@ func (c *FakeEvents) Apply(ctx context.Context, event *eventsv1.EventApplyConfig if name == nil { return nil, fmt.Errorf("event.Name must be provided to Apply") } + emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, *name, types.ApplyPatchType, data), &v1.Event{}) + Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Event), err } diff --git a/kubernetes/typed/events/v1beta1/fake/fake_event.go b/kubernetes/typed/events/v1beta1/fake/fake_event.go index 522b4dc063..cba8222970 100644 --- a/kubernetes/typed/events/v1beta1/fake/fake_event.go +++ b/kubernetes/typed/events/v1beta1/fake/fake_event.go @@ -44,22 +44,24 @@ var eventsKind = v1beta1.SchemeGroupVersion.WithKind("Event") // Get takes name of the event, and returns the corresponding event object, and an error if there is any. func (c *FakeEvents) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Event, err error) { + emptyResult := &v1beta1.Event{} obj, err := c.Fake. - Invokes(testing.NewGetAction(eventsResource, c.ns, name), &v1beta1.Event{}) + Invokes(testing.NewGetAction(eventsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Event), err } // List takes label and field selectors, and returns the list of Events that match those selectors. func (c *FakeEvents) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EventList, err error) { + emptyResult := &v1beta1.EventList{} obj, err := c.Fake. - Invokes(testing.NewListAction(eventsResource, eventsKind, c.ns, opts), &v1beta1.EventList{}) + Invokes(testing.NewListAction(eventsResource, eventsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeEvents) Watch(ctx context.Context, opts v1.ListOptions) (watch.Inte // Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any. func (c *FakeEvents) Create(ctx context.Context, event *v1beta1.Event, opts v1.CreateOptions) (result *v1beta1.Event, err error) { + emptyResult := &v1beta1.Event{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(eventsResource, c.ns, event), &v1beta1.Event{}) + Invokes(testing.NewCreateAction(eventsResource, c.ns, event), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Event), err } // Update takes the representation of a event and updates it. Returns the server's representation of the event, and an error, if there is any. func (c *FakeEvents) Update(ctx context.Context, event *v1beta1.Event, opts v1.UpdateOptions) (result *v1beta1.Event, err error) { + emptyResult := &v1beta1.Event{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(eventsResource, c.ns, event), &v1beta1.Event{}) + Invokes(testing.NewUpdateAction(eventsResource, c.ns, event), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Event), err } @@ -122,11 +126,12 @@ func (c *FakeEvents) DeleteCollection(ctx context.Context, opts v1.DeleteOptions // Patch applies the patch and returns the patched event. func (c *FakeEvents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Event, err error) { + emptyResult := &v1beta1.Event{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, name, pt, data, subresources...), &v1beta1.Event{}) + Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Event), err } @@ -144,11 +149,12 @@ func (c *FakeEvents) Apply(ctx context.Context, event *eventsv1beta1.EventApplyC if name == nil { return nil, fmt.Errorf("event.Name must be provided to Apply") } + emptyResult := &v1beta1.Event{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.Event{}) + Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Event), err } diff --git a/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go b/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go index abe3d2da1f..3bedb4264d 100644 --- a/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go +++ b/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go @@ -44,22 +44,24 @@ var daemonsetsKind = v1beta1.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 *v1beta1.DaemonSet, err error) { + emptyResult := &v1beta1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewGetAction(daemonsetsResource, c.ns, name), &v1beta1.DaemonSet{}) + Invokes(testing.NewGetAction(daemonsetsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.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 *v1beta1.DaemonSetList, err error) { + emptyResult := &v1beta1.DaemonSetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(daemonsetsResource, daemonsetsKind, c.ns, opts), &v1beta1.DaemonSetList{}) + Invokes(testing.NewListAction(daemonsetsResource, daemonsetsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeDaemonSets) Watch(ctx context.Context, opts v1.ListOptions) (watch. // 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 *v1beta1.DaemonSet, opts v1.CreateOptions) (result *v1beta1.DaemonSet, err error) { + emptyResult := &v1beta1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(daemonsetsResource, c.ns, daemonSet), &v1beta1.DaemonSet{}) + Invokes(testing.NewCreateAction(daemonsetsResource, c.ns, daemonSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.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 *v1beta1.DaemonSet, opts v1.UpdateOptions) (result *v1beta1.DaemonSet, err error) { + emptyResult := &v1beta1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), &v1beta1.DaemonSet{}) + Invokes(testing.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.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 *v1beta1.DaemonSet, opts v1.UpdateOptions) (*v1beta1.DaemonSet, error) { +func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (result *v1beta1.DaemonSet, err error) { + emptyResult := &v1beta1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), &v1beta1.DaemonSet{}) + Invokes(testing.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.DaemonSet), err } @@ -134,11 +139,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 *v1beta1.DaemonSet, err error) { + emptyResult := &v1beta1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, pt, data, subresources...), &v1beta1.DaemonSet{}) + Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.DaemonSet), err } @@ -156,11 +162,12 @@ func (c *FakeDaemonSets) Apply(ctx context.Context, daemonSet *extensionsv1beta1 if name == nil { return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") } + emptyResult := &v1beta1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.DaemonSet{}) + Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.DaemonSet), err } @@ -179,11 +186,12 @@ func (c *FakeDaemonSets) ApplyStatus(ctx context.Context, daemonSet *extensionsv if name == nil { return nil, fmt.Errorf("daemonSet.Name must be provided to Apply") } + emptyResult := &v1beta1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.DaemonSet{}) + Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.DaemonSet), err } diff --git a/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go b/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go index e399361a92..16be81f40f 100644 --- a/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go +++ b/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go @@ -44,22 +44,24 @@ var deploymentsKind = v1beta1.SchemeGroupVersion.WithKind("Deployment") // Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. func (c *FakeDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Deployment, err error) { + emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), &v1beta1.Deployment{}) + Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Deployment), err } // List takes label and field selectors, and returns the list of Deployments that match those selectors. func (c *FakeDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { + emptyResult := &v1beta1.DeploymentList{} obj, err := c.Fake. - Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), &v1beta1.DeploymentList{}) + Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch // Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. func (c *FakeDeployments) Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (result *v1beta1.Deployment, err error) { + emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), &v1beta1.Deployment{}) + Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Deployment), err } // Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. func (c *FakeDeployments) Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { + emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), &v1beta1.Deployment{}) + Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Deployment), 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 *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (*v1beta1.Deployment, error) { +func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { + emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), &v1beta1.Deployment{}) + Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Deployment), err } @@ -134,11 +139,12 @@ func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOp // Patch applies the patch and returns the patched deployment. func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Deployment, err error) { + emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), &v1beta1.Deployment{}) + Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Deployment), err } @@ -156,11 +162,12 @@ func (c *FakeDeployments) Apply(ctx context.Context, deployment *extensionsv1bet if name == nil { return nil, fmt.Errorf("deployment.Name must be provided to Apply") } + emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.Deployment{}) + Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Deployment), err } @@ -179,33 +186,36 @@ func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *extension if name == nil { return nil, fmt.Errorf("deployment.Name must be provided to Apply") } + emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.Deployment{}) + Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Deployment), err } // GetScale takes name of the deployment, and returns the corresponding scale object, and an error if there is any. func (c *FakeDeployments) GetScale(ctx context.Context, deploymentName string, options v1.GetOptions) (result *v1beta1.Scale, err error) { + emptyResult := &v1beta1.Scale{} obj, err := c.Fake. - Invokes(testing.NewGetSubresourceAction(deploymentsResource, c.ns, "scale", deploymentName), &v1beta1.Scale{}) + Invokes(testing.NewGetSubresourceAction(deploymentsResource, c.ns, "scale", deploymentName), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Scale), err } // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *FakeDeployments) UpdateScale(ctx context.Context, deploymentName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (result *v1beta1.Scale, err error) { + emptyResult := &v1beta1.Scale{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "scale", c.ns, scale), &v1beta1.Scale{}) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Scale), err } @@ -220,11 +230,12 @@ func (c *FakeDeployments) ApplyScale(ctx context.Context, deploymentName string, if err != nil { return nil, err } + emptyResult := &v1beta1.Scale{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, deploymentName, types.ApplyPatchType, data, "status"), &v1beta1.Scale{}) + Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, deploymentName, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Scale), err } diff --git a/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go b/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go index 48ae51e80d..69f3dc9ba9 100644 --- a/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go +++ b/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go @@ -44,22 +44,24 @@ var ingressesKind = v1beta1.SchemeGroupVersion.WithKind("Ingress") // Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. func (c *FakeIngresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Ingress, err error) { + emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewGetAction(ingressesResource, c.ns, name), &v1beta1.Ingress{}) + Invokes(testing.NewGetAction(ingressesResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Ingress), err } // List takes label and field selectors, and returns the list of Ingresses that match those selectors. func (c *FakeIngresses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { + emptyResult := &v1beta1.IngressList{} obj, err := c.Fake. - Invokes(testing.NewListAction(ingressesResource, ingressesKind, c.ns, opts), &v1beta1.IngressList{}) + Invokes(testing.NewListAction(ingressesResource, ingressesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeIngresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.I // Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any. func (c *FakeIngresses) Create(ctx context.Context, ingress *v1beta1.Ingress, opts v1.CreateOptions) (result *v1beta1.Ingress, err error) { + emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(ingressesResource, c.ns, ingress), &v1beta1.Ingress{}) + Invokes(testing.NewCreateAction(ingressesResource, c.ns, ingress), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Ingress), err } // Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any. func (c *FakeIngresses) Update(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { + emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(ingressesResource, c.ns, ingress), &v1beta1.Ingress{}) + Invokes(testing.NewUpdateAction(ingressesResource, c.ns, ingress), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Ingress), 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 *FakeIngresses) UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (*v1beta1.Ingress, error) { +func (c *FakeIngresses) UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { + emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(ingressesResource, "status", c.ns, ingress), &v1beta1.Ingress{}) + Invokes(testing.NewUpdateSubresourceAction(ingressesResource, "status", c.ns, ingress), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Ingress), err } @@ -134,11 +139,12 @@ func (c *FakeIngresses) DeleteCollection(ctx context.Context, opts v1.DeleteOpti // Patch applies the patch and returns the patched ingress. func (c *FakeIngresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Ingress, err error) { + emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, name, pt, data, subresources...), &v1beta1.Ingress{}) + Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Ingress), err } @@ -156,11 +162,12 @@ func (c *FakeIngresses) Apply(ctx context.Context, ingress *extensionsv1beta1.In if name == nil { return nil, fmt.Errorf("ingress.Name must be provided to Apply") } + emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.Ingress{}) + Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Ingress), err } @@ -179,11 +186,12 @@ func (c *FakeIngresses) ApplyStatus(ctx context.Context, ingress *extensionsv1be if name == nil { return nil, fmt.Errorf("ingress.Name must be provided to Apply") } + emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.Ingress{}) + Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Ingress), err } diff --git a/kubernetes/typed/extensions/v1beta1/fake/fake_networkpolicy.go b/kubernetes/typed/extensions/v1beta1/fake/fake_networkpolicy.go index a32022140a..8e36b10275 100644 --- a/kubernetes/typed/extensions/v1beta1/fake/fake_networkpolicy.go +++ b/kubernetes/typed/extensions/v1beta1/fake/fake_networkpolicy.go @@ -44,22 +44,24 @@ var networkpoliciesKind = v1beta1.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 *v1beta1.NetworkPolicy, err error) { + emptyResult := &v1beta1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewGetAction(networkpoliciesResource, c.ns, name), &v1beta1.NetworkPolicy{}) + Invokes(testing.NewGetAction(networkpoliciesResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.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 *v1beta1.NetworkPolicyList, err error) { + emptyResult := &v1beta1.NetworkPolicyList{} obj, err := c.Fake. - Invokes(testing.NewListAction(networkpoliciesResource, networkpoliciesKind, c.ns, opts), &v1beta1.NetworkPolicyList{}) + Invokes(testing.NewListAction(networkpoliciesResource, networkpoliciesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeNetworkPolicies) Watch(ctx context.Context, opts v1.ListOptions) (w // 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 *v1beta1.NetworkPolicy, opts v1.CreateOptions) (result *v1beta1.NetworkPolicy, err error) { + emptyResult := &v1beta1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(networkpoliciesResource, c.ns, networkPolicy), &v1beta1.NetworkPolicy{}) + Invokes(testing.NewCreateAction(networkpoliciesResource, c.ns, networkPolicy), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.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 *v1beta1.NetworkPolicy, opts v1.UpdateOptions) (result *v1beta1.NetworkPolicy, err error) { + emptyResult := &v1beta1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(networkpoliciesResource, c.ns, networkPolicy), &v1beta1.NetworkPolicy{}) + Invokes(testing.NewUpdateAction(networkpoliciesResource, c.ns, networkPolicy), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.NetworkPolicy), err } @@ -122,11 +126,12 @@ func (c *FakeNetworkPolicies) DeleteCollection(ctx context.Context, opts v1.Dele // Patch applies the patch and returns the patched networkPolicy. func (c *FakeNetworkPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.NetworkPolicy, err error) { + emptyResult := &v1beta1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(networkpoliciesResource, c.ns, name, pt, data, subresources...), &v1beta1.NetworkPolicy{}) + Invokes(testing.NewPatchSubresourceAction(networkpoliciesResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.NetworkPolicy), err } @@ -144,11 +149,12 @@ func (c *FakeNetworkPolicies) Apply(ctx context.Context, networkPolicy *extensio if name == nil { return nil, fmt.Errorf("networkPolicy.Name must be provided to Apply") } + emptyResult := &v1beta1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(networkpoliciesResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.NetworkPolicy{}) + Invokes(testing.NewPatchSubresourceAction(networkpoliciesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.NetworkPolicy), err } diff --git a/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go b/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go index 42da6fa8b6..b8031f709e 100644 --- a/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go +++ b/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go @@ -44,22 +44,24 @@ var replicasetsKind = v1beta1.SchemeGroupVersion.WithKind("ReplicaSet") // Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any. func (c *FakeReplicaSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ReplicaSet, err error) { + emptyResult := &v1beta1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewGetAction(replicasetsResource, c.ns, name), &v1beta1.ReplicaSet{}) + Invokes(testing.NewGetAction(replicasetsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ReplicaSet), err } // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. func (c *FakeReplicaSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ReplicaSetList, err error) { + emptyResult := &v1beta1.ReplicaSetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(replicasetsResource, replicasetsKind, c.ns, opts), &v1beta1.ReplicaSetList{}) + Invokes(testing.NewListAction(replicasetsResource, replicasetsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeReplicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch // Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any. func (c *FakeReplicaSets) Create(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.CreateOptions) (result *v1beta1.ReplicaSet, err error) { + emptyResult := &v1beta1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(replicasetsResource, c.ns, replicaSet), &v1beta1.ReplicaSet{}) + Invokes(testing.NewCreateAction(replicasetsResource, c.ns, replicaSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ReplicaSet), err } // Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any. func (c *FakeReplicaSets) Update(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.UpdateOptions) (result *v1beta1.ReplicaSet, err error) { + emptyResult := &v1beta1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(replicasetsResource, c.ns, replicaSet), &v1beta1.ReplicaSet{}) + Invokes(testing.NewUpdateAction(replicasetsResource, c.ns, replicaSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ReplicaSet), 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 *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.UpdateOptions) (*v1beta1.ReplicaSet, error) { +func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.UpdateOptions) (result *v1beta1.ReplicaSet, err error) { + emptyResult := &v1beta1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), &v1beta1.ReplicaSet{}) + Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ReplicaSet), err } @@ -134,11 +139,12 @@ func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOp // Patch applies the patch and returns the patched replicaSet. func (c *FakeReplicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ReplicaSet, err error) { + emptyResult := &v1beta1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, pt, data, subresources...), &v1beta1.ReplicaSet{}) + Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ReplicaSet), err } @@ -156,11 +162,12 @@ func (c *FakeReplicaSets) Apply(ctx context.Context, replicaSet *extensionsv1bet if name == nil { return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") } + emptyResult := &v1beta1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.ReplicaSet{}) + Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ReplicaSet), err } @@ -179,33 +186,36 @@ func (c *FakeReplicaSets) ApplyStatus(ctx context.Context, replicaSet *extension if name == nil { return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") } + emptyResult := &v1beta1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.ReplicaSet{}) + Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ReplicaSet), err } // GetScale takes name of the replicaSet, and returns the corresponding scale object, and an error if there is any. func (c *FakeReplicaSets) GetScale(ctx context.Context, replicaSetName string, options v1.GetOptions) (result *v1beta1.Scale, err error) { + emptyResult := &v1beta1.Scale{} obj, err := c.Fake. - Invokes(testing.NewGetSubresourceAction(replicasetsResource, c.ns, "scale", replicaSetName), &v1beta1.Scale{}) + Invokes(testing.NewGetSubresourceAction(replicasetsResource, c.ns, "scale", replicaSetName), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Scale), err } // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *FakeReplicaSets) UpdateScale(ctx context.Context, replicaSetName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (result *v1beta1.Scale, err error) { + emptyResult := &v1beta1.Scale{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "scale", c.ns, scale), &v1beta1.Scale{}) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Scale), err } @@ -220,11 +230,12 @@ func (c *FakeReplicaSets) ApplyScale(ctx context.Context, replicaSetName string, if err != nil { return nil, err } + emptyResult := &v1beta1.Scale{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, replicaSetName, types.ApplyPatchType, data, "status"), &v1beta1.Scale{}) + Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, replicaSetName, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Scale), err } diff --git a/kubernetes/typed/flowcontrol/v1/fake/fake_flowschema.go b/kubernetes/typed/flowcontrol/v1/fake/fake_flowschema.go index 922a60d89b..20e9dbdb8f 100644 --- a/kubernetes/typed/flowcontrol/v1/fake/fake_flowschema.go +++ b/kubernetes/typed/flowcontrol/v1/fake/fake_flowschema.go @@ -43,20 +43,22 @@ var flowschemasKind = v1.SchemeGroupVersion.WithKind("FlowSchema") // Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.FlowSchema, err error) { + emptyResult := &v1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(flowschemasResource, name), &v1.FlowSchema{}) + Invokes(testing.NewRootGetAction(flowschemasResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.FlowSchema), err } // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. func (c *FakeFlowSchemas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FlowSchemaList, err error) { + emptyResult := &v1.FlowSchemaList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(flowschemasResource, flowschemasKind, opts), &v1.FlowSchemaList{}) + Invokes(testing.NewRootListAction(flowschemasResource, flowschemasKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,31 +82,34 @@ func (c *FakeFlowSchemas) Watch(ctx context.Context, opts metav1.ListOptions) (w // Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.CreateOptions) (result *v1.FlowSchema, err error) { + emptyResult := &v1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(flowschemasResource, flowSchema), &v1.FlowSchema{}) + Invokes(testing.NewRootCreateAction(flowschemasResource, flowSchema), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.FlowSchema), err } // Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (result *v1.FlowSchema, err error) { + emptyResult := &v1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(flowschemasResource, flowSchema), &v1.FlowSchema{}) + Invokes(testing.NewRootUpdateAction(flowschemasResource, flowSchema), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.FlowSchema), 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 *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (*v1.FlowSchema, error) { +func (c *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (result *v1.FlowSchema, err error) { + emptyResult := &v1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(flowschemasResource, "status", flowSchema), &v1.FlowSchema{}) + Invokes(testing.NewRootUpdateSubresourceAction(flowschemasResource, "status", flowSchema), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.FlowSchema), err } @@ -126,10 +131,11 @@ func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts metav1.Dele // Patch applies the patch and returns the patched flowSchema. func (c *FakeFlowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FlowSchema, err error) { + emptyResult := &v1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, name, pt, data, subresources...), &v1.FlowSchema{}) + Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.FlowSchema), err } @@ -147,10 +153,11 @@ func (c *FakeFlowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1.F if name == nil { return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") } + emptyResult := &v1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data), &v1.FlowSchema{}) + Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.FlowSchema), err } @@ -169,10 +176,11 @@ func (c *FakeFlowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontr if name == nil { return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") } + emptyResult := &v1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data, "status"), &v1.FlowSchema{}) + Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.FlowSchema), err } diff --git a/kubernetes/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.go index 27d9586748..239a071361 100644 --- a/kubernetes/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.go @@ -43,20 +43,22 @@ var prioritylevelconfigurationsKind = v1.SchemeGroupVersion.WithKind("PriorityLe // Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PriorityLevelConfiguration, err error) { + emptyResult := &v1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(prioritylevelconfigurationsResource, name), &v1.PriorityLevelConfiguration{}) + Invokes(testing.NewRootGetAction(prioritylevelconfigurationsResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PriorityLevelConfiguration), err } // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityLevelConfigurationList, err error) { + emptyResult := &v1.PriorityLevelConfigurationList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), &v1.PriorityLevelConfigurationList{}) + Invokes(testing.NewRootListAction(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,31 +82,34 @@ func (c *FakePriorityLevelConfigurations) Watch(ctx context.Context, opts metav1 // Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.CreateOptions) (result *v1.PriorityLevelConfiguration, err error) { + emptyResult := &v1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), &v1.PriorityLevelConfiguration{}) + Invokes(testing.NewRootCreateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PriorityLevelConfiguration), err } // Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (result *v1.PriorityLevelConfiguration, err error) { + emptyResult := &v1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), &v1.PriorityLevelConfiguration{}) + Invokes(testing.NewRootUpdateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PriorityLevelConfiguration), 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 *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*v1.PriorityLevelConfiguration, error) { +func (c *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (result *v1.PriorityLevelConfiguration, err error) { + emptyResult := &v1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration), &v1.PriorityLevelConfiguration{}) + Invokes(testing.NewRootUpdateSubresourceAction(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PriorityLevelConfiguration), err } @@ -126,10 +131,11 @@ func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, // Patch applies the patch and returns the patched priorityLevelConfiguration. func (c *FakePriorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityLevelConfiguration, err error) { + emptyResult := &v1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, name, pt, data, subresources...), &v1.PriorityLevelConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PriorityLevelConfiguration), err } @@ -147,10 +153,11 @@ func (c *FakePriorityLevelConfigurations) Apply(ctx context.Context, priorityLev if name == nil { return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") } + emptyResult := &v1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data), &v1.PriorityLevelConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PriorityLevelConfiguration), err } @@ -169,10 +176,11 @@ func (c *FakePriorityLevelConfigurations) ApplyStatus(ctx context.Context, prior if name == nil { return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") } + emptyResult := &v1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, "status"), &v1.PriorityLevelConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PriorityLevelConfiguration), err } diff --git a/kubernetes/typed/flowcontrol/v1beta1/fake/fake_flowschema.go b/kubernetes/typed/flowcontrol/v1beta1/fake/fake_flowschema.go index be7a7e390f..9a94a0d340 100644 --- a/kubernetes/typed/flowcontrol/v1beta1/fake/fake_flowschema.go +++ b/kubernetes/typed/flowcontrol/v1beta1/fake/fake_flowschema.go @@ -43,20 +43,22 @@ var flowschemasKind = v1beta1.SchemeGroupVersion.WithKind("FlowSchema") // Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.FlowSchema, err error) { + emptyResult := &v1beta1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(flowschemasResource, name), &v1beta1.FlowSchema{}) + Invokes(testing.NewRootGetAction(flowschemasResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.FlowSchema), err } // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. func (c *FakeFlowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.FlowSchemaList, err error) { + emptyResult := &v1beta1.FlowSchemaList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(flowschemasResource, flowschemasKind, opts), &v1beta1.FlowSchemaList{}) + Invokes(testing.NewRootListAction(flowschemasResource, flowschemasKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,31 +82,34 @@ func (c *FakeFlowSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch // Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1beta1.FlowSchema, opts v1.CreateOptions) (result *v1beta1.FlowSchema, err error) { + emptyResult := &v1beta1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(flowschemasResource, flowSchema), &v1beta1.FlowSchema{}) + Invokes(testing.NewRootCreateAction(flowschemasResource, flowSchema), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.FlowSchema), err } // Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1beta1.FlowSchema, opts v1.UpdateOptions) (result *v1beta1.FlowSchema, err error) { + emptyResult := &v1beta1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(flowschemasResource, flowSchema), &v1beta1.FlowSchema{}) + Invokes(testing.NewRootUpdateAction(flowschemasResource, flowSchema), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.FlowSchema), 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 *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1beta1.FlowSchema, opts v1.UpdateOptions) (*v1beta1.FlowSchema, error) { +func (c *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1beta1.FlowSchema, opts v1.UpdateOptions) (result *v1beta1.FlowSchema, err error) { + emptyResult := &v1beta1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(flowschemasResource, "status", flowSchema), &v1beta1.FlowSchema{}) + Invokes(testing.NewRootUpdateSubresourceAction(flowschemasResource, "status", flowSchema), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.FlowSchema), err } @@ -126,10 +131,11 @@ func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOp // Patch applies the patch and returns the patched flowSchema. func (c *FakeFlowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.FlowSchema, err error) { + emptyResult := &v1beta1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, name, pt, data, subresources...), &v1beta1.FlowSchema{}) + Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.FlowSchema), err } @@ -147,10 +153,11 @@ func (c *FakeFlowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1be if name == nil { return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") } + emptyResult := &v1beta1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data), &v1beta1.FlowSchema{}) + Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.FlowSchema), err } @@ -169,10 +176,11 @@ func (c *FakeFlowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontr if name == nil { return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") } + emptyResult := &v1beta1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data, "status"), &v1beta1.FlowSchema{}) + Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.FlowSchema), err } diff --git a/kubernetes/typed/flowcontrol/v1beta1/fake/fake_prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1beta1/fake/fake_prioritylevelconfiguration.go index 698a168b37..edacdaf250 100644 --- a/kubernetes/typed/flowcontrol/v1beta1/fake/fake_prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1beta1/fake/fake_prioritylevelconfiguration.go @@ -43,20 +43,22 @@ var prioritylevelconfigurationsKind = v1beta1.SchemeGroupVersion.WithKind("Prior // Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { + emptyResult := &v1beta1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(prioritylevelconfigurationsResource, name), &v1beta1.PriorityLevelConfiguration{}) + Invokes(testing.NewRootGetAction(prioritylevelconfigurationsResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PriorityLevelConfiguration), err } // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityLevelConfigurationList, err error) { + emptyResult := &v1beta1.PriorityLevelConfigurationList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), &v1beta1.PriorityLevelConfigurationList{}) + Invokes(testing.NewRootListAction(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,31 +82,34 @@ func (c *FakePriorityLevelConfigurations) Watch(ctx context.Context, opts v1.Lis // Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1beta1.PriorityLevelConfiguration, opts v1.CreateOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { + emptyResult := &v1beta1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), &v1beta1.PriorityLevelConfiguration{}) + Invokes(testing.NewRootCreateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PriorityLevelConfiguration), err } // Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1beta1.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { + emptyResult := &v1beta1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), &v1beta1.PriorityLevelConfiguration{}) + Invokes(testing.NewRootUpdateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PriorityLevelConfiguration), 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 *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta1.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1beta1.PriorityLevelConfiguration, error) { +func (c *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta1.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { + emptyResult := &v1beta1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration), &v1beta1.PriorityLevelConfiguration{}) + Invokes(testing.NewRootUpdateSubresourceAction(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PriorityLevelConfiguration), err } @@ -126,10 +131,11 @@ func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, // Patch applies the patch and returns the patched priorityLevelConfiguration. func (c *FakePriorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PriorityLevelConfiguration, err error) { + emptyResult := &v1beta1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, name, pt, data, subresources...), &v1beta1.PriorityLevelConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PriorityLevelConfiguration), err } @@ -147,10 +153,11 @@ func (c *FakePriorityLevelConfigurations) Apply(ctx context.Context, priorityLev if name == nil { return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") } + emptyResult := &v1beta1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data), &v1beta1.PriorityLevelConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PriorityLevelConfiguration), err } @@ -169,10 +176,11 @@ func (c *FakePriorityLevelConfigurations) ApplyStatus(ctx context.Context, prior if name == nil { return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") } + emptyResult := &v1beta1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, "status"), &v1beta1.PriorityLevelConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PriorityLevelConfiguration), err } diff --git a/kubernetes/typed/flowcontrol/v1beta2/fake/fake_flowschema.go b/kubernetes/typed/flowcontrol/v1beta2/fake/fake_flowschema.go index 7ce6d2116b..956becdc72 100644 --- a/kubernetes/typed/flowcontrol/v1beta2/fake/fake_flowschema.go +++ b/kubernetes/typed/flowcontrol/v1beta2/fake/fake_flowschema.go @@ -43,20 +43,22 @@ var flowschemasKind = v1beta2.SchemeGroupVersion.WithKind("FlowSchema") // Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.FlowSchema, err error) { + emptyResult := &v1beta2.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(flowschemasResource, name), &v1beta2.FlowSchema{}) + Invokes(testing.NewRootGetAction(flowschemasResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.FlowSchema), err } // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. func (c *FakeFlowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.FlowSchemaList, err error) { + emptyResult := &v1beta2.FlowSchemaList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(flowschemasResource, flowschemasKind, opts), &v1beta2.FlowSchemaList{}) + Invokes(testing.NewRootListAction(flowschemasResource, flowschemasKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,31 +82,34 @@ func (c *FakeFlowSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch // Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.CreateOptions) (result *v1beta2.FlowSchema, err error) { + emptyResult := &v1beta2.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(flowschemasResource, flowSchema), &v1beta2.FlowSchema{}) + Invokes(testing.NewRootCreateAction(flowschemasResource, flowSchema), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.FlowSchema), err } // Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.UpdateOptions) (result *v1beta2.FlowSchema, err error) { + emptyResult := &v1beta2.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(flowschemasResource, flowSchema), &v1beta2.FlowSchema{}) + Invokes(testing.NewRootUpdateAction(flowschemasResource, flowSchema), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.FlowSchema), 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 *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.UpdateOptions) (*v1beta2.FlowSchema, error) { +func (c *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.UpdateOptions) (result *v1beta2.FlowSchema, err error) { + emptyResult := &v1beta2.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(flowschemasResource, "status", flowSchema), &v1beta2.FlowSchema{}) + Invokes(testing.NewRootUpdateSubresourceAction(flowschemasResource, "status", flowSchema), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.FlowSchema), err } @@ -126,10 +131,11 @@ func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOp // Patch applies the patch and returns the patched flowSchema. func (c *FakeFlowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.FlowSchema, err error) { + emptyResult := &v1beta2.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, name, pt, data, subresources...), &v1beta2.FlowSchema{}) + Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.FlowSchema), err } @@ -147,10 +153,11 @@ func (c *FakeFlowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1be if name == nil { return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") } + emptyResult := &v1beta2.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data), &v1beta2.FlowSchema{}) + Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.FlowSchema), err } @@ -169,10 +176,11 @@ func (c *FakeFlowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontr if name == nil { return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") } + emptyResult := &v1beta2.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data, "status"), &v1beta2.FlowSchema{}) + Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.FlowSchema), err } diff --git a/kubernetes/typed/flowcontrol/v1beta2/fake/fake_prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1beta2/fake/fake_prioritylevelconfiguration.go index 7340f8a09e..40c763ff57 100644 --- a/kubernetes/typed/flowcontrol/v1beta2/fake/fake_prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1beta2/fake/fake_prioritylevelconfiguration.go @@ -43,20 +43,22 @@ var prioritylevelconfigurationsKind = v1beta2.SchemeGroupVersion.WithKind("Prior // Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { + emptyResult := &v1beta2.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(prioritylevelconfigurationsResource, name), &v1beta2.PriorityLevelConfiguration{}) + Invokes(testing.NewRootGetAction(prioritylevelconfigurationsResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.PriorityLevelConfiguration), err } // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.PriorityLevelConfigurationList, err error) { + emptyResult := &v1beta2.PriorityLevelConfigurationList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), &v1beta2.PriorityLevelConfigurationList{}) + Invokes(testing.NewRootListAction(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,31 +82,34 @@ func (c *FakePriorityLevelConfigurations) Watch(ctx context.Context, opts v1.Lis // Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.CreateOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { + emptyResult := &v1beta2.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), &v1beta2.PriorityLevelConfiguration{}) + Invokes(testing.NewRootCreateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.PriorityLevelConfiguration), err } // Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { + emptyResult := &v1beta2.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), &v1beta2.PriorityLevelConfiguration{}) + Invokes(testing.NewRootUpdateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.PriorityLevelConfiguration), 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 *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1beta2.PriorityLevelConfiguration, error) { +func (c *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { + emptyResult := &v1beta2.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration), &v1beta2.PriorityLevelConfiguration{}) + Invokes(testing.NewRootUpdateSubresourceAction(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.PriorityLevelConfiguration), err } @@ -126,10 +131,11 @@ func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, // Patch applies the patch and returns the patched priorityLevelConfiguration. func (c *FakePriorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.PriorityLevelConfiguration, err error) { + emptyResult := &v1beta2.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, name, pt, data, subresources...), &v1beta2.PriorityLevelConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.PriorityLevelConfiguration), err } @@ -147,10 +153,11 @@ func (c *FakePriorityLevelConfigurations) Apply(ctx context.Context, priorityLev if name == nil { return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") } + emptyResult := &v1beta2.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data), &v1beta2.PriorityLevelConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.PriorityLevelConfiguration), err } @@ -169,10 +176,11 @@ func (c *FakePriorityLevelConfigurations) ApplyStatus(ctx context.Context, prior if name == nil { return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") } + emptyResult := &v1beta2.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, "status"), &v1beta2.PriorityLevelConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta2.PriorityLevelConfiguration), err } diff --git a/kubernetes/typed/flowcontrol/v1beta3/fake/fake_flowschema.go b/kubernetes/typed/flowcontrol/v1beta3/fake/fake_flowschema.go index 1371f6ed67..9f632abcfe 100644 --- a/kubernetes/typed/flowcontrol/v1beta3/fake/fake_flowschema.go +++ b/kubernetes/typed/flowcontrol/v1beta3/fake/fake_flowschema.go @@ -43,20 +43,22 @@ var flowschemasKind = v1beta3.SchemeGroupVersion.WithKind("FlowSchema") // Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta3.FlowSchema, err error) { + emptyResult := &v1beta3.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(flowschemasResource, name), &v1beta3.FlowSchema{}) + Invokes(testing.NewRootGetAction(flowschemasResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta3.FlowSchema), err } // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. func (c *FakeFlowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta3.FlowSchemaList, err error) { + emptyResult := &v1beta3.FlowSchemaList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(flowschemasResource, flowschemasKind, opts), &v1beta3.FlowSchemaList{}) + Invokes(testing.NewRootListAction(flowschemasResource, flowschemasKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,31 +82,34 @@ func (c *FakeFlowSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch // Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1beta3.FlowSchema, opts v1.CreateOptions) (result *v1beta3.FlowSchema, err error) { + emptyResult := &v1beta3.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(flowschemasResource, flowSchema), &v1beta3.FlowSchema{}) + Invokes(testing.NewRootCreateAction(flowschemasResource, flowSchema), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta3.FlowSchema), err } // Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1beta3.FlowSchema, opts v1.UpdateOptions) (result *v1beta3.FlowSchema, err error) { + emptyResult := &v1beta3.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(flowschemasResource, flowSchema), &v1beta3.FlowSchema{}) + Invokes(testing.NewRootUpdateAction(flowschemasResource, flowSchema), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta3.FlowSchema), 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 *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1beta3.FlowSchema, opts v1.UpdateOptions) (*v1beta3.FlowSchema, error) { +func (c *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1beta3.FlowSchema, opts v1.UpdateOptions) (result *v1beta3.FlowSchema, err error) { + emptyResult := &v1beta3.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(flowschemasResource, "status", flowSchema), &v1beta3.FlowSchema{}) + Invokes(testing.NewRootUpdateSubresourceAction(flowschemasResource, "status", flowSchema), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta3.FlowSchema), err } @@ -126,10 +131,11 @@ func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOp // Patch applies the patch and returns the patched flowSchema. func (c *FakeFlowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta3.FlowSchema, err error) { + emptyResult := &v1beta3.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, name, pt, data, subresources...), &v1beta3.FlowSchema{}) + Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta3.FlowSchema), err } @@ -147,10 +153,11 @@ func (c *FakeFlowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1be if name == nil { return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") } + emptyResult := &v1beta3.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data), &v1beta3.FlowSchema{}) + Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta3.FlowSchema), err } @@ -169,10 +176,11 @@ func (c *FakeFlowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontr if name == nil { return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") } + emptyResult := &v1beta3.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data, "status"), &v1beta3.FlowSchema{}) + Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta3.FlowSchema), err } diff --git a/kubernetes/typed/flowcontrol/v1beta3/fake/fake_prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1beta3/fake/fake_prioritylevelconfiguration.go index a0e266fecb..91205e85ac 100644 --- a/kubernetes/typed/flowcontrol/v1beta3/fake/fake_prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1beta3/fake/fake_prioritylevelconfiguration.go @@ -43,20 +43,22 @@ var prioritylevelconfigurationsKind = v1beta3.SchemeGroupVersion.WithKind("Prior // Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { + emptyResult := &v1beta3.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(prioritylevelconfigurationsResource, name), &v1beta3.PriorityLevelConfiguration{}) + Invokes(testing.NewRootGetAction(prioritylevelconfigurationsResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta3.PriorityLevelConfiguration), err } // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta3.PriorityLevelConfigurationList, err error) { + emptyResult := &v1beta3.PriorityLevelConfigurationList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), &v1beta3.PriorityLevelConfigurationList{}) + Invokes(testing.NewRootListAction(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,31 +82,34 @@ func (c *FakePriorityLevelConfigurations) Watch(ctx context.Context, opts v1.Lis // Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1beta3.PriorityLevelConfiguration, opts v1.CreateOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { + emptyResult := &v1beta3.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), &v1beta3.PriorityLevelConfiguration{}) + Invokes(testing.NewRootCreateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta3.PriorityLevelConfiguration), err } // Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1beta3.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { + emptyResult := &v1beta3.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), &v1beta3.PriorityLevelConfiguration{}) + Invokes(testing.NewRootUpdateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta3.PriorityLevelConfiguration), 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 *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta3.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1beta3.PriorityLevelConfiguration, error) { +func (c *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta3.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { + emptyResult := &v1beta3.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration), &v1beta3.PriorityLevelConfiguration{}) + Invokes(testing.NewRootUpdateSubresourceAction(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta3.PriorityLevelConfiguration), err } @@ -126,10 +131,11 @@ func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, // Patch applies the patch and returns the patched priorityLevelConfiguration. func (c *FakePriorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta3.PriorityLevelConfiguration, err error) { + emptyResult := &v1beta3.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, name, pt, data, subresources...), &v1beta3.PriorityLevelConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta3.PriorityLevelConfiguration), err } @@ -147,10 +153,11 @@ func (c *FakePriorityLevelConfigurations) Apply(ctx context.Context, priorityLev if name == nil { return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") } + emptyResult := &v1beta3.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data), &v1beta3.PriorityLevelConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta3.PriorityLevelConfiguration), err } @@ -169,10 +176,11 @@ func (c *FakePriorityLevelConfigurations) ApplyStatus(ctx context.Context, prior if name == nil { return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") } + emptyResult := &v1beta3.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, "status"), &v1beta3.PriorityLevelConfiguration{}) + Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta3.PriorityLevelConfiguration), err } diff --git a/kubernetes/typed/networking/v1/fake/fake_ingress.go b/kubernetes/typed/networking/v1/fake/fake_ingress.go index 002de0dd8a..49cded65b6 100644 --- a/kubernetes/typed/networking/v1/fake/fake_ingress.go +++ b/kubernetes/typed/networking/v1/fake/fake_ingress.go @@ -44,22 +44,24 @@ var ingressesKind = v1.SchemeGroupVersion.WithKind("Ingress") // Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. func (c *FakeIngresses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Ingress, err error) { + emptyResult := &v1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewGetAction(ingressesResource, c.ns, name), &v1.Ingress{}) + Invokes(testing.NewGetAction(ingressesResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Ingress), err } // List takes label and field selectors, and returns the list of Ingresses that match those selectors. func (c *FakeIngresses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressList, err error) { + emptyResult := &v1.IngressList{} obj, err := c.Fake. - Invokes(testing.NewListAction(ingressesResource, ingressesKind, c.ns, opts), &v1.IngressList{}) + Invokes(testing.NewListAction(ingressesResource, ingressesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeIngresses) Watch(ctx context.Context, opts metav1.ListOptions) (wat // Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any. func (c *FakeIngresses) Create(ctx context.Context, ingress *v1.Ingress, opts metav1.CreateOptions) (result *v1.Ingress, err error) { + emptyResult := &v1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(ingressesResource, c.ns, ingress), &v1.Ingress{}) + Invokes(testing.NewCreateAction(ingressesResource, c.ns, ingress), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Ingress), err } // Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any. func (c *FakeIngresses) Update(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (result *v1.Ingress, err error) { + emptyResult := &v1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(ingressesResource, c.ns, ingress), &v1.Ingress{}) + Invokes(testing.NewUpdateAction(ingressesResource, c.ns, ingress), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Ingress), 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 *FakeIngresses) UpdateStatus(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (*v1.Ingress, error) { +func (c *FakeIngresses) UpdateStatus(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (result *v1.Ingress, err error) { + emptyResult := &v1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(ingressesResource, "status", c.ns, ingress), &v1.Ingress{}) + Invokes(testing.NewUpdateSubresourceAction(ingressesResource, "status", c.ns, ingress), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Ingress), err } @@ -134,11 +139,12 @@ func (c *FakeIngresses) DeleteCollection(ctx context.Context, opts metav1.Delete // Patch applies the patch and returns the patched ingress. func (c *FakeIngresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Ingress, err error) { + emptyResult := &v1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, name, pt, data, subresources...), &v1.Ingress{}) + Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Ingress), err } @@ -156,11 +162,12 @@ func (c *FakeIngresses) Apply(ctx context.Context, ingress *networkingv1.Ingress if name == nil { return nil, fmt.Errorf("ingress.Name must be provided to Apply") } + emptyResult := &v1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, *name, types.ApplyPatchType, data), &v1.Ingress{}) + Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Ingress), err } @@ -179,11 +186,12 @@ func (c *FakeIngresses) ApplyStatus(ctx context.Context, ingress *networkingv1.I if name == nil { return nil, fmt.Errorf("ingress.Name must be provided to Apply") } + emptyResult := &v1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.Ingress{}) + Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Ingress), err } diff --git a/kubernetes/typed/networking/v1/fake/fake_ingressclass.go b/kubernetes/typed/networking/v1/fake/fake_ingressclass.go index 208a975082..7d9cd478ad 100644 --- a/kubernetes/typed/networking/v1/fake/fake_ingressclass.go +++ b/kubernetes/typed/networking/v1/fake/fake_ingressclass.go @@ -43,20 +43,22 @@ var ingressclassesKind = v1.SchemeGroupVersion.WithKind("IngressClass") // Get takes name of the ingressClass, and returns the corresponding ingressClass object, and an error if there is any. func (c *FakeIngressClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.IngressClass, err error) { + emptyResult := &v1.IngressClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(ingressclassesResource, name), &v1.IngressClass{}) + Invokes(testing.NewRootGetAction(ingressclassesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.IngressClass), err } // List takes label and field selectors, and returns the list of IngressClasses that match those selectors. func (c *FakeIngressClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressClassList, err error) { + emptyResult := &v1.IngressClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(ingressclassesResource, ingressclassesKind, opts), &v1.IngressClassList{}) + Invokes(testing.NewRootListAction(ingressclassesResource, ingressclassesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeIngressClasses) Watch(ctx context.Context, opts metav1.ListOptions) // Create takes the representation of a ingressClass and creates it. Returns the server's representation of the ingressClass, and an error, if there is any. func (c *FakeIngressClasses) Create(ctx context.Context, ingressClass *v1.IngressClass, opts metav1.CreateOptions) (result *v1.IngressClass, err error) { + emptyResult := &v1.IngressClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(ingressclassesResource, ingressClass), &v1.IngressClass{}) + Invokes(testing.NewRootCreateAction(ingressclassesResource, ingressClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.IngressClass), err } // Update takes the representation of a ingressClass and updates it. Returns the server's representation of the ingressClass, and an error, if there is any. func (c *FakeIngressClasses) Update(ctx context.Context, ingressClass *v1.IngressClass, opts metav1.UpdateOptions) (result *v1.IngressClass, err error) { + emptyResult := &v1.IngressClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(ingressclassesResource, ingressClass), &v1.IngressClass{}) + Invokes(testing.NewRootUpdateAction(ingressclassesResource, ingressClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.IngressClass), err } @@ -115,10 +119,11 @@ func (c *FakeIngressClasses) DeleteCollection(ctx context.Context, opts metav1.D // Patch applies the patch and returns the patched ingressClass. func (c *FakeIngressClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.IngressClass, err error) { + emptyResult := &v1.IngressClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(ingressclassesResource, name, pt, data, subresources...), &v1.IngressClass{}) + Invokes(testing.NewRootPatchSubresourceAction(ingressclassesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.IngressClass), err } @@ -136,10 +141,11 @@ func (c *FakeIngressClasses) Apply(ctx context.Context, ingressClass *networking if name == nil { return nil, fmt.Errorf("ingressClass.Name must be provided to Apply") } + emptyResult := &v1.IngressClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(ingressclassesResource, *name, types.ApplyPatchType, data), &v1.IngressClass{}) + Invokes(testing.NewRootPatchSubresourceAction(ingressclassesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.IngressClass), err } diff --git a/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go b/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go index dde09774c4..9b3e7c19f9 100644 --- a/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go +++ b/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go @@ -44,22 +44,24 @@ var networkpoliciesKind = v1.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 metav1.GetOptions) (result *v1.NetworkPolicy, err error) { + emptyResult := &v1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewGetAction(networkpoliciesResource, c.ns, name), &v1.NetworkPolicy{}) + Invokes(testing.NewGetAction(networkpoliciesResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.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 metav1.ListOptions) (result *v1.NetworkPolicyList, err error) { + emptyResult := &v1.NetworkPolicyList{} obj, err := c.Fake. - Invokes(testing.NewListAction(networkpoliciesResource, networkpoliciesKind, c.ns, opts), &v1.NetworkPolicyList{}) + Invokes(testing.NewListAction(networkpoliciesResource, networkpoliciesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeNetworkPolicies) Watch(ctx context.Context, opts metav1.ListOptions // 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 *v1.NetworkPolicy, opts metav1.CreateOptions) (result *v1.NetworkPolicy, err error) { + emptyResult := &v1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(networkpoliciesResource, c.ns, networkPolicy), &v1.NetworkPolicy{}) + Invokes(testing.NewCreateAction(networkpoliciesResource, c.ns, networkPolicy), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.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 *v1.NetworkPolicy, opts metav1.UpdateOptions) (result *v1.NetworkPolicy, err error) { + emptyResult := &v1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(networkpoliciesResource, c.ns, networkPolicy), &v1.NetworkPolicy{}) + Invokes(testing.NewUpdateAction(networkpoliciesResource, c.ns, networkPolicy), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.NetworkPolicy), err } @@ -122,11 +126,12 @@ func (c *FakeNetworkPolicies) DeleteCollection(ctx context.Context, opts metav1. // Patch applies the patch and returns the patched networkPolicy. func (c *FakeNetworkPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NetworkPolicy, err error) { + emptyResult := &v1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(networkpoliciesResource, c.ns, name, pt, data, subresources...), &v1.NetworkPolicy{}) + Invokes(testing.NewPatchSubresourceAction(networkpoliciesResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.NetworkPolicy), err } @@ -144,11 +149,12 @@ func (c *FakeNetworkPolicies) Apply(ctx context.Context, networkPolicy *networki if name == nil { return nil, fmt.Errorf("networkPolicy.Name must be provided to Apply") } + emptyResult := &v1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(networkpoliciesResource, c.ns, *name, types.ApplyPatchType, data), &v1.NetworkPolicy{}) + Invokes(testing.NewPatchSubresourceAction(networkpoliciesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.NetworkPolicy), err } diff --git a/kubernetes/typed/networking/v1alpha1/fake/fake_ipaddress.go b/kubernetes/typed/networking/v1alpha1/fake/fake_ipaddress.go index 4db8df68cb..cffe0d63de 100644 --- a/kubernetes/typed/networking/v1alpha1/fake/fake_ipaddress.go +++ b/kubernetes/typed/networking/v1alpha1/fake/fake_ipaddress.go @@ -43,20 +43,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.NewRootGetAction(ipaddressesResource, name), 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.NewRootListAction(ipaddressesResource, ipaddressesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeIPAddresses) Watch(ctx context.Context, opts v1.ListOptions) (watch // 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.NewRootCreateAction(ipaddressesResource, iPAddress), 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.NewRootUpdateAction(ipaddressesResource, iPAddress), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.IPAddress), err } @@ -115,10 +119,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.NewRootPatchSubresourceAction(ipaddressesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.IPAddress), err } @@ -136,10 +141,11 @@ func (c *FakeIPAddresses) Apply(ctx context.Context, iPAddress *networkingv1alph 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.NewRootPatchSubresourceAction(ipaddressesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.IPAddress), err } diff --git a/kubernetes/typed/networking/v1alpha1/fake/fake_servicecidr.go b/kubernetes/typed/networking/v1alpha1/fake/fake_servicecidr.go index 653ef631af..754985d167 100644 --- a/kubernetes/typed/networking/v1alpha1/fake/fake_servicecidr.go +++ b/kubernetes/typed/networking/v1alpha1/fake/fake_servicecidr.go @@ -43,20 +43,22 @@ var servicecidrsKind = v1alpha1.SchemeGroupVersion.WithKind("ServiceCIDR") // Get takes name of the serviceCIDR, and returns the corresponding serviceCIDR object, and an error if there is any. func (c *FakeServiceCIDRs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ServiceCIDR, err error) { + emptyResult := &v1alpha1.ServiceCIDR{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(servicecidrsResource, name), &v1alpha1.ServiceCIDR{}) + Invokes(testing.NewRootGetAction(servicecidrsResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ServiceCIDR), err } // List takes label and field selectors, and returns the list of ServiceCIDRs that match those selectors. func (c *FakeServiceCIDRs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ServiceCIDRList, err error) { + emptyResult := &v1alpha1.ServiceCIDRList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(servicecidrsResource, servicecidrsKind, opts), &v1alpha1.ServiceCIDRList{}) + Invokes(testing.NewRootListAction(servicecidrsResource, servicecidrsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,31 +82,34 @@ func (c *FakeServiceCIDRs) Watch(ctx context.Context, opts v1.ListOptions) (watc // Create takes the representation of a serviceCIDR and creates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. func (c *FakeServiceCIDRs) Create(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.CreateOptions) (result *v1alpha1.ServiceCIDR, err error) { + emptyResult := &v1alpha1.ServiceCIDR{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(servicecidrsResource, serviceCIDR), &v1alpha1.ServiceCIDR{}) + Invokes(testing.NewRootCreateAction(servicecidrsResource, serviceCIDR), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ServiceCIDR), err } // Update takes the representation of a serviceCIDR and updates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. func (c *FakeServiceCIDRs) Update(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (result *v1alpha1.ServiceCIDR, err error) { + emptyResult := &v1alpha1.ServiceCIDR{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(servicecidrsResource, serviceCIDR), &v1alpha1.ServiceCIDR{}) + Invokes(testing.NewRootUpdateAction(servicecidrsResource, serviceCIDR), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ServiceCIDR), 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 *FakeServiceCIDRs) UpdateStatus(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (*v1alpha1.ServiceCIDR, error) { +func (c *FakeServiceCIDRs) UpdateStatus(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (result *v1alpha1.ServiceCIDR, err error) { + emptyResult := &v1alpha1.ServiceCIDR{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(servicecidrsResource, "status", serviceCIDR), &v1alpha1.ServiceCIDR{}) + Invokes(testing.NewRootUpdateSubresourceAction(servicecidrsResource, "status", serviceCIDR), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ServiceCIDR), err } @@ -126,10 +131,11 @@ func (c *FakeServiceCIDRs) DeleteCollection(ctx context.Context, opts v1.DeleteO // Patch applies the patch and returns the patched serviceCIDR. func (c *FakeServiceCIDRs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ServiceCIDR, err error) { + emptyResult := &v1alpha1.ServiceCIDR{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(servicecidrsResource, name, pt, data, subresources...), &v1alpha1.ServiceCIDR{}) + Invokes(testing.NewRootPatchSubresourceAction(servicecidrsResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ServiceCIDR), err } @@ -147,10 +153,11 @@ func (c *FakeServiceCIDRs) Apply(ctx context.Context, serviceCIDR *networkingv1a if name == nil { return nil, fmt.Errorf("serviceCIDR.Name must be provided to Apply") } + emptyResult := &v1alpha1.ServiceCIDR{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(servicecidrsResource, *name, types.ApplyPatchType, data), &v1alpha1.ServiceCIDR{}) + Invokes(testing.NewRootPatchSubresourceAction(servicecidrsResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ServiceCIDR), err } @@ -169,10 +176,11 @@ func (c *FakeServiceCIDRs) ApplyStatus(ctx context.Context, serviceCIDR *network if name == nil { return nil, fmt.Errorf("serviceCIDR.Name must be provided to Apply") } + emptyResult := &v1alpha1.ServiceCIDR{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(servicecidrsResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.ServiceCIDR{}) + Invokes(testing.NewRootPatchSubresourceAction(servicecidrsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ServiceCIDR), err } diff --git a/kubernetes/typed/networking/v1beta1/fake/fake_ingress.go b/kubernetes/typed/networking/v1beta1/fake/fake_ingress.go index 7a3b861be0..b2adf27b6c 100644 --- a/kubernetes/typed/networking/v1beta1/fake/fake_ingress.go +++ b/kubernetes/typed/networking/v1beta1/fake/fake_ingress.go @@ -44,22 +44,24 @@ var ingressesKind = v1beta1.SchemeGroupVersion.WithKind("Ingress") // Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. func (c *FakeIngresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Ingress, err error) { + emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewGetAction(ingressesResource, c.ns, name), &v1beta1.Ingress{}) + Invokes(testing.NewGetAction(ingressesResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Ingress), err } // List takes label and field selectors, and returns the list of Ingresses that match those selectors. func (c *FakeIngresses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { + emptyResult := &v1beta1.IngressList{} obj, err := c.Fake. - Invokes(testing.NewListAction(ingressesResource, ingressesKind, c.ns, opts), &v1beta1.IngressList{}) + Invokes(testing.NewListAction(ingressesResource, ingressesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeIngresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.I // Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any. func (c *FakeIngresses) Create(ctx context.Context, ingress *v1beta1.Ingress, opts v1.CreateOptions) (result *v1beta1.Ingress, err error) { + emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(ingressesResource, c.ns, ingress), &v1beta1.Ingress{}) + Invokes(testing.NewCreateAction(ingressesResource, c.ns, ingress), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Ingress), err } // Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any. func (c *FakeIngresses) Update(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { + emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(ingressesResource, c.ns, ingress), &v1beta1.Ingress{}) + Invokes(testing.NewUpdateAction(ingressesResource, c.ns, ingress), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Ingress), 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 *FakeIngresses) UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (*v1beta1.Ingress, error) { +func (c *FakeIngresses) UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { + emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(ingressesResource, "status", c.ns, ingress), &v1beta1.Ingress{}) + Invokes(testing.NewUpdateSubresourceAction(ingressesResource, "status", c.ns, ingress), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Ingress), err } @@ -134,11 +139,12 @@ func (c *FakeIngresses) DeleteCollection(ctx context.Context, opts v1.DeleteOpti // Patch applies the patch and returns the patched ingress. func (c *FakeIngresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Ingress, err error) { + emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, name, pt, data, subresources...), &v1beta1.Ingress{}) + Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Ingress), err } @@ -156,11 +162,12 @@ func (c *FakeIngresses) Apply(ctx context.Context, ingress *networkingv1beta1.In if name == nil { return nil, fmt.Errorf("ingress.Name must be provided to Apply") } + emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.Ingress{}) + Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Ingress), err } @@ -179,11 +186,12 @@ func (c *FakeIngresses) ApplyStatus(ctx context.Context, ingress *networkingv1be if name == nil { return nil, fmt.Errorf("ingress.Name must be provided to Apply") } + emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.Ingress{}) + Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Ingress), err } diff --git a/kubernetes/typed/networking/v1beta1/fake/fake_ingressclass.go b/kubernetes/typed/networking/v1beta1/fake/fake_ingressclass.go index 1804e61fc3..5a98f982b9 100644 --- a/kubernetes/typed/networking/v1beta1/fake/fake_ingressclass.go +++ b/kubernetes/typed/networking/v1beta1/fake/fake_ingressclass.go @@ -43,20 +43,22 @@ var ingressclassesKind = v1beta1.SchemeGroupVersion.WithKind("IngressClass") // Get takes name of the ingressClass, and returns the corresponding ingressClass object, and an error if there is any. func (c *FakeIngressClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.IngressClass, err error) { + emptyResult := &v1beta1.IngressClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(ingressclassesResource, name), &v1beta1.IngressClass{}) + Invokes(testing.NewRootGetAction(ingressclassesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.IngressClass), err } // List takes label and field selectors, and returns the list of IngressClasses that match those selectors. func (c *FakeIngressClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressClassList, err error) { + emptyResult := &v1beta1.IngressClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(ingressclassesResource, ingressclassesKind, opts), &v1beta1.IngressClassList{}) + Invokes(testing.NewRootListAction(ingressclassesResource, ingressclassesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeIngressClasses) Watch(ctx context.Context, opts v1.ListOptions) (wa // Create takes the representation of a ingressClass and creates it. Returns the server's representation of the ingressClass, and an error, if there is any. func (c *FakeIngressClasses) Create(ctx context.Context, ingressClass *v1beta1.IngressClass, opts v1.CreateOptions) (result *v1beta1.IngressClass, err error) { + emptyResult := &v1beta1.IngressClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(ingressclassesResource, ingressClass), &v1beta1.IngressClass{}) + Invokes(testing.NewRootCreateAction(ingressclassesResource, ingressClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.IngressClass), err } // Update takes the representation of a ingressClass and updates it. Returns the server's representation of the ingressClass, and an error, if there is any. func (c *FakeIngressClasses) Update(ctx context.Context, ingressClass *v1beta1.IngressClass, opts v1.UpdateOptions) (result *v1beta1.IngressClass, err error) { + emptyResult := &v1beta1.IngressClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(ingressclassesResource, ingressClass), &v1beta1.IngressClass{}) + Invokes(testing.NewRootUpdateAction(ingressclassesResource, ingressClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.IngressClass), err } @@ -115,10 +119,11 @@ func (c *FakeIngressClasses) DeleteCollection(ctx context.Context, opts v1.Delet // Patch applies the patch and returns the patched ingressClass. func (c *FakeIngressClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.IngressClass, err error) { + emptyResult := &v1beta1.IngressClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(ingressclassesResource, name, pt, data, subresources...), &v1beta1.IngressClass{}) + Invokes(testing.NewRootPatchSubresourceAction(ingressclassesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.IngressClass), err } @@ -136,10 +141,11 @@ func (c *FakeIngressClasses) Apply(ctx context.Context, ingressClass *networking if name == nil { return nil, fmt.Errorf("ingressClass.Name must be provided to Apply") } + emptyResult := &v1beta1.IngressClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(ingressclassesResource, *name, types.ApplyPatchType, data), &v1beta1.IngressClass{}) + Invokes(testing.NewRootPatchSubresourceAction(ingressclassesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.IngressClass), err } diff --git a/kubernetes/typed/node/v1/fake/fake_runtimeclass.go b/kubernetes/typed/node/v1/fake/fake_runtimeclass.go index 35cfbcae4b..a512e9f09e 100644 --- a/kubernetes/typed/node/v1/fake/fake_runtimeclass.go +++ b/kubernetes/typed/node/v1/fake/fake_runtimeclass.go @@ -43,20 +43,22 @@ var runtimeclassesKind = v1.SchemeGroupVersion.WithKind("RuntimeClass") // Get takes name of the runtimeClass, and returns the corresponding runtimeClass object, and an error if there is any. func (c *FakeRuntimeClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RuntimeClass, err error) { + emptyResult := &v1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(runtimeclassesResource, name), &v1.RuntimeClass{}) + Invokes(testing.NewRootGetAction(runtimeclassesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RuntimeClass), err } // List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. func (c *FakeRuntimeClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RuntimeClassList, err error) { + emptyResult := &v1.RuntimeClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(runtimeclassesResource, runtimeclassesKind, opts), &v1.RuntimeClassList{}) + Invokes(testing.NewRootListAction(runtimeclassesResource, runtimeclassesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeRuntimeClasses) Watch(ctx context.Context, opts metav1.ListOptions) // Create takes the representation of a runtimeClass and creates it. Returns the server's representation of the runtimeClass, and an error, if there is any. func (c *FakeRuntimeClasses) Create(ctx context.Context, runtimeClass *v1.RuntimeClass, opts metav1.CreateOptions) (result *v1.RuntimeClass, err error) { + emptyResult := &v1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(runtimeclassesResource, runtimeClass), &v1.RuntimeClass{}) + Invokes(testing.NewRootCreateAction(runtimeclassesResource, runtimeClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RuntimeClass), err } // Update takes the representation of a runtimeClass and updates it. Returns the server's representation of the runtimeClass, and an error, if there is any. func (c *FakeRuntimeClasses) Update(ctx context.Context, runtimeClass *v1.RuntimeClass, opts metav1.UpdateOptions) (result *v1.RuntimeClass, err error) { + emptyResult := &v1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(runtimeclassesResource, runtimeClass), &v1.RuntimeClass{}) + Invokes(testing.NewRootUpdateAction(runtimeclassesResource, runtimeClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RuntimeClass), err } @@ -115,10 +119,11 @@ func (c *FakeRuntimeClasses) DeleteCollection(ctx context.Context, opts metav1.D // Patch applies the patch and returns the patched runtimeClass. func (c *FakeRuntimeClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RuntimeClass, err error) { + emptyResult := &v1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(runtimeclassesResource, name, pt, data, subresources...), &v1.RuntimeClass{}) + Invokes(testing.NewRootPatchSubresourceAction(runtimeclassesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RuntimeClass), err } @@ -136,10 +141,11 @@ func (c *FakeRuntimeClasses) Apply(ctx context.Context, runtimeClass *nodev1.Run if name == nil { return nil, fmt.Errorf("runtimeClass.Name must be provided to Apply") } + emptyResult := &v1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(runtimeclassesResource, *name, types.ApplyPatchType, data), &v1.RuntimeClass{}) + Invokes(testing.NewRootPatchSubresourceAction(runtimeclassesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RuntimeClass), err } diff --git a/kubernetes/typed/node/v1alpha1/fake/fake_runtimeclass.go b/kubernetes/typed/node/v1alpha1/fake/fake_runtimeclass.go index 2ff7d3f973..808bd4d406 100644 --- a/kubernetes/typed/node/v1alpha1/fake/fake_runtimeclass.go +++ b/kubernetes/typed/node/v1alpha1/fake/fake_runtimeclass.go @@ -43,20 +43,22 @@ var runtimeclassesKind = v1alpha1.SchemeGroupVersion.WithKind("RuntimeClass") // Get takes name of the runtimeClass, and returns the corresponding runtimeClass object, and an error if there is any. func (c *FakeRuntimeClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RuntimeClass, err error) { + emptyResult := &v1alpha1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(runtimeclassesResource, name), &v1alpha1.RuntimeClass{}) + Invokes(testing.NewRootGetAction(runtimeclassesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.RuntimeClass), err } // List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. func (c *FakeRuntimeClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RuntimeClassList, err error) { + emptyResult := &v1alpha1.RuntimeClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(runtimeclassesResource, runtimeclassesKind, opts), &v1alpha1.RuntimeClassList{}) + Invokes(testing.NewRootListAction(runtimeclassesResource, runtimeclassesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeRuntimeClasses) Watch(ctx context.Context, opts v1.ListOptions) (wa // Create takes the representation of a runtimeClass and creates it. Returns the server's representation of the runtimeClass, and an error, if there is any. func (c *FakeRuntimeClasses) Create(ctx context.Context, runtimeClass *v1alpha1.RuntimeClass, opts v1.CreateOptions) (result *v1alpha1.RuntimeClass, err error) { + emptyResult := &v1alpha1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(runtimeclassesResource, runtimeClass), &v1alpha1.RuntimeClass{}) + Invokes(testing.NewRootCreateAction(runtimeclassesResource, runtimeClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.RuntimeClass), err } // Update takes the representation of a runtimeClass and updates it. Returns the server's representation of the runtimeClass, and an error, if there is any. func (c *FakeRuntimeClasses) Update(ctx context.Context, runtimeClass *v1alpha1.RuntimeClass, opts v1.UpdateOptions) (result *v1alpha1.RuntimeClass, err error) { + emptyResult := &v1alpha1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(runtimeclassesResource, runtimeClass), &v1alpha1.RuntimeClass{}) + Invokes(testing.NewRootUpdateAction(runtimeclassesResource, runtimeClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.RuntimeClass), err } @@ -115,10 +119,11 @@ func (c *FakeRuntimeClasses) DeleteCollection(ctx context.Context, opts v1.Delet // Patch applies the patch and returns the patched runtimeClass. func (c *FakeRuntimeClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RuntimeClass, err error) { + emptyResult := &v1alpha1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(runtimeclassesResource, name, pt, data, subresources...), &v1alpha1.RuntimeClass{}) + Invokes(testing.NewRootPatchSubresourceAction(runtimeclassesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.RuntimeClass), err } @@ -136,10 +141,11 @@ func (c *FakeRuntimeClasses) Apply(ctx context.Context, runtimeClass *nodev1alph if name == nil { return nil, fmt.Errorf("runtimeClass.Name must be provided to Apply") } + emptyResult := &v1alpha1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(runtimeclassesResource, *name, types.ApplyPatchType, data), &v1alpha1.RuntimeClass{}) + Invokes(testing.NewRootPatchSubresourceAction(runtimeclassesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.RuntimeClass), err } diff --git a/kubernetes/typed/node/v1beta1/fake/fake_runtimeclass.go b/kubernetes/typed/node/v1beta1/fake/fake_runtimeclass.go index e6552f9aca..a450fb86a2 100644 --- a/kubernetes/typed/node/v1beta1/fake/fake_runtimeclass.go +++ b/kubernetes/typed/node/v1beta1/fake/fake_runtimeclass.go @@ -43,20 +43,22 @@ var runtimeclassesKind = v1beta1.SchemeGroupVersion.WithKind("RuntimeClass") // Get takes name of the runtimeClass, and returns the corresponding runtimeClass object, and an error if there is any. func (c *FakeRuntimeClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.RuntimeClass, err error) { + emptyResult := &v1beta1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(runtimeclassesResource, name), &v1beta1.RuntimeClass{}) + Invokes(testing.NewRootGetAction(runtimeclassesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.RuntimeClass), err } // List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. func (c *FakeRuntimeClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RuntimeClassList, err error) { + emptyResult := &v1beta1.RuntimeClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(runtimeclassesResource, runtimeclassesKind, opts), &v1beta1.RuntimeClassList{}) + Invokes(testing.NewRootListAction(runtimeclassesResource, runtimeclassesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeRuntimeClasses) Watch(ctx context.Context, opts v1.ListOptions) (wa // Create takes the representation of a runtimeClass and creates it. Returns the server's representation of the runtimeClass, and an error, if there is any. func (c *FakeRuntimeClasses) Create(ctx context.Context, runtimeClass *v1beta1.RuntimeClass, opts v1.CreateOptions) (result *v1beta1.RuntimeClass, err error) { + emptyResult := &v1beta1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(runtimeclassesResource, runtimeClass), &v1beta1.RuntimeClass{}) + Invokes(testing.NewRootCreateAction(runtimeclassesResource, runtimeClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.RuntimeClass), err } // Update takes the representation of a runtimeClass and updates it. Returns the server's representation of the runtimeClass, and an error, if there is any. func (c *FakeRuntimeClasses) Update(ctx context.Context, runtimeClass *v1beta1.RuntimeClass, opts v1.UpdateOptions) (result *v1beta1.RuntimeClass, err error) { + emptyResult := &v1beta1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(runtimeclassesResource, runtimeClass), &v1beta1.RuntimeClass{}) + Invokes(testing.NewRootUpdateAction(runtimeclassesResource, runtimeClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.RuntimeClass), err } @@ -115,10 +119,11 @@ func (c *FakeRuntimeClasses) DeleteCollection(ctx context.Context, opts v1.Delet // Patch applies the patch and returns the patched runtimeClass. func (c *FakeRuntimeClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.RuntimeClass, err error) { + emptyResult := &v1beta1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(runtimeclassesResource, name, pt, data, subresources...), &v1beta1.RuntimeClass{}) + Invokes(testing.NewRootPatchSubresourceAction(runtimeclassesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.RuntimeClass), err } @@ -136,10 +141,11 @@ func (c *FakeRuntimeClasses) Apply(ctx context.Context, runtimeClass *nodev1beta if name == nil { return nil, fmt.Errorf("runtimeClass.Name must be provided to Apply") } + emptyResult := &v1beta1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(runtimeclassesResource, *name, types.ApplyPatchType, data), &v1beta1.RuntimeClass{}) + Invokes(testing.NewRootPatchSubresourceAction(runtimeclassesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.RuntimeClass), err } diff --git a/kubernetes/typed/policy/v1/fake/fake_poddisruptionbudget.go b/kubernetes/typed/policy/v1/fake/fake_poddisruptionbudget.go index 7b5f51caf4..1916b7d281 100644 --- a/kubernetes/typed/policy/v1/fake/fake_poddisruptionbudget.go +++ b/kubernetes/typed/policy/v1/fake/fake_poddisruptionbudget.go @@ -44,22 +44,24 @@ var poddisruptionbudgetsKind = v1.SchemeGroupVersion.WithKind("PodDisruptionBudg // Get takes name of the podDisruptionBudget, and returns the corresponding podDisruptionBudget object, and an error if there is any. func (c *FakePodDisruptionBudgets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PodDisruptionBudget, err error) { + emptyResult := &v1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewGetAction(poddisruptionbudgetsResource, c.ns, name), &v1.PodDisruptionBudget{}) + Invokes(testing.NewGetAction(poddisruptionbudgetsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PodDisruptionBudget), err } // List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. func (c *FakePodDisruptionBudgets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodDisruptionBudgetList, err error) { + emptyResult := &v1.PodDisruptionBudgetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(poddisruptionbudgetsResource, poddisruptionbudgetsKind, c.ns, opts), &v1.PodDisruptionBudgetList{}) + Invokes(testing.NewListAction(poddisruptionbudgetsResource, poddisruptionbudgetsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakePodDisruptionBudgets) Watch(ctx context.Context, opts metav1.ListOp // Create takes the representation of a podDisruptionBudget and creates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. func (c *FakePodDisruptionBudgets) Create(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.CreateOptions) (result *v1.PodDisruptionBudget, err error) { + emptyResult := &v1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(poddisruptionbudgetsResource, c.ns, podDisruptionBudget), &v1.PodDisruptionBudget{}) + Invokes(testing.NewCreateAction(poddisruptionbudgetsResource, c.ns, podDisruptionBudget), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PodDisruptionBudget), err } // Update takes the representation of a podDisruptionBudget and updates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. func (c *FakePodDisruptionBudgets) Update(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (result *v1.PodDisruptionBudget, err error) { + emptyResult := &v1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(poddisruptionbudgetsResource, c.ns, podDisruptionBudget), &v1.PodDisruptionBudget{}) + Invokes(testing.NewUpdateAction(poddisruptionbudgetsResource, c.ns, podDisruptionBudget), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PodDisruptionBudget), 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 *FakePodDisruptionBudgets) UpdateStatus(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (*v1.PodDisruptionBudget, error) { +func (c *FakePodDisruptionBudgets) UpdateStatus(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (result *v1.PodDisruptionBudget, err error) { + emptyResult := &v1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(poddisruptionbudgetsResource, "status", c.ns, podDisruptionBudget), &v1.PodDisruptionBudget{}) + Invokes(testing.NewUpdateSubresourceAction(poddisruptionbudgetsResource, "status", c.ns, podDisruptionBudget), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PodDisruptionBudget), err } @@ -134,11 +139,12 @@ func (c *FakePodDisruptionBudgets) DeleteCollection(ctx context.Context, opts me // Patch applies the patch and returns the patched podDisruptionBudget. func (c *FakePodDisruptionBudgets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodDisruptionBudget, err error) { + emptyResult := &v1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, name, pt, data, subresources...), &v1.PodDisruptionBudget{}) + Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PodDisruptionBudget), err } @@ -156,11 +162,12 @@ func (c *FakePodDisruptionBudgets) Apply(ctx context.Context, podDisruptionBudge if name == nil { return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply") } + emptyResult := &v1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data), &v1.PodDisruptionBudget{}) + Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PodDisruptionBudget), err } @@ -179,11 +186,12 @@ func (c *FakePodDisruptionBudgets) ApplyStatus(ctx context.Context, podDisruptio if name == nil { return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply") } + emptyResult := &v1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.PodDisruptionBudget{}) + Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PodDisruptionBudget), err } diff --git a/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go b/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go index bcee8e7774..6015f367b9 100644 --- a/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go +++ b/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go @@ -44,22 +44,24 @@ var poddisruptionbudgetsKind = v1beta1.SchemeGroupVersion.WithKind("PodDisruptio // Get takes name of the podDisruptionBudget, and returns the corresponding podDisruptionBudget object, and an error if there is any. func (c *FakePodDisruptionBudgets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PodDisruptionBudget, err error) { + emptyResult := &v1beta1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewGetAction(poddisruptionbudgetsResource, c.ns, name), &v1beta1.PodDisruptionBudget{}) + Invokes(testing.NewGetAction(poddisruptionbudgetsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PodDisruptionBudget), err } // List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. func (c *FakePodDisruptionBudgets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PodDisruptionBudgetList, err error) { + emptyResult := &v1beta1.PodDisruptionBudgetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(poddisruptionbudgetsResource, poddisruptionbudgetsKind, c.ns, opts), &v1beta1.PodDisruptionBudgetList{}) + Invokes(testing.NewListAction(poddisruptionbudgetsResource, poddisruptionbudgetsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakePodDisruptionBudgets) Watch(ctx context.Context, opts v1.ListOption // Create takes the representation of a podDisruptionBudget and creates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. func (c *FakePodDisruptionBudgets) Create(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.CreateOptions) (result *v1beta1.PodDisruptionBudget, err error) { + emptyResult := &v1beta1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(poddisruptionbudgetsResource, c.ns, podDisruptionBudget), &v1beta1.PodDisruptionBudget{}) + Invokes(testing.NewCreateAction(poddisruptionbudgetsResource, c.ns, podDisruptionBudget), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PodDisruptionBudget), err } // Update takes the representation of a podDisruptionBudget and updates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. func (c *FakePodDisruptionBudgets) Update(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.UpdateOptions) (result *v1beta1.PodDisruptionBudget, err error) { + emptyResult := &v1beta1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(poddisruptionbudgetsResource, c.ns, podDisruptionBudget), &v1beta1.PodDisruptionBudget{}) + Invokes(testing.NewUpdateAction(poddisruptionbudgetsResource, c.ns, podDisruptionBudget), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PodDisruptionBudget), 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 *FakePodDisruptionBudgets) UpdateStatus(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.UpdateOptions) (*v1beta1.PodDisruptionBudget, error) { +func (c *FakePodDisruptionBudgets) UpdateStatus(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.UpdateOptions) (result *v1beta1.PodDisruptionBudget, err error) { + emptyResult := &v1beta1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(poddisruptionbudgetsResource, "status", c.ns, podDisruptionBudget), &v1beta1.PodDisruptionBudget{}) + Invokes(testing.NewUpdateSubresourceAction(poddisruptionbudgetsResource, "status", c.ns, podDisruptionBudget), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PodDisruptionBudget), err } @@ -134,11 +139,12 @@ func (c *FakePodDisruptionBudgets) DeleteCollection(ctx context.Context, opts v1 // Patch applies the patch and returns the patched podDisruptionBudget. func (c *FakePodDisruptionBudgets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PodDisruptionBudget, err error) { + emptyResult := &v1beta1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, name, pt, data, subresources...), &v1beta1.PodDisruptionBudget{}) + Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PodDisruptionBudget), err } @@ -156,11 +162,12 @@ func (c *FakePodDisruptionBudgets) Apply(ctx context.Context, podDisruptionBudge if name == nil { return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply") } + emptyResult := &v1beta1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.PodDisruptionBudget{}) + Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PodDisruptionBudget), err } @@ -179,11 +186,12 @@ func (c *FakePodDisruptionBudgets) ApplyStatus(ctx context.Context, podDisruptio if name == nil { return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply") } + emptyResult := &v1beta1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.PodDisruptionBudget{}) + Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PodDisruptionBudget), err } diff --git a/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go b/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go index 5add33ddfb..ef6c57d767 100644 --- a/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go +++ b/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go @@ -43,20 +43,22 @@ var clusterrolesKind = v1.SchemeGroupVersion.WithKind("ClusterRole") // Get takes name of the clusterRole, and returns the corresponding clusterRole object, and an error if there is any. func (c *FakeClusterRoles) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterRole, err error) { + emptyResult := &v1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clusterrolesResource, name), &v1.ClusterRole{}) + Invokes(testing.NewRootGetAction(clusterrolesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterRole), err } // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. func (c *FakeClusterRoles) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleList, err error) { + emptyResult := &v1.ClusterRoleList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(clusterrolesResource, clusterrolesKind, opts), &v1.ClusterRoleList{}) + Invokes(testing.NewRootListAction(clusterrolesResource, clusterrolesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeClusterRoles) Watch(ctx context.Context, opts metav1.ListOptions) ( // Create takes the representation of a clusterRole and creates it. Returns the server's representation of the clusterRole, and an error, if there is any. func (c *FakeClusterRoles) Create(ctx context.Context, clusterRole *v1.ClusterRole, opts metav1.CreateOptions) (result *v1.ClusterRole, err error) { + emptyResult := &v1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clusterrolesResource, clusterRole), &v1.ClusterRole{}) + Invokes(testing.NewRootCreateAction(clusterrolesResource, clusterRole), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterRole), err } // Update takes the representation of a clusterRole and updates it. Returns the server's representation of the clusterRole, and an error, if there is any. func (c *FakeClusterRoles) Update(ctx context.Context, clusterRole *v1.ClusterRole, opts metav1.UpdateOptions) (result *v1.ClusterRole, err error) { + emptyResult := &v1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clusterrolesResource, clusterRole), &v1.ClusterRole{}) + Invokes(testing.NewRootUpdateAction(clusterrolesResource, clusterRole), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterRole), err } @@ -115,10 +119,11 @@ func (c *FakeClusterRoles) DeleteCollection(ctx context.Context, opts metav1.Del // Patch applies the patch and returns the patched clusterRole. func (c *FakeClusterRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterRole, err error) { + emptyResult := &v1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolesResource, name, pt, data, subresources...), &v1.ClusterRole{}) + Invokes(testing.NewRootPatchSubresourceAction(clusterrolesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterRole), err } @@ -136,10 +141,11 @@ func (c *FakeClusterRoles) Apply(ctx context.Context, clusterRole *rbacv1.Cluste if name == nil { return nil, fmt.Errorf("clusterRole.Name must be provided to Apply") } + emptyResult := &v1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolesResource, *name, types.ApplyPatchType, data), &v1.ClusterRole{}) + Invokes(testing.NewRootPatchSubresourceAction(clusterrolesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterRole), err } diff --git a/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go b/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go index d42e93e653..5ffc0be3ea 100644 --- a/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go +++ b/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go @@ -43,20 +43,22 @@ var clusterrolebindingsKind = v1.SchemeGroupVersion.WithKind("ClusterRoleBinding // Get takes name of the clusterRoleBinding, and returns the corresponding clusterRoleBinding object, and an error if there is any. func (c *FakeClusterRoleBindings) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterRoleBinding, err error) { + emptyResult := &v1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clusterrolebindingsResource, name), &v1.ClusterRoleBinding{}) + Invokes(testing.NewRootGetAction(clusterrolebindingsResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterRoleBinding), err } // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. func (c *FakeClusterRoleBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleBindingList, err error) { + emptyResult := &v1.ClusterRoleBindingList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(clusterrolebindingsResource, clusterrolebindingsKind, opts), &v1.ClusterRoleBindingList{}) + Invokes(testing.NewRootListAction(clusterrolebindingsResource, clusterrolebindingsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeClusterRoleBindings) Watch(ctx context.Context, opts metav1.ListOpt // Create takes the representation of a clusterRoleBinding and creates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. func (c *FakeClusterRoleBindings) Create(ctx context.Context, clusterRoleBinding *v1.ClusterRoleBinding, opts metav1.CreateOptions) (result *v1.ClusterRoleBinding, err error) { + emptyResult := &v1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clusterrolebindingsResource, clusterRoleBinding), &v1.ClusterRoleBinding{}) + Invokes(testing.NewRootCreateAction(clusterrolebindingsResource, clusterRoleBinding), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterRoleBinding), err } // Update takes the representation of a clusterRoleBinding and updates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. func (c *FakeClusterRoleBindings) Update(ctx context.Context, clusterRoleBinding *v1.ClusterRoleBinding, opts metav1.UpdateOptions) (result *v1.ClusterRoleBinding, err error) { + emptyResult := &v1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clusterrolebindingsResource, clusterRoleBinding), &v1.ClusterRoleBinding{}) + Invokes(testing.NewRootUpdateAction(clusterrolebindingsResource, clusterRoleBinding), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterRoleBinding), err } @@ -115,10 +119,11 @@ func (c *FakeClusterRoleBindings) DeleteCollection(ctx context.Context, opts met // Patch applies the patch and returns the patched clusterRoleBinding. func (c *FakeClusterRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterRoleBinding, err error) { + emptyResult := &v1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolebindingsResource, name, pt, data, subresources...), &v1.ClusterRoleBinding{}) + Invokes(testing.NewRootPatchSubresourceAction(clusterrolebindingsResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterRoleBinding), err } @@ -136,10 +141,11 @@ func (c *FakeClusterRoleBindings) Apply(ctx context.Context, clusterRoleBinding if name == nil { return nil, fmt.Errorf("clusterRoleBinding.Name must be provided to Apply") } + emptyResult := &v1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolebindingsResource, *name, types.ApplyPatchType, data), &v1.ClusterRoleBinding{}) + Invokes(testing.NewRootPatchSubresourceAction(clusterrolebindingsResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.ClusterRoleBinding), err } diff --git a/kubernetes/typed/rbac/v1/fake/fake_role.go b/kubernetes/typed/rbac/v1/fake/fake_role.go index a3bc5da663..ef5e736707 100644 --- a/kubernetes/typed/rbac/v1/fake/fake_role.go +++ b/kubernetes/typed/rbac/v1/fake/fake_role.go @@ -44,22 +44,24 @@ var rolesKind = v1.SchemeGroupVersion.WithKind("Role") // Get takes name of the role, and returns the corresponding role object, and an error if there is any. func (c *FakeRoles) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Role, err error) { + emptyResult := &v1.Role{} obj, err := c.Fake. - Invokes(testing.NewGetAction(rolesResource, c.ns, name), &v1.Role{}) + Invokes(testing.NewGetAction(rolesResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Role), err } // List takes label and field selectors, and returns the list of Roles that match those selectors. func (c *FakeRoles) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleList, err error) { + emptyResult := &v1.RoleList{} obj, err := c.Fake. - Invokes(testing.NewListAction(rolesResource, rolesKind, c.ns, opts), &v1.RoleList{}) + Invokes(testing.NewListAction(rolesResource, rolesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeRoles) Watch(ctx context.Context, opts metav1.ListOptions) (watch.I // Create takes the representation of a role and creates it. Returns the server's representation of the role, and an error, if there is any. func (c *FakeRoles) Create(ctx context.Context, role *v1.Role, opts metav1.CreateOptions) (result *v1.Role, err error) { + emptyResult := &v1.Role{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(rolesResource, c.ns, role), &v1.Role{}) + Invokes(testing.NewCreateAction(rolesResource, c.ns, role), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Role), err } // Update takes the representation of a role and updates it. Returns the server's representation of the role, and an error, if there is any. func (c *FakeRoles) Update(ctx context.Context, role *v1.Role, opts metav1.UpdateOptions) (result *v1.Role, err error) { + emptyResult := &v1.Role{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(rolesResource, c.ns, role), &v1.Role{}) + Invokes(testing.NewUpdateAction(rolesResource, c.ns, role), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Role), err } @@ -122,11 +126,12 @@ func (c *FakeRoles) DeleteCollection(ctx context.Context, opts metav1.DeleteOpti // Patch applies the patch and returns the patched role. func (c *FakeRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Role, err error) { + emptyResult := &v1.Role{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolesResource, c.ns, name, pt, data, subresources...), &v1.Role{}) + Invokes(testing.NewPatchSubresourceAction(rolesResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Role), err } @@ -144,11 +149,12 @@ func (c *FakeRoles) Apply(ctx context.Context, role *rbacv1.RoleApplyConfigurati if name == nil { return nil, fmt.Errorf("role.Name must be provided to Apply") } + emptyResult := &v1.Role{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolesResource, c.ns, *name, types.ApplyPatchType, data), &v1.Role{}) + Invokes(testing.NewPatchSubresourceAction(rolesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.Role), err } diff --git a/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go b/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go index eeb37e9db3..e9624cd2e4 100644 --- a/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go +++ b/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go @@ -44,22 +44,24 @@ var rolebindingsKind = v1.SchemeGroupVersion.WithKind("RoleBinding") // Get takes name of the roleBinding, and returns the corresponding roleBinding object, and an error if there is any. func (c *FakeRoleBindings) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RoleBinding, err error) { + emptyResult := &v1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewGetAction(rolebindingsResource, c.ns, name), &v1.RoleBinding{}) + Invokes(testing.NewGetAction(rolebindingsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RoleBinding), err } // List takes label and field selectors, and returns the list of RoleBindings that match those selectors. func (c *FakeRoleBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleBindingList, err error) { + emptyResult := &v1.RoleBindingList{} obj, err := c.Fake. - Invokes(testing.NewListAction(rolebindingsResource, rolebindingsKind, c.ns, opts), &v1.RoleBindingList{}) + Invokes(testing.NewListAction(rolebindingsResource, rolebindingsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeRoleBindings) Watch(ctx context.Context, opts metav1.ListOptions) ( // Create takes the representation of a roleBinding and creates it. Returns the server's representation of the roleBinding, and an error, if there is any. func (c *FakeRoleBindings) Create(ctx context.Context, roleBinding *v1.RoleBinding, opts metav1.CreateOptions) (result *v1.RoleBinding, err error) { + emptyResult := &v1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(rolebindingsResource, c.ns, roleBinding), &v1.RoleBinding{}) + Invokes(testing.NewCreateAction(rolebindingsResource, c.ns, roleBinding), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RoleBinding), err } // Update takes the representation of a roleBinding and updates it. Returns the server's representation of the roleBinding, and an error, if there is any. func (c *FakeRoleBindings) Update(ctx context.Context, roleBinding *v1.RoleBinding, opts metav1.UpdateOptions) (result *v1.RoleBinding, err error) { + emptyResult := &v1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(rolebindingsResource, c.ns, roleBinding), &v1.RoleBinding{}) + Invokes(testing.NewUpdateAction(rolebindingsResource, c.ns, roleBinding), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RoleBinding), err } @@ -122,11 +126,12 @@ func (c *FakeRoleBindings) DeleteCollection(ctx context.Context, opts metav1.Del // Patch applies the patch and returns the patched roleBinding. func (c *FakeRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RoleBinding, err error) { + emptyResult := &v1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolebindingsResource, c.ns, name, pt, data, subresources...), &v1.RoleBinding{}) + Invokes(testing.NewPatchSubresourceAction(rolebindingsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RoleBinding), err } @@ -144,11 +149,12 @@ func (c *FakeRoleBindings) Apply(ctx context.Context, roleBinding *rbacv1.RoleBi if name == nil { return nil, fmt.Errorf("roleBinding.Name must be provided to Apply") } + emptyResult := &v1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolebindingsResource, c.ns, *name, types.ApplyPatchType, data), &v1.RoleBinding{}) + Invokes(testing.NewPatchSubresourceAction(rolebindingsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.RoleBinding), err } diff --git a/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go b/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go index 534a1990f5..f953a91c67 100644 --- a/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go +++ b/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go @@ -43,20 +43,22 @@ var clusterrolesKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterRole") // Get takes name of the clusterRole, and returns the corresponding clusterRole object, and an error if there is any. func (c *FakeClusterRoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterRole, err error) { + emptyResult := &v1alpha1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clusterrolesResource, name), &v1alpha1.ClusterRole{}) + Invokes(testing.NewRootGetAction(clusterrolesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ClusterRole), err } // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. func (c *FakeClusterRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleList, err error) { + emptyResult := &v1alpha1.ClusterRoleList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(clusterrolesResource, clusterrolesKind, opts), &v1alpha1.ClusterRoleList{}) + Invokes(testing.NewRootListAction(clusterrolesResource, clusterrolesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeClusterRoles) Watch(ctx context.Context, opts v1.ListOptions) (watc // Create takes the representation of a clusterRole and creates it. Returns the server's representation of the clusterRole, and an error, if there is any. func (c *FakeClusterRoles) Create(ctx context.Context, clusterRole *v1alpha1.ClusterRole, opts v1.CreateOptions) (result *v1alpha1.ClusterRole, err error) { + emptyResult := &v1alpha1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clusterrolesResource, clusterRole), &v1alpha1.ClusterRole{}) + Invokes(testing.NewRootCreateAction(clusterrolesResource, clusterRole), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ClusterRole), err } // Update takes the representation of a clusterRole and updates it. Returns the server's representation of the clusterRole, and an error, if there is any. func (c *FakeClusterRoles) Update(ctx context.Context, clusterRole *v1alpha1.ClusterRole, opts v1.UpdateOptions) (result *v1alpha1.ClusterRole, err error) { + emptyResult := &v1alpha1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clusterrolesResource, clusterRole), &v1alpha1.ClusterRole{}) + Invokes(testing.NewRootUpdateAction(clusterrolesResource, clusterRole), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ClusterRole), err } @@ -115,10 +119,11 @@ func (c *FakeClusterRoles) DeleteCollection(ctx context.Context, opts v1.DeleteO // Patch applies the patch and returns the patched clusterRole. func (c *FakeClusterRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterRole, err error) { + emptyResult := &v1alpha1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolesResource, name, pt, data, subresources...), &v1alpha1.ClusterRole{}) + Invokes(testing.NewRootPatchSubresourceAction(clusterrolesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ClusterRole), err } @@ -136,10 +141,11 @@ func (c *FakeClusterRoles) Apply(ctx context.Context, clusterRole *rbacv1alpha1. if name == nil { return nil, fmt.Errorf("clusterRole.Name must be provided to Apply") } + emptyResult := &v1alpha1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolesResource, *name, types.ApplyPatchType, data), &v1alpha1.ClusterRole{}) + Invokes(testing.NewRootPatchSubresourceAction(clusterrolesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ClusterRole), err } diff --git a/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go b/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go index 0a4359392d..7b0ee96c79 100644 --- a/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go +++ b/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go @@ -43,20 +43,22 @@ var clusterrolebindingsKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterRoleB // Get takes name of the clusterRoleBinding, and returns the corresponding clusterRoleBinding object, and an error if there is any. func (c *FakeClusterRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterRoleBinding, err error) { + emptyResult := &v1alpha1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clusterrolebindingsResource, name), &v1alpha1.ClusterRoleBinding{}) + Invokes(testing.NewRootGetAction(clusterrolebindingsResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ClusterRoleBinding), err } // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. func (c *FakeClusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleBindingList, err error) { + emptyResult := &v1alpha1.ClusterRoleBindingList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(clusterrolebindingsResource, clusterrolebindingsKind, opts), &v1alpha1.ClusterRoleBindingList{}) + Invokes(testing.NewRootListAction(clusterrolebindingsResource, clusterrolebindingsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeClusterRoleBindings) Watch(ctx context.Context, opts v1.ListOptions // Create takes the representation of a clusterRoleBinding and creates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. func (c *FakeClusterRoleBindings) Create(ctx context.Context, clusterRoleBinding *v1alpha1.ClusterRoleBinding, opts v1.CreateOptions) (result *v1alpha1.ClusterRoleBinding, err error) { + emptyResult := &v1alpha1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clusterrolebindingsResource, clusterRoleBinding), &v1alpha1.ClusterRoleBinding{}) + Invokes(testing.NewRootCreateAction(clusterrolebindingsResource, clusterRoleBinding), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ClusterRoleBinding), err } // Update takes the representation of a clusterRoleBinding and updates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. func (c *FakeClusterRoleBindings) Update(ctx context.Context, clusterRoleBinding *v1alpha1.ClusterRoleBinding, opts v1.UpdateOptions) (result *v1alpha1.ClusterRoleBinding, err error) { + emptyResult := &v1alpha1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clusterrolebindingsResource, clusterRoleBinding), &v1alpha1.ClusterRoleBinding{}) + Invokes(testing.NewRootUpdateAction(clusterrolebindingsResource, clusterRoleBinding), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ClusterRoleBinding), err } @@ -115,10 +119,11 @@ func (c *FakeClusterRoleBindings) DeleteCollection(ctx context.Context, opts v1. // Patch applies the patch and returns the patched clusterRoleBinding. func (c *FakeClusterRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterRoleBinding, err error) { + emptyResult := &v1alpha1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolebindingsResource, name, pt, data, subresources...), &v1alpha1.ClusterRoleBinding{}) + Invokes(testing.NewRootPatchSubresourceAction(clusterrolebindingsResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ClusterRoleBinding), err } @@ -136,10 +141,11 @@ func (c *FakeClusterRoleBindings) Apply(ctx context.Context, clusterRoleBinding if name == nil { return nil, fmt.Errorf("clusterRoleBinding.Name must be provided to Apply") } + emptyResult := &v1alpha1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolebindingsResource, *name, types.ApplyPatchType, data), &v1alpha1.ClusterRoleBinding{}) + Invokes(testing.NewRootPatchSubresourceAction(clusterrolebindingsResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.ClusterRoleBinding), err } diff --git a/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go b/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go index a0e28348ae..738180ce85 100644 --- a/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go +++ b/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go @@ -44,22 +44,24 @@ var rolesKind = v1alpha1.SchemeGroupVersion.WithKind("Role") // Get takes name of the role, and returns the corresponding role object, and an error if there is any. func (c *FakeRoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Role, err error) { + emptyResult := &v1alpha1.Role{} obj, err := c.Fake. - Invokes(testing.NewGetAction(rolesResource, c.ns, name), &v1alpha1.Role{}) + Invokes(testing.NewGetAction(rolesResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Role), err } // List takes label and field selectors, and returns the list of Roles that match those selectors. func (c *FakeRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleList, err error) { + emptyResult := &v1alpha1.RoleList{} obj, err := c.Fake. - Invokes(testing.NewListAction(rolesResource, rolesKind, c.ns, opts), &v1alpha1.RoleList{}) + Invokes(testing.NewListAction(rolesResource, rolesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Inter // Create takes the representation of a role and creates it. Returns the server's representation of the role, and an error, if there is any. func (c *FakeRoles) Create(ctx context.Context, role *v1alpha1.Role, opts v1.CreateOptions) (result *v1alpha1.Role, err error) { + emptyResult := &v1alpha1.Role{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(rolesResource, c.ns, role), &v1alpha1.Role{}) + Invokes(testing.NewCreateAction(rolesResource, c.ns, role), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Role), err } // Update takes the representation of a role and updates it. Returns the server's representation of the role, and an error, if there is any. func (c *FakeRoles) Update(ctx context.Context, role *v1alpha1.Role, opts v1.UpdateOptions) (result *v1alpha1.Role, err error) { + emptyResult := &v1alpha1.Role{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(rolesResource, c.ns, role), &v1alpha1.Role{}) + Invokes(testing.NewUpdateAction(rolesResource, c.ns, role), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Role), err } @@ -122,11 +126,12 @@ func (c *FakeRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, // Patch applies the patch and returns the patched role. func (c *FakeRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Role, err error) { + emptyResult := &v1alpha1.Role{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolesResource, c.ns, name, pt, data, subresources...), &v1alpha1.Role{}) + Invokes(testing.NewPatchSubresourceAction(rolesResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Role), err } @@ -144,11 +149,12 @@ func (c *FakeRoles) Apply(ctx context.Context, role *rbacv1alpha1.RoleApplyConfi if name == nil { return nil, fmt.Errorf("role.Name must be provided to Apply") } + emptyResult := &v1alpha1.Role{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.Role{}) + Invokes(testing.NewPatchSubresourceAction(rolesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.Role), err } diff --git a/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go b/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go index 76649f5c2b..3fb9549b8d 100644 --- a/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go +++ b/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go @@ -44,22 +44,24 @@ var rolebindingsKind = v1alpha1.SchemeGroupVersion.WithKind("RoleBinding") // Get takes name of the roleBinding, and returns the corresponding roleBinding object, and an error if there is any. func (c *FakeRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RoleBinding, err error) { + emptyResult := &v1alpha1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewGetAction(rolebindingsResource, c.ns, name), &v1alpha1.RoleBinding{}) + Invokes(testing.NewGetAction(rolebindingsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.RoleBinding), err } // List takes label and field selectors, and returns the list of RoleBindings that match those selectors. func (c *FakeRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleBindingList, err error) { + emptyResult := &v1alpha1.RoleBindingList{} obj, err := c.Fake. - Invokes(testing.NewListAction(rolebindingsResource, rolebindingsKind, c.ns, opts), &v1alpha1.RoleBindingList{}) + Invokes(testing.NewListAction(rolebindingsResource, rolebindingsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watc // Create takes the representation of a roleBinding and creates it. Returns the server's representation of the roleBinding, and an error, if there is any. func (c *FakeRoleBindings) Create(ctx context.Context, roleBinding *v1alpha1.RoleBinding, opts v1.CreateOptions) (result *v1alpha1.RoleBinding, err error) { + emptyResult := &v1alpha1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(rolebindingsResource, c.ns, roleBinding), &v1alpha1.RoleBinding{}) + Invokes(testing.NewCreateAction(rolebindingsResource, c.ns, roleBinding), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.RoleBinding), err } // Update takes the representation of a roleBinding and updates it. Returns the server's representation of the roleBinding, and an error, if there is any. func (c *FakeRoleBindings) Update(ctx context.Context, roleBinding *v1alpha1.RoleBinding, opts v1.UpdateOptions) (result *v1alpha1.RoleBinding, err error) { + emptyResult := &v1alpha1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(rolebindingsResource, c.ns, roleBinding), &v1alpha1.RoleBinding{}) + Invokes(testing.NewUpdateAction(rolebindingsResource, c.ns, roleBinding), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.RoleBinding), err } @@ -122,11 +126,12 @@ func (c *FakeRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteO // Patch applies the patch and returns the patched roleBinding. func (c *FakeRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RoleBinding, err error) { + emptyResult := &v1alpha1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolebindingsResource, c.ns, name, pt, data, subresources...), &v1alpha1.RoleBinding{}) + Invokes(testing.NewPatchSubresourceAction(rolebindingsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.RoleBinding), err } @@ -144,11 +149,12 @@ func (c *FakeRoleBindings) Apply(ctx context.Context, roleBinding *rbacv1alpha1. if name == nil { return nil, fmt.Errorf("roleBinding.Name must be provided to Apply") } + emptyResult := &v1alpha1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolebindingsResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.RoleBinding{}) + Invokes(testing.NewPatchSubresourceAction(rolebindingsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.RoleBinding), err } diff --git a/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go b/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go index 2a94a4315e..da45ac6f0f 100644 --- a/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go +++ b/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go @@ -43,20 +43,22 @@ var clusterrolesKind = v1beta1.SchemeGroupVersion.WithKind("ClusterRole") // Get takes name of the clusterRole, and returns the corresponding clusterRole object, and an error if there is any. func (c *FakeClusterRoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterRole, err error) { + emptyResult := &v1beta1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clusterrolesResource, name), &v1beta1.ClusterRole{}) + Invokes(testing.NewRootGetAction(clusterrolesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ClusterRole), err } // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. func (c *FakeClusterRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleList, err error) { + emptyResult := &v1beta1.ClusterRoleList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(clusterrolesResource, clusterrolesKind, opts), &v1beta1.ClusterRoleList{}) + Invokes(testing.NewRootListAction(clusterrolesResource, clusterrolesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeClusterRoles) Watch(ctx context.Context, opts v1.ListOptions) (watc // Create takes the representation of a clusterRole and creates it. Returns the server's representation of the clusterRole, and an error, if there is any. func (c *FakeClusterRoles) Create(ctx context.Context, clusterRole *v1beta1.ClusterRole, opts v1.CreateOptions) (result *v1beta1.ClusterRole, err error) { + emptyResult := &v1beta1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clusterrolesResource, clusterRole), &v1beta1.ClusterRole{}) + Invokes(testing.NewRootCreateAction(clusterrolesResource, clusterRole), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ClusterRole), err } // Update takes the representation of a clusterRole and updates it. Returns the server's representation of the clusterRole, and an error, if there is any. func (c *FakeClusterRoles) Update(ctx context.Context, clusterRole *v1beta1.ClusterRole, opts v1.UpdateOptions) (result *v1beta1.ClusterRole, err error) { + emptyResult := &v1beta1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clusterrolesResource, clusterRole), &v1beta1.ClusterRole{}) + Invokes(testing.NewRootUpdateAction(clusterrolesResource, clusterRole), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ClusterRole), err } @@ -115,10 +119,11 @@ func (c *FakeClusterRoles) DeleteCollection(ctx context.Context, opts v1.DeleteO // Patch applies the patch and returns the patched clusterRole. func (c *FakeClusterRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterRole, err error) { + emptyResult := &v1beta1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolesResource, name, pt, data, subresources...), &v1beta1.ClusterRole{}) + Invokes(testing.NewRootPatchSubresourceAction(clusterrolesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ClusterRole), err } @@ -136,10 +141,11 @@ func (c *FakeClusterRoles) Apply(ctx context.Context, clusterRole *rbacv1beta1.C if name == nil { return nil, fmt.Errorf("clusterRole.Name must be provided to Apply") } + emptyResult := &v1beta1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolesResource, *name, types.ApplyPatchType, data), &v1beta1.ClusterRole{}) + Invokes(testing.NewRootPatchSubresourceAction(clusterrolesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ClusterRole), err } diff --git a/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go b/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go index c9fd7c0cdd..fc7de1d683 100644 --- a/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go +++ b/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go @@ -43,20 +43,22 @@ var clusterrolebindingsKind = v1beta1.SchemeGroupVersion.WithKind("ClusterRoleBi // Get takes name of the clusterRoleBinding, and returns the corresponding clusterRoleBinding object, and an error if there is any. func (c *FakeClusterRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterRoleBinding, err error) { + emptyResult := &v1beta1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clusterrolebindingsResource, name), &v1beta1.ClusterRoleBinding{}) + Invokes(testing.NewRootGetAction(clusterrolebindingsResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ClusterRoleBinding), err } // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. func (c *FakeClusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleBindingList, err error) { + emptyResult := &v1beta1.ClusterRoleBindingList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(clusterrolebindingsResource, clusterrolebindingsKind, opts), &v1beta1.ClusterRoleBindingList{}) + Invokes(testing.NewRootListAction(clusterrolebindingsResource, clusterrolebindingsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeClusterRoleBindings) Watch(ctx context.Context, opts v1.ListOptions // Create takes the representation of a clusterRoleBinding and creates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. func (c *FakeClusterRoleBindings) Create(ctx context.Context, clusterRoleBinding *v1beta1.ClusterRoleBinding, opts v1.CreateOptions) (result *v1beta1.ClusterRoleBinding, err error) { + emptyResult := &v1beta1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clusterrolebindingsResource, clusterRoleBinding), &v1beta1.ClusterRoleBinding{}) + Invokes(testing.NewRootCreateAction(clusterrolebindingsResource, clusterRoleBinding), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ClusterRoleBinding), err } // Update takes the representation of a clusterRoleBinding and updates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. func (c *FakeClusterRoleBindings) Update(ctx context.Context, clusterRoleBinding *v1beta1.ClusterRoleBinding, opts v1.UpdateOptions) (result *v1beta1.ClusterRoleBinding, err error) { + emptyResult := &v1beta1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clusterrolebindingsResource, clusterRoleBinding), &v1beta1.ClusterRoleBinding{}) + Invokes(testing.NewRootUpdateAction(clusterrolebindingsResource, clusterRoleBinding), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ClusterRoleBinding), err } @@ -115,10 +119,11 @@ func (c *FakeClusterRoleBindings) DeleteCollection(ctx context.Context, opts v1. // Patch applies the patch and returns the patched clusterRoleBinding. func (c *FakeClusterRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterRoleBinding, err error) { + emptyResult := &v1beta1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolebindingsResource, name, pt, data, subresources...), &v1beta1.ClusterRoleBinding{}) + Invokes(testing.NewRootPatchSubresourceAction(clusterrolebindingsResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ClusterRoleBinding), err } @@ -136,10 +141,11 @@ func (c *FakeClusterRoleBindings) Apply(ctx context.Context, clusterRoleBinding if name == nil { return nil, fmt.Errorf("clusterRoleBinding.Name must be provided to Apply") } + emptyResult := &v1beta1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolebindingsResource, *name, types.ApplyPatchType, data), &v1beta1.ClusterRoleBinding{}) + Invokes(testing.NewRootPatchSubresourceAction(clusterrolebindingsResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.ClusterRoleBinding), err } diff --git a/kubernetes/typed/rbac/v1beta1/fake/fake_role.go b/kubernetes/typed/rbac/v1beta1/fake/fake_role.go index 4158cf1d55..6f7b59c2c1 100644 --- a/kubernetes/typed/rbac/v1beta1/fake/fake_role.go +++ b/kubernetes/typed/rbac/v1beta1/fake/fake_role.go @@ -44,22 +44,24 @@ var rolesKind = v1beta1.SchemeGroupVersion.WithKind("Role") // Get takes name of the role, and returns the corresponding role object, and an error if there is any. func (c *FakeRoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Role, err error) { + emptyResult := &v1beta1.Role{} obj, err := c.Fake. - Invokes(testing.NewGetAction(rolesResource, c.ns, name), &v1beta1.Role{}) + Invokes(testing.NewGetAction(rolesResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Role), err } // List takes label and field selectors, and returns the list of Roles that match those selectors. func (c *FakeRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleList, err error) { + emptyResult := &v1beta1.RoleList{} obj, err := c.Fake. - Invokes(testing.NewListAction(rolesResource, rolesKind, c.ns, opts), &v1beta1.RoleList{}) + Invokes(testing.NewListAction(rolesResource, rolesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Inter // Create takes the representation of a role and creates it. Returns the server's representation of the role, and an error, if there is any. func (c *FakeRoles) Create(ctx context.Context, role *v1beta1.Role, opts v1.CreateOptions) (result *v1beta1.Role, err error) { + emptyResult := &v1beta1.Role{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(rolesResource, c.ns, role), &v1beta1.Role{}) + Invokes(testing.NewCreateAction(rolesResource, c.ns, role), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Role), err } // Update takes the representation of a role and updates it. Returns the server's representation of the role, and an error, if there is any. func (c *FakeRoles) Update(ctx context.Context, role *v1beta1.Role, opts v1.UpdateOptions) (result *v1beta1.Role, err error) { + emptyResult := &v1beta1.Role{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(rolesResource, c.ns, role), &v1beta1.Role{}) + Invokes(testing.NewUpdateAction(rolesResource, c.ns, role), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Role), err } @@ -122,11 +126,12 @@ func (c *FakeRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, // Patch applies the patch and returns the patched role. func (c *FakeRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Role, err error) { + emptyResult := &v1beta1.Role{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolesResource, c.ns, name, pt, data, subresources...), &v1beta1.Role{}) + Invokes(testing.NewPatchSubresourceAction(rolesResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Role), err } @@ -144,11 +149,12 @@ func (c *FakeRoles) Apply(ctx context.Context, role *rbacv1beta1.RoleApplyConfig if name == nil { return nil, fmt.Errorf("role.Name must be provided to Apply") } + emptyResult := &v1beta1.Role{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolesResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.Role{}) + Invokes(testing.NewPatchSubresourceAction(rolesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.Role), err } diff --git a/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go b/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go index 4616f0fd10..7bbf5aceff 100644 --- a/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go +++ b/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go @@ -44,22 +44,24 @@ var rolebindingsKind = v1beta1.SchemeGroupVersion.WithKind("RoleBinding") // Get takes name of the roleBinding, and returns the corresponding roleBinding object, and an error if there is any. func (c *FakeRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.RoleBinding, err error) { + emptyResult := &v1beta1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewGetAction(rolebindingsResource, c.ns, name), &v1beta1.RoleBinding{}) + Invokes(testing.NewGetAction(rolebindingsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.RoleBinding), err } // List takes label and field selectors, and returns the list of RoleBindings that match those selectors. func (c *FakeRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleBindingList, err error) { + emptyResult := &v1beta1.RoleBindingList{} obj, err := c.Fake. - Invokes(testing.NewListAction(rolebindingsResource, rolebindingsKind, c.ns, opts), &v1beta1.RoleBindingList{}) + Invokes(testing.NewListAction(rolebindingsResource, rolebindingsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watc // Create takes the representation of a roleBinding and creates it. Returns the server's representation of the roleBinding, and an error, if there is any. func (c *FakeRoleBindings) Create(ctx context.Context, roleBinding *v1beta1.RoleBinding, opts v1.CreateOptions) (result *v1beta1.RoleBinding, err error) { + emptyResult := &v1beta1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(rolebindingsResource, c.ns, roleBinding), &v1beta1.RoleBinding{}) + Invokes(testing.NewCreateAction(rolebindingsResource, c.ns, roleBinding), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.RoleBinding), err } // Update takes the representation of a roleBinding and updates it. Returns the server's representation of the roleBinding, and an error, if there is any. func (c *FakeRoleBindings) Update(ctx context.Context, roleBinding *v1beta1.RoleBinding, opts v1.UpdateOptions) (result *v1beta1.RoleBinding, err error) { + emptyResult := &v1beta1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(rolebindingsResource, c.ns, roleBinding), &v1beta1.RoleBinding{}) + Invokes(testing.NewUpdateAction(rolebindingsResource, c.ns, roleBinding), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.RoleBinding), err } @@ -122,11 +126,12 @@ func (c *FakeRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteO // Patch applies the patch and returns the patched roleBinding. func (c *FakeRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.RoleBinding, err error) { + emptyResult := &v1beta1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolebindingsResource, c.ns, name, pt, data, subresources...), &v1beta1.RoleBinding{}) + Invokes(testing.NewPatchSubresourceAction(rolebindingsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.RoleBinding), err } @@ -144,11 +149,12 @@ func (c *FakeRoleBindings) Apply(ctx context.Context, roleBinding *rbacv1beta1.R if name == nil { return nil, fmt.Errorf("roleBinding.Name must be provided to Apply") } + emptyResult := &v1beta1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolebindingsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.RoleBinding{}) + Invokes(testing.NewPatchSubresourceAction(rolebindingsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.RoleBinding), err } diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_podschedulingcontext.go b/kubernetes/typed/resource/v1alpha2/fake/fake_podschedulingcontext.go index 54882f8175..6fda8c53a2 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_podschedulingcontext.go +++ b/kubernetes/typed/resource/v1alpha2/fake/fake_podschedulingcontext.go @@ -44,22 +44,24 @@ var podschedulingcontextsKind = v1alpha2.SchemeGroupVersion.WithKind("PodSchedul // Get takes name of the podSchedulingContext, and returns the corresponding podSchedulingContext object, and an error if there is any. func (c *FakePodSchedulingContexts) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.PodSchedulingContext, err error) { + emptyResult := &v1alpha2.PodSchedulingContext{} obj, err := c.Fake. - Invokes(testing.NewGetAction(podschedulingcontextsResource, c.ns, name), &v1alpha2.PodSchedulingContext{}) + Invokes(testing.NewGetAction(podschedulingcontextsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.PodSchedulingContext), err } // List takes label and field selectors, and returns the list of PodSchedulingContexts that match those selectors. func (c *FakePodSchedulingContexts) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.PodSchedulingContextList, err error) { + emptyResult := &v1alpha2.PodSchedulingContextList{} obj, err := c.Fake. - Invokes(testing.NewListAction(podschedulingcontextsResource, podschedulingcontextsKind, c.ns, opts), &v1alpha2.PodSchedulingContextList{}) + Invokes(testing.NewListAction(podschedulingcontextsResource, podschedulingcontextsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakePodSchedulingContexts) Watch(ctx context.Context, opts v1.ListOptio // Create takes the representation of a podSchedulingContext and creates it. Returns the server's representation of the podSchedulingContext, and an error, if there is any. func (c *FakePodSchedulingContexts) Create(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.CreateOptions) (result *v1alpha2.PodSchedulingContext, err error) { + emptyResult := &v1alpha2.PodSchedulingContext{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(podschedulingcontextsResource, c.ns, podSchedulingContext), &v1alpha2.PodSchedulingContext{}) + Invokes(testing.NewCreateAction(podschedulingcontextsResource, c.ns, podSchedulingContext), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.PodSchedulingContext), err } // Update takes the representation of a podSchedulingContext and updates it. Returns the server's representation of the podSchedulingContext, and an error, if there is any. func (c *FakePodSchedulingContexts) Update(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.UpdateOptions) (result *v1alpha2.PodSchedulingContext, err error) { + emptyResult := &v1alpha2.PodSchedulingContext{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(podschedulingcontextsResource, c.ns, podSchedulingContext), &v1alpha2.PodSchedulingContext{}) + Invokes(testing.NewUpdateAction(podschedulingcontextsResource, c.ns, podSchedulingContext), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.PodSchedulingContext), 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 *FakePodSchedulingContexts) UpdateStatus(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.UpdateOptions) (*v1alpha2.PodSchedulingContext, error) { +func (c *FakePodSchedulingContexts) UpdateStatus(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.UpdateOptions) (result *v1alpha2.PodSchedulingContext, err error) { + emptyResult := &v1alpha2.PodSchedulingContext{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(podschedulingcontextsResource, "status", c.ns, podSchedulingContext), &v1alpha2.PodSchedulingContext{}) + Invokes(testing.NewUpdateSubresourceAction(podschedulingcontextsResource, "status", c.ns, podSchedulingContext), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.PodSchedulingContext), err } @@ -134,11 +139,12 @@ func (c *FakePodSchedulingContexts) DeleteCollection(ctx context.Context, opts v // Patch applies the patch and returns the patched podSchedulingContext. func (c *FakePodSchedulingContexts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.PodSchedulingContext, err error) { + emptyResult := &v1alpha2.PodSchedulingContext{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(podschedulingcontextsResource, c.ns, name, pt, data, subresources...), &v1alpha2.PodSchedulingContext{}) + Invokes(testing.NewPatchSubresourceAction(podschedulingcontextsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.PodSchedulingContext), err } @@ -156,11 +162,12 @@ func (c *FakePodSchedulingContexts) Apply(ctx context.Context, podSchedulingCont if name == nil { return nil, fmt.Errorf("podSchedulingContext.Name must be provided to Apply") } + emptyResult := &v1alpha2.PodSchedulingContext{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(podschedulingcontextsResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha2.PodSchedulingContext{}) + Invokes(testing.NewPatchSubresourceAction(podschedulingcontextsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.PodSchedulingContext), err } @@ -179,11 +186,12 @@ func (c *FakePodSchedulingContexts) ApplyStatus(ctx context.Context, podScheduli if name == nil { return nil, fmt.Errorf("podSchedulingContext.Name must be provided to Apply") } + emptyResult := &v1alpha2.PodSchedulingContext{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(podschedulingcontextsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha2.PodSchedulingContext{}) + Invokes(testing.NewPatchSubresourceAction(podschedulingcontextsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.PodSchedulingContext), err } diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaim.go b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaim.go index 087e51f714..30fb78ce80 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaim.go +++ b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaim.go @@ -44,22 +44,24 @@ var resourceclaimsKind = v1alpha2.SchemeGroupVersion.WithKind("ResourceClaim") // Get takes name of the resourceClaim, and returns the corresponding resourceClaim object, and an error if there is any. func (c *FakeResourceClaims) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClaim, err error) { + emptyResult := &v1alpha2.ResourceClaim{} obj, err := c.Fake. - Invokes(testing.NewGetAction(resourceclaimsResource, c.ns, name), &v1alpha2.ResourceClaim{}) + Invokes(testing.NewGetAction(resourceclaimsResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClaim), err } // List takes label and field selectors, and returns the list of ResourceClaims that match those selectors. func (c *FakeResourceClaims) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimList, err error) { + emptyResult := &v1alpha2.ResourceClaimList{} obj, err := c.Fake. - Invokes(testing.NewListAction(resourceclaimsResource, resourceclaimsKind, c.ns, opts), &v1alpha2.ResourceClaimList{}) + Invokes(testing.NewListAction(resourceclaimsResource, resourceclaimsKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,34 +86,37 @@ func (c *FakeResourceClaims) Watch(ctx context.Context, opts v1.ListOptions) (wa // Create takes the representation of a resourceClaim and creates it. Returns the server's representation of the resourceClaim, and an error, if there is any. func (c *FakeResourceClaims) Create(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.CreateOptions) (result *v1alpha2.ResourceClaim, err error) { + emptyResult := &v1alpha2.ResourceClaim{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(resourceclaimsResource, c.ns, resourceClaim), &v1alpha2.ResourceClaim{}) + Invokes(testing.NewCreateAction(resourceclaimsResource, c.ns, resourceClaim), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClaim), err } // Update takes the representation of a resourceClaim and updates it. Returns the server's representation of the resourceClaim, and an error, if there is any. func (c *FakeResourceClaims) Update(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.UpdateOptions) (result *v1alpha2.ResourceClaim, err error) { + emptyResult := &v1alpha2.ResourceClaim{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(resourceclaimsResource, c.ns, resourceClaim), &v1alpha2.ResourceClaim{}) + Invokes(testing.NewUpdateAction(resourceclaimsResource, c.ns, resourceClaim), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClaim), 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 *FakeResourceClaims) UpdateStatus(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.UpdateOptions) (*v1alpha2.ResourceClaim, error) { +func (c *FakeResourceClaims) UpdateStatus(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.UpdateOptions) (result *v1alpha2.ResourceClaim, err error) { + emptyResult := &v1alpha2.ResourceClaim{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(resourceclaimsResource, "status", c.ns, resourceClaim), &v1alpha2.ResourceClaim{}) + Invokes(testing.NewUpdateSubresourceAction(resourceclaimsResource, "status", c.ns, resourceClaim), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClaim), err } @@ -134,11 +139,12 @@ func (c *FakeResourceClaims) DeleteCollection(ctx context.Context, opts v1.Delet // Patch applies the patch and returns the patched resourceClaim. func (c *FakeResourceClaims) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClaim, err error) { + emptyResult := &v1alpha2.ResourceClaim{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourceclaimsResource, c.ns, name, pt, data, subresources...), &v1alpha2.ResourceClaim{}) + Invokes(testing.NewPatchSubresourceAction(resourceclaimsResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClaim), err } @@ -156,11 +162,12 @@ func (c *FakeResourceClaims) Apply(ctx context.Context, resourceClaim *resourcev if name == nil { return nil, fmt.Errorf("resourceClaim.Name must be provided to Apply") } + emptyResult := &v1alpha2.ResourceClaim{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourceclaimsResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha2.ResourceClaim{}) + Invokes(testing.NewPatchSubresourceAction(resourceclaimsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClaim), err } @@ -179,11 +186,12 @@ func (c *FakeResourceClaims) ApplyStatus(ctx context.Context, resourceClaim *res if name == nil { return nil, fmt.Errorf("resourceClaim.Name must be provided to Apply") } + emptyResult := &v1alpha2.ResourceClaim{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourceclaimsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1alpha2.ResourceClaim{}) + Invokes(testing.NewPatchSubresourceAction(resourceclaimsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClaim), err } diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimparameters.go b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimparameters.go index da32b5caec..0bd86e4f85 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimparameters.go +++ b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimparameters.go @@ -44,22 +44,24 @@ var resourceclaimparametersKind = v1alpha2.SchemeGroupVersion.WithKind("Resource // Get takes name of the resourceClaimParameters, and returns the corresponding resourceClaimParameters object, and an error if there is any. func (c *FakeResourceClaimParameters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClaimParameters, err error) { + emptyResult := &v1alpha2.ResourceClaimParameters{} obj, err := c.Fake. - Invokes(testing.NewGetAction(resourceclaimparametersResource, c.ns, name), &v1alpha2.ResourceClaimParameters{}) + Invokes(testing.NewGetAction(resourceclaimparametersResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClaimParameters), err } // List takes label and field selectors, and returns the list of ResourceClaimParameters that match those selectors. func (c *FakeResourceClaimParameters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimParametersList, err error) { + emptyResult := &v1alpha2.ResourceClaimParametersList{} obj, err := c.Fake. - Invokes(testing.NewListAction(resourceclaimparametersResource, resourceclaimparametersKind, c.ns, opts), &v1alpha2.ResourceClaimParametersList{}) + Invokes(testing.NewListAction(resourceclaimparametersResource, resourceclaimparametersKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeResourceClaimParameters) Watch(ctx context.Context, opts v1.ListOpt // Create takes the representation of a resourceClaimParameters and creates it. Returns the server's representation of the resourceClaimParameters, and an error, if there is any. func (c *FakeResourceClaimParameters) Create(ctx context.Context, resourceClaimParameters *v1alpha2.ResourceClaimParameters, opts v1.CreateOptions) (result *v1alpha2.ResourceClaimParameters, err error) { + emptyResult := &v1alpha2.ResourceClaimParameters{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(resourceclaimparametersResource, c.ns, resourceClaimParameters), &v1alpha2.ResourceClaimParameters{}) + Invokes(testing.NewCreateAction(resourceclaimparametersResource, c.ns, resourceClaimParameters), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClaimParameters), err } // Update takes the representation of a resourceClaimParameters and updates it. Returns the server's representation of the resourceClaimParameters, and an error, if there is any. func (c *FakeResourceClaimParameters) Update(ctx context.Context, resourceClaimParameters *v1alpha2.ResourceClaimParameters, opts v1.UpdateOptions) (result *v1alpha2.ResourceClaimParameters, err error) { + emptyResult := &v1alpha2.ResourceClaimParameters{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(resourceclaimparametersResource, c.ns, resourceClaimParameters), &v1alpha2.ResourceClaimParameters{}) + Invokes(testing.NewUpdateAction(resourceclaimparametersResource, c.ns, resourceClaimParameters), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClaimParameters), err } @@ -122,11 +126,12 @@ func (c *FakeResourceClaimParameters) DeleteCollection(ctx context.Context, opts // Patch applies the patch and returns the patched resourceClaimParameters. func (c *FakeResourceClaimParameters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClaimParameters, err error) { + emptyResult := &v1alpha2.ResourceClaimParameters{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourceclaimparametersResource, c.ns, name, pt, data, subresources...), &v1alpha2.ResourceClaimParameters{}) + Invokes(testing.NewPatchSubresourceAction(resourceclaimparametersResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClaimParameters), err } @@ -144,11 +149,12 @@ func (c *FakeResourceClaimParameters) Apply(ctx context.Context, resourceClaimPa if name == nil { return nil, fmt.Errorf("resourceClaimParameters.Name must be provided to Apply") } + emptyResult := &v1alpha2.ResourceClaimParameters{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourceclaimparametersResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha2.ResourceClaimParameters{}) + Invokes(testing.NewPatchSubresourceAction(resourceclaimparametersResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClaimParameters), err } diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimtemplate.go b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimtemplate.go index 2a1b4554eb..014356091e 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimtemplate.go +++ b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimtemplate.go @@ -44,22 +44,24 @@ var resourceclaimtemplatesKind = v1alpha2.SchemeGroupVersion.WithKind("ResourceC // Get takes name of the resourceClaimTemplate, and returns the corresponding resourceClaimTemplate object, and an error if there is any. func (c *FakeResourceClaimTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClaimTemplate, err error) { + emptyResult := &v1alpha2.ResourceClaimTemplate{} obj, err := c.Fake. - Invokes(testing.NewGetAction(resourceclaimtemplatesResource, c.ns, name), &v1alpha2.ResourceClaimTemplate{}) + Invokes(testing.NewGetAction(resourceclaimtemplatesResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClaimTemplate), err } // List takes label and field selectors, and returns the list of ResourceClaimTemplates that match those selectors. func (c *FakeResourceClaimTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimTemplateList, err error) { + emptyResult := &v1alpha2.ResourceClaimTemplateList{} obj, err := c.Fake. - Invokes(testing.NewListAction(resourceclaimtemplatesResource, resourceclaimtemplatesKind, c.ns, opts), &v1alpha2.ResourceClaimTemplateList{}) + Invokes(testing.NewListAction(resourceclaimtemplatesResource, resourceclaimtemplatesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeResourceClaimTemplates) Watch(ctx context.Context, opts v1.ListOpti // Create takes the representation of a resourceClaimTemplate and creates it. Returns the server's representation of the resourceClaimTemplate, and an error, if there is any. func (c *FakeResourceClaimTemplates) Create(ctx context.Context, resourceClaimTemplate *v1alpha2.ResourceClaimTemplate, opts v1.CreateOptions) (result *v1alpha2.ResourceClaimTemplate, err error) { + emptyResult := &v1alpha2.ResourceClaimTemplate{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(resourceclaimtemplatesResource, c.ns, resourceClaimTemplate), &v1alpha2.ResourceClaimTemplate{}) + Invokes(testing.NewCreateAction(resourceclaimtemplatesResource, c.ns, resourceClaimTemplate), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClaimTemplate), err } // Update takes the representation of a resourceClaimTemplate and updates it. Returns the server's representation of the resourceClaimTemplate, and an error, if there is any. func (c *FakeResourceClaimTemplates) Update(ctx context.Context, resourceClaimTemplate *v1alpha2.ResourceClaimTemplate, opts v1.UpdateOptions) (result *v1alpha2.ResourceClaimTemplate, err error) { + emptyResult := &v1alpha2.ResourceClaimTemplate{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(resourceclaimtemplatesResource, c.ns, resourceClaimTemplate), &v1alpha2.ResourceClaimTemplate{}) + Invokes(testing.NewUpdateAction(resourceclaimtemplatesResource, c.ns, resourceClaimTemplate), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClaimTemplate), err } @@ -122,11 +126,12 @@ func (c *FakeResourceClaimTemplates) DeleteCollection(ctx context.Context, opts // Patch applies the patch and returns the patched resourceClaimTemplate. func (c *FakeResourceClaimTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClaimTemplate, err error) { + emptyResult := &v1alpha2.ResourceClaimTemplate{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourceclaimtemplatesResource, c.ns, name, pt, data, subresources...), &v1alpha2.ResourceClaimTemplate{}) + Invokes(testing.NewPatchSubresourceAction(resourceclaimtemplatesResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClaimTemplate), err } @@ -144,11 +149,12 @@ func (c *FakeResourceClaimTemplates) Apply(ctx context.Context, resourceClaimTem if name == nil { return nil, fmt.Errorf("resourceClaimTemplate.Name must be provided to Apply") } + emptyResult := &v1alpha2.ResourceClaimTemplate{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourceclaimtemplatesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha2.ResourceClaimTemplate{}) + Invokes(testing.NewPatchSubresourceAction(resourceclaimtemplatesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClaimTemplate), err } diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclass.go b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclass.go index 4d247c5136..6c4ea1045f 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclass.go +++ b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclass.go @@ -43,20 +43,22 @@ var resourceclassesKind = v1alpha2.SchemeGroupVersion.WithKind("ResourceClass") // Get takes name of the resourceClass, and returns the corresponding resourceClass object, and an error if there is any. func (c *FakeResourceClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClass, err error) { + emptyResult := &v1alpha2.ResourceClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(resourceclassesResource, name), &v1alpha2.ResourceClass{}) + Invokes(testing.NewRootGetAction(resourceclassesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClass), err } // List takes label and field selectors, and returns the list of ResourceClasses that match those selectors. func (c *FakeResourceClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassList, err error) { + emptyResult := &v1alpha2.ResourceClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(resourceclassesResource, resourceclassesKind, opts), &v1alpha2.ResourceClassList{}) + Invokes(testing.NewRootListAction(resourceclassesResource, resourceclassesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeResourceClasses) Watch(ctx context.Context, opts v1.ListOptions) (w // Create takes the representation of a resourceClass and creates it. Returns the server's representation of the resourceClass, and an error, if there is any. func (c *FakeResourceClasses) Create(ctx context.Context, resourceClass *v1alpha2.ResourceClass, opts v1.CreateOptions) (result *v1alpha2.ResourceClass, err error) { + emptyResult := &v1alpha2.ResourceClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(resourceclassesResource, resourceClass), &v1alpha2.ResourceClass{}) + Invokes(testing.NewRootCreateAction(resourceclassesResource, resourceClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClass), err } // Update takes the representation of a resourceClass and updates it. Returns the server's representation of the resourceClass, and an error, if there is any. func (c *FakeResourceClasses) Update(ctx context.Context, resourceClass *v1alpha2.ResourceClass, opts v1.UpdateOptions) (result *v1alpha2.ResourceClass, err error) { + emptyResult := &v1alpha2.ResourceClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(resourceclassesResource, resourceClass), &v1alpha2.ResourceClass{}) + Invokes(testing.NewRootUpdateAction(resourceclassesResource, resourceClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClass), err } @@ -115,10 +119,11 @@ func (c *FakeResourceClasses) DeleteCollection(ctx context.Context, opts v1.Dele // Patch applies the patch and returns the patched resourceClass. func (c *FakeResourceClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClass, err error) { + emptyResult := &v1alpha2.ResourceClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(resourceclassesResource, name, pt, data, subresources...), &v1alpha2.ResourceClass{}) + Invokes(testing.NewRootPatchSubresourceAction(resourceclassesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClass), err } @@ -136,10 +141,11 @@ func (c *FakeResourceClasses) Apply(ctx context.Context, resourceClass *resource if name == nil { return nil, fmt.Errorf("resourceClass.Name must be provided to Apply") } + emptyResult := &v1alpha2.ResourceClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(resourceclassesResource, *name, types.ApplyPatchType, data), &v1alpha2.ResourceClass{}) + Invokes(testing.NewRootPatchSubresourceAction(resourceclassesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClass), err } diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclassparameters.go b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclassparameters.go index c11762963f..e07d43fa89 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclassparameters.go +++ b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclassparameters.go @@ -44,22 +44,24 @@ var resourceclassparametersKind = v1alpha2.SchemeGroupVersion.WithKind("Resource // Get takes name of the resourceClassParameters, and returns the corresponding resourceClassParameters object, and an error if there is any. func (c *FakeResourceClassParameters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClassParameters, err error) { + emptyResult := &v1alpha2.ResourceClassParameters{} obj, err := c.Fake. - Invokes(testing.NewGetAction(resourceclassparametersResource, c.ns, name), &v1alpha2.ResourceClassParameters{}) + Invokes(testing.NewGetAction(resourceclassparametersResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClassParameters), err } // List takes label and field selectors, and returns the list of ResourceClassParameters that match those selectors. func (c *FakeResourceClassParameters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassParametersList, err error) { + emptyResult := &v1alpha2.ResourceClassParametersList{} obj, err := c.Fake. - Invokes(testing.NewListAction(resourceclassparametersResource, resourceclassparametersKind, c.ns, opts), &v1alpha2.ResourceClassParametersList{}) + Invokes(testing.NewListAction(resourceclassparametersResource, resourceclassparametersKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeResourceClassParameters) Watch(ctx context.Context, opts v1.ListOpt // Create takes the representation of a resourceClassParameters and creates it. Returns the server's representation of the resourceClassParameters, and an error, if there is any. func (c *FakeResourceClassParameters) Create(ctx context.Context, resourceClassParameters *v1alpha2.ResourceClassParameters, opts v1.CreateOptions) (result *v1alpha2.ResourceClassParameters, err error) { + emptyResult := &v1alpha2.ResourceClassParameters{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(resourceclassparametersResource, c.ns, resourceClassParameters), &v1alpha2.ResourceClassParameters{}) + Invokes(testing.NewCreateAction(resourceclassparametersResource, c.ns, resourceClassParameters), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClassParameters), err } // Update takes the representation of a resourceClassParameters and updates it. Returns the server's representation of the resourceClassParameters, and an error, if there is any. func (c *FakeResourceClassParameters) Update(ctx context.Context, resourceClassParameters *v1alpha2.ResourceClassParameters, opts v1.UpdateOptions) (result *v1alpha2.ResourceClassParameters, err error) { + emptyResult := &v1alpha2.ResourceClassParameters{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(resourceclassparametersResource, c.ns, resourceClassParameters), &v1alpha2.ResourceClassParameters{}) + Invokes(testing.NewUpdateAction(resourceclassparametersResource, c.ns, resourceClassParameters), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClassParameters), err } @@ -122,11 +126,12 @@ func (c *FakeResourceClassParameters) DeleteCollection(ctx context.Context, opts // Patch applies the patch and returns the patched resourceClassParameters. func (c *FakeResourceClassParameters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClassParameters, err error) { + emptyResult := &v1alpha2.ResourceClassParameters{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourceclassparametersResource, c.ns, name, pt, data, subresources...), &v1alpha2.ResourceClassParameters{}) + Invokes(testing.NewPatchSubresourceAction(resourceclassparametersResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClassParameters), err } @@ -144,11 +149,12 @@ func (c *FakeResourceClassParameters) Apply(ctx context.Context, resourceClassPa if name == nil { return nil, fmt.Errorf("resourceClassParameters.Name must be provided to Apply") } + emptyResult := &v1alpha2.ResourceClassParameters{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourceclassparametersResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha2.ResourceClassParameters{}) + Invokes(testing.NewPatchSubresourceAction(resourceclassparametersResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceClassParameters), err } diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceslice.go b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceslice.go index 325e729e92..713f0ef575 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceslice.go +++ b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceslice.go @@ -43,20 +43,22 @@ var resourceslicesKind = v1alpha2.SchemeGroupVersion.WithKind("ResourceSlice") // Get takes name of the resourceSlice, and returns the corresponding resourceSlice object, and an error if there is any. func (c *FakeResourceSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceSlice, err error) { + emptyResult := &v1alpha2.ResourceSlice{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(resourceslicesResource, name), &v1alpha2.ResourceSlice{}) + Invokes(testing.NewRootGetAction(resourceslicesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceSlice), err } // List takes label and field selectors, and returns the list of ResourceSlices that match those selectors. func (c *FakeResourceSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceSliceList, err error) { + emptyResult := &v1alpha2.ResourceSliceList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(resourceslicesResource, resourceslicesKind, opts), &v1alpha2.ResourceSliceList{}) + Invokes(testing.NewRootListAction(resourceslicesResource, resourceslicesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeResourceSlices) Watch(ctx context.Context, opts v1.ListOptions) (wa // Create takes the representation of a resourceSlice and creates it. Returns the server's representation of the resourceSlice, and an error, if there is any. func (c *FakeResourceSlices) Create(ctx context.Context, resourceSlice *v1alpha2.ResourceSlice, opts v1.CreateOptions) (result *v1alpha2.ResourceSlice, err error) { + emptyResult := &v1alpha2.ResourceSlice{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(resourceslicesResource, resourceSlice), &v1alpha2.ResourceSlice{}) + Invokes(testing.NewRootCreateAction(resourceslicesResource, resourceSlice), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceSlice), err } // Update takes the representation of a resourceSlice and updates it. Returns the server's representation of the resourceSlice, and an error, if there is any. func (c *FakeResourceSlices) Update(ctx context.Context, resourceSlice *v1alpha2.ResourceSlice, opts v1.UpdateOptions) (result *v1alpha2.ResourceSlice, err error) { + emptyResult := &v1alpha2.ResourceSlice{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(resourceslicesResource, resourceSlice), &v1alpha2.ResourceSlice{}) + Invokes(testing.NewRootUpdateAction(resourceslicesResource, resourceSlice), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceSlice), err } @@ -115,10 +119,11 @@ func (c *FakeResourceSlices) DeleteCollection(ctx context.Context, opts v1.Delet // Patch applies the patch and returns the patched resourceSlice. func (c *FakeResourceSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceSlice, err error) { + emptyResult := &v1alpha2.ResourceSlice{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(resourceslicesResource, name, pt, data, subresources...), &v1alpha2.ResourceSlice{}) + Invokes(testing.NewRootPatchSubresourceAction(resourceslicesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceSlice), err } @@ -136,10 +141,11 @@ func (c *FakeResourceSlices) Apply(ctx context.Context, resourceSlice *resourcev if name == nil { return nil, fmt.Errorf("resourceSlice.Name must be provided to Apply") } + emptyResult := &v1alpha2.ResourceSlice{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(resourceslicesResource, *name, types.ApplyPatchType, data), &v1alpha2.ResourceSlice{}) + Invokes(testing.NewRootPatchSubresourceAction(resourceslicesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha2.ResourceSlice), err } diff --git a/kubernetes/typed/scheduling/v1/fake/fake_priorityclass.go b/kubernetes/typed/scheduling/v1/fake/fake_priorityclass.go index 40ab9fb407..b966592266 100644 --- a/kubernetes/typed/scheduling/v1/fake/fake_priorityclass.go +++ b/kubernetes/typed/scheduling/v1/fake/fake_priorityclass.go @@ -43,20 +43,22 @@ var priorityclassesKind = v1.SchemeGroupVersion.WithKind("PriorityClass") // Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any. func (c *FakePriorityClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PriorityClass, err error) { + emptyResult := &v1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(priorityclassesResource, name), &v1.PriorityClass{}) + Invokes(testing.NewRootGetAction(priorityclassesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PriorityClass), err } // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. func (c *FakePriorityClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityClassList, err error) { + emptyResult := &v1.PriorityClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(priorityclassesResource, priorityclassesKind, opts), &v1.PriorityClassList{}) + Invokes(testing.NewRootListAction(priorityclassesResource, priorityclassesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakePriorityClasses) Watch(ctx context.Context, opts metav1.ListOptions // Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any. func (c *FakePriorityClasses) Create(ctx context.Context, priorityClass *v1.PriorityClass, opts metav1.CreateOptions) (result *v1.PriorityClass, err error) { + emptyResult := &v1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(priorityclassesResource, priorityClass), &v1.PriorityClass{}) + Invokes(testing.NewRootCreateAction(priorityclassesResource, priorityClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PriorityClass), err } // Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any. func (c *FakePriorityClasses) Update(ctx context.Context, priorityClass *v1.PriorityClass, opts metav1.UpdateOptions) (result *v1.PriorityClass, err error) { + emptyResult := &v1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(priorityclassesResource, priorityClass), &v1.PriorityClass{}) + Invokes(testing.NewRootUpdateAction(priorityclassesResource, priorityClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PriorityClass), err } @@ -115,10 +119,11 @@ func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, opts metav1. // Patch applies the patch and returns the patched priorityClass. func (c *FakePriorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityClass, err error) { + emptyResult := &v1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, name, pt, data, subresources...), &v1.PriorityClass{}) + Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PriorityClass), err } @@ -136,10 +141,11 @@ func (c *FakePriorityClasses) Apply(ctx context.Context, priorityClass *scheduli if name == nil { return nil, fmt.Errorf("priorityClass.Name must be provided to Apply") } + emptyResult := &v1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, *name, types.ApplyPatchType, data), &v1.PriorityClass{}) + Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.PriorityClass), err } diff --git a/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go b/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go index 3c8404a725..c76820cb1c 100644 --- a/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go +++ b/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go @@ -43,20 +43,22 @@ var priorityclassesKind = v1alpha1.SchemeGroupVersion.WithKind("PriorityClass") // Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any. func (c *FakePriorityClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PriorityClass, err error) { + emptyResult := &v1alpha1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(priorityclassesResource, name), &v1alpha1.PriorityClass{}) + Invokes(testing.NewRootGetAction(priorityclassesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.PriorityClass), err } // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. func (c *FakePriorityClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PriorityClassList, err error) { + emptyResult := &v1alpha1.PriorityClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(priorityclassesResource, priorityclassesKind, opts), &v1alpha1.PriorityClassList{}) + Invokes(testing.NewRootListAction(priorityclassesResource, priorityclassesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakePriorityClasses) Watch(ctx context.Context, opts v1.ListOptions) (w // Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any. func (c *FakePriorityClasses) Create(ctx context.Context, priorityClass *v1alpha1.PriorityClass, opts v1.CreateOptions) (result *v1alpha1.PriorityClass, err error) { + emptyResult := &v1alpha1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(priorityclassesResource, priorityClass), &v1alpha1.PriorityClass{}) + Invokes(testing.NewRootCreateAction(priorityclassesResource, priorityClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.PriorityClass), err } // Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any. func (c *FakePriorityClasses) Update(ctx context.Context, priorityClass *v1alpha1.PriorityClass, opts v1.UpdateOptions) (result *v1alpha1.PriorityClass, err error) { + emptyResult := &v1alpha1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(priorityclassesResource, priorityClass), &v1alpha1.PriorityClass{}) + Invokes(testing.NewRootUpdateAction(priorityclassesResource, priorityClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.PriorityClass), err } @@ -115,10 +119,11 @@ func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, opts v1.Dele // Patch applies the patch and returns the patched priorityClass. func (c *FakePriorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PriorityClass, err error) { + emptyResult := &v1alpha1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, name, pt, data, subresources...), &v1alpha1.PriorityClass{}) + Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.PriorityClass), err } @@ -136,10 +141,11 @@ func (c *FakePriorityClasses) Apply(ctx context.Context, priorityClass *scheduli if name == nil { return nil, fmt.Errorf("priorityClass.Name must be provided to Apply") } + emptyResult := &v1alpha1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, *name, types.ApplyPatchType, data), &v1alpha1.PriorityClass{}) + Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.PriorityClass), err } diff --git a/kubernetes/typed/scheduling/v1beta1/fake/fake_priorityclass.go b/kubernetes/typed/scheduling/v1beta1/fake/fake_priorityclass.go index 4cf2e26c77..0ca92e2155 100644 --- a/kubernetes/typed/scheduling/v1beta1/fake/fake_priorityclass.go +++ b/kubernetes/typed/scheduling/v1beta1/fake/fake_priorityclass.go @@ -43,20 +43,22 @@ var priorityclassesKind = v1beta1.SchemeGroupVersion.WithKind("PriorityClass") // Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any. func (c *FakePriorityClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PriorityClass, err error) { + emptyResult := &v1beta1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(priorityclassesResource, name), &v1beta1.PriorityClass{}) + Invokes(testing.NewRootGetAction(priorityclassesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PriorityClass), err } // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. func (c *FakePriorityClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityClassList, err error) { + emptyResult := &v1beta1.PriorityClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(priorityclassesResource, priorityclassesKind, opts), &v1beta1.PriorityClassList{}) + Invokes(testing.NewRootListAction(priorityclassesResource, priorityclassesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakePriorityClasses) Watch(ctx context.Context, opts v1.ListOptions) (w // Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any. func (c *FakePriorityClasses) Create(ctx context.Context, priorityClass *v1beta1.PriorityClass, opts v1.CreateOptions) (result *v1beta1.PriorityClass, err error) { + emptyResult := &v1beta1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(priorityclassesResource, priorityClass), &v1beta1.PriorityClass{}) + Invokes(testing.NewRootCreateAction(priorityclassesResource, priorityClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PriorityClass), err } // Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any. func (c *FakePriorityClasses) Update(ctx context.Context, priorityClass *v1beta1.PriorityClass, opts v1.UpdateOptions) (result *v1beta1.PriorityClass, err error) { + emptyResult := &v1beta1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(priorityclassesResource, priorityClass), &v1beta1.PriorityClass{}) + Invokes(testing.NewRootUpdateAction(priorityclassesResource, priorityClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PriorityClass), err } @@ -115,10 +119,11 @@ func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, opts v1.Dele // Patch applies the patch and returns the patched priorityClass. func (c *FakePriorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PriorityClass, err error) { + emptyResult := &v1beta1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, name, pt, data, subresources...), &v1beta1.PriorityClass{}) + Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PriorityClass), err } @@ -136,10 +141,11 @@ func (c *FakePriorityClasses) Apply(ctx context.Context, priorityClass *scheduli if name == nil { return nil, fmt.Errorf("priorityClass.Name must be provided to Apply") } + emptyResult := &v1beta1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, *name, types.ApplyPatchType, data), &v1beta1.PriorityClass{}) + Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.PriorityClass), err } diff --git a/kubernetes/typed/storage/v1/fake/fake_csidriver.go b/kubernetes/typed/storage/v1/fake/fake_csidriver.go index 4983227376..27a795913a 100644 --- a/kubernetes/typed/storage/v1/fake/fake_csidriver.go +++ b/kubernetes/typed/storage/v1/fake/fake_csidriver.go @@ -43,20 +43,22 @@ var csidriversKind = v1.SchemeGroupVersion.WithKind("CSIDriver") // Get takes name of the cSIDriver, and returns the corresponding cSIDriver object, and an error if there is any. func (c *FakeCSIDrivers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CSIDriver, err error) { + emptyResult := &v1.CSIDriver{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(csidriversResource, name), &v1.CSIDriver{}) + Invokes(testing.NewRootGetAction(csidriversResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CSIDriver), err } // List takes label and field selectors, and returns the list of CSIDrivers that match those selectors. func (c *FakeCSIDrivers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CSIDriverList, err error) { + emptyResult := &v1.CSIDriverList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(csidriversResource, csidriversKind, opts), &v1.CSIDriverList{}) + Invokes(testing.NewRootListAction(csidriversResource, csidriversKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeCSIDrivers) Watch(ctx context.Context, opts metav1.ListOptions) (wa // Create takes the representation of a cSIDriver and creates it. Returns the server's representation of the cSIDriver, and an error, if there is any. func (c *FakeCSIDrivers) Create(ctx context.Context, cSIDriver *v1.CSIDriver, opts metav1.CreateOptions) (result *v1.CSIDriver, err error) { + emptyResult := &v1.CSIDriver{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(csidriversResource, cSIDriver), &v1.CSIDriver{}) + Invokes(testing.NewRootCreateAction(csidriversResource, cSIDriver), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CSIDriver), err } // Update takes the representation of a cSIDriver and updates it. Returns the server's representation of the cSIDriver, and an error, if there is any. func (c *FakeCSIDrivers) Update(ctx context.Context, cSIDriver *v1.CSIDriver, opts metav1.UpdateOptions) (result *v1.CSIDriver, err error) { + emptyResult := &v1.CSIDriver{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(csidriversResource, cSIDriver), &v1.CSIDriver{}) + Invokes(testing.NewRootUpdateAction(csidriversResource, cSIDriver), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CSIDriver), err } @@ -115,10 +119,11 @@ func (c *FakeCSIDrivers) DeleteCollection(ctx context.Context, opts metav1.Delet // Patch applies the patch and returns the patched cSIDriver. func (c *FakeCSIDrivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSIDriver, err error) { + emptyResult := &v1.CSIDriver{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(csidriversResource, name, pt, data, subresources...), &v1.CSIDriver{}) + Invokes(testing.NewRootPatchSubresourceAction(csidriversResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CSIDriver), err } @@ -136,10 +141,11 @@ func (c *FakeCSIDrivers) Apply(ctx context.Context, cSIDriver *storagev1.CSIDriv if name == nil { return nil, fmt.Errorf("cSIDriver.Name must be provided to Apply") } + emptyResult := &v1.CSIDriver{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(csidriversResource, *name, types.ApplyPatchType, data), &v1.CSIDriver{}) + Invokes(testing.NewRootPatchSubresourceAction(csidriversResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CSIDriver), err } diff --git a/kubernetes/typed/storage/v1/fake/fake_csinode.go b/kubernetes/typed/storage/v1/fake/fake_csinode.go index 0271a20f3d..e8e48fce8b 100644 --- a/kubernetes/typed/storage/v1/fake/fake_csinode.go +++ b/kubernetes/typed/storage/v1/fake/fake_csinode.go @@ -43,20 +43,22 @@ var csinodesKind = v1.SchemeGroupVersion.WithKind("CSINode") // Get takes name of the cSINode, and returns the corresponding cSINode object, and an error if there is any. func (c *FakeCSINodes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CSINode, err error) { + emptyResult := &v1.CSINode{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(csinodesResource, name), &v1.CSINode{}) + Invokes(testing.NewRootGetAction(csinodesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CSINode), err } // List takes label and field selectors, and returns the list of CSINodes that match those selectors. func (c *FakeCSINodes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CSINodeList, err error) { + emptyResult := &v1.CSINodeList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(csinodesResource, csinodesKind, opts), &v1.CSINodeList{}) + Invokes(testing.NewRootListAction(csinodesResource, csinodesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeCSINodes) Watch(ctx context.Context, opts metav1.ListOptions) (watc // Create takes the representation of a cSINode and creates it. Returns the server's representation of the cSINode, and an error, if there is any. func (c *FakeCSINodes) Create(ctx context.Context, cSINode *v1.CSINode, opts metav1.CreateOptions) (result *v1.CSINode, err error) { + emptyResult := &v1.CSINode{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(csinodesResource, cSINode), &v1.CSINode{}) + Invokes(testing.NewRootCreateAction(csinodesResource, cSINode), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CSINode), err } // Update takes the representation of a cSINode and updates it. Returns the server's representation of the cSINode, and an error, if there is any. func (c *FakeCSINodes) Update(ctx context.Context, cSINode *v1.CSINode, opts metav1.UpdateOptions) (result *v1.CSINode, err error) { + emptyResult := &v1.CSINode{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(csinodesResource, cSINode), &v1.CSINode{}) + Invokes(testing.NewRootUpdateAction(csinodesResource, cSINode), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CSINode), err } @@ -115,10 +119,11 @@ func (c *FakeCSINodes) DeleteCollection(ctx context.Context, opts metav1.DeleteO // Patch applies the patch and returns the patched cSINode. func (c *FakeCSINodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSINode, err error) { + emptyResult := &v1.CSINode{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(csinodesResource, name, pt, data, subresources...), &v1.CSINode{}) + Invokes(testing.NewRootPatchSubresourceAction(csinodesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CSINode), err } @@ -136,10 +141,11 @@ func (c *FakeCSINodes) Apply(ctx context.Context, cSINode *storagev1.CSINodeAppl if name == nil { return nil, fmt.Errorf("cSINode.Name must be provided to Apply") } + emptyResult := &v1.CSINode{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(csinodesResource, *name, types.ApplyPatchType, data), &v1.CSINode{}) + Invokes(testing.NewRootPatchSubresourceAction(csinodesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CSINode), err } diff --git a/kubernetes/typed/storage/v1/fake/fake_csistoragecapacity.go b/kubernetes/typed/storage/v1/fake/fake_csistoragecapacity.go index b12bbe3c15..8dd75b759a 100644 --- a/kubernetes/typed/storage/v1/fake/fake_csistoragecapacity.go +++ b/kubernetes/typed/storage/v1/fake/fake_csistoragecapacity.go @@ -44,22 +44,24 @@ var csistoragecapacitiesKind = v1.SchemeGroupVersion.WithKind("CSIStorageCapacit // Get takes name of the cSIStorageCapacity, and returns the corresponding cSIStorageCapacity object, and an error if there is any. func (c *FakeCSIStorageCapacities) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CSIStorageCapacity, err error) { + emptyResult := &v1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewGetAction(csistoragecapacitiesResource, c.ns, name), &v1.CSIStorageCapacity{}) + Invokes(testing.NewGetAction(csistoragecapacitiesResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CSIStorageCapacity), err } // List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. func (c *FakeCSIStorageCapacities) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CSIStorageCapacityList, err error) { + emptyResult := &v1.CSIStorageCapacityList{} obj, err := c.Fake. - Invokes(testing.NewListAction(csistoragecapacitiesResource, csistoragecapacitiesKind, c.ns, opts), &v1.CSIStorageCapacityList{}) + Invokes(testing.NewListAction(csistoragecapacitiesResource, csistoragecapacitiesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeCSIStorageCapacities) Watch(ctx context.Context, opts metav1.ListOp // Create takes the representation of a cSIStorageCapacity and creates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. func (c *FakeCSIStorageCapacities) Create(ctx context.Context, cSIStorageCapacity *v1.CSIStorageCapacity, opts metav1.CreateOptions) (result *v1.CSIStorageCapacity, err error) { + emptyResult := &v1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(csistoragecapacitiesResource, c.ns, cSIStorageCapacity), &v1.CSIStorageCapacity{}) + Invokes(testing.NewCreateAction(csistoragecapacitiesResource, c.ns, cSIStorageCapacity), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CSIStorageCapacity), err } // Update takes the representation of a cSIStorageCapacity and updates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. func (c *FakeCSIStorageCapacities) Update(ctx context.Context, cSIStorageCapacity *v1.CSIStorageCapacity, opts metav1.UpdateOptions) (result *v1.CSIStorageCapacity, err error) { + emptyResult := &v1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(csistoragecapacitiesResource, c.ns, cSIStorageCapacity), &v1.CSIStorageCapacity{}) + Invokes(testing.NewUpdateAction(csistoragecapacitiesResource, c.ns, cSIStorageCapacity), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CSIStorageCapacity), err } @@ -122,11 +126,12 @@ func (c *FakeCSIStorageCapacities) DeleteCollection(ctx context.Context, opts me // Patch applies the patch and returns the patched cSIStorageCapacity. func (c *FakeCSIStorageCapacities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSIStorageCapacity, err error) { + emptyResult := &v1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(csistoragecapacitiesResource, c.ns, name, pt, data, subresources...), &v1.CSIStorageCapacity{}) + Invokes(testing.NewPatchSubresourceAction(csistoragecapacitiesResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CSIStorageCapacity), err } @@ -144,11 +149,12 @@ func (c *FakeCSIStorageCapacities) Apply(ctx context.Context, cSIStorageCapacity if name == nil { return nil, fmt.Errorf("cSIStorageCapacity.Name must be provided to Apply") } + emptyResult := &v1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(csistoragecapacitiesResource, c.ns, *name, types.ApplyPatchType, data), &v1.CSIStorageCapacity{}) + Invokes(testing.NewPatchSubresourceAction(csistoragecapacitiesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.CSIStorageCapacity), err } diff --git a/kubernetes/typed/storage/v1/fake/fake_storageclass.go b/kubernetes/typed/storage/v1/fake/fake_storageclass.go index e232f4c8d7..a44b58f427 100644 --- a/kubernetes/typed/storage/v1/fake/fake_storageclass.go +++ b/kubernetes/typed/storage/v1/fake/fake_storageclass.go @@ -43,20 +43,22 @@ var storageclassesKind = v1.SchemeGroupVersion.WithKind("StorageClass") // Get takes name of the storageClass, and returns the corresponding storageClass object, and an error if there is any. func (c *FakeStorageClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.StorageClass, err error) { + emptyResult := &v1.StorageClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(storageclassesResource, name), &v1.StorageClass{}) + Invokes(testing.NewRootGetAction(storageclassesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.StorageClass), err } // List takes label and field selectors, and returns the list of StorageClasses that match those selectors. func (c *FakeStorageClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.StorageClassList, err error) { + emptyResult := &v1.StorageClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(storageclassesResource, storageclassesKind, opts), &v1.StorageClassList{}) + Invokes(testing.NewRootListAction(storageclassesResource, storageclassesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeStorageClasses) Watch(ctx context.Context, opts metav1.ListOptions) // Create takes the representation of a storageClass and creates it. Returns the server's representation of the storageClass, and an error, if there is any. func (c *FakeStorageClasses) Create(ctx context.Context, storageClass *v1.StorageClass, opts metav1.CreateOptions) (result *v1.StorageClass, err error) { + emptyResult := &v1.StorageClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(storageclassesResource, storageClass), &v1.StorageClass{}) + Invokes(testing.NewRootCreateAction(storageclassesResource, storageClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.StorageClass), err } // Update takes the representation of a storageClass and updates it. Returns the server's representation of the storageClass, and an error, if there is any. func (c *FakeStorageClasses) Update(ctx context.Context, storageClass *v1.StorageClass, opts metav1.UpdateOptions) (result *v1.StorageClass, err error) { + emptyResult := &v1.StorageClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(storageclassesResource, storageClass), &v1.StorageClass{}) + Invokes(testing.NewRootUpdateAction(storageclassesResource, storageClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.StorageClass), err } @@ -115,10 +119,11 @@ func (c *FakeStorageClasses) DeleteCollection(ctx context.Context, opts metav1.D // Patch applies the patch and returns the patched storageClass. func (c *FakeStorageClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.StorageClass, err error) { + emptyResult := &v1.StorageClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(storageclassesResource, name, pt, data, subresources...), &v1.StorageClass{}) + Invokes(testing.NewRootPatchSubresourceAction(storageclassesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.StorageClass), err } @@ -136,10 +141,11 @@ func (c *FakeStorageClasses) Apply(ctx context.Context, storageClass *storagev1. if name == nil { return nil, fmt.Errorf("storageClass.Name must be provided to Apply") } + emptyResult := &v1.StorageClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(storageclassesResource, *name, types.ApplyPatchType, data), &v1.StorageClass{}) + Invokes(testing.NewRootPatchSubresourceAction(storageclassesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.StorageClass), err } diff --git a/kubernetes/typed/storage/v1/fake/fake_volumeattachment.go b/kubernetes/typed/storage/v1/fake/fake_volumeattachment.go index 3f5f2aec57..d68b6782ff 100644 --- a/kubernetes/typed/storage/v1/fake/fake_volumeattachment.go +++ b/kubernetes/typed/storage/v1/fake/fake_volumeattachment.go @@ -43,20 +43,22 @@ var volumeattachmentsKind = v1.SchemeGroupVersion.WithKind("VolumeAttachment") // Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any. func (c *FakeVolumeAttachments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VolumeAttachment, err error) { + emptyResult := &v1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(volumeattachmentsResource, name), &v1.VolumeAttachment{}) + Invokes(testing.NewRootGetAction(volumeattachmentsResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VolumeAttachment), err } // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. func (c *FakeVolumeAttachments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VolumeAttachmentList, err error) { + emptyResult := &v1.VolumeAttachmentList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(volumeattachmentsResource, volumeattachmentsKind, opts), &v1.VolumeAttachmentList{}) + Invokes(testing.NewRootListAction(volumeattachmentsResource, volumeattachmentsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,31 +82,34 @@ func (c *FakeVolumeAttachments) Watch(ctx context.Context, opts metav1.ListOptio // Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. func (c *FakeVolumeAttachments) Create(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.CreateOptions) (result *v1.VolumeAttachment, err error) { + emptyResult := &v1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(volumeattachmentsResource, volumeAttachment), &v1.VolumeAttachment{}) + Invokes(testing.NewRootCreateAction(volumeattachmentsResource, volumeAttachment), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VolumeAttachment), err } // Update takes the representation of a volumeAttachment and updates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. func (c *FakeVolumeAttachments) Update(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.UpdateOptions) (result *v1.VolumeAttachment, err error) { + emptyResult := &v1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(volumeattachmentsResource, volumeAttachment), &v1.VolumeAttachment{}) + Invokes(testing.NewRootUpdateAction(volumeattachmentsResource, volumeAttachment), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VolumeAttachment), 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 *FakeVolumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.UpdateOptions) (*v1.VolumeAttachment, error) { +func (c *FakeVolumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.UpdateOptions) (result *v1.VolumeAttachment, err error) { + emptyResult := &v1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(volumeattachmentsResource, "status", volumeAttachment), &v1.VolumeAttachment{}) + Invokes(testing.NewRootUpdateSubresourceAction(volumeattachmentsResource, "status", volumeAttachment), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VolumeAttachment), err } @@ -126,10 +131,11 @@ func (c *FakeVolumeAttachments) DeleteCollection(ctx context.Context, opts metav // Patch applies the patch and returns the patched volumeAttachment. func (c *FakeVolumeAttachments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VolumeAttachment, err error) { + emptyResult := &v1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, name, pt, data, subresources...), &v1.VolumeAttachment{}) + Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VolumeAttachment), err } @@ -147,10 +153,11 @@ func (c *FakeVolumeAttachments) Apply(ctx context.Context, volumeAttachment *sto if name == nil { return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") } + emptyResult := &v1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, *name, types.ApplyPatchType, data), &v1.VolumeAttachment{}) + Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VolumeAttachment), err } @@ -169,10 +176,11 @@ func (c *FakeVolumeAttachments) ApplyStatus(ctx context.Context, volumeAttachmen if name == nil { return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") } + emptyResult := &v1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, *name, types.ApplyPatchType, data, "status"), &v1.VolumeAttachment{}) + Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1.VolumeAttachment), err } diff --git a/kubernetes/typed/storage/v1alpha1/fake/fake_csistoragecapacity.go b/kubernetes/typed/storage/v1alpha1/fake/fake_csistoragecapacity.go index c1614cda7d..0099fd7717 100644 --- a/kubernetes/typed/storage/v1alpha1/fake/fake_csistoragecapacity.go +++ b/kubernetes/typed/storage/v1alpha1/fake/fake_csistoragecapacity.go @@ -44,22 +44,24 @@ var csistoragecapacitiesKind = v1alpha1.SchemeGroupVersion.WithKind("CSIStorageC // Get takes name of the cSIStorageCapacity, and returns the corresponding cSIStorageCapacity object, and an error if there is any. func (c *FakeCSIStorageCapacities) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.CSIStorageCapacity, err error) { + emptyResult := &v1alpha1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewGetAction(csistoragecapacitiesResource, c.ns, name), &v1alpha1.CSIStorageCapacity{}) + Invokes(testing.NewGetAction(csistoragecapacitiesResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.CSIStorageCapacity), err } // List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. func (c *FakeCSIStorageCapacities) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.CSIStorageCapacityList, err error) { + emptyResult := &v1alpha1.CSIStorageCapacityList{} obj, err := c.Fake. - Invokes(testing.NewListAction(csistoragecapacitiesResource, csistoragecapacitiesKind, c.ns, opts), &v1alpha1.CSIStorageCapacityList{}) + Invokes(testing.NewListAction(csistoragecapacitiesResource, csistoragecapacitiesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeCSIStorageCapacities) Watch(ctx context.Context, opts v1.ListOption // Create takes the representation of a cSIStorageCapacity and creates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. func (c *FakeCSIStorageCapacities) Create(ctx context.Context, cSIStorageCapacity *v1alpha1.CSIStorageCapacity, opts v1.CreateOptions) (result *v1alpha1.CSIStorageCapacity, err error) { + emptyResult := &v1alpha1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(csistoragecapacitiesResource, c.ns, cSIStorageCapacity), &v1alpha1.CSIStorageCapacity{}) + Invokes(testing.NewCreateAction(csistoragecapacitiesResource, c.ns, cSIStorageCapacity), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.CSIStorageCapacity), err } // Update takes the representation of a cSIStorageCapacity and updates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. func (c *FakeCSIStorageCapacities) Update(ctx context.Context, cSIStorageCapacity *v1alpha1.CSIStorageCapacity, opts v1.UpdateOptions) (result *v1alpha1.CSIStorageCapacity, err error) { + emptyResult := &v1alpha1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(csistoragecapacitiesResource, c.ns, cSIStorageCapacity), &v1alpha1.CSIStorageCapacity{}) + Invokes(testing.NewUpdateAction(csistoragecapacitiesResource, c.ns, cSIStorageCapacity), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.CSIStorageCapacity), err } @@ -122,11 +126,12 @@ func (c *FakeCSIStorageCapacities) DeleteCollection(ctx context.Context, opts v1 // Patch applies the patch and returns the patched cSIStorageCapacity. func (c *FakeCSIStorageCapacities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.CSIStorageCapacity, err error) { + emptyResult := &v1alpha1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(csistoragecapacitiesResource, c.ns, name, pt, data, subresources...), &v1alpha1.CSIStorageCapacity{}) + Invokes(testing.NewPatchSubresourceAction(csistoragecapacitiesResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.CSIStorageCapacity), err } @@ -144,11 +149,12 @@ func (c *FakeCSIStorageCapacities) Apply(ctx context.Context, cSIStorageCapacity if name == nil { return nil, fmt.Errorf("cSIStorageCapacity.Name must be provided to Apply") } + emptyResult := &v1alpha1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(csistoragecapacitiesResource, c.ns, *name, types.ApplyPatchType, data), &v1alpha1.CSIStorageCapacity{}) + Invokes(testing.NewPatchSubresourceAction(csistoragecapacitiesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.CSIStorageCapacity), err } diff --git a/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go b/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go index 9725d6d10b..19ded07b80 100644 --- a/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go +++ b/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go @@ -43,20 +43,22 @@ var volumeattachmentsKind = v1alpha1.SchemeGroupVersion.WithKind("VolumeAttachme // Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any. func (c *FakeVolumeAttachments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeAttachment, err error) { + emptyResult := &v1alpha1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(volumeattachmentsResource, name), &v1alpha1.VolumeAttachment{}) + Invokes(testing.NewRootGetAction(volumeattachmentsResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumeAttachment), err } // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. func (c *FakeVolumeAttachments) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttachmentList, err error) { + emptyResult := &v1alpha1.VolumeAttachmentList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(volumeattachmentsResource, volumeattachmentsKind, opts), &v1alpha1.VolumeAttachmentList{}) + Invokes(testing.NewRootListAction(volumeattachmentsResource, volumeattachmentsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,31 +82,34 @@ func (c *FakeVolumeAttachments) Watch(ctx context.Context, opts v1.ListOptions) // Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. func (c *FakeVolumeAttachments) Create(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.CreateOptions) (result *v1alpha1.VolumeAttachment, err error) { + emptyResult := &v1alpha1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(volumeattachmentsResource, volumeAttachment), &v1alpha1.VolumeAttachment{}) + Invokes(testing.NewRootCreateAction(volumeattachmentsResource, volumeAttachment), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumeAttachment), err } // Update takes the representation of a volumeAttachment and updates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. func (c *FakeVolumeAttachments) Update(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttachment, err error) { + emptyResult := &v1alpha1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(volumeattachmentsResource, volumeAttachment), &v1alpha1.VolumeAttachment{}) + Invokes(testing.NewRootUpdateAction(volumeattachmentsResource, volumeAttachment), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumeAttachment), 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 *FakeVolumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (*v1alpha1.VolumeAttachment, error) { +func (c *FakeVolumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttachment, err error) { + emptyResult := &v1alpha1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(volumeattachmentsResource, "status", volumeAttachment), &v1alpha1.VolumeAttachment{}) + Invokes(testing.NewRootUpdateSubresourceAction(volumeattachmentsResource, "status", volumeAttachment), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumeAttachment), err } @@ -126,10 +131,11 @@ func (c *FakeVolumeAttachments) DeleteCollection(ctx context.Context, opts v1.De // Patch applies the patch and returns the patched volumeAttachment. func (c *FakeVolumeAttachments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttachment, err error) { + emptyResult := &v1alpha1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, name, pt, data, subresources...), &v1alpha1.VolumeAttachment{}) + Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumeAttachment), err } @@ -147,10 +153,11 @@ func (c *FakeVolumeAttachments) Apply(ctx context.Context, volumeAttachment *sto if name == nil { return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") } + emptyResult := &v1alpha1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, *name, types.ApplyPatchType, data), &v1alpha1.VolumeAttachment{}) + Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumeAttachment), err } @@ -169,10 +176,11 @@ func (c *FakeVolumeAttachments) ApplyStatus(ctx context.Context, volumeAttachmen if name == nil { return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") } + emptyResult := &v1alpha1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.VolumeAttachment{}) + Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumeAttachment), err } diff --git a/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattributesclass.go b/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattributesclass.go index d25263df48..c3fd1eebac 100644 --- a/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattributesclass.go +++ b/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattributesclass.go @@ -43,20 +43,22 @@ var volumeattributesclassesKind = v1alpha1.SchemeGroupVersion.WithKind("VolumeAt // Get takes name of the volumeAttributesClass, and returns the corresponding volumeAttributesClass object, and an error if there is any. func (c *FakeVolumeAttributesClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeAttributesClass, err error) { + emptyResult := &v1alpha1.VolumeAttributesClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(volumeattributesclassesResource, name), &v1alpha1.VolumeAttributesClass{}) + Invokes(testing.NewRootGetAction(volumeattributesclassesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumeAttributesClass), err } // List takes label and field selectors, and returns the list of VolumeAttributesClasses that match those selectors. func (c *FakeVolumeAttributesClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttributesClassList, err error) { + emptyResult := &v1alpha1.VolumeAttributesClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(volumeattributesclassesResource, volumeattributesclassesKind, opts), &v1alpha1.VolumeAttributesClassList{}) + Invokes(testing.NewRootListAction(volumeattributesclassesResource, volumeattributesclassesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeVolumeAttributesClasses) Watch(ctx context.Context, opts v1.ListOpt // Create takes the representation of a volumeAttributesClass and creates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. func (c *FakeVolumeAttributesClasses) Create(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.CreateOptions) (result *v1alpha1.VolumeAttributesClass, err error) { + emptyResult := &v1alpha1.VolumeAttributesClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(volumeattributesclassesResource, volumeAttributesClass), &v1alpha1.VolumeAttributesClass{}) + Invokes(testing.NewRootCreateAction(volumeattributesclassesResource, volumeAttributesClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumeAttributesClass), err } // Update takes the representation of a volumeAttributesClass and updates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. func (c *FakeVolumeAttributesClasses) Update(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttributesClass, err error) { + emptyResult := &v1alpha1.VolumeAttributesClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(volumeattributesclassesResource, volumeAttributesClass), &v1alpha1.VolumeAttributesClass{}) + Invokes(testing.NewRootUpdateAction(volumeattributesclassesResource, volumeAttributesClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumeAttributesClass), err } @@ -115,10 +119,11 @@ func (c *FakeVolumeAttributesClasses) DeleteCollection(ctx context.Context, opts // Patch applies the patch and returns the patched volumeAttributesClass. func (c *FakeVolumeAttributesClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttributesClass, err error) { + emptyResult := &v1alpha1.VolumeAttributesClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattributesclassesResource, name, pt, data, subresources...), &v1alpha1.VolumeAttributesClass{}) + Invokes(testing.NewRootPatchSubresourceAction(volumeattributesclassesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumeAttributesClass), err } @@ -136,10 +141,11 @@ func (c *FakeVolumeAttributesClasses) Apply(ctx context.Context, volumeAttribute if name == nil { return nil, fmt.Errorf("volumeAttributesClass.Name must be provided to Apply") } + emptyResult := &v1alpha1.VolumeAttributesClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattributesclassesResource, *name, types.ApplyPatchType, data), &v1alpha1.VolumeAttributesClass{}) + Invokes(testing.NewRootPatchSubresourceAction(volumeattributesclassesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.VolumeAttributesClass), err } diff --git a/kubernetes/typed/storage/v1beta1/fake/fake_csidriver.go b/kubernetes/typed/storage/v1beta1/fake/fake_csidriver.go index 4257aa6183..c1a73310da 100644 --- a/kubernetes/typed/storage/v1beta1/fake/fake_csidriver.go +++ b/kubernetes/typed/storage/v1beta1/fake/fake_csidriver.go @@ -43,20 +43,22 @@ var csidriversKind = v1beta1.SchemeGroupVersion.WithKind("CSIDriver") // Get takes name of the cSIDriver, and returns the corresponding cSIDriver object, and an error if there is any. func (c *FakeCSIDrivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CSIDriver, err error) { + emptyResult := &v1beta1.CSIDriver{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(csidriversResource, name), &v1beta1.CSIDriver{}) + Invokes(testing.NewRootGetAction(csidriversResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CSIDriver), err } // List takes label and field selectors, and returns the list of CSIDrivers that match those selectors. func (c *FakeCSIDrivers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIDriverList, err error) { + emptyResult := &v1beta1.CSIDriverList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(csidriversResource, csidriversKind, opts), &v1beta1.CSIDriverList{}) + Invokes(testing.NewRootListAction(csidriversResource, csidriversKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeCSIDrivers) Watch(ctx context.Context, opts v1.ListOptions) (watch. // Create takes the representation of a cSIDriver and creates it. Returns the server's representation of the cSIDriver, and an error, if there is any. func (c *FakeCSIDrivers) Create(ctx context.Context, cSIDriver *v1beta1.CSIDriver, opts v1.CreateOptions) (result *v1beta1.CSIDriver, err error) { + emptyResult := &v1beta1.CSIDriver{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(csidriversResource, cSIDriver), &v1beta1.CSIDriver{}) + Invokes(testing.NewRootCreateAction(csidriversResource, cSIDriver), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CSIDriver), err } // Update takes the representation of a cSIDriver and updates it. Returns the server's representation of the cSIDriver, and an error, if there is any. func (c *FakeCSIDrivers) Update(ctx context.Context, cSIDriver *v1beta1.CSIDriver, opts v1.UpdateOptions) (result *v1beta1.CSIDriver, err error) { + emptyResult := &v1beta1.CSIDriver{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(csidriversResource, cSIDriver), &v1beta1.CSIDriver{}) + Invokes(testing.NewRootUpdateAction(csidriversResource, cSIDriver), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CSIDriver), err } @@ -115,10 +119,11 @@ func (c *FakeCSIDrivers) DeleteCollection(ctx context.Context, opts v1.DeleteOpt // Patch applies the patch and returns the patched cSIDriver. func (c *FakeCSIDrivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSIDriver, err error) { + emptyResult := &v1beta1.CSIDriver{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(csidriversResource, name, pt, data, subresources...), &v1beta1.CSIDriver{}) + Invokes(testing.NewRootPatchSubresourceAction(csidriversResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CSIDriver), err } @@ -136,10 +141,11 @@ func (c *FakeCSIDrivers) Apply(ctx context.Context, cSIDriver *storagev1beta1.CS if name == nil { return nil, fmt.Errorf("cSIDriver.Name must be provided to Apply") } + emptyResult := &v1beta1.CSIDriver{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(csidriversResource, *name, types.ApplyPatchType, data), &v1beta1.CSIDriver{}) + Invokes(testing.NewRootPatchSubresourceAction(csidriversResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CSIDriver), err } diff --git a/kubernetes/typed/storage/v1beta1/fake/fake_csinode.go b/kubernetes/typed/storage/v1beta1/fake/fake_csinode.go index d38c104bc1..c37d82fc7c 100644 --- a/kubernetes/typed/storage/v1beta1/fake/fake_csinode.go +++ b/kubernetes/typed/storage/v1beta1/fake/fake_csinode.go @@ -43,20 +43,22 @@ var csinodesKind = v1beta1.SchemeGroupVersion.WithKind("CSINode") // Get takes name of the cSINode, and returns the corresponding cSINode object, and an error if there is any. func (c *FakeCSINodes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CSINode, err error) { + emptyResult := &v1beta1.CSINode{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(csinodesResource, name), &v1beta1.CSINode{}) + Invokes(testing.NewRootGetAction(csinodesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CSINode), err } // List takes label and field selectors, and returns the list of CSINodes that match those selectors. func (c *FakeCSINodes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSINodeList, err error) { + emptyResult := &v1beta1.CSINodeList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(csinodesResource, csinodesKind, opts), &v1beta1.CSINodeList{}) + Invokes(testing.NewRootListAction(csinodesResource, csinodesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeCSINodes) Watch(ctx context.Context, opts v1.ListOptions) (watch.In // Create takes the representation of a cSINode and creates it. Returns the server's representation of the cSINode, and an error, if there is any. func (c *FakeCSINodes) Create(ctx context.Context, cSINode *v1beta1.CSINode, opts v1.CreateOptions) (result *v1beta1.CSINode, err error) { + emptyResult := &v1beta1.CSINode{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(csinodesResource, cSINode), &v1beta1.CSINode{}) + Invokes(testing.NewRootCreateAction(csinodesResource, cSINode), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CSINode), err } // Update takes the representation of a cSINode and updates it. Returns the server's representation of the cSINode, and an error, if there is any. func (c *FakeCSINodes) Update(ctx context.Context, cSINode *v1beta1.CSINode, opts v1.UpdateOptions) (result *v1beta1.CSINode, err error) { + emptyResult := &v1beta1.CSINode{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(csinodesResource, cSINode), &v1beta1.CSINode{}) + Invokes(testing.NewRootUpdateAction(csinodesResource, cSINode), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CSINode), err } @@ -115,10 +119,11 @@ func (c *FakeCSINodes) DeleteCollection(ctx context.Context, opts v1.DeleteOptio // Patch applies the patch and returns the patched cSINode. func (c *FakeCSINodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSINode, err error) { + emptyResult := &v1beta1.CSINode{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(csinodesResource, name, pt, data, subresources...), &v1beta1.CSINode{}) + Invokes(testing.NewRootPatchSubresourceAction(csinodesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CSINode), err } @@ -136,10 +141,11 @@ func (c *FakeCSINodes) Apply(ctx context.Context, cSINode *storagev1beta1.CSINod if name == nil { return nil, fmt.Errorf("cSINode.Name must be provided to Apply") } + emptyResult := &v1beta1.CSINode{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(csinodesResource, *name, types.ApplyPatchType, data), &v1beta1.CSINode{}) + Invokes(testing.NewRootPatchSubresourceAction(csinodesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CSINode), err } diff --git a/kubernetes/typed/storage/v1beta1/fake/fake_csistoragecapacity.go b/kubernetes/typed/storage/v1beta1/fake/fake_csistoragecapacity.go index d7bbb614b2..77888e58a9 100644 --- a/kubernetes/typed/storage/v1beta1/fake/fake_csistoragecapacity.go +++ b/kubernetes/typed/storage/v1beta1/fake/fake_csistoragecapacity.go @@ -44,22 +44,24 @@ var csistoragecapacitiesKind = v1beta1.SchemeGroupVersion.WithKind("CSIStorageCa // Get takes name of the cSIStorageCapacity, and returns the corresponding cSIStorageCapacity object, and an error if there is any. func (c *FakeCSIStorageCapacities) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CSIStorageCapacity, err error) { + emptyResult := &v1beta1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewGetAction(csistoragecapacitiesResource, c.ns, name), &v1beta1.CSIStorageCapacity{}) + Invokes(testing.NewGetAction(csistoragecapacitiesResource, c.ns, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CSIStorageCapacity), err } // List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. func (c *FakeCSIStorageCapacities) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIStorageCapacityList, err error) { + emptyResult := &v1beta1.CSIStorageCapacityList{} obj, err := c.Fake. - Invokes(testing.NewListAction(csistoragecapacitiesResource, csistoragecapacitiesKind, c.ns, opts), &v1beta1.CSIStorageCapacityList{}) + Invokes(testing.NewListAction(csistoragecapacitiesResource, csistoragecapacitiesKind, c.ns, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -84,22 +86,24 @@ func (c *FakeCSIStorageCapacities) Watch(ctx context.Context, opts v1.ListOption // Create takes the representation of a cSIStorageCapacity and creates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. func (c *FakeCSIStorageCapacities) Create(ctx context.Context, cSIStorageCapacity *v1beta1.CSIStorageCapacity, opts v1.CreateOptions) (result *v1beta1.CSIStorageCapacity, err error) { + emptyResult := &v1beta1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(csistoragecapacitiesResource, c.ns, cSIStorageCapacity), &v1beta1.CSIStorageCapacity{}) + Invokes(testing.NewCreateAction(csistoragecapacitiesResource, c.ns, cSIStorageCapacity), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CSIStorageCapacity), err } // Update takes the representation of a cSIStorageCapacity and updates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. func (c *FakeCSIStorageCapacities) Update(ctx context.Context, cSIStorageCapacity *v1beta1.CSIStorageCapacity, opts v1.UpdateOptions) (result *v1beta1.CSIStorageCapacity, err error) { + emptyResult := &v1beta1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(csistoragecapacitiesResource, c.ns, cSIStorageCapacity), &v1beta1.CSIStorageCapacity{}) + Invokes(testing.NewUpdateAction(csistoragecapacitiesResource, c.ns, cSIStorageCapacity), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CSIStorageCapacity), err } @@ -122,11 +126,12 @@ func (c *FakeCSIStorageCapacities) DeleteCollection(ctx context.Context, opts v1 // Patch applies the patch and returns the patched cSIStorageCapacity. func (c *FakeCSIStorageCapacities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSIStorageCapacity, err error) { + emptyResult := &v1beta1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(csistoragecapacitiesResource, c.ns, name, pt, data, subresources...), &v1beta1.CSIStorageCapacity{}) + Invokes(testing.NewPatchSubresourceAction(csistoragecapacitiesResource, c.ns, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CSIStorageCapacity), err } @@ -144,11 +149,12 @@ func (c *FakeCSIStorageCapacities) Apply(ctx context.Context, cSIStorageCapacity if name == nil { return nil, fmt.Errorf("cSIStorageCapacity.Name must be provided to Apply") } + emptyResult := &v1beta1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(csistoragecapacitiesResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.CSIStorageCapacity{}) + Invokes(testing.NewPatchSubresourceAction(csistoragecapacitiesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.CSIStorageCapacity), err } diff --git a/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go b/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go index 869e58b4f7..594c4fa003 100644 --- a/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go +++ b/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go @@ -43,20 +43,22 @@ var storageclassesKind = v1beta1.SchemeGroupVersion.WithKind("StorageClass") // Get takes name of the storageClass, and returns the corresponding storageClass object, and an error if there is any. func (c *FakeStorageClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.StorageClass, err error) { + emptyResult := &v1beta1.StorageClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(storageclassesResource, name), &v1beta1.StorageClass{}) + Invokes(testing.NewRootGetAction(storageclassesResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.StorageClass), err } // List takes label and field selectors, and returns the list of StorageClasses that match those selectors. func (c *FakeStorageClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StorageClassList, err error) { + emptyResult := &v1beta1.StorageClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(storageclassesResource, storageclassesKind, opts), &v1beta1.StorageClassList{}) + Invokes(testing.NewRootListAction(storageclassesResource, storageclassesKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,20 +82,22 @@ func (c *FakeStorageClasses) Watch(ctx context.Context, opts v1.ListOptions) (wa // Create takes the representation of a storageClass and creates it. Returns the server's representation of the storageClass, and an error, if there is any. func (c *FakeStorageClasses) Create(ctx context.Context, storageClass *v1beta1.StorageClass, opts v1.CreateOptions) (result *v1beta1.StorageClass, err error) { + emptyResult := &v1beta1.StorageClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(storageclassesResource, storageClass), &v1beta1.StorageClass{}) + Invokes(testing.NewRootCreateAction(storageclassesResource, storageClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.StorageClass), err } // Update takes the representation of a storageClass and updates it. Returns the server's representation of the storageClass, and an error, if there is any. func (c *FakeStorageClasses) Update(ctx context.Context, storageClass *v1beta1.StorageClass, opts v1.UpdateOptions) (result *v1beta1.StorageClass, err error) { + emptyResult := &v1beta1.StorageClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(storageclassesResource, storageClass), &v1beta1.StorageClass{}) + Invokes(testing.NewRootUpdateAction(storageclassesResource, storageClass), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.StorageClass), err } @@ -115,10 +119,11 @@ func (c *FakeStorageClasses) DeleteCollection(ctx context.Context, opts v1.Delet // Patch applies the patch and returns the patched storageClass. func (c *FakeStorageClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StorageClass, err error) { + emptyResult := &v1beta1.StorageClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(storageclassesResource, name, pt, data, subresources...), &v1beta1.StorageClass{}) + Invokes(testing.NewRootPatchSubresourceAction(storageclassesResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.StorageClass), err } @@ -136,10 +141,11 @@ func (c *FakeStorageClasses) Apply(ctx context.Context, storageClass *storagev1b if name == nil { return nil, fmt.Errorf("storageClass.Name must be provided to Apply") } + emptyResult := &v1beta1.StorageClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(storageclassesResource, *name, types.ApplyPatchType, data), &v1beta1.StorageClass{}) + Invokes(testing.NewRootPatchSubresourceAction(storageclassesResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.StorageClass), err } diff --git a/kubernetes/typed/storage/v1beta1/fake/fake_volumeattachment.go b/kubernetes/typed/storage/v1beta1/fake/fake_volumeattachment.go index e2b4a2eb1b..41da92c1a3 100644 --- a/kubernetes/typed/storage/v1beta1/fake/fake_volumeattachment.go +++ b/kubernetes/typed/storage/v1beta1/fake/fake_volumeattachment.go @@ -43,20 +43,22 @@ var volumeattachmentsKind = v1beta1.SchemeGroupVersion.WithKind("VolumeAttachmen // Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any. func (c *FakeVolumeAttachments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeAttachment, err error) { + emptyResult := &v1beta1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(volumeattachmentsResource, name), &v1beta1.VolumeAttachment{}) + Invokes(testing.NewRootGetAction(volumeattachmentsResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VolumeAttachment), err } // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. func (c *FakeVolumeAttachments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeAttachmentList, err error) { + emptyResult := &v1beta1.VolumeAttachmentList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(volumeattachmentsResource, volumeattachmentsKind, opts), &v1beta1.VolumeAttachmentList{}) + Invokes(testing.NewRootListAction(volumeattachmentsResource, volumeattachmentsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,31 +82,34 @@ func (c *FakeVolumeAttachments) Watch(ctx context.Context, opts v1.ListOptions) // Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. func (c *FakeVolumeAttachments) Create(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.CreateOptions) (result *v1beta1.VolumeAttachment, err error) { + emptyResult := &v1beta1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(volumeattachmentsResource, volumeAttachment), &v1beta1.VolumeAttachment{}) + Invokes(testing.NewRootCreateAction(volumeattachmentsResource, volumeAttachment), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VolumeAttachment), err } // Update takes the representation of a volumeAttachment and updates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. func (c *FakeVolumeAttachments) Update(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.UpdateOptions) (result *v1beta1.VolumeAttachment, err error) { + emptyResult := &v1beta1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(volumeattachmentsResource, volumeAttachment), &v1beta1.VolumeAttachment{}) + Invokes(testing.NewRootUpdateAction(volumeattachmentsResource, volumeAttachment), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VolumeAttachment), 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 *FakeVolumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.UpdateOptions) (*v1beta1.VolumeAttachment, error) { +func (c *FakeVolumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.UpdateOptions) (result *v1beta1.VolumeAttachment, err error) { + emptyResult := &v1beta1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(volumeattachmentsResource, "status", volumeAttachment), &v1beta1.VolumeAttachment{}) + Invokes(testing.NewRootUpdateSubresourceAction(volumeattachmentsResource, "status", volumeAttachment), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VolumeAttachment), err } @@ -126,10 +131,11 @@ func (c *FakeVolumeAttachments) DeleteCollection(ctx context.Context, opts v1.De // Patch applies the patch and returns the patched volumeAttachment. func (c *FakeVolumeAttachments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeAttachment, err error) { + emptyResult := &v1beta1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, name, pt, data, subresources...), &v1beta1.VolumeAttachment{}) + Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VolumeAttachment), err } @@ -147,10 +153,11 @@ func (c *FakeVolumeAttachments) Apply(ctx context.Context, volumeAttachment *sto if name == nil { return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") } + emptyResult := &v1beta1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, *name, types.ApplyPatchType, data), &v1beta1.VolumeAttachment{}) + Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VolumeAttachment), err } @@ -169,10 +176,11 @@ func (c *FakeVolumeAttachments) ApplyStatus(ctx context.Context, volumeAttachmen if name == nil { return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") } + emptyResult := &v1beta1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, *name, types.ApplyPatchType, data, "status"), &v1beta1.VolumeAttachment{}) + Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1beta1.VolumeAttachment), err } diff --git a/kubernetes/typed/storagemigration/v1alpha1/fake/fake_storageversionmigration.go b/kubernetes/typed/storagemigration/v1alpha1/fake/fake_storageversionmigration.go index 9b5da88c72..ede21403a5 100644 --- a/kubernetes/typed/storagemigration/v1alpha1/fake/fake_storageversionmigration.go +++ b/kubernetes/typed/storagemigration/v1alpha1/fake/fake_storageversionmigration.go @@ -43,20 +43,22 @@ var storageversionmigrationsKind = v1alpha1.SchemeGroupVersion.WithKind("Storage // Get takes name of the storageVersionMigration, and returns the corresponding storageVersionMigration object, and an error if there is any. func (c *FakeStorageVersionMigrations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.StorageVersionMigration, err error) { + emptyResult := &v1alpha1.StorageVersionMigration{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(storageversionmigrationsResource, name), &v1alpha1.StorageVersionMigration{}) + Invokes(testing.NewRootGetAction(storageversionmigrationsResource, name), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.StorageVersionMigration), err } // List takes label and field selectors, and returns the list of StorageVersionMigrations that match those selectors. func (c *FakeStorageVersionMigrations) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionMigrationList, err error) { + emptyResult := &v1alpha1.StorageVersionMigrationList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(storageversionmigrationsResource, storageversionmigrationsKind, opts), &v1alpha1.StorageVersionMigrationList{}) + Invokes(testing.NewRootListAction(storageversionmigrationsResource, storageversionmigrationsKind, opts), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } label, _, _ := testing.ExtractFromListOptions(opts) @@ -80,31 +82,34 @@ func (c *FakeStorageVersionMigrations) Watch(ctx context.Context, opts v1.ListOp // Create takes the representation of a storageVersionMigration and creates it. Returns the server's representation of the storageVersionMigration, and an error, if there is any. func (c *FakeStorageVersionMigrations) Create(ctx context.Context, storageVersionMigration *v1alpha1.StorageVersionMigration, opts v1.CreateOptions) (result *v1alpha1.StorageVersionMigration, err error) { + emptyResult := &v1alpha1.StorageVersionMigration{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(storageversionmigrationsResource, storageVersionMigration), &v1alpha1.StorageVersionMigration{}) + Invokes(testing.NewRootCreateAction(storageversionmigrationsResource, storageVersionMigration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.StorageVersionMigration), err } // Update takes the representation of a storageVersionMigration and updates it. Returns the server's representation of the storageVersionMigration, and an error, if there is any. func (c *FakeStorageVersionMigrations) Update(ctx context.Context, storageVersionMigration *v1alpha1.StorageVersionMigration, opts v1.UpdateOptions) (result *v1alpha1.StorageVersionMigration, err error) { + emptyResult := &v1alpha1.StorageVersionMigration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(storageversionmigrationsResource, storageVersionMigration), &v1alpha1.StorageVersionMigration{}) + Invokes(testing.NewRootUpdateAction(storageversionmigrationsResource, storageVersionMigration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.StorageVersionMigration), 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 *FakeStorageVersionMigrations) UpdateStatus(ctx context.Context, storageVersionMigration *v1alpha1.StorageVersionMigration, opts v1.UpdateOptions) (*v1alpha1.StorageVersionMigration, error) { +func (c *FakeStorageVersionMigrations) UpdateStatus(ctx context.Context, storageVersionMigration *v1alpha1.StorageVersionMigration, opts v1.UpdateOptions) (result *v1alpha1.StorageVersionMigration, err error) { + emptyResult := &v1alpha1.StorageVersionMigration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(storageversionmigrationsResource, "status", storageVersionMigration), &v1alpha1.StorageVersionMigration{}) + Invokes(testing.NewRootUpdateSubresourceAction(storageversionmigrationsResource, "status", storageVersionMigration), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.StorageVersionMigration), err } @@ -126,10 +131,11 @@ func (c *FakeStorageVersionMigrations) DeleteCollection(ctx context.Context, opt // Patch applies the patch and returns the patched storageVersionMigration. func (c *FakeStorageVersionMigrations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.StorageVersionMigration, err error) { + emptyResult := &v1alpha1.StorageVersionMigration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(storageversionmigrationsResource, name, pt, data, subresources...), &v1alpha1.StorageVersionMigration{}) + Invokes(testing.NewRootPatchSubresourceAction(storageversionmigrationsResource, name, pt, data, subresources...), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.StorageVersionMigration), err } @@ -147,10 +153,11 @@ func (c *FakeStorageVersionMigrations) Apply(ctx context.Context, storageVersion if name == nil { return nil, fmt.Errorf("storageVersionMigration.Name must be provided to Apply") } + emptyResult := &v1alpha1.StorageVersionMigration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(storageversionmigrationsResource, *name, types.ApplyPatchType, data), &v1alpha1.StorageVersionMigration{}) + Invokes(testing.NewRootPatchSubresourceAction(storageversionmigrationsResource, *name, types.ApplyPatchType, data), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.StorageVersionMigration), err } @@ -169,10 +176,11 @@ func (c *FakeStorageVersionMigrations) ApplyStatus(ctx context.Context, storageV if name == nil { return nil, fmt.Errorf("storageVersionMigration.Name must be provided to Apply") } + emptyResult := &v1alpha1.StorageVersionMigration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(storageversionmigrationsResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.StorageVersionMigration{}) + Invokes(testing.NewRootPatchSubresourceAction(storageversionmigrationsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) if obj == nil { - return nil, err + return emptyResult, err } return obj.(*v1alpha1.StorageVersionMigration), err } From af62623c06fd265270e7107c62818e3da6ec69fa Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Thu, 25 Jan 2024 08:47:20 -0500 Subject: [PATCH 006/159] Remove gcp in-tree cloud provider and credential provider Signed-off-by: Davanum Srinivas Kubernetes-commit: bf268f02a3567c1af29199c27a7cf61cca494b2d --- plugin/pkg/client/auth/azure/azure_stub.go | 36 --------------------- plugin/pkg/client/auth/gcp/gcp_stub.go | 36 --------------------- plugin/pkg/client/auth/plugins_providers.go | 26 --------------- 3 files changed, 98 deletions(-) delete mode 100644 plugin/pkg/client/auth/azure/azure_stub.go delete mode 100644 plugin/pkg/client/auth/gcp/gcp_stub.go delete mode 100644 plugin/pkg/client/auth/plugins_providers.go diff --git a/plugin/pkg/client/auth/azure/azure_stub.go b/plugin/pkg/client/auth/azure/azure_stub.go deleted file mode 100644 index 22d3c6b3fe..0000000000 --- a/plugin/pkg/client/auth/azure/azure_stub.go +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package azure - -import ( - "errors" - - "k8s.io/client-go/rest" - "k8s.io/klog/v2" -) - -func init() { - if err := rest.RegisterAuthProviderPlugin("azure", newAzureAuthProvider); err != nil { - klog.Fatalf("Failed to register azure auth plugin: %v", err) - } -} - -func newAzureAuthProvider(_ string, _ map[string]string, _ rest.AuthProviderConfigPersister) (rest.AuthProvider, error) { - return nil, errors.New(`The azure auth plugin has been removed. -Please use the https://github.com/Azure/kubelogin kubectl/client-go credential plugin instead. -See https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins for further details`) -} diff --git a/plugin/pkg/client/auth/gcp/gcp_stub.go b/plugin/pkg/client/auth/gcp/gcp_stub.go deleted file mode 100644 index 99585f9391..0000000000 --- a/plugin/pkg/client/auth/gcp/gcp_stub.go +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package gcp - -import ( - "errors" - - "k8s.io/client-go/rest" - "k8s.io/klog/v2" -) - -func init() { - if err := rest.RegisterAuthProviderPlugin("gcp", newGCPAuthProvider); err != nil { - klog.Fatalf("Failed to register gcp auth plugin: %v", err) - } -} - -func newGCPAuthProvider(_ string, _ map[string]string, _ rest.AuthProviderConfigPersister) (rest.AuthProvider, error) { - return nil, errors.New(`The gcp auth plugin has been removed. -Please use the "gke-gcloud-auth-plugin" kubectl/client-go credential plugin instead. -See https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke for further details`) -} diff --git a/plugin/pkg/client/auth/plugins_providers.go b/plugin/pkg/client/auth/plugins_providers.go deleted file mode 100644 index 3f0688774e..0000000000 --- a/plugin/pkg/client/auth/plugins_providers.go +++ /dev/null @@ -1,26 +0,0 @@ -//go:build !providerless -// +build !providerless - -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package auth - -import ( - // Initialize client auth plugins for cloud providers. - _ "k8s.io/client-go/plugin/pkg/client/auth/azure" - _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" -) From ffda3468aab0d3eae4c8f5410fafdd4352a87439 Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Mon, 27 May 2024 17:42:29 +0200 Subject: [PATCH 007/159] Update kubectl kustomize to kyaml/v0.17.1, cmd/config/v0.14.1, api/v0.17.2, kustomize/v5.4.2 Signed-off-by: Stephen Kitt Kubernetes-commit: 33c6f6bc65395aa514c9cf17115a1c63564c22e7 --- go.mod | 17 +++++++++++------ go.sum | 28 +++++++++++++++++----------- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index e85900001d..379fcc850a 100644 --- a/go.mod +++ b/go.mod @@ -19,14 +19,13 @@ require ( github.com/peterbourgon/diskv v2.0.1+incompatible github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.4 - go.uber.org/goleak v1.3.0 golang.org/x/net v0.25.0 golang.org/x/oauth2 v0.20.0 golang.org/x/term v0.20.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 - k8s.io/api v0.0.0-20240528083513-7480c4668141 - k8s.io/apimachinery v0.0.0-20240528083227-d8a3da39bf82 + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -36,12 +35,12 @@ require ( ) require ( - github.com/davecgh/go-spew v1.1.1 // 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/go-logr/logr v1.4.1 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect - github.com/go-openapi/swag v0.22.3 // indirect + github.com/go-openapi/swag v0.22.4 // indirect github.com/google/btree v1.0.1 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -53,10 +52,16 @@ require ( github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/onsi/gomega v1.33.1 // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect golang.org/x/sys v0.20.0 // indirect golang.org/x/text v0.15.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace ( + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go +) diff --git a/go.sum b/go.sum index 17248f8532..280e48fb0c 100644 --- a/go.sum +++ b/go.sum @@ -1,21 +1,27 @@ +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= 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/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 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= 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-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/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -79,10 +85,11 @@ github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+v github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -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/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/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -94,15 +101,16 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= -go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -137,6 +145,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -150,10 +159,7 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240528083513-7480c4668141 h1:xzR/CbPgqt7z5Tfld1Bxh1q4LouztWgUZk6y3RrWoTA= -k8s.io/api v0.0.0-20240528083513-7480c4668141/go.mod h1:zxjqHi2uhPFAcVqls8xe2bdAq1XYUsQ+ZiEDXT3iNAM= -k8s.io/apimachinery v0.0.0-20240528083227-d8a3da39bf82 h1:VdBSu9hfIGtUc3VYM0eGHnUch0L2OSH7Tl2prbbAPQU= -k8s.io/apimachinery v0.0.0-20240528083227-d8a3da39bf82/go.mod h1:Tbh97rImB1AK+ESEKVAzaakMJKJaMzpxIdHfDmHds3U= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 16552d46562645525d660f10e484f7d352e97d33 Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Fri, 16 Feb 2024 13:57:24 +0100 Subject: [PATCH 008/159] Use canonical json-patch v4 import The canonical import for json-patch v4 is gopkg.in/evanphx/json-patch.v4 (see https://github.com/evanphx/json-patch/blob/master/README.md#get-it for reference). Using the v4-specific path should also reduce the risk of unwanted v5 upgrade attempts, because they won't be offered as automated upgrades by dependency upgrade management tools, and they won't happen through indirect dependencies (see https://github.com/kubernetes/kubernetes/pull/120327 for context). Signed-off-by: Stephen Kitt Kubernetes-commit: 5300466a5c8988b479a151ceb77f49dd00065c83 --- go.mod | 2 +- go.sum | 4 ++-- scale/client_test.go | 2 +- testing/fixture.go | 2 +- util/csaupgrade/upgrade_test.go | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 379fcc850a..d780e5c0c8 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ module k8s.io/client-go go 1.22.0 require ( - github.com/evanphx/json-patch v4.12.0+incompatible github.com/gogo/protobuf v1.3.2 github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da github.com/golang/protobuf v1.5.4 @@ -24,6 +23,7 @@ require ( golang.org/x/term v0.20.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 + gopkg.in/evanphx/json-patch.v4 v4.12.0 k8s.io/api v0.0.0 k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.120.1 diff --git a/go.sum b/go.sum index 280e48fb0c..6eb2357c5f 100644 --- a/go.sum +++ b/go.sum @@ -10,8 +10,6 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= -github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -151,6 +149,8 @@ google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHh 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/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/scale/client_test.go b/scale/client_test.go index 058bf3c1ca..2b4a7a7e19 100644 --- a/scale/client_test.go +++ b/scale/client_test.go @@ -25,7 +25,7 @@ import ( "net/http" "testing" - jsonpatch "github.com/evanphx/json-patch" + jsonpatch "gopkg.in/evanphx/json-patch.v4" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/testing/fixture.go b/testing/fixture.go index 396840670f..f626c12bf3 100644 --- a/testing/fixture.go +++ b/testing/fixture.go @@ -23,7 +23,7 @@ import ( "strings" "sync" - jsonpatch "github.com/evanphx/json-patch" + jsonpatch "gopkg.in/evanphx/json-patch.v4" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" diff --git a/util/csaupgrade/upgrade_test.go b/util/csaupgrade/upgrade_test.go index 33c6683494..de7369cda1 100644 --- a/util/csaupgrade/upgrade_test.go +++ b/util/csaupgrade/upgrade_test.go @@ -21,9 +21,9 @@ import ( "reflect" "testing" - jsonpatch "github.com/evanphx/json-patch" "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/require" + jsonpatch "gopkg.in/evanphx/json-patch.v4" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/util/sets" From 9c3db8681d49b6b709f01f41d710962cebbf54b2 Mon Sep 17 00:00:00 2001 From: Haibing Zhou Date: Fri, 16 Feb 2024 12:09:37 -0800 Subject: [PATCH 009/159] workqueue: make queue as configurable The default queue implementation is mostly FIFO and it is not exchangeable unless we implement the whole `workqueue.Interface` which is less desirable as we have to duplicate a lot of code. There was one attempt done in [kubernetes/kubernetes#109349][1] which tried to implement a priority queue. That is really useful and [knative/pkg][2] implemented something called two-lane-queue. While two lane queue is great, but isn't perfect since a full slow queue can still slow down items in fast queue. This change proposes a swappable queue implementation while not adding extra maintenance effort in kubernetes community. We are happy to maintain our own queue implementation (similar to two-lane-queue) in downstream. [1]: https://github.com/kubernetes/kubernetes/pull/109349 [2]: https://github.com/knative/pkg/blob/main/controller/two_lane_queue.go Kubernetes-commit: 87b4279e07349b3c68f16f69a349a02bddd12f25 --- util/workqueue/metrics_test.go | 2 +- util/workqueue/queue.go | 75 +++++++++++++++++++++++++++++----- util/workqueue/queue_test.go | 37 ++++++++++++++++- 3 files changed, 100 insertions(+), 14 deletions(-) diff --git a/util/workqueue/metrics_test.go b/util/workqueue/metrics_test.go index 3c3cc36111..a98a728f68 100644 --- a/util/workqueue/metrics_test.go +++ b/util/workqueue/metrics_test.go @@ -41,7 +41,7 @@ func TestMetricShutdown(t *testing.T) { updateCalled: ch, } c := testingclock.NewFakeClock(time.Now()) - q := newQueue(c, m, time.Millisecond) + q := newQueue(c, DefaultQueue(), m, time.Millisecond) for !c.HasWaiters() { // Wait for the go routine to call NewTicker() time.Sleep(time.Millisecond) diff --git a/util/workqueue/queue.go b/util/workqueue/queue.go index a363d1afb4..163d65c056 100644 --- a/util/workqueue/queue.go +++ b/util/workqueue/queue.go @@ -33,6 +33,48 @@ type Interface interface { ShuttingDown() bool } +// Queue is the underlying storage for items. The functions below are always +// called from the same goroutine. +type Queue interface { + // Touch can be hooked when an existing item is added again. This may be + // useful if the implementation allows priority change for the given item. + Touch(item interface{}) + // Push adds a new item. + Push(item interface{}) + // Len tells the total number of items. + Len() int + // Pop retrieves an item. + Pop() (item interface{}) +} + +// DefaultQueue is a slice based FIFO queue. +func DefaultQueue() Queue { + return new(queue) +} + +// queue is a slice which implements Queue. +type queue []interface{} + +func (q *queue) Touch(item interface{}) {} + +func (q *queue) Push(item interface{}) { + *q = append(*q, item) +} + +func (q *queue) Len() int { + return len(*q) +} + +func (q *queue) Pop() (item interface{}) { + item = (*q)[0] + + // The underlying array still exists and reference this object, so the object will not be garbage collected. + (*q)[0] = nil + *q = (*q)[1:] + + return item +} + // QueueConfig specifies optional configurations to customize an Interface. type QueueConfig struct { // Name for the queue. If unnamed, the metrics will not be registered. @@ -44,6 +86,9 @@ type QueueConfig struct { // Clock ability to inject real or fake clock for testing purposes. Clock clock.WithTicker + + // Queue provides the underlying queue to use. It is optional and defaults to slice based FIFO queue. + Queue Queue } // New constructs a new work queue (see the package comment). @@ -83,16 +128,22 @@ func newQueueWithConfig(config QueueConfig, updatePeriod time.Duration) *Type { config.Clock = clock.RealClock{} } + if config.Queue == nil { + config.Queue = DefaultQueue() + } + return newQueue( config.Clock, + config.Queue, metricsFactory.newQueueMetrics(config.Name, config.Clock), updatePeriod, ) } -func newQueue(c clock.WithTicker, metrics queueMetrics, updatePeriod time.Duration) *Type { +func newQueue(c clock.WithTicker, queue Queue, metrics queueMetrics, updatePeriod time.Duration) *Type { t := &Type{ clock: c, + queue: queue, dirty: set{}, processing: set{}, cond: sync.NewCond(&sync.Mutex{}), @@ -116,7 +167,7 @@ type Type struct { // queue defines the order in which we will work on items. Every // element of queue should be in the dirty set and not in the // processing set. - queue []t + queue Queue // dirty defines all of the items that need to be processed. dirty set @@ -167,6 +218,11 @@ func (q *Type) Add(item interface{}) { return } if q.dirty.has(item) { + // the same item is added again before it is processed, call the Touch + // function if the queue cares about it (for e.g, reset its priority) + if !q.processing.has(item) { + q.queue.Touch(item) + } return } @@ -177,7 +233,7 @@ func (q *Type) Add(item interface{}) { return } - q.queue = append(q.queue, item) + q.queue.Push(item) q.cond.Signal() } @@ -187,7 +243,7 @@ func (q *Type) Add(item interface{}) { func (q *Type) Len() int { q.cond.L.Lock() defer q.cond.L.Unlock() - return len(q.queue) + return q.queue.Len() } // Get blocks until it can return an item to be processed. If shutdown = true, @@ -196,18 +252,15 @@ func (q *Type) Len() int { func (q *Type) Get() (item interface{}, shutdown bool) { q.cond.L.Lock() defer q.cond.L.Unlock() - for len(q.queue) == 0 && !q.shuttingDown { + for q.queue.Len() == 0 && !q.shuttingDown { q.cond.Wait() } - if len(q.queue) == 0 { + if q.queue.Len() == 0 { // We must be shutting down. return nil, true } - item = q.queue[0] - // The underlying array still exists and reference this object, so the object will not be garbage collected. - q.queue[0] = nil - q.queue = q.queue[1:] + item = q.queue.Pop() q.metrics.get(item) @@ -228,7 +281,7 @@ func (q *Type) Done(item interface{}) { q.processing.delete(item) if q.dirty.has(item) { - q.queue = append(q.queue, item) + q.queue.Push(item) q.cond.Signal() } else if q.processing.len() == 0 { q.cond.Signal() diff --git a/util/workqueue/queue_test.go b/util/workqueue/queue_test.go index e2a33973c0..1cf2cd2f19 100644 --- a/util/workqueue/queue_test.go +++ b/util/workqueue/queue_test.go @@ -27,6 +27,23 @@ import ( "k8s.io/client-go/util/workqueue" ) +// traceQueue traces whether items are touched +type traceQueue struct { + workqueue.Queue + + touched map[interface{}]struct{} +} + +func (t *traceQueue) Touch(item interface{}) { + t.Queue.Touch(item) + if t.touched == nil { + t.touched = make(map[interface{}]struct{}) + } + t.touched[item] = struct{}{} +} + +var _ workqueue.Queue = &traceQueue{} + func TestBasic(t *testing.T) { tests := []struct { queue *workqueue.Type @@ -198,7 +215,11 @@ func TestReinsert(t *testing.T) { } func TestCollapse(t *testing.T) { - q := workqueue.New() + tq := &traceQueue{Queue: workqueue.DefaultQueue()} + q := workqueue.NewWithConfig(workqueue.QueueConfig{ + Name: "", + Queue: tq, + }) // Add a new one twice q.Add("bar") q.Add("bar") @@ -216,10 +237,18 @@ func TestCollapse(t *testing.T) { if a := q.Len(); a != 0 { t.Errorf("Expected queue to be empty. Has %v items", a) } + + if _, ok := tq.touched["bar"]; !ok { + t.Errorf("Expected bar to be Touched") + } } func TestCollapseWhileProcessing(t *testing.T) { - q := workqueue.New() + tq := &traceQueue{Queue: workqueue.DefaultQueue()} + q := workqueue.NewWithConfig(workqueue.QueueConfig{ + Name: "", + Queue: tq, + }) q.Add("foo") // Start processing @@ -261,6 +290,10 @@ func TestCollapseWhileProcessing(t *testing.T) { if a := q.Len(); a != 0 { t.Errorf("Expected queue to be empty. Has %v items", a) } + + if _, ok := tq.touched["foo"]; ok { + t.Errorf("Unexpected Touch") + } } func TestQueueDrainageUsingShutDownWithDrain(t *testing.T) { From 45e17fede08496913c4ce21def96bdff28987d76 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Mon, 11 Mar 2024 12:56:40 +0100 Subject: [PATCH 010/159] client-go/cache/reflector: use metav1.InitialEventsAnnotationKey Kubernetes-commit: a953539fb57b2ee18337f323ef15425a4d6207ed --- tools/cache/reflector.go | 2 +- tools/cache/reflector_watchlist_test.go | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/cache/reflector.go b/tools/cache/reflector.go index f733e244cc..14221cd240 100644 --- a/tools/cache/reflector.go +++ b/tools/cache/reflector.go @@ -780,7 +780,7 @@ loop: } case watch.Bookmark: // A `Bookmark` means watch has synced here, just update the resourceVersion - if meta.GetAnnotations()["k8s.io/initial-events-end"] == "true" { + if meta.GetAnnotations()[metav1.InitialEventsAnnotationKey] == "true" { if exitOnInitialEventsEndBookmark != nil { *exitOnInitialEventsEndBookmark = true } diff --git a/tools/cache/reflector_watchlist_test.go b/tools/cache/reflector_watchlist_test.go index 76eacb5a51..a2eec9193f 100644 --- a/tools/cache/reflector_watchlist_test.go +++ b/tools/cache/reflector_watchlist_test.go @@ -174,7 +174,7 @@ func TestWatchList(t *testing.T) { {Type: watch.Bookmark, Object: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ ResourceVersion: "2", - Annotations: map[string]string{"k8s.io/initial-events-end": "true"}, + Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "true"}, }, }}, }, @@ -203,7 +203,7 @@ func TestWatchList(t *testing.T) { {Type: watch.Bookmark, Object: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ ResourceVersion: "5", - Annotations: map[string]string{"k8s.io/initial-events-end": "true"}, + Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "true"}, }, }}, }, @@ -241,7 +241,7 @@ func TestWatchList(t *testing.T) { {Type: watch.Bookmark, Object: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ ResourceVersion: "2", - Annotations: map[string]string{"k8s.io/initial-events-end": "true"}, + Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "true"}, }, }}, }, @@ -279,7 +279,7 @@ func TestWatchList(t *testing.T) { {Type: watch.Bookmark, Object: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ ResourceVersion: "1", - Annotations: map[string]string{"k8s.io/initial-events-end": "true"}, + Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "true"}, }, }}, }, @@ -310,7 +310,7 @@ func TestWatchList(t *testing.T) { {Type: watch.Bookmark, Object: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ ResourceVersion: "2", - Annotations: map[string]string{"k8s.io/initial-events-end": "true"}, + Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "true"}, }, }}, {Type: watch.Added, Object: makePod("p3", "3")}, @@ -351,7 +351,7 @@ func TestWatchList(t *testing.T) { {Type: watch.Bookmark, Object: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ ResourceVersion: "2", - Annotations: map[string]string{"k8s.io/initial-events-end": "true"}, + Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "true"}, }, }}, {Type: watch.Added, Object: makePod("p3", "3")}, @@ -382,7 +382,7 @@ func TestWatchList(t *testing.T) { {Type: watch.Bookmark, Object: &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ ResourceVersion: "2", - Annotations: map[string]string{"k8s.io/initial-events-end": "false"}, + Annotations: map[string]string{metav1.InitialEventsAnnotationKey: "false"}, }, }}, }, From fa185a21dba355e46e1ea087d2edc656708f8a80 Mon Sep 17 00:00:00 2001 From: Lan Liang Date: Mon, 18 Mar 2024 08:10:12 +0000 Subject: [PATCH 011/159] cleanup: delete rand.Seed(time.Now().UnixNano()) and using global number generator. see https://tip.golang.org/doc/go1.20 Signed-off-by: Lan Liang Kubernetes-commit: dc992adad385ab631e4a528ee6a342ea71e7a379 --- tools/cache/main_test.go | 3 --- tools/record/main_test.go | 3 --- util/workqueue/main_test.go | 3 --- 3 files changed, 9 deletions(-) diff --git a/tools/cache/main_test.go b/tools/cache/main_test.go index 16933a4b53..abbfb0b506 100644 --- a/tools/cache/main_test.go +++ b/tools/cache/main_test.go @@ -17,13 +17,10 @@ limitations under the License. package cache import ( - "math/rand" "os" "testing" - "time" ) func TestMain(m *testing.M) { - rand.Seed(time.Now().UnixNano()) os.Exit(m.Run()) } diff --git a/tools/record/main_test.go b/tools/record/main_test.go index b3c74f25bc..58f81f7491 100644 --- a/tools/record/main_test.go +++ b/tools/record/main_test.go @@ -17,13 +17,10 @@ limitations under the License. package record import ( - "math/rand" "os" "testing" - "time" ) func TestMain(m *testing.M) { - rand.Seed(time.Now().UnixNano()) os.Exit(m.Run()) } diff --git a/util/workqueue/main_test.go b/util/workqueue/main_test.go index 41274b2c25..04d5817e4c 100644 --- a/util/workqueue/main_test.go +++ b/util/workqueue/main_test.go @@ -17,13 +17,10 @@ limitations under the License. package workqueue import ( - "math/rand" "os" "testing" - "time" ) func TestMain(m *testing.M) { - rand.Seed(time.Now().UnixNano()) os.Exit(m.Run()) } From 1518fca9f06c6a73fc091535b8966c71704e657b Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Mon, 18 Mar 2024 11:59:16 +0000 Subject: [PATCH 012/159] sync: update go.mod --- go.mod | 5 ----- 1 file changed, 5 deletions(-) diff --git a/go.mod b/go.mod index 04bfce009f..4c2cbf8144 100644 --- a/go.mod +++ b/go.mod @@ -59,8 +59,3 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace ( - k8s.io/api => k8s.io/api v0.0.0-20240314205423-d1659ebfc7f3 - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240307171817-d82afe1e363a -) From a457c5ed6855c4135e8c59ccba3d495a442eb31f Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Wed, 27 Mar 2024 11:22:35 +0100 Subject: [PATCH 013/159] DRA api: ResourceHandle.DriverName is required It was already required via validation, but not declared as such by the OpenAPI. Kubernetes-commit: 1a13b0aa3333d04ae67a6fcdd21c8e2a042dc0c2 --- applyconfigurations/internal/internal.go | 1 + 1 file changed, 1 insertion(+) diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 0d753b07b1..f3314a39ee 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -12413,6 +12413,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: driverName type: scalar: string + default: "" - name: structuredData type: namedType: io.k8s.api.resource.v1alpha2.StructuredResourceHandle From a2cc4908546a413d5353d53b8052eeac6c6aff3e Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Wed, 3 Apr 2024 16:37:18 -0400 Subject: [PATCH 014/159] Update x/net for CVE-2023-45288 Signed-off-by: Davanum Srinivas Kubernetes-commit: 99fac38d2864e6bc9bb7cd1743d658caa1360c0c --- go.mod | 16 +++++++++++----- go.sum | 26 ++++++++++++++++---------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 4c2cbf8144..7d92a4168b 100644 --- a/go.mod +++ b/go.mod @@ -19,13 +19,13 @@ require ( github.com/peterbourgon/diskv v2.0.1+incompatible github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.4 - golang.org/x/net v0.21.0 + golang.org/x/net v0.23.0 golang.org/x/oauth2 v0.10.0 - golang.org/x/term v0.17.0 + golang.org/x/term v0.18.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 - k8s.io/api v0.0.0-20240314205423-d1659ebfc7f3 - k8s.io/apimachinery v0.0.0-20240307171817-d82afe1e363a + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -52,10 +52,16 @@ require ( github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/sys v0.17.0 // indirect + golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/appengine v1.6.7 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace ( + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go +) diff --git a/go.sum b/go.sum index 26627599be..5f7f660845 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,9 @@ +cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -8,6 +12,7 @@ github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxER github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= @@ -95,20 +100,23 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -117,10 +125,10 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -138,6 +146,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= @@ -153,10 +162,7 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240314205423-d1659ebfc7f3 h1:qOTA6AgJrLhETfhNJHy4J7tSgOXdIC7hts3Sr5Gesbk= -k8s.io/api v0.0.0-20240314205423-d1659ebfc7f3/go.mod h1:RzL8aPQw9ZdVXCdY+Iz3AXnVX+jFyQNqcmzmS+2/Ur0= -k8s.io/apimachinery v0.0.0-20240307171817-d82afe1e363a h1:0OAuWcxW23YggVeW/f7sDWuEF2U4HDVSN+CQNMxwimI= -k8s.io/apimachinery v0.0.0-20240307171817-d82afe1e363a/go.mod h1:wEJvNDlfxMRaMhyv38SIHIEC9hah/xuzqUUhxIyUv7Y= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From aa7909e7d7c0661792ba21b9e882f3cd6ad0ce53 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Wed, 3 Apr 2024 20:13:01 -0700 Subject: [PATCH 015/159] Merge pull request #124174 from dims/update-x/net-for-CVE-2023-45288 Update x/net for CVE-2023-45288 Kubernetes-commit: d9c54f69d4bb7ae1bb655e1a2a50297d615025b5 --- go.mod | 10 ++-------- go.sum | 14 ++++---------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index 7d92a4168b..3e496abf37 100644 --- a/go.mod +++ b/go.mod @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.18.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 - k8s.io/api v0.0.0 - k8s.io/apimachinery v0.0.0 + k8s.io/api v0.0.0-20240404035423-5e7d566356d1 + k8s.io/apimachinery v0.0.0-20240404035254-e696ec55a32e k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -59,9 +59,3 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace ( - k8s.io/api => ../api - k8s.io/apimachinery => ../apimachinery - k8s.io/client-go => ../client-go -) diff --git a/go.sum b/go.sum index 5f7f660845..0fb64c1198 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,5 @@ -cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -12,7 +8,6 @@ github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxER github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= @@ -100,16 +95,13 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -146,7 +138,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= @@ -162,7 +153,10 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= +k8s.io/api v0.0.0-20240404035423-5e7d566356d1 h1:tUkP151p85IMjkPt1+gdSJ4a7HTp6atyw0BPaOl43AI= +k8s.io/api v0.0.0-20240404035423-5e7d566356d1/go.mod h1:hpltBotDO81r+TzqESp+1COe04YlRTmdCzAysBBM8CU= +k8s.io/apimachinery v0.0.0-20240404035254-e696ec55a32e h1:QDMqQVyH8eAEDzaa0HcUsmoJE2goz2xNXb2SKkcU3Lw= +k8s.io/apimachinery v0.0.0-20240404035254-e696ec55a32e/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 7da319745b8bc1ed417798a7441dc5f74ba6c571 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Tyczy=C5=84ski?= Date: Tue, 9 Apr 2024 09:06:38 +0200 Subject: [PATCH 016/159] Refactor informer constructors Kubernetes-commit: 4da185a601e1f657a873dfd7e51efcc8a3b94c37 --- tools/cache/controller.go | 118 ++++++++++++++++++++++++++++++-------- 1 file changed, 93 insertions(+), 25 deletions(-) diff --git a/tools/cache/controller.go b/tools/cache/controller.go index ee19a5af95..c6f6f52fab 100644 --- a/tools/cache/controller.go +++ b/tools/cache/controller.go @@ -346,6 +346,52 @@ func DeletionHandlingObjectToName(obj interface{}) (ObjectName, error) { return ObjectToName(obj) } +// InformerOptions configure a Reflector. +type InformerOptions struct { + // ListerWatcher implements List and Watch functions for the source of the resource + // the informer will be informing about. + ListerWatcher ListerWatcher + + // ObjectType is an object of the type that informer is expected to receive. + ObjectType runtime.Object + + // Handler defines functions that should called on object mutations. + Handler ResourceEventHandler + + // ResyncPeriod is the underlying Reflector's resync period. If non-zero, the store + // is re-synced with that frequency - Modify events are delivered even if objects + // didn't change. + // This is useful for synchronizing objects that configure external resources + // (e.g. configure cloud provider functionalities). + // Optional - if unset, store resyncing is not happening periodically. + ResyncPeriod time.Duration + + // Indexers, if set, are the indexers for the received objects to optimize + // certain queries. + // Optional - if unset no indexes are maintained. + Indexers Indexers + + // Transform function, if set, will be called on all objects before they will be + // put into the Store and corresponding Add/Modify/Delete handlers will be invoked + // for them. + // Optional - if unset no additional transforming is happening. + Transform TransformFunc +} + +// NewInformerWithOptions returns a Store and a controller for populating the store +// while also providing event notifications. You should only used the returned +// Store for Get/List operations; Add/Modify/Deletes will cause the event +// notifications to be faulty. +func NewInformerWithOptions(options InformerOptions) (Store, Controller) { + var clientState Store + if options.Indexers == nil { + clientState = NewStore(DeletionHandlingMetaNamespaceKeyFunc) + } else { + clientState = NewIndexer(DeletionHandlingMetaNamespaceKeyFunc, options.Indexers) + } + return clientState, newInformer(clientState, options) +} + // NewInformer returns a Store and a controller for populating the store // while also providing event notifications. You should only used the returned // Store for Get/List operations; Add/Modify/Deletes will cause the event @@ -360,6 +406,8 @@ func DeletionHandlingObjectToName(obj interface{}) (ObjectName, error) { // long as possible (until the upstream source closes the watch or times out, // or you stop the controller). // - h is the object you want notifications sent to. +// +// Deprecated: Use NewInformerWithOptions instead. func NewInformer( lw ListerWatcher, objType runtime.Object, @@ -369,7 +417,13 @@ func NewInformer( // This will hold the client state, as we know it. clientState := NewStore(DeletionHandlingMetaNamespaceKeyFunc) - return clientState, newInformer(lw, objType, resyncPeriod, h, clientState, nil) + options := InformerOptions{ + ListerWatcher: lw, + ObjectType: objType, + Handler: h, + ResyncPeriod: resyncPeriod, + } + return clientState, newInformer(clientState, options) } // NewIndexerInformer returns an Indexer and a Controller for populating the index @@ -387,6 +441,8 @@ func NewInformer( // or you stop the controller). // - h is the object you want notifications sent to. // - indexers is the indexer for the received object type. +// +// Deprecated: Use NewInformerWithOptions instead. func NewIndexerInformer( lw ListerWatcher, objType runtime.Object, @@ -397,7 +453,14 @@ func NewIndexerInformer( // This will hold the client state, as we know it. clientState := NewIndexer(DeletionHandlingMetaNamespaceKeyFunc, indexers) - return clientState, newInformer(lw, objType, resyncPeriod, h, clientState, nil) + options := InformerOptions{ + ListerWatcher: lw, + ObjectType: objType, + Handler: h, + ResyncPeriod: resyncPeriod, + Indexers: indexers, + } + return clientState, newInformer(clientState, options) } // NewTransformingInformer returns a Store and a controller for populating @@ -407,6 +470,8 @@ func NewIndexerInformer( // The given transform function will be called on all objects before they will // put into the Store and corresponding Add/Modify/Delete handlers will // be invoked for them. +// +// Deprecated: Use NewInformerWithOptions instead. func NewTransformingInformer( lw ListerWatcher, objType runtime.Object, @@ -417,7 +482,14 @@ func NewTransformingInformer( // This will hold the client state, as we know it. clientState := NewStore(DeletionHandlingMetaNamespaceKeyFunc) - return clientState, newInformer(lw, objType, resyncPeriod, h, clientState, transformer) + options := InformerOptions{ + ListerWatcher: lw, + ObjectType: objType, + Handler: h, + ResyncPeriod: resyncPeriod, + Transform: transformer, + } + return clientState, newInformer(clientState, options) } // NewTransformingIndexerInformer returns an Indexer and a controller for @@ -427,6 +499,8 @@ func NewTransformingInformer( // The given transform function will be called on all objects before they will // be put into the Index and corresponding Add/Modify/Delete handlers will // be invoked for them. +// +// Deprecated: Use NewInformerWithOptions instead. func NewTransformingIndexerInformer( lw ListerWatcher, objType runtime.Object, @@ -438,7 +512,15 @@ func NewTransformingIndexerInformer( // This will hold the client state, as we know it. clientState := NewIndexer(DeletionHandlingMetaNamespaceKeyFunc, indexers) - return clientState, newInformer(lw, objType, resyncPeriod, h, clientState, transformer) + options := InformerOptions{ + ListerWatcher: lw, + ObjectType: objType, + Handler: h, + ResyncPeriod: resyncPeriod, + Indexers: indexers, + Transform: transformer, + } + return clientState, newInformer(clientState, options) } // Multiplexes updates in the form of a list of Deltas into a Store, and informs @@ -481,42 +563,28 @@ func processDeltas( // providing event notifications. // // Parameters -// - lw is list and watch functions for the source of the resource you want to -// be informed of. -// - objType is an object of the type that you expect to receive. -// - resyncPeriod: if non-zero, will re-list this often (you will get OnUpdate -// calls, even if nothing changed). Otherwise, re-list will be delayed as -// long as possible (until the upstream source closes the watch or times out, -// or you stop the controller). -// - h is the object you want notifications sent to. // - clientState is the store you want to populate -func newInformer( - lw ListerWatcher, - objType runtime.Object, - resyncPeriod time.Duration, - h ResourceEventHandler, - clientState Store, - transformer TransformFunc, -) Controller { +// - options contain the options to configure the controller +func newInformer(clientState Store, options InformerOptions) Controller { // This will hold incoming changes. Note how we pass clientState in as a // KeyLister, that way resync operations will result in the correct set // of update/delete deltas. fifo := NewDeltaFIFOWithOptions(DeltaFIFOOptions{ KnownObjects: clientState, EmitDeltaTypeReplaced: true, - Transformer: transformer, + Transformer: options.Transform, }) cfg := &Config{ Queue: fifo, - ListerWatcher: lw, - ObjectType: objType, - FullResyncPeriod: resyncPeriod, + ListerWatcher: options.ListerWatcher, + ObjectType: options.ObjectType, + FullResyncPeriod: options.ResyncPeriod, RetryOnError: false, Process: func(obj interface{}, isInInitialList bool) error { if deltas, ok := obj.(Deltas); ok { - return processDeltas(h, clientState, deltas, isInInitialList) + return processDeltas(options.Handler, clientState, deltas, isInInitialList) } return errors.New("object given as Process argument is not Deltas") }, From b9e952f4d7a716401820b07cf1506974bef8a152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Tyczy=C5=84ski?= Date: Tue, 9 Apr 2024 09:12:54 +0200 Subject: [PATCH 017/159] Allow for configuring MinWatchTimeout in Reflector and Informer. Kubernetes-commit: 29e38c19b853b6cc3950541b1727395acf5eb4d3 --- tools/cache/controller.go | 14 ++++++++ tools/cache/reflector.go | 27 +++++++++++----- tools/cache/reflector_test.go | 61 +++++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+), 8 deletions(-) diff --git a/tools/cache/controller.go b/tools/cache/controller.go index c6f6f52fab..e523a66522 100644 --- a/tools/cache/controller.go +++ b/tools/cache/controller.go @@ -59,6 +59,12 @@ type Config struct { // FullResyncPeriod is the period at which ShouldResync is considered. FullResyncPeriod time.Duration + // MinWatchTimeout, if set, will define the minimum timeout for watch requests send + // to kube-apiserver. However, values lower than 5m will not be honored to avoid + // negative performance impact on controlplane. + // Optional - if unset a default value of 5m will be used. + MinWatchTimeout time.Duration + // ShouldResync is periodically used by the reflector to determine // whether to Resync the Queue. If ShouldResync is `nil` or // returns true, it means the reflector should proceed with the @@ -138,6 +144,7 @@ func (c *controller) Run(stopCh <-chan struct{}) { c.config.Queue, ReflectorOptions{ ResyncPeriod: c.config.FullResyncPeriod, + MinWatchTimeout: c.config.MinWatchTimeout, TypeDescription: c.config.ObjectDescription, Clock: c.clock, }, @@ -366,6 +373,12 @@ type InformerOptions struct { // Optional - if unset, store resyncing is not happening periodically. ResyncPeriod time.Duration + // MinWatchTimeout, if set, will define the minimum timeout for watch requests send + // to kube-apiserver. However, values lower than 5m will not be honored to avoid + // negative performance impact on controlplane. + // Optional - if unset a default value of 5m will be used. + MinWatchTimeout time.Duration + // Indexers, if set, are the indexers for the received objects to optimize // certain queries. // Optional - if unset no indexes are maintained. @@ -580,6 +593,7 @@ func newInformer(clientState Store, options InformerOptions) Controller { ListerWatcher: options.ListerWatcher, ObjectType: options.ObjectType, FullResyncPeriod: options.ResyncPeriod, + MinWatchTimeout: options.MinWatchTimeout, RetryOnError: false, Process: func(obj interface{}, isInInitialList bool) error { diff --git a/tools/cache/reflector.go b/tools/cache/reflector.go index 14221cd240..157436da75 100644 --- a/tools/cache/reflector.go +++ b/tools/cache/reflector.go @@ -49,6 +49,12 @@ import ( const defaultExpectedTypeName = "" +var ( + // We try to spread the load on apiserver by setting timeouts for + // watch requests - it is random in [minWatchTimeout, 2*minWatchTimeout]. + defaultMinWatchTimeout = 5 * time.Minute +) + // Reflector watches a specified resource and causes all changes to be reflected in the given store. type Reflector struct { // name identifies this reflector. By default it will be a file:line if possible. @@ -72,6 +78,8 @@ type Reflector struct { // backoff manages backoff of ListWatch backoffManager wait.BackoffManager resyncPeriod time.Duration + // minWatchTimeout defines the minimum timeout for watch requests. + minWatchTimeout time.Duration // clock allows tests to manipulate time clock clock.Clock // paginatedResult defines whether pagination should be forced for list calls. @@ -151,12 +159,6 @@ func DefaultWatchErrorHandler(r *Reflector, err error) { } } -var ( - // We try to spread the load on apiserver by setting timeouts for - // watch requests - it is random in [minWatchTimeout, 2*minWatchTimeout]. - minWatchTimeout = 5 * time.Minute -) - // NewNamespaceKeyedIndexerAndReflector creates an Indexer and a Reflector // The indexer is configured to key on namespace func NewNamespaceKeyedIndexerAndReflector(lw ListerWatcher, expectedType interface{}, resyncPeriod time.Duration) (indexer Indexer, reflector *Reflector) { @@ -194,6 +196,10 @@ type ReflectorOptions struct { // (do not resync). ResyncPeriod time.Duration + // MinWatchTimeout, if non-zero, defines the minimum timeout for watch requests send to kube-apiserver. + // However, values lower than 5m will not be honored to avoid negative performance impact on controlplane. + MinWatchTimeout time.Duration + // Clock allows tests to control time. If unset defaults to clock.RealClock{} Clock clock.Clock } @@ -213,9 +219,14 @@ func NewReflectorWithOptions(lw ListerWatcher, expectedType interface{}, store S if reflectorClock == nil { reflectorClock = clock.RealClock{} } + minWatchTimeout := defaultMinWatchTimeout + if options.MinWatchTimeout > defaultMinWatchTimeout { + minWatchTimeout = options.MinWatchTimeout + } r := &Reflector{ name: options.Name, resyncPeriod: options.ResyncPeriod, + minWatchTimeout: minWatchTimeout, typeDescription: options.TypeDescription, listerWatcher: lw, store: store, @@ -415,7 +426,7 @@ func (r *Reflector) watch(w watch.Interface, stopCh <-chan struct{}, resyncerrc start := r.clock.Now() if w == nil { - timeoutSeconds := int64(minWatchTimeout.Seconds() * (rand.Float64() + 1.0)) + timeoutSeconds := int64(r.minWatchTimeout.Seconds() * (rand.Float64() + 1.0)) options := metav1.ListOptions{ ResourceVersion: r.LastSyncResourceVersion(), // We want to avoid situations of hanging watchers. Stop any watchers that do not @@ -642,7 +653,7 @@ func (r *Reflector) watchList(stopCh <-chan struct{}) (watch.Interface, error) { // TODO(#115478): large "list", slow clients, slow network, p&f // might slow down streaming and eventually fail. // maybe in such a case we should retry with an increased timeout? - timeoutSeconds := int64(minWatchTimeout.Seconds() * (rand.Float64() + 1.0)) + timeoutSeconds := int64(r.minWatchTimeout.Seconds() * (rand.Float64() + 1.0)) options := metav1.ListOptions{ ResourceVersion: lastKnownRV, AllowWatchBookmarks: true, diff --git a/tools/cache/reflector_test.go b/tools/cache/reflector_test.go index 611357b7d5..84a8d2697f 100644 --- a/tools/cache/reflector_test.go +++ b/tools/cache/reflector_test.go @@ -1091,6 +1091,67 @@ func TestGetExpectedGVKFromObject(t *testing.T) { } } +func TestWatchTimeout(t *testing.T) { + + testCases := []struct { + name string + minWatchTimeout time.Duration + expectedMinTimeoutSeconds int64 + }{ + { + name: "no timeout", + expectedMinTimeoutSeconds: 5 * 60, + }, + { + name: "small timeout not honored", + minWatchTimeout: time.Second, + expectedMinTimeoutSeconds: 5 * 60, + }, + { + name: "30m timeout", + minWatchTimeout: 30 * time.Minute, + expectedMinTimeoutSeconds: 30 * 60, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + stopCh := make(chan struct{}) + s := NewStore(MetaNamespaceKeyFunc) + var gotTimeoutSeconds int64 + + lw := &testLW{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "10"}}, nil + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if options.TimeoutSeconds != nil { + gotTimeoutSeconds = *options.TimeoutSeconds + } + + // Stop once the reflector begins watching since we're only interested in the list. + close(stopCh) + return watch.NewFake(), nil + }, + } + + opts := ReflectorOptions{ + MinWatchTimeout: tc.minWatchTimeout, + } + r := NewReflectorWithOptions(lw, &v1.Pod{}, s, opts) + if err := r.ListAndWatch(stopCh); err != nil { + t.Fatal(err) + } + + minExpected := tc.expectedMinTimeoutSeconds + maxExpected := 2 * tc.expectedMinTimeoutSeconds + if gotTimeoutSeconds < minExpected || gotTimeoutSeconds > maxExpected { + t.Errorf("unexpected TimeoutSecond, got %v, expected in [%v, %v]", gotTimeoutSeconds, minExpected, maxExpected) + } + }) + } +} + type storeWithRV struct { Store From d67dddfe904b8f56592481d01f009576c114d3a4 Mon Sep 17 00:00:00 2001 From: Alvaro Aleman Date: Thu, 11 Apr 2024 18:11:41 -0400 Subject: [PATCH 018/159] Workqueue: Add generic versions that are properly typed This change adds a generic version of the various workqueue types while retaining compatibility for the existing exported symbols and constructors. The generic variants are prefixed with `Typed` and the existing ones are marked as deprecated to nudge people to transition without breaking them. Kubernetes-commit: 0c7370bb851c15825d30a516722139ccccca0cfc --- util/workqueue/default_rate_limiters.go | 139 +++++++++++++++------ util/workqueue/delaying_queue.go | 66 +++++++--- util/workqueue/delaying_queue_test.go | 2 +- util/workqueue/metrics_test.go | 4 +- util/workqueue/queue.go | 110 +++++++++------- util/workqueue/queue_test.go | 8 +- util/workqueue/rate_limiting_queue.go | 64 +++++++--- util/workqueue/rate_limiting_queue_test.go | 8 +- 8 files changed, 270 insertions(+), 131 deletions(-) diff --git a/util/workqueue/default_rate_limiters.go b/util/workqueue/default_rate_limiters.go index efda7c197f..1f9567881c 100644 --- a/util/workqueue/default_rate_limiters.go +++ b/util/workqueue/default_rate_limiters.go @@ -24,49 +24,66 @@ import ( "golang.org/x/time/rate" ) -type RateLimiter interface { +// Deprecated: RateLimiter is deprecated, use TypedRateLimiter instead. +type RateLimiter TypedRateLimiter[any] + +type TypedRateLimiter[T comparable] interface { // When gets an item and gets to decide how long that item should wait - When(item interface{}) time.Duration + When(item T) time.Duration // Forget indicates that an item is finished being retried. Doesn't matter whether it's for failing // or for success, we'll stop tracking it - Forget(item interface{}) + Forget(item T) // NumRequeues returns back how many failures the item has had - NumRequeues(item interface{}) int + NumRequeues(item T) int } // DefaultControllerRateLimiter is a no-arg constructor for a default rate limiter for a workqueue. It has // both overall and per-item rate limiting. The overall is a token bucket and the per-item is exponential +// +// Deprecated: Use DefaultTypedControllerRateLimiter instead. func DefaultControllerRateLimiter() RateLimiter { - return NewMaxOfRateLimiter( - NewItemExponentialFailureRateLimiter(5*time.Millisecond, 1000*time.Second), + return DefaultTypedControllerRateLimiter[any]() +} + +// DefaultTypedControllerRateLimiter is a no-arg constructor for a default rate limiter for a workqueue. It has +// both overall and per-item rate limiting. The overall is a token bucket and the per-item is exponential +func DefaultTypedControllerRateLimiter[T comparable]() TypedRateLimiter[T] { + return NewTypedMaxOfRateLimiter( + NewTypedItemExponentialFailureRateLimiter[T](5*time.Millisecond, 1000*time.Second), // 10 qps, 100 bucket size. This is only for retry speed and its only the overall factor (not per item) - &BucketRateLimiter{Limiter: rate.NewLimiter(rate.Limit(10), 100)}, + &TypedBucketRateLimiter[T]{Limiter: rate.NewLimiter(rate.Limit(10), 100)}, ) } -// BucketRateLimiter adapts a standard bucket to the workqueue ratelimiter API -type BucketRateLimiter struct { +// Deprecated: BucketRateLimiter is deprecated, use TypedBucketRateLimiter instead. +type BucketRateLimiter = TypedBucketRateLimiter[any] + +// TypedBucketRateLimiter adapts a standard bucket to the workqueue ratelimiter API +type TypedBucketRateLimiter[T comparable] struct { *rate.Limiter } var _ RateLimiter = &BucketRateLimiter{} -func (r *BucketRateLimiter) When(item interface{}) time.Duration { +func (r *TypedBucketRateLimiter[T]) When(item T) time.Duration { return r.Limiter.Reserve().Delay() } -func (r *BucketRateLimiter) NumRequeues(item interface{}) int { +func (r *TypedBucketRateLimiter[T]) NumRequeues(item T) int { return 0 } -func (r *BucketRateLimiter) Forget(item interface{}) { +func (r *TypedBucketRateLimiter[T]) Forget(item T) { } -// ItemExponentialFailureRateLimiter does a simple baseDelay*2^ limit +// Deprecated: ItemExponentialFailureRateLimiter is deprecated, use TypedItemExponentialFailureRateLimiter instead. +type ItemExponentialFailureRateLimiter = TypedItemExponentialFailureRateLimiter[any] + +// TypedItemExponentialFailureRateLimiter does a simple baseDelay*2^ limit // dealing with max failures and expiration are up to the caller -type ItemExponentialFailureRateLimiter struct { +type TypedItemExponentialFailureRateLimiter[T comparable] struct { failuresLock sync.Mutex - failures map[interface{}]int + failures map[T]int baseDelay time.Duration maxDelay time.Duration @@ -74,19 +91,29 @@ type ItemExponentialFailureRateLimiter struct { var _ RateLimiter = &ItemExponentialFailureRateLimiter{} +// Deprecated: NewItemExponentialFailureRateLimiter is deprecated, use NewTypedItemExponentialFailureRateLimiter instead. func NewItemExponentialFailureRateLimiter(baseDelay time.Duration, maxDelay time.Duration) RateLimiter { - return &ItemExponentialFailureRateLimiter{ - failures: map[interface{}]int{}, + return NewTypedItemExponentialFailureRateLimiter[any](baseDelay, maxDelay) +} + +func NewTypedItemExponentialFailureRateLimiter[T comparable](baseDelay time.Duration, maxDelay time.Duration) TypedRateLimiter[T] { + return &TypedItemExponentialFailureRateLimiter[T]{ + failures: map[T]int{}, baseDelay: baseDelay, maxDelay: maxDelay, } } +// Deprecated: DefaultItemBasedRateLimiter is deprecated, use DefaultTypedItemBasedRateLimiter instead. func DefaultItemBasedRateLimiter() RateLimiter { - return NewItemExponentialFailureRateLimiter(time.Millisecond, 1000*time.Second) + return DefaultTypedItemBasedRateLimiter[any]() } -func (r *ItemExponentialFailureRateLimiter) When(item interface{}) time.Duration { +func DefaultTypedItemBasedRateLimiter[T comparable]() TypedRateLimiter[T] { + return NewTypedItemExponentialFailureRateLimiter[T](time.Millisecond, 1000*time.Second) +} + +func (r *TypedItemExponentialFailureRateLimiter[T]) When(item T) time.Duration { r.failuresLock.Lock() defer r.failuresLock.Unlock() @@ -107,14 +134,14 @@ func (r *ItemExponentialFailureRateLimiter) When(item interface{}) time.Duration return calculated } -func (r *ItemExponentialFailureRateLimiter) NumRequeues(item interface{}) int { +func (r *TypedItemExponentialFailureRateLimiter[T]) NumRequeues(item T) int { r.failuresLock.Lock() defer r.failuresLock.Unlock() return r.failures[item] } -func (r *ItemExponentialFailureRateLimiter) Forget(item interface{}) { +func (r *TypedItemExponentialFailureRateLimiter[T]) Forget(item T) { r.failuresLock.Lock() defer r.failuresLock.Unlock() @@ -122,9 +149,13 @@ func (r *ItemExponentialFailureRateLimiter) Forget(item interface{}) { } // ItemFastSlowRateLimiter does a quick retry for a certain number of attempts, then a slow retry after that -type ItemFastSlowRateLimiter struct { +// Deprecated: Use TypedItemFastSlowRateLimiter instead. +type ItemFastSlowRateLimiter = TypedItemFastSlowRateLimiter[any] + +// TypedItemFastSlowRateLimiter does a quick retry for a certain number of attempts, then a slow retry after that +type TypedItemFastSlowRateLimiter[T comparable] struct { failuresLock sync.Mutex - failures map[interface{}]int + failures map[T]int maxFastAttempts int fastDelay time.Duration @@ -133,16 +164,21 @@ type ItemFastSlowRateLimiter struct { var _ RateLimiter = &ItemFastSlowRateLimiter{} +// Deprecated: NewItemFastSlowRateLimiter is deprecated, use NewTypedItemFastSlowRateLimiter instead. func NewItemFastSlowRateLimiter(fastDelay, slowDelay time.Duration, maxFastAttempts int) RateLimiter { - return &ItemFastSlowRateLimiter{ - failures: map[interface{}]int{}, + return NewTypedItemFastSlowRateLimiter[any](fastDelay, slowDelay, maxFastAttempts) +} + +func NewTypedItemFastSlowRateLimiter[T comparable](fastDelay, slowDelay time.Duration, maxFastAttempts int) TypedRateLimiter[T] { + return &TypedItemFastSlowRateLimiter[T]{ + failures: map[T]int{}, fastDelay: fastDelay, slowDelay: slowDelay, maxFastAttempts: maxFastAttempts, } } -func (r *ItemFastSlowRateLimiter) When(item interface{}) time.Duration { +func (r *TypedItemFastSlowRateLimiter[T]) When(item T) time.Duration { r.failuresLock.Lock() defer r.failuresLock.Unlock() @@ -155,14 +191,14 @@ func (r *ItemFastSlowRateLimiter) When(item interface{}) time.Duration { return r.slowDelay } -func (r *ItemFastSlowRateLimiter) NumRequeues(item interface{}) int { +func (r *TypedItemFastSlowRateLimiter[T]) NumRequeues(item T) int { r.failuresLock.Lock() defer r.failuresLock.Unlock() return r.failures[item] } -func (r *ItemFastSlowRateLimiter) Forget(item interface{}) { +func (r *TypedItemFastSlowRateLimiter[T]) Forget(item T) { r.failuresLock.Lock() defer r.failuresLock.Unlock() @@ -172,11 +208,18 @@ func (r *ItemFastSlowRateLimiter) Forget(item interface{}) { // MaxOfRateLimiter calls every RateLimiter and returns the worst case response // When used with a token bucket limiter, the burst could be apparently exceeded in cases where particular items // were separately delayed a longer time. -type MaxOfRateLimiter struct { - limiters []RateLimiter +// +// Deprecated: Use TypedMaxOfRateLimiter instead. +type MaxOfRateLimiter = TypedMaxOfRateLimiter[any] + +// TypedMaxOfRateLimiter calls every RateLimiter and returns the worst case response +// When used with a token bucket limiter, the burst could be apparently exceeded in cases where particular items +// were separately delayed a longer time. +type TypedMaxOfRateLimiter[T comparable] struct { + limiters []TypedRateLimiter[T] } -func (r *MaxOfRateLimiter) When(item interface{}) time.Duration { +func (r *TypedMaxOfRateLimiter[T]) When(item T) time.Duration { ret := time.Duration(0) for _, limiter := range r.limiters { curr := limiter.When(item) @@ -188,11 +231,16 @@ func (r *MaxOfRateLimiter) When(item interface{}) time.Duration { return ret } -func NewMaxOfRateLimiter(limiters ...RateLimiter) RateLimiter { - return &MaxOfRateLimiter{limiters: limiters} +// Deprecated: NewMaxOfRateLimiter is deprecated, use NewTypedMaxOfRateLimiter instead. +func NewMaxOfRateLimiter(limiters ...TypedRateLimiter[any]) RateLimiter { + return NewTypedMaxOfRateLimiter(limiters...) } -func (r *MaxOfRateLimiter) NumRequeues(item interface{}) int { +func NewTypedMaxOfRateLimiter[T comparable](limiters ...TypedRateLimiter[T]) TypedRateLimiter[T] { + return &TypedMaxOfRateLimiter[T]{limiters: limiters} +} + +func (r *TypedMaxOfRateLimiter[T]) NumRequeues(item T) int { ret := 0 for _, limiter := range r.limiters { curr := limiter.NumRequeues(item) @@ -204,23 +252,32 @@ func (r *MaxOfRateLimiter) NumRequeues(item interface{}) int { return ret } -func (r *MaxOfRateLimiter) Forget(item interface{}) { +func (r *TypedMaxOfRateLimiter[T]) Forget(item T) { for _, limiter := range r.limiters { limiter.Forget(item) } } // WithMaxWaitRateLimiter have maxDelay which avoids waiting too long -type WithMaxWaitRateLimiter struct { - limiter RateLimiter +// Deprecated: Use TypedWithMaxWaitRateLimiter instead. +type WithMaxWaitRateLimiter = TypedWithMaxWaitRateLimiter[any] + +// TypedWithMaxWaitRateLimiter have maxDelay which avoids waiting too long +type TypedWithMaxWaitRateLimiter[T comparable] struct { + limiter TypedRateLimiter[T] maxDelay time.Duration } +// Deprecated: NewWithMaxWaitRateLimiter is deprecated, use NewTypedWithMaxWaitRateLimiter instead. func NewWithMaxWaitRateLimiter(limiter RateLimiter, maxDelay time.Duration) RateLimiter { - return &WithMaxWaitRateLimiter{limiter: limiter, maxDelay: maxDelay} + return NewTypedWithMaxWaitRateLimiter[any](limiter, maxDelay) +} + +func NewTypedWithMaxWaitRateLimiter[T comparable](limiter TypedRateLimiter[T], maxDelay time.Duration) TypedRateLimiter[T] { + return &TypedWithMaxWaitRateLimiter[T]{limiter: limiter, maxDelay: maxDelay} } -func (w WithMaxWaitRateLimiter) When(item interface{}) time.Duration { +func (w TypedWithMaxWaitRateLimiter[T]) When(item T) time.Duration { delay := w.limiter.When(item) if delay > w.maxDelay { return w.maxDelay @@ -229,10 +286,10 @@ func (w WithMaxWaitRateLimiter) When(item interface{}) time.Duration { return delay } -func (w WithMaxWaitRateLimiter) Forget(item interface{}) { +func (w TypedWithMaxWaitRateLimiter[T]) Forget(item T) { w.limiter.Forget(item) } -func (w WithMaxWaitRateLimiter) NumRequeues(item interface{}) int { +func (w TypedWithMaxWaitRateLimiter[T]) NumRequeues(item T) int { return w.limiter.NumRequeues(item) } diff --git a/util/workqueue/delaying_queue.go b/util/workqueue/delaying_queue.go index c1df720302..958b96a80c 100644 --- a/util/workqueue/delaying_queue.go +++ b/util/workqueue/delaying_queue.go @@ -27,14 +27,25 @@ import ( // DelayingInterface is an Interface that can Add an item at a later time. This makes it easier to // requeue items after failures without ending up in a hot-loop. -type DelayingInterface interface { - Interface +// +// Deprecated: use TypedDelayingInterface instead. +type DelayingInterface TypedDelayingInterface[any] + +// TypedDelayingInterface is an Interface that can Add an item at a later time. This makes it easier to +// requeue items after failures without ending up in a hot-loop. +type TypedDelayingInterface[T comparable] interface { + TypedInterface[T] // AddAfter adds an item to the workqueue after the indicated duration has passed - AddAfter(item interface{}, duration time.Duration) + AddAfter(item T, duration time.Duration) } // DelayingQueueConfig specifies optional configurations to customize a DelayingInterface. -type DelayingQueueConfig struct { +// +// Deprecated: use TypedDelayingQueueConfig instead. +type DelayingQueueConfig = TypedDelayingQueueConfig[any] + +// TypedDelayingQueueConfig specifies optional configurations to customize a DelayingInterface. +type TypedDelayingQueueConfig[T comparable] struct { // Name for the queue. If unnamed, the metrics will not be registered. Name string @@ -46,25 +57,42 @@ type DelayingQueueConfig struct { Clock clock.WithTicker // Queue optionally allows injecting custom queue Interface instead of the default one. - Queue Interface + Queue TypedInterface[T] } // NewDelayingQueue constructs a new workqueue with delayed queuing ability. // NewDelayingQueue does not emit metrics. For use with a MetricsProvider, please use // NewDelayingQueueWithConfig instead and specify a name. +// +// Deprecated: use TypedNewDelayingQueue instead. func NewDelayingQueue() DelayingInterface { return NewDelayingQueueWithConfig(DelayingQueueConfig{}) } +// TypedNewDelayingQueue constructs a new workqueue with delayed queuing ability. +// TypedNewDelayingQueue does not emit metrics. For use with a MetricsProvider, please use +// TypedNewDelayingQueueWithConfig instead and specify a name. +func TypedNewDelayingQueue[T comparable]() TypedDelayingInterface[T] { + return NewTypedDelayingQueueWithConfig(TypedDelayingQueueConfig[T]{}) +} + // NewDelayingQueueWithConfig constructs a new workqueue with options to // customize different properties. +// +// Deprecated: use TypedNewDelayingQueueWithConfig instead. func NewDelayingQueueWithConfig(config DelayingQueueConfig) DelayingInterface { + return NewTypedDelayingQueueWithConfig[any](config) +} + +// NewTypedDelayingQueueWithConfig constructs a new workqueue with options to +// customize different properties. +func NewTypedDelayingQueueWithConfig[T comparable](config TypedDelayingQueueConfig[T]) TypedDelayingInterface[T] { if config.Clock == nil { config.Clock = clock.RealClock{} } if config.Queue == nil { - config.Queue = NewWithConfig(QueueConfig{ + config.Queue = NewTypedWithConfig[T](TypedQueueConfig[T]{ Name: config.Name, MetricsProvider: config.MetricsProvider, Clock: config.Clock, @@ -100,9 +128,9 @@ func NewDelayingQueueWithCustomClock(clock clock.WithTicker, name string) Delayi }) } -func newDelayingQueue(clock clock.WithTicker, q Interface, name string, provider MetricsProvider) *delayingType { - ret := &delayingType{ - Interface: q, +func newDelayingQueue[T comparable](clock clock.WithTicker, q TypedInterface[T], name string, provider MetricsProvider) *delayingType[T] { + ret := &delayingType[T]{ + TypedInterface: q, clock: clock, heartbeat: clock.NewTicker(maxWait), stopCh: make(chan struct{}), @@ -115,8 +143,8 @@ func newDelayingQueue(clock clock.WithTicker, q Interface, name string, provider } // delayingType wraps an Interface and provides delayed re-enquing -type delayingType struct { - Interface +type delayingType[T comparable] struct { + TypedInterface[T] // clock tracks time for delayed firing clock clock.Clock @@ -193,16 +221,16 @@ func (pq waitForPriorityQueue) Peek() interface{} { // ShutDown stops the queue. After the queue drains, the returned shutdown bool // on Get() will be true. This method may be invoked more than once. -func (q *delayingType) ShutDown() { +func (q *delayingType[T]) ShutDown() { q.stopOnce.Do(func() { - q.Interface.ShutDown() + q.TypedInterface.ShutDown() close(q.stopCh) q.heartbeat.Stop() }) } // AddAfter adds the given item to the work queue after the given delay -func (q *delayingType) AddAfter(item interface{}, duration time.Duration) { +func (q *delayingType[T]) AddAfter(item T, duration time.Duration) { // don't add if we're already shutting down if q.ShuttingDown() { return @@ -229,7 +257,7 @@ func (q *delayingType) AddAfter(item interface{}, duration time.Duration) { const maxWait = 10 * time.Second // waitingLoop runs until the workqueue is shutdown and keeps a check on the list of items to be added. -func (q *delayingType) waitingLoop() { +func (q *delayingType[T]) waitingLoop() { defer utilruntime.HandleCrash() // Make a placeholder channel to use when there are no items in our list @@ -244,7 +272,7 @@ func (q *delayingType) waitingLoop() { waitingEntryByData := map[t]*waitFor{} for { - if q.Interface.ShuttingDown() { + if q.TypedInterface.ShuttingDown() { return } @@ -258,7 +286,7 @@ func (q *delayingType) waitingLoop() { } entry = heap.Pop(waitingForQueue).(*waitFor) - q.Add(entry.data) + q.Add(entry.data.(T)) delete(waitingEntryByData, entry.data) } @@ -287,7 +315,7 @@ func (q *delayingType) waitingLoop() { if waitEntry.readyAt.After(q.clock.Now()) { insert(waitingForQueue, waitingEntryByData, waitEntry) } else { - q.Add(waitEntry.data) + q.Add(waitEntry.data.(T)) } drained := false @@ -297,7 +325,7 @@ func (q *delayingType) waitingLoop() { if waitEntry.readyAt.After(q.clock.Now()) { insert(waitingForQueue, waitingEntryByData, waitEntry) } else { - q.Add(waitEntry.data) + q.Add(waitEntry.data.(T)) } default: drained = true diff --git a/util/workqueue/delaying_queue_test.go b/util/workqueue/delaying_queue_test.go index 3c589e17c9..5eac320bcf 100644 --- a/util/workqueue/delaying_queue_test.go +++ b/util/workqueue/delaying_queue_test.go @@ -241,7 +241,7 @@ func waitForAdded(q DelayingInterface, depth int) error { func waitForWaitingQueueToFill(q DelayingInterface) error { return wait.Poll(1*time.Millisecond, 10*time.Second, func() (done bool, err error) { - if len(q.(*delayingType).waitingForAddCh) == 0 { + if len(q.(*delayingType[any]).waitingForAddCh) == 0 { return true, nil } diff --git a/util/workqueue/metrics_test.go b/util/workqueue/metrics_test.go index a98a728f68..552ec7a8fa 100644 --- a/util/workqueue/metrics_test.go +++ b/util/workqueue/metrics_test.go @@ -41,7 +41,7 @@ func TestMetricShutdown(t *testing.T) { updateCalled: ch, } c := testingclock.NewFakeClock(time.Now()) - q := newQueue(c, DefaultQueue(), m, time.Millisecond) + q := newQueue[any](c, DefaultQueue[any](), m, time.Millisecond) for !c.HasWaiters() { // Wait for the go routine to call NewTicker() time.Sleep(time.Millisecond) @@ -176,7 +176,7 @@ func TestMetrics(t *testing.T) { Clock: c, MetricsProvider: &mp, } - q := newQueueWithConfig(config, time.Millisecond) + q := newQueueWithConfig[any](config, time.Millisecond) defer q.ShutDown() for !c.HasWaiters() { // Wait for the go routine to call NewTicker() diff --git a/util/workqueue/queue.go b/util/workqueue/queue.go index 163d65c056..ff715482c1 100644 --- a/util/workqueue/queue.go +++ b/util/workqueue/queue.go @@ -23,11 +23,14 @@ import ( "k8s.io/utils/clock" ) -type Interface interface { - Add(item interface{}) +// Deprecated: Interface is deprecated, use TypedInterface instead. +type Interface TypedInterface[any] + +type TypedInterface[T comparable] interface { + Add(item T) Len() int - Get() (item interface{}, shutdown bool) - Done(item interface{}) + Get() (item T, shutdown bool) + Done(item T) ShutDown() ShutDownWithDrain() ShuttingDown() bool @@ -35,48 +38,51 @@ type Interface interface { // Queue is the underlying storage for items. The functions below are always // called from the same goroutine. -type Queue interface { +type Queue[T comparable] interface { // Touch can be hooked when an existing item is added again. This may be // useful if the implementation allows priority change for the given item. - Touch(item interface{}) + Touch(item T) // Push adds a new item. - Push(item interface{}) + Push(item T) // Len tells the total number of items. Len() int // Pop retrieves an item. - Pop() (item interface{}) + Pop() (item T) } // DefaultQueue is a slice based FIFO queue. -func DefaultQueue() Queue { - return new(queue) +func DefaultQueue[T comparable]() Queue[T] { + return new(queue[T]) } // queue is a slice which implements Queue. -type queue []interface{} +type queue[T comparable] []T -func (q *queue) Touch(item interface{}) {} +func (q *queue[T]) Touch(item T) {} -func (q *queue) Push(item interface{}) { +func (q *queue[T]) Push(item T) { *q = append(*q, item) } -func (q *queue) Len() int { +func (q *queue[T]) Len() int { return len(*q) } -func (q *queue) Pop() (item interface{}) { +func (q *queue[T]) Pop() (item T) { item = (*q)[0] // The underlying array still exists and reference this object, so the object will not be garbage collected. - (*q)[0] = nil + (*q)[0] = *new(T) *q = (*q)[1:] return item } // QueueConfig specifies optional configurations to customize an Interface. -type QueueConfig struct { +// Deprecated: use TypedQueueConfig instead. +type QueueConfig = TypedQueueConfig[any] + +type TypedQueueConfig[T comparable] struct { // Name for the queue. If unnamed, the metrics will not be registered. Name string @@ -88,19 +94,36 @@ type QueueConfig struct { Clock clock.WithTicker // Queue provides the underlying queue to use. It is optional and defaults to slice based FIFO queue. - Queue Queue + Queue Queue[T] } // New constructs a new work queue (see the package comment). +// +// Deprecated: use NewTyped instead. func New() *Type { return NewWithConfig(QueueConfig{ Name: "", }) } +// NewTyped constructs a new work queue (see the package comment). +func NewTyped[T comparable]() *Typed[T] { + return NewTypedWithConfig(TypedQueueConfig[T]{ + Name: "", + }) +} + // NewWithConfig constructs a new workqueue with ability to // customize different properties. +// +// Deprecated: use NewTypedWithConfig instead. func NewWithConfig(config QueueConfig) *Type { + return NewTypedWithConfig(config) +} + +// NewTypedWithConfig constructs a new workqueue with ability to +// customize different properties. +func NewTypedWithConfig[T comparable](config TypedQueueConfig[T]) *Typed[T] { return newQueueWithConfig(config, defaultUnfinishedWorkUpdatePeriod) } @@ -114,7 +137,7 @@ func NewNamed(name string) *Type { // newQueueWithConfig constructs a new named workqueue // with the ability to customize different properties for testing purposes -func newQueueWithConfig(config QueueConfig, updatePeriod time.Duration) *Type { +func newQueueWithConfig[T comparable](config TypedQueueConfig[T], updatePeriod time.Duration) *Typed[T] { var metricsFactory *queueMetricsFactory if config.MetricsProvider != nil { metricsFactory = &queueMetricsFactory{ @@ -129,7 +152,7 @@ func newQueueWithConfig(config QueueConfig, updatePeriod time.Duration) *Type { } if config.Queue == nil { - config.Queue = DefaultQueue() + config.Queue = DefaultQueue[T]() } return newQueue( @@ -140,12 +163,12 @@ func newQueueWithConfig(config QueueConfig, updatePeriod time.Duration) *Type { ) } -func newQueue(c clock.WithTicker, queue Queue, metrics queueMetrics, updatePeriod time.Duration) *Type { - t := &Type{ +func newQueue[T comparable](c clock.WithTicker, queue Queue[T], metrics queueMetrics, updatePeriod time.Duration) *Typed[T] { + t := &Typed[T]{ clock: c, queue: queue, - dirty: set{}, - processing: set{}, + dirty: set[T]{}, + processing: set[T]{}, cond: sync.NewCond(&sync.Mutex{}), metrics: metrics, unfinishedWorkUpdatePeriod: updatePeriod, @@ -163,20 +186,23 @@ func newQueue(c clock.WithTicker, queue Queue, metrics queueMetrics, updatePerio const defaultUnfinishedWorkUpdatePeriod = 500 * time.Millisecond // Type is a work queue (see the package comment). -type Type struct { +// Deprecated: Use Typed instead. +type Type = Typed[any] + +type Typed[t comparable] struct { // queue defines the order in which we will work on items. Every // element of queue should be in the dirty set and not in the // processing set. - queue Queue + queue Queue[t] // dirty defines all of the items that need to be processed. - dirty set + dirty set[t] // Things that are currently being processed are in the processing set. // These things may be simultaneously in the dirty set. When we finish // processing something and remove it from this set, we'll check if // it's in the dirty set, and if so, add it to the queue. - processing set + processing set[t] cond *sync.Cond @@ -191,27 +217,27 @@ type Type struct { type empty struct{} type t interface{} -type set map[t]empty +type set[t comparable] map[t]empty -func (s set) has(item t) bool { +func (s set[t]) has(item t) bool { _, exists := s[item] return exists } -func (s set) insert(item t) { +func (s set[t]) insert(item t) { s[item] = empty{} } -func (s set) delete(item t) { +func (s set[t]) delete(item t) { delete(s, item) } -func (s set) len() int { +func (s set[t]) len() int { return len(s) } // Add marks item as needing processing. -func (q *Type) Add(item interface{}) { +func (q *Typed[T]) Add(item T) { q.cond.L.Lock() defer q.cond.L.Unlock() if q.shuttingDown { @@ -240,7 +266,7 @@ func (q *Type) Add(item interface{}) { // Len returns the current queue length, for informational purposes only. You // shouldn't e.g. gate a call to Add() or Get() on Len() being a particular // value, that can't be synchronized properly. -func (q *Type) Len() int { +func (q *Typed[T]) Len() int { q.cond.L.Lock() defer q.cond.L.Unlock() return q.queue.Len() @@ -249,7 +275,7 @@ func (q *Type) Len() int { // Get blocks until it can return an item to be processed. If shutdown = true, // the caller should end their goroutine. You must call Done with item when you // have finished processing it. -func (q *Type) Get() (item interface{}, shutdown bool) { +func (q *Typed[T]) Get() (item T, shutdown bool) { q.cond.L.Lock() defer q.cond.L.Unlock() for q.queue.Len() == 0 && !q.shuttingDown { @@ -257,7 +283,7 @@ func (q *Type) Get() (item interface{}, shutdown bool) { } if q.queue.Len() == 0 { // We must be shutting down. - return nil, true + return *new(T), true } item = q.queue.Pop() @@ -273,7 +299,7 @@ func (q *Type) Get() (item interface{}, shutdown bool) { // Done marks item as done processing, and if it has been marked as dirty again // while it was being processed, it will be re-added to the queue for // re-processing. -func (q *Type) Done(item interface{}) { +func (q *Typed[T]) Done(item T) { q.cond.L.Lock() defer q.cond.L.Unlock() @@ -290,7 +316,7 @@ func (q *Type) Done(item interface{}) { // ShutDown will cause q to ignore all new items added to it and // immediately instruct the worker goroutines to exit. -func (q *Type) ShutDown() { +func (q *Typed[T]) ShutDown() { q.cond.L.Lock() defer q.cond.L.Unlock() @@ -308,7 +334,7 @@ func (q *Type) ShutDown() { // indefinitely. It is, however, safe to call ShutDown after having called // ShutDownWithDrain, as to force the queue shut down to terminate immediately // without waiting for the drainage. -func (q *Type) ShutDownWithDrain() { +func (q *Typed[T]) ShutDownWithDrain() { q.cond.L.Lock() defer q.cond.L.Unlock() @@ -321,14 +347,14 @@ func (q *Type) ShutDownWithDrain() { } } -func (q *Type) ShuttingDown() bool { +func (q *Typed[T]) ShuttingDown() bool { q.cond.L.Lock() defer q.cond.L.Unlock() return q.shuttingDown } -func (q *Type) updateUnfinishedWorkLoop() { +func (q *Typed[T]) updateUnfinishedWorkLoop() { t := q.clock.NewTicker(q.unfinishedWorkUpdatePeriod) defer t.Stop() for range t.C() { diff --git a/util/workqueue/queue_test.go b/util/workqueue/queue_test.go index 1cf2cd2f19..6cec86ee6e 100644 --- a/util/workqueue/queue_test.go +++ b/util/workqueue/queue_test.go @@ -29,7 +29,7 @@ import ( // traceQueue traces whether items are touched type traceQueue struct { - workqueue.Queue + workqueue.Queue[any] touched map[interface{}]struct{} } @@ -42,7 +42,7 @@ func (t *traceQueue) Touch(item interface{}) { t.touched[item] = struct{}{} } -var _ workqueue.Queue = &traceQueue{} +var _ workqueue.Queue[any] = &traceQueue{} func TestBasic(t *testing.T) { tests := []struct { @@ -215,7 +215,7 @@ func TestReinsert(t *testing.T) { } func TestCollapse(t *testing.T) { - tq := &traceQueue{Queue: workqueue.DefaultQueue()} + tq := &traceQueue{Queue: workqueue.DefaultQueue[any]()} q := workqueue.NewWithConfig(workqueue.QueueConfig{ Name: "", Queue: tq, @@ -244,7 +244,7 @@ func TestCollapse(t *testing.T) { } func TestCollapseWhileProcessing(t *testing.T) { - tq := &traceQueue{Queue: workqueue.DefaultQueue()} + tq := &traceQueue{Queue: workqueue.DefaultQueue[any]()} q := workqueue.NewWithConfig(workqueue.QueueConfig{ Name: "", Queue: tq, diff --git a/util/workqueue/rate_limiting_queue.go b/util/workqueue/rate_limiting_queue.go index 3e4016fb04..fe45afa5a4 100644 --- a/util/workqueue/rate_limiting_queue.go +++ b/util/workqueue/rate_limiting_queue.go @@ -19,24 +19,33 @@ package workqueue import "k8s.io/utils/clock" // RateLimitingInterface is an interface that rate limits items being added to the queue. -type RateLimitingInterface interface { - DelayingInterface +// +// Deprecated: Use TypedRateLimitingInterface instead. +type RateLimitingInterface TypedRateLimitingInterface[any] + +// TypedRateLimitingInterface is an interface that rate limits items being added to the queue. +type TypedRateLimitingInterface[T comparable] interface { + TypedDelayingInterface[T] // AddRateLimited adds an item to the workqueue after the rate limiter says it's ok - AddRateLimited(item interface{}) + AddRateLimited(item T) // Forget indicates that an item is finished being retried. Doesn't matter whether it's for perm failing // or for success, we'll stop the rate limiter from tracking it. This only clears the `rateLimiter`, you // still have to call `Done` on the queue. - Forget(item interface{}) + Forget(item T) // NumRequeues returns back how many times the item was requeued - NumRequeues(item interface{}) int + NumRequeues(item T) int } // RateLimitingQueueConfig specifies optional configurations to customize a RateLimitingInterface. +// +// Deprecated: Use TypedRateLimitingQueueConfig instead. +type RateLimitingQueueConfig = TypedRateLimitingQueueConfig[any] -type RateLimitingQueueConfig struct { +// TypedRateLimitingQueueConfig specifies optional configurations to customize a TypedRateLimitingInterface. +type TypedRateLimitingQueueConfig[T comparable] struct { // Name for the queue. If unnamed, the metrics will not be registered. Name string @@ -48,36 +57,55 @@ type RateLimitingQueueConfig struct { Clock clock.WithTicker // DelayingQueue optionally allows injecting custom delaying queue DelayingInterface instead of the default one. - DelayingQueue DelayingInterface + DelayingQueue TypedDelayingInterface[T] } // NewRateLimitingQueue constructs a new workqueue with rateLimited queuing ability // Remember to call Forget! If you don't, you may end up tracking failures forever. // NewRateLimitingQueue does not emit metrics. For use with a MetricsProvider, please use // NewRateLimitingQueueWithConfig instead and specify a name. +// +// Deprecated: Use NewTypedRateLimitingQueue instead. func NewRateLimitingQueue(rateLimiter RateLimiter) RateLimitingInterface { return NewRateLimitingQueueWithConfig(rateLimiter, RateLimitingQueueConfig{}) } +// NewTypedRateLimitingQueue constructs a new workqueue with rateLimited queuing ability +// Remember to call Forget! If you don't, you may end up tracking failures forever. +// NewTypedRateLimitingQueue does not emit metrics. For use with a MetricsProvider, please use +// NewTypedRateLimitingQueueWithConfig instead and specify a name. +func NewTypedRateLimitingQueue[T comparable](rateLimiter TypedRateLimiter[T]) TypedRateLimitingInterface[T] { + return NewTypedRateLimitingQueueWithConfig(rateLimiter, TypedRateLimitingQueueConfig[T]{}) +} + // NewRateLimitingQueueWithConfig constructs a new workqueue with rateLimited queuing ability // with options to customize different properties. // Remember to call Forget! If you don't, you may end up tracking failures forever. +// +// Deprecated: Use NewTypedRateLimitingQueueWithConfig instead. func NewRateLimitingQueueWithConfig(rateLimiter RateLimiter, config RateLimitingQueueConfig) RateLimitingInterface { + return NewTypedRateLimitingQueueWithConfig(rateLimiter, config) +} + +// NewTypedRateLimitingQueueWithConfig constructs a new workqueue with rateLimited queuing ability +// with options to customize different properties. +// Remember to call Forget! If you don't, you may end up tracking failures forever. +func NewTypedRateLimitingQueueWithConfig[T comparable](rateLimiter TypedRateLimiter[T], config TypedRateLimitingQueueConfig[T]) TypedRateLimitingInterface[T] { if config.Clock == nil { config.Clock = clock.RealClock{} } if config.DelayingQueue == nil { - config.DelayingQueue = NewDelayingQueueWithConfig(DelayingQueueConfig{ + config.DelayingQueue = NewTypedDelayingQueueWithConfig(TypedDelayingQueueConfig[T]{ Name: config.Name, MetricsProvider: config.MetricsProvider, Clock: config.Clock, }) } - return &rateLimitingType{ - DelayingInterface: config.DelayingQueue, - rateLimiter: rateLimiter, + return &rateLimitingType[T]{ + TypedDelayingInterface: config.DelayingQueue, + rateLimiter: rateLimiter, } } @@ -99,21 +127,21 @@ func NewRateLimitingQueueWithDelayingInterface(di DelayingInterface, rateLimiter } // rateLimitingType wraps an Interface and provides rateLimited re-enquing -type rateLimitingType struct { - DelayingInterface +type rateLimitingType[T comparable] struct { + TypedDelayingInterface[T] - rateLimiter RateLimiter + rateLimiter TypedRateLimiter[T] } // AddRateLimited AddAfter's the item based on the time when the rate limiter says it's ok -func (q *rateLimitingType) AddRateLimited(item interface{}) { - q.DelayingInterface.AddAfter(item, q.rateLimiter.When(item)) +func (q *rateLimitingType[T]) AddRateLimited(item T) { + q.TypedDelayingInterface.AddAfter(item, q.rateLimiter.When(item)) } -func (q *rateLimitingType) NumRequeues(item interface{}) int { +func (q *rateLimitingType[T]) NumRequeues(item T) int { return q.rateLimiter.NumRequeues(item) } -func (q *rateLimitingType) Forget(item interface{}) { +func (q *rateLimitingType[T]) Forget(item T) { q.rateLimiter.Forget(item) } diff --git a/util/workqueue/rate_limiting_queue_test.go b/util/workqueue/rate_limiting_queue_test.go index 77e161307e..3c55f829c2 100644 --- a/util/workqueue/rate_limiting_queue_test.go +++ b/util/workqueue/rate_limiting_queue_test.go @@ -25,17 +25,17 @@ import ( func TestRateLimitingQueue(t *testing.T) { limiter := NewItemExponentialFailureRateLimiter(1*time.Millisecond, 1*time.Second) - queue := NewRateLimitingQueue(limiter).(*rateLimitingType) + queue := NewRateLimitingQueue(limiter).(*rateLimitingType[any]) fakeClock := testingclock.NewFakeClock(time.Now()) - delayingQueue := &delayingType{ - Interface: New(), + delayingQueue := &delayingType[any]{ + TypedInterface: New(), clock: fakeClock, heartbeat: fakeClock.NewTicker(maxWait), stopCh: make(chan struct{}), waitingForAddCh: make(chan *waitFor, 1000), metrics: newRetryMetrics("", nil), } - queue.DelayingInterface = delayingQueue + queue.TypedDelayingInterface = delayingQueue queue.AddRateLimited("one") waitEntry := <-delayingQueue.waitingForAddCh From 34d780971c58739b488612a4c1f72403b6580cd6 Mon Sep 17 00:00:00 2001 From: Jiahui Feng Date: Mon, 15 Apr 2024 13:33:10 -0700 Subject: [PATCH 019/159] generated: ./hack/pin-dependency.sh github.com/google/cel-go v0.20.1 Kubernetes-commit: 94997c6fefa2791192d0a7ab68b02bf5d8b6c2c5 --- go.mod | 11 +++++++++-- go.sum | 14 ++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 9f908941c3..7468b91676 100644 --- a/go.mod +++ b/go.mod @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.18.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 - k8s.io/api v0.0.0-20240418173402-5975d5e5bda6 - k8s.io/apimachinery v0.0.0-20240423013215-bfd47a16b8d5 + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -42,6 +42,7 @@ require ( github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.3 // indirect github.com/google/btree v1.0.1 // indirect + github.com/google/cel-go v0.20.1 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 @@ -59,3 +60,9 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace ( + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go +) diff --git a/go.sum b/go.sum index 94fd79f4bd..7019f69685 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,9 @@ +cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -8,6 +12,7 @@ github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxER github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= @@ -95,13 +100,16 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -138,6 +146,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= @@ -153,10 +162,7 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240418173402-5975d5e5bda6 h1:iIqllpQqao2EVRqwEYv4PrT5rNpARgSjIvduHLbUhiQ= -k8s.io/api v0.0.0-20240418173402-5975d5e5bda6/go.mod h1:aiyYpZwHjPqNTHVIbcUReEDsDv1bLzwNhSENZpETJiA= -k8s.io/apimachinery v0.0.0-20240423013215-bfd47a16b8d5 h1:3Pbeq2m3wBdRI2yPFR3ir82qmFm9lqGIns+M3kL0eOs= -k8s.io/apimachinery v0.0.0-20240423013215-bfd47a16b8d5/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From b17c363481226d5576e8c6cfb9e0c318b9222ec3 Mon Sep 17 00:00:00 2001 From: Ben Luddy Date: Tue, 16 Apr 2024 12:48:12 -0400 Subject: [PATCH 020/159] Add test to detect unintentional changes in dynamic client requests. Kubernetes-commit: a803c8034d60a81b0da71ea8631e27888a607476 --- dynamic/golden_test.go | 232 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 dynamic/golden_test.go diff --git a/dynamic/golden_test.go b/dynamic/golden_test.go new file mode 100644 index 0000000000..20bede85fe --- /dev/null +++ b/dynamic/golden_test.go @@ -0,0 +1,232 @@ +package dynamic_test + +import ( + "context" + "fmt" + "net" + "net/http" + "net/http/httptest" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "testing" + "time" + + "github.com/google/go-cmp/cmp" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "k8s.io/client-go/dynamic" + "k8s.io/client-go/rest" +) + +func TestGoldenRequest(t *testing.T) { + for _, tc := range []struct { + name string + do func(context.Context, dynamic.Interface) error + }{ + { + name: "create", + do: func(ctx context.Context, client dynamic.Interface) error { + _, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Create( + ctx, + &unstructured.Unstructured{Object: map[string]interface{}{ + "metadata": map[string]interface{}{"name": "mips"}, + }}, + metav1.CreateOptions{FieldValidation: "warn"}, + "fin", + ) + return err + }, + }, + { + name: "update", + do: func(ctx context.Context, client dynamic.Interface) error { + _, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Update( + ctx, + &unstructured.Unstructured{Object: map[string]interface{}{ + "metadata": map[string]interface{}{"name": "mips"}, + }}, + metav1.UpdateOptions{FieldValidation: "warn"}, + "fin", + ) + return err + }, + }, + { + name: "updatestatus", + do: func(ctx context.Context, client dynamic.Interface) error { + _, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").UpdateStatus( + ctx, + &unstructured.Unstructured{Object: map[string]interface{}{ + "metadata": map[string]interface{}{"name": "mips"}, + }}, + metav1.UpdateOptions{FieldValidation: "warn"}, + ) + return err + }, + }, + { + name: "delete", + do: func(ctx context.Context, client dynamic.Interface) error { + return client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Delete( + ctx, + "mips", + metav1.DeleteOptions{DryRun: []string{metav1.DryRunAll}}, + "fin", + ) + }, + }, + { + name: "deletecollection", + do: func(ctx context.Context, client dynamic.Interface) error { + return client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").DeleteCollection( + ctx, + metav1.DeleteOptions{DryRun: []string{metav1.DryRunAll}}, + metav1.ListOptions{ResourceVersion: "42"}, + ) + }, + }, + { + name: "get", + do: func(ctx context.Context, client dynamic.Interface) error { + _, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Get( + ctx, + "mips", + metav1.GetOptions{ResourceVersion: "42"}, + "fin", + ) + return err + }, + }, + { + name: "list", + do: func(ctx context.Context, client dynamic.Interface) error { + _, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").List( + ctx, + metav1.ListOptions{ResourceVersion: "42"}, + ) + return err + }, + }, + { + name: "watch", + do: func(ctx context.Context, client dynamic.Interface) error { + _, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Watch( + ctx, + metav1.ListOptions{ResourceVersion: "42"}, + ) + return err + }, + }, + { + name: "patch", + do: func(ctx context.Context, client dynamic.Interface) error { + _, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Patch( + ctx, + "mips", + types.StrategicMergePatchType, + []byte("{\"foo\":\"bar\"}\n"), + metav1.PatchOptions{FieldManager: "baz"}, + "fin", + ) + return err + }, + }, + { + name: "apply", + do: func(ctx context.Context, client dynamic.Interface) error { + _, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").Apply( + ctx, + "mips", + &unstructured.Unstructured{Object: map[string]interface{}{ + "metadata": map[string]interface{}{"name": "mips"}, + }}, + metav1.ApplyOptions{Force: true}, + "fin", + ) + return err + }, + }, + { + name: "applystatus", + do: func(ctx context.Context, client dynamic.Interface) error { + _, err := client.Resource(schema.GroupVersionResource{Group: "flops", Version: "v1alpha1", Resource: "flips"}).Namespace("mops").ApplyStatus( + ctx, + "mips", + &unstructured.Unstructured{Object: map[string]interface{}{ + "metadata": map[string]interface{}{"name": "mips"}, + }}, + metav1.ApplyOptions{Force: true}, + ) + return err + }, + }, + } { + t.Run(tc.name, func(t *testing.T) { + handled := make(chan struct{}) + srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + defer close(handled) + + got, err := httputil.DumpRequest(r, true) + if err != nil { + t.Fatal(err) + } + + path := filepath.Join("testdata", filepath.FromSlash(t.Name())) + + if os.Getenv("UPDATE_DYNAMIC_CLIENT_FIXTURES") == "true" { + err := os.WriteFile(path, got, os.FileMode(0755)) + if err != nil { + t.Fatalf("failed to update fixture: %v", err) + } + } + + want, err := os.ReadFile(path) + if err != nil { + t.Fatalf("failed to load fixture: %v", err) + } + if diff := cmp.Diff(got, want); diff != "" { + t.Errorf("unexpected difference from expected bytes:\n%s", diff) + } + })) + defer srv.Close() + + client, err := dynamic.NewForConfig(&rest.Config{ + Host: "example.com", + UserAgent: "TestGoldenRequest", + Transport: &http.Transport{ + // The client will send a static Host header while always + // connecting to the test server. + DialContext: func(ctx context.Context, network string, addr string) (net.Conn, error) { + u, err := url.Parse(srv.URL) + if err != nil { + return nil, fmt.Errorf("failed to parse test server url: %w", err) + } + return (&net.Dialer{}).DialContext(ctx, "tcp", u.Host) + }, + }, + }) + if err != nil { + t.Fatal(err) + } + + ctx, cancel := context.WithTimeout(context.Background(), time.Second) + defer cancel() + if err := tc.do(ctx, client); err != nil { + // This test detects server-perceptible changes to the request. As + // long as the server receives the expected request, a non-nil error + // returned from a client method is not a failure. + t.Logf("client returned non-nil error: %v", err) + } + + select { + case <-handled: + default: + t.Fatal("no request received") + } + }) + } +} From 4cd6b756be04aa05f4f881118a63ac43ad8c63ce Mon Sep 17 00:00:00 2001 From: Ben Luddy Date: Tue, 16 Apr 2024 12:49:15 -0400 Subject: [PATCH 021/159] Generate HTTP request fixtures for dynamic client tests. Kubernetes-commit: e335b8e81b467c70f0f8a485f69e5664adbbc687 --- dynamic/golden_test.go | 16 ++++++++++++++++ dynamic/testdata/TestGoldenRequest/apply | 9 +++++++++ dynamic/testdata/TestGoldenRequest/applystatus | 9 +++++++++ dynamic/testdata/TestGoldenRequest/create | 9 +++++++++ dynamic/testdata/TestGoldenRequest/delete | 9 +++++++++ .../testdata/TestGoldenRequest/deletecollection | 9 +++++++++ dynamic/testdata/TestGoldenRequest/get | 6 ++++++ dynamic/testdata/TestGoldenRequest/list | 6 ++++++ dynamic/testdata/TestGoldenRequest/patch | 9 +++++++++ dynamic/testdata/TestGoldenRequest/update | 9 +++++++++ dynamic/testdata/TestGoldenRequest/updatestatus | 9 +++++++++ dynamic/testdata/TestGoldenRequest/watch | 6 ++++++ 12 files changed, 106 insertions(+) create mode 100755 dynamic/testdata/TestGoldenRequest/apply create mode 100755 dynamic/testdata/TestGoldenRequest/applystatus create mode 100755 dynamic/testdata/TestGoldenRequest/create create mode 100755 dynamic/testdata/TestGoldenRequest/delete create mode 100755 dynamic/testdata/TestGoldenRequest/deletecollection create mode 100755 dynamic/testdata/TestGoldenRequest/get create mode 100755 dynamic/testdata/TestGoldenRequest/list create mode 100755 dynamic/testdata/TestGoldenRequest/patch create mode 100755 dynamic/testdata/TestGoldenRequest/update create mode 100755 dynamic/testdata/TestGoldenRequest/updatestatus create mode 100755 dynamic/testdata/TestGoldenRequest/watch diff --git a/dynamic/golden_test.go b/dynamic/golden_test.go index 20bede85fe..2ae6dfc6a3 100644 --- a/dynamic/golden_test.go +++ b/dynamic/golden_test.go @@ -1,3 +1,19 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + package dynamic_test import ( diff --git a/dynamic/testdata/TestGoldenRequest/apply b/dynamic/testdata/TestGoldenRequest/apply new file mode 100755 index 0000000000..9f6385a7e3 --- /dev/null +++ b/dynamic/testdata/TestGoldenRequest/apply @@ -0,0 +1,9 @@ +PATCH /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin?force=true HTTP/1.1 +Host: example.com +Accept: application/json +Accept-Encoding: gzip +Content-Length: 29 +Content-Type: application/apply-patch+yaml +User-Agent: TestGoldenRequest + +{"metadata":{"name":"mips"}} diff --git a/dynamic/testdata/TestGoldenRequest/applystatus b/dynamic/testdata/TestGoldenRequest/applystatus new file mode 100755 index 0000000000..ce69f16689 --- /dev/null +++ b/dynamic/testdata/TestGoldenRequest/applystatus @@ -0,0 +1,9 @@ +PATCH /apis/flops/v1alpha1/namespaces/mops/flips/mips/status?force=true HTTP/1.1 +Host: example.com +Accept: application/json +Accept-Encoding: gzip +Content-Length: 29 +Content-Type: application/apply-patch+yaml +User-Agent: TestGoldenRequest + +{"metadata":{"name":"mips"}} diff --git a/dynamic/testdata/TestGoldenRequest/create b/dynamic/testdata/TestGoldenRequest/create new file mode 100755 index 0000000000..5a742e1cac --- /dev/null +++ b/dynamic/testdata/TestGoldenRequest/create @@ -0,0 +1,9 @@ +POST /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin?fieldValidation=warn HTTP/1.1 +Host: example.com +Accept: application/json +Accept-Encoding: gzip +Content-Length: 29 +Content-Type: application/json +User-Agent: TestGoldenRequest + +{"metadata":{"name":"mips"}} diff --git a/dynamic/testdata/TestGoldenRequest/delete b/dynamic/testdata/TestGoldenRequest/delete new file mode 100755 index 0000000000..b16229680b --- /dev/null +++ b/dynamic/testdata/TestGoldenRequest/delete @@ -0,0 +1,9 @@ +DELETE /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin HTTP/1.1 +Host: example.com +Accept: application/json +Accept-Encoding: gzip +Content-Length: 60 +Content-Type: application/json +User-Agent: TestGoldenRequest + +{"kind":"DeleteOptions","apiVersion":"v1","dryRun":["All"]} diff --git a/dynamic/testdata/TestGoldenRequest/deletecollection b/dynamic/testdata/TestGoldenRequest/deletecollection new file mode 100755 index 0000000000..8e9a2437b5 --- /dev/null +++ b/dynamic/testdata/TestGoldenRequest/deletecollection @@ -0,0 +1,9 @@ +DELETE /apis/flops/v1alpha1/namespaces/mops/flips?resourceVersion=42 HTTP/1.1 +Host: example.com +Accept: application/json +Accept-Encoding: gzip +Content-Length: 60 +Content-Type: application/json +User-Agent: TestGoldenRequest + +{"kind":"DeleteOptions","apiVersion":"v1","dryRun":["All"]} diff --git a/dynamic/testdata/TestGoldenRequest/get b/dynamic/testdata/TestGoldenRequest/get new file mode 100755 index 0000000000..d7e78a8aae --- /dev/null +++ b/dynamic/testdata/TestGoldenRequest/get @@ -0,0 +1,6 @@ +GET /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin?resourceVersion=42 HTTP/1.1 +Host: example.com +Accept: application/json +Accept-Encoding: gzip +User-Agent: TestGoldenRequest + diff --git a/dynamic/testdata/TestGoldenRequest/list b/dynamic/testdata/TestGoldenRequest/list new file mode 100755 index 0000000000..68e673f15b --- /dev/null +++ b/dynamic/testdata/TestGoldenRequest/list @@ -0,0 +1,6 @@ +GET /apis/flops/v1alpha1/namespaces/mops/flips?resourceVersion=42 HTTP/1.1 +Host: example.com +Accept: application/json +Accept-Encoding: gzip +User-Agent: TestGoldenRequest + diff --git a/dynamic/testdata/TestGoldenRequest/patch b/dynamic/testdata/TestGoldenRequest/patch new file mode 100755 index 0000000000..4b6070652a --- /dev/null +++ b/dynamic/testdata/TestGoldenRequest/patch @@ -0,0 +1,9 @@ +PATCH /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin?fieldManager=baz HTTP/1.1 +Host: example.com +Accept: application/json +Accept-Encoding: gzip +Content-Length: 14 +Content-Type: application/strategic-merge-patch+json +User-Agent: TestGoldenRequest + +{"foo":"bar"} diff --git a/dynamic/testdata/TestGoldenRequest/update b/dynamic/testdata/TestGoldenRequest/update new file mode 100755 index 0000000000..5d8e70214c --- /dev/null +++ b/dynamic/testdata/TestGoldenRequest/update @@ -0,0 +1,9 @@ +PUT /apis/flops/v1alpha1/namespaces/mops/flips/mips/fin?fieldValidation=warn HTTP/1.1 +Host: example.com +Accept: application/json +Accept-Encoding: gzip +Content-Length: 29 +Content-Type: application/json +User-Agent: TestGoldenRequest + +{"metadata":{"name":"mips"}} diff --git a/dynamic/testdata/TestGoldenRequest/updatestatus b/dynamic/testdata/TestGoldenRequest/updatestatus new file mode 100755 index 0000000000..9c2724e3ad --- /dev/null +++ b/dynamic/testdata/TestGoldenRequest/updatestatus @@ -0,0 +1,9 @@ +PUT /apis/flops/v1alpha1/namespaces/mops/flips/mips/status?fieldValidation=warn HTTP/1.1 +Host: example.com +Accept: application/json +Accept-Encoding: gzip +Content-Length: 29 +Content-Type: application/json +User-Agent: TestGoldenRequest + +{"metadata":{"name":"mips"}} diff --git a/dynamic/testdata/TestGoldenRequest/watch b/dynamic/testdata/TestGoldenRequest/watch new file mode 100755 index 0000000000..8436fb775c --- /dev/null +++ b/dynamic/testdata/TestGoldenRequest/watch @@ -0,0 +1,6 @@ +GET /apis/flops/v1alpha1/namespaces/mops/flips?resourceVersion=42&watch=true HTTP/1.1 +Host: example.com +Accept: application/json +Accept-Encoding: gzip +User-Agent: TestGoldenRequest + From 2fe05741c13c98ce394371b99668ba74e2787073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Tyczy=C5=84ski?= Date: Wed, 17 Apr 2024 11:19:08 +0200 Subject: [PATCH 022/159] Fix race in informer transformers Kubernetes-commit: e9f74597a8e7104b26640614e952d4453654453b --- tools/cache/controller_test.go | 109 +++++++++++++++++++++++++++++++++ tools/cache/delta_fifo.go | 53 ++++++++++------ 2 files changed, 142 insertions(+), 20 deletions(-) diff --git a/tools/cache/controller_test.go b/tools/cache/controller_test.go index 4058581154..992c1f5a4a 100644 --- a/tools/cache/controller_test.go +++ b/tools/cache/controller_test.go @@ -20,6 +20,7 @@ import ( "fmt" "math/rand" "sync" + "sync/atomic" "testing" "time" @@ -575,6 +576,114 @@ func TestTransformingInformer(t *testing.T) { close(stopCh) } +func TestTransformingInformerRace(t *testing.T) { + // source simulates an apiserver object endpoint. + source := fcache.NewFakeControllerSource() + + label := "to-be-transformed" + makePod := func(name string) *v1.Pod { + return &v1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Namespace: "namespace", + Labels: map[string]string{label: "true"}, + }, + Spec: v1.PodSpec{ + Hostname: "hostname", + }, + } + } + + badTransform := atomic.Bool{} + podTransformer := func(obj interface{}) (interface{}, error) { + pod, ok := obj.(*v1.Pod) + if !ok { + return nil, fmt.Errorf("unexpected object type: %T", obj) + } + if pod.ObjectMeta.Labels[label] != "true" { + badTransform.Store(true) + return nil, fmt.Errorf("object already transformed: %#v", obj) + } + pod.ObjectMeta.Labels[label] = "false" + return pod, nil + } + + numObjs := 5 + for i := 0; i < numObjs; i++ { + source.Add(makePod(fmt.Sprintf("pod-%d", i))) + } + + type event struct{} + events := make(chan event, numObjs) + recordEvent := func(eventType watch.EventType, previous, current interface{}) { + events <- event{} + } + checkEvents := func(count int) { + for i := 0; i < count; i++ { + <-events + } + } + store, controller := NewTransformingInformer( + source, + &v1.Pod{}, + 5*time.Millisecond, + ResourceEventHandlerDetailedFuncs{ + AddFunc: func(obj interface{}, isInInitialList bool) { recordEvent(watch.Added, nil, obj) }, + UpdateFunc: func(oldObj, newObj interface{}) { recordEvent(watch.Modified, oldObj, newObj) }, + DeleteFunc: func(obj interface{}) { recordEvent(watch.Deleted, obj, nil) }, + }, + podTransformer, + ) + + stopCh := make(chan struct{}) + go controller.Run(stopCh) + + checkEvents(numObjs) + + // Periodically fetch objects to ensure no access races. + wg := sync.WaitGroup{} + errors := make(chan error, numObjs) + for i := 0; i < numObjs; i++ { + wg.Add(1) + go func(index int) { + defer wg.Done() + key := fmt.Sprintf("namespace/pod-%d", index) + for { + select { + case <-stopCh: + return + default: + } + + obj, ok, err := store.GetByKey(key) + if !ok || err != nil { + errors <- fmt.Errorf("couldn't get the object for %v", key) + return + } + pod := obj.(*v1.Pod) + if pod.ObjectMeta.Labels[label] != "false" { + errors <- fmt.Errorf("unexpected object: %#v", pod) + return + } + } + }(i) + } + + // Let resyncs to happen for some time. + time.Sleep(time.Second) + + close(stopCh) + wg.Wait() + close(errors) + for err := range errors { + t.Error(err) + } + + if badTransform.Load() { + t.Errorf("unexpected transformation happened") + } +} + func TestDeletionHandlingObjectToName(t *testing.T) { cm := &v1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ diff --git a/tools/cache/delta_fifo.go b/tools/cache/delta_fifo.go index 7160bb1ee7..ce74dfb6f1 100644 --- a/tools/cache/delta_fifo.go +++ b/tools/cache/delta_fifo.go @@ -139,20 +139,17 @@ type DeltaFIFO struct { } // TransformFunc allows for transforming an object before it will be processed. -// TransformFunc (similarly to ResourceEventHandler functions) should be able -// to correctly handle the tombstone of type cache.DeletedFinalStateUnknown. -// -// New in v1.27: In such cases, the contained object will already have gone -// through the transform object separately (when it was added / updated prior -// to the delete), so the TransformFunc can likely safely ignore such objects -// (i.e., just return the input object). // // The most common usage pattern is to clean-up some parts of the object to // reduce component memory usage if a given component doesn't care about them. // -// New in v1.27: unless the object is a DeletedFinalStateUnknown, TransformFunc -// sees the object before any other actor, and it is now safe to mutate the -// object in place instead of making a copy. +// New in v1.27: TransformFunc sees the object before any other actor, and it +// is now safe to mutate the object in place instead of making a copy. +// +// It's recommended for the TransformFunc to be idempotent. +// It MUST be idempotent if objects already present in the cache are passed to +// the Replace() to avoid re-mutating them. Default informers do not pass +// existing objects to Replace though. // // Note that TransformFunc is called while inserting objects into the // notification queue and is therefore extremely performance sensitive; please @@ -440,22 +437,38 @@ func isDeletionDup(a, b *Delta) *Delta { // queueActionLocked appends to the delta list for the object. // Caller must lock first. func (f *DeltaFIFO) queueActionLocked(actionType DeltaType, obj interface{}) error { + return f.queueActionInternalLocked(actionType, actionType, obj) +} + +// queueActionInternalLocked appends to the delta list for the object. +// The actionType is emitted and must honor emitDeltaTypeReplaced. +// The internalActionType is only used within this function and must +// ignore emitDeltaTypeReplaced. +// Caller must lock first. +func (f *DeltaFIFO) queueActionInternalLocked(actionType, internalActionType DeltaType, obj interface{}) error { id, err := f.KeyOf(obj) if err != nil { return KeyError{obj, err} } // Every object comes through this code path once, so this is a good - // place to call the transform func. If obj is a - // DeletedFinalStateUnknown tombstone, then the containted inner object - // will already have gone through the transformer, but we document that - // this can happen. In cases involving Replace(), such an object can - // come through multiple times. + // place to call the transform func. + // + // If obj is a DeletedFinalStateUnknown tombstone or the action is a Sync, + // then the object have already gone through the transformer. + // + // If the objects already present in the cache are passed to Replace(), + // the transformer must be idempotent to avoid re-mutating them, + // or coordinate with all readers from the cache to avoid data races. + // Default informers do not pass existing objects to Replace. if f.transformer != nil { - var err error - obj, err = f.transformer(obj) - if err != nil { - return err + _, isTombstone := obj.(DeletedFinalStateUnknown) + if !isTombstone && internalActionType != Sync { + var err error + obj, err = f.transformer(obj) + if err != nil { + return err + } } } @@ -638,7 +651,7 @@ func (f *DeltaFIFO) Replace(list []interface{}, _ string) error { return KeyError{item, err} } keys.Insert(key) - if err := f.queueActionLocked(action, item); err != nil { + if err := f.queueActionInternalLocked(action, Replaced, item); err != nil { return fmt.Errorf("couldn't enqueue object: %v", err) } } From 5db05eb7677e992b4af59c49ad5d27adf485d50c Mon Sep 17 00:00:00 2001 From: jwcesign Date: Wed, 17 Apr 2024 18:15:27 +0800 Subject: [PATCH 023/159] upgrade: upgrade dependencies github.com/prometheus/common to the newest version Signed-off-by: jwcesign Kubernetes-commit: f0aa62bc96d6e734249adfa3e094a52e45c8fb6d --- go.mod | 12 +++++++++--- go.sum | 18 ++++++++++++------ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 1e84a85a16..52a0725d49 100644 --- a/go.mod +++ b/go.mod @@ -20,12 +20,12 @@ require ( github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.4 golang.org/x/net v0.23.0 - golang.org/x/oauth2 v0.10.0 + golang.org/x/oauth2 v0.18.0 golang.org/x/term v0.18.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 - k8s.io/api v0.0.0-20240418133400-98d0c7a1b77e - k8s.io/apimachinery v0.0.0-20240418133208-0ee3e6150890 + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -59,3 +59,9 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace ( + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go +) diff --git a/go.sum b/go.sum index b2ef5c9125..7019f69685 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,9 @@ +cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -8,6 +12,7 @@ github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxER github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= @@ -95,13 +100,16 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -109,8 +117,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.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= -golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= +golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= +golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= 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= @@ -138,6 +146,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= @@ -153,10 +162,7 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240418133400-98d0c7a1b77e h1:aMC4qrBMfXPVWNvK5a9JWrPqAYF7IqaEil4veyTpq14= -k8s.io/api v0.0.0-20240418133400-98d0c7a1b77e/go.mod h1:aiyYpZwHjPqNTHVIbcUReEDsDv1bLzwNhSENZpETJiA= -k8s.io/apimachinery v0.0.0-20240418133208-0ee3e6150890 h1:QnCWgLriYnSGYNYeDsMidsvvh4zidzUylhjQeKRajk4= -k8s.io/apimachinery v0.0.0-20240418133208-0ee3e6150890/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 841e997e336f75f0c2c0f5f479db8c5861013e40 Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Fri, 19 Apr 2024 17:58:02 +0200 Subject: [PATCH 024/159] Improve the lister function documentation In particular, document that ListAllByNamespace delegates to ListAll if no namespace is specified. Signed-off-by: Stephen Kitt Kubernetes-commit: 54e899317ef46e3b70827cacee244717022db0ad --- tools/cache/listers.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/cache/listers.go b/tools/cache/listers.go index 420ca7b2ac..a60f44943e 100644 --- a/tools/cache/listers.go +++ b/tools/cache/listers.go @@ -30,7 +30,7 @@ import ( // AppendFunc is used to add a matching item to whatever list the caller is using type AppendFunc func(interface{}) -// ListAll calls appendFn with each value retrieved from store which matches the selector. +// ListAll lists items in the store matching the given selector, calling appendFn on each one. func ListAll(store Store, selector labels.Selector, appendFn AppendFunc) error { selectAll := selector.Empty() for _, m := range store.List() { @@ -51,7 +51,9 @@ func ListAll(store Store, selector labels.Selector, appendFn AppendFunc) error { return nil } -// ListAllByNamespace used to list items belongs to namespace from Indexer. +// ListAllByNamespace lists items in the given namespace in the store matching the given selector, +// calling appendFn on each one. +// If a blank namespace (NamespaceAll) is specified, this delegates to ListAll(). func ListAllByNamespace(indexer Indexer, namespace string, selector labels.Selector, appendFn AppendFunc) error { if namespace == metav1.NamespaceAll { return ListAll(indexer, selector, appendFn) From 5b2b83af725476013800d230cbe638b0e6880188 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Mon, 22 Apr 2024 07:11:25 -0700 Subject: [PATCH 025/159] Merge pull request #124346 from jwcesign/master upgrade: upgrade dependencies github.com/prometheus/common to the newest version Kubernetes-commit: 76de052680da0b7a59b35fb79db7ab322faf2854 --- go.mod | 10 ++-------- go.sum | 14 ++++---------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index 52a0725d49..7e049fdbf5 100644 --- a/go.mod +++ b/go.mod @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.18.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 - k8s.io/api v0.0.0 - k8s.io/apimachinery v0.0.0 + k8s.io/api v0.0.0-20240418173402-5975d5e5bda6 + k8s.io/apimachinery v0.0.0-20240418133208-0ee3e6150890 k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -59,9 +59,3 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace ( - k8s.io/api => ../api - k8s.io/apimachinery => ../apimachinery - k8s.io/client-go => ../client-go -) diff --git a/go.sum b/go.sum index 7019f69685..c7fc39ef3b 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,5 @@ -cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -12,7 +8,6 @@ github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxER github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= @@ -100,16 +95,13 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -146,7 +138,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= @@ -162,7 +153,10 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= +k8s.io/api v0.0.0-20240418173402-5975d5e5bda6 h1:iIqllpQqao2EVRqwEYv4PrT5rNpARgSjIvduHLbUhiQ= +k8s.io/api v0.0.0-20240418173402-5975d5e5bda6/go.mod h1:aiyYpZwHjPqNTHVIbcUReEDsDv1bLzwNhSENZpETJiA= +k8s.io/apimachinery v0.0.0-20240418133208-0ee3e6150890 h1:QnCWgLriYnSGYNYeDsMidsvvh4zidzUylhjQeKRajk4= +k8s.io/apimachinery v0.0.0-20240418133208-0ee3e6150890/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From d071c085407c40f7764b2890417095c7f0434f9a Mon Sep 17 00:00:00 2001 From: Jiahui Feng Date: Mon, 22 Apr 2024 10:54:32 -0700 Subject: [PATCH 026/159] generated: ./hack/update-vendor.sh Kubernetes-commit: 350fcf957e90501f0b224b7ccf771b29d4d5c6b6 --- go.mod | 1 - 1 file changed, 1 deletion(-) diff --git a/go.mod b/go.mod index 7468b91676..52a0725d49 100644 --- a/go.mod +++ b/go.mod @@ -42,7 +42,6 @@ require ( github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.3 // indirect github.com/google/btree v1.0.1 // indirect - github.com/google/cel-go v0.20.1 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 From e4f9b83713ecb3459888726153a4486b6f785c70 Mon Sep 17 00:00:00 2001 From: Marek Siarkowicz Date: Tue, 23 Apr 2024 11:10:37 +0200 Subject: [PATCH 027/159] Upgrade etcd libraries to v3.5.13 Add otelgrpc.WithMessageEvents(otelgrpc.ReceivedEvents, otelgrpc.SentEvents) to tracing options due to https://github.com/open-telemetry/opentelemetry-go-contrib/pull/3964 Kubernetes-commit: 3e5b03eb433ee359782f5aa6e9368ab2a0d0370c --- go.mod | 12 +++++++++--- go.sum | 18 ++++++++++++------ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 4b22d5d91a..8c059be8ee 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/google/gnostic-models v0.6.8 github.com/google/go-cmp v0.6.0 github.com/google/gofuzz v1.2.0 - github.com/google/uuid v1.3.0 + github.com/google/uuid v1.3.1 github.com/gorilla/websocket v1.5.0 github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 github.com/imdario/mergo v0.3.6 @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.18.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 - k8s.io/api v0.0.0-20240424013410-b75136d48620 - k8s.io/apimachinery v0.0.0-20240423013216-bb8822152cab + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -59,3 +59,9 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace ( + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go +) diff --git a/go.sum b/go.sum index 56cc6cf421..913aa6cb5b 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,9 @@ +cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -8,6 +12,7 @@ github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxER github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= @@ -37,8 +42,8 @@ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -95,13 +100,16 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -138,6 +146,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= @@ -153,10 +162,7 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240424013410-b75136d48620 h1:dzg8mCo8BpTfOP203ZFxfebLQyA3LpW5lG1+i/eVv7g= -k8s.io/api v0.0.0-20240424013410-b75136d48620/go.mod h1:fFymgTFQL4j8w8Flpt3VTvpl4TxSNV09Wd/aygrTaz0= -k8s.io/apimachinery v0.0.0-20240423013216-bb8822152cab h1:TMfzldAdQcFsOgbBZIpw46/LqHTLMYTeqy8nsvA8l5k= -k8s.io/apimachinery v0.0.0-20240423013216-bb8822152cab/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From ea434dfecf3802655626328ae9c543ce4127cea3 Mon Sep 17 00:00:00 2001 From: Stefan Bueringer Date: Fri, 26 Apr 2024 15:28:17 +0200 Subject: [PATCH 028/159] Bump sigs.k8s.io/yaml to v1.4.0 Kubernetes-commit: 04cc45b4adda1b19d5067d45ed246c0f84fed966 --- go.mod | 12 +++++++++--- go.sum | 18 ++++++++++++------ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index a3a037a1d4..4122955c1e 100644 --- a/go.mod +++ b/go.mod @@ -24,14 +24,14 @@ require ( golang.org/x/term v0.18.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 - k8s.io/api v0.0.0-20240424173406-2676848ed820 - k8s.io/apimachinery v0.0.0-20240424173219-03f2f3350dc5 + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd sigs.k8s.io/structured-merge-diff/v4 v4.4.1 - sigs.k8s.io/yaml v1.3.0 + sigs.k8s.io/yaml v1.4.0 ) require ( @@ -59,3 +59,9 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace ( + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go +) diff --git a/go.sum b/go.sum index b8684218dd..ee1358c11a 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,9 @@ +cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -8,6 +12,7 @@ github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxER github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= @@ -95,13 +100,16 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -138,6 +146,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= @@ -153,10 +162,7 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240424173406-2676848ed820 h1:N+lpEvK5kX4Qt7RHnJSd5Yto1WlZHSO0vLzahb9r2hg= -k8s.io/api v0.0.0-20240424173406-2676848ed820/go.mod h1:3eq7SCqCCTpQrXYjxOYQDnC5uWopfuWP5xL24nn/DQs= -k8s.io/apimachinery v0.0.0-20240424173219-03f2f3350dc5 h1:l6ErQDrxBVdvr45UjLjVyvGUwiCRD7A2UF49iYm7ZAc= -k8s.io/apimachinery v0.0.0-20240424173219-03f2f3350dc5/go.mod h1:Xbr0GEGusNQhkPdkN3/WJL9E50/dq40D+fHHqjG+FL8= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= @@ -167,5 +173,5 @@ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMm 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/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= +sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= From f9eba8e8c3be1ac446fc7f8e4a4c4b74f4408fc0 Mon Sep 17 00:00:00 2001 From: jiuker <2818723467@qq.com> Date: Sun, 28 Apr 2024 15:06:51 +0800 Subject: [PATCH 029/159] fix: Hang when canceling leader election information Hang when canceling leader election information. Occasionally, two leaders may run simultaneously. Kubernetes-commit: b6b46a0e00682517d2ca7b7e9c2706b8e407e52e --- tools/leaderelection/leaderelection.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/leaderelection/leaderelection.go b/tools/leaderelection/leaderelection.go index af840c4a25..5a1194b4ab 100644 --- a/tools/leaderelection/leaderelection.go +++ b/tools/leaderelection/leaderelection.go @@ -304,7 +304,9 @@ func (le *LeaderElector) release() bool { RenewTime: now, AcquireTime: now, } - if err := le.config.Lock.Update(context.TODO(), leaderElectionRecord); err != nil { + timeoutCtx, timeoutCancel := context.WithTimeout(context.Background(), le.config.RenewDeadline) + defer timeoutCancel() + if err := le.config.Lock.Update(timeoutCtx, leaderElectionRecord); err != nil { klog.Errorf("Failed to release lock: %v", err) return false } From 9aa3aae99d2d50b29b67c72b40c23ff41f924348 Mon Sep 17 00:00:00 2001 From: Alvaro Aleman Date: Sun, 28 Apr 2024 18:26:18 +0200 Subject: [PATCH 030/159] Use the generic/typed workqueue throughout This change makes us use the generic workqueue throughout the project in order to improve type safety and readability of the code. Kubernetes-commit: 6d0ac8c561a7ac66c21e4ee7bd1976c2ecedbf32 --- examples/workqueue/main.go | 10 +++++----- transport/cert_rotation.go | 7 +++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/examples/workqueue/main.go b/examples/workqueue/main.go index e854840aed..b8825dc1e2 100644 --- a/examples/workqueue/main.go +++ b/examples/workqueue/main.go @@ -37,12 +37,12 @@ import ( // Controller demonstrates how to implement a controller with client-go. type Controller struct { indexer cache.Indexer - queue workqueue.RateLimitingInterface + queue workqueue.TypedRateLimitingInterface[string] informer cache.Controller } // NewController creates a new Controller. -func NewController(queue workqueue.RateLimitingInterface, indexer cache.Indexer, informer cache.Controller) *Controller { +func NewController(queue workqueue.TypedRateLimitingInterface[string], indexer cache.Indexer, informer cache.Controller) *Controller { return &Controller{ informer: informer, indexer: indexer, @@ -62,7 +62,7 @@ func (c *Controller) processNextItem() bool { defer c.queue.Done(key) // Invoke the method containing the business logic - err := c.syncToStdout(key.(string)) + err := c.syncToStdout(key) // Handle the error if something went wrong during the execution of the business logic c.handleErr(err, key) return true @@ -90,7 +90,7 @@ func (c *Controller) syncToStdout(key string) error { } // handleErr checks if an error happened and makes sure we will retry later. -func (c *Controller) handleErr(err error, key interface{}) { +func (c *Controller) handleErr(err error, key string) { if err == nil { // Forget about the #AddRateLimited history of the key on every successful synchronization. // This ensures that future processing of updates for this key is not delayed because of @@ -168,7 +168,7 @@ func main() { podListWatcher := cache.NewListWatchFromClient(clientset.CoreV1().RESTClient(), "pods", v1.NamespaceDefault, fields.Everything()) // create the workqueue - queue := workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()) + queue := workqueue.NewTypedRateLimitingQueue(workqueue.DefaultTypedControllerRateLimiter[string]()) // Bind the workqueue to a cache with the help of an informer. This way we make sure that // whenever the cache is updated, the pod key is added to the workqueue. diff --git a/transport/cert_rotation.go b/transport/cert_rotation.go index dc22b6ec4c..e76f65812d 100644 --- a/transport/cert_rotation.go +++ b/transport/cert_rotation.go @@ -47,14 +47,17 @@ type dynamicClientCert struct { connDialer *connrotation.Dialer // queue only ever has one item, but it has nice error handling backoff/retry semantics - queue workqueue.RateLimitingInterface + queue workqueue.TypedRateLimitingInterface[string] } func certRotatingDialer(reload reloadFunc, dial utilnet.DialFunc) *dynamicClientCert { d := &dynamicClientCert{ reload: reload, connDialer: connrotation.NewDialer(connrotation.DialFunc(dial)), - queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "DynamicClientCertificate"), + queue: workqueue.NewTypedRateLimitingQueueWithConfig( + workqueue.DefaultTypedControllerRateLimiter[string](), + workqueue.TypedRateLimitingQueueConfig[string]{Name: "DynamicClientCertificate"}, + ), } return d From 049f231649247b73656545445b5accd911bea272 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Mon, 29 Apr 2024 12:51:32 -0700 Subject: [PATCH 031/159] Merge pull request #124562 from sbueringer/pr-bump-sigs-yaml Bump sigs.k8s.io/yaml to v1.4.0 Kubernetes-commit: c1ef6c44f5d7b582bf19669c6dbf2ff9552b9d6c --- go.mod | 10 ++-------- go.sum | 14 ++++---------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index 4122955c1e..49fb47bb15 100644 --- a/go.mod +++ b/go.mod @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.18.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 - k8s.io/api v0.0.0 - k8s.io/apimachinery v0.0.0 + k8s.io/api v0.0.0-20240429213425-c4ac111f8f96 + k8s.io/apimachinery v0.0.0-20240429213236-d5c9711b77ee k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -59,9 +59,3 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace ( - k8s.io/api => ../api - k8s.io/apimachinery => ../apimachinery - k8s.io/client-go => ../client-go -) diff --git a/go.sum b/go.sum index ee1358c11a..e70b478fa8 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,5 @@ -cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -12,7 +8,6 @@ github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxER github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= @@ -100,16 +95,13 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -146,7 +138,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= @@ -162,7 +153,10 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= +k8s.io/api v0.0.0-20240429213425-c4ac111f8f96 h1:yHnkZVz2tsRQPzwI9hfhRR6Bzhn6VdN9KCuHeZSjTaQ= +k8s.io/api v0.0.0-20240429213425-c4ac111f8f96/go.mod h1:9u2hv4hNvL2CuAClOovlI26iuQi5Hof8z8o5s6vcaaQ= +k8s.io/apimachinery v0.0.0-20240429213236-d5c9711b77ee h1:ufifSA/u9dYbZYX6YVgFCfewd6zuuJPnhq8OVA0taL0= +k8s.io/apimachinery v0.0.0-20240429213236-d5c9711b77ee/go.mod h1:+hpAhBheGa7Ub4X6JfKqjEeACgGYZqZv+ILGzigzVGU= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 64ff14beda4b4d616123d621b1cf132ef7ccd798 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Wed, 1 May 2024 09:06:11 -0400 Subject: [PATCH 032/159] address comments during review Signed-off-by: Davanum Srinivas Kubernetes-commit: 7187d9af81eb1dc2691e7faeb1aaa254d85cc860 --- plugin/pkg/client/auth/azure/azure_stub.go | 36 +++++++++++++++++++++ plugin/pkg/client/auth/gcp/gcp_stub.go | 36 +++++++++++++++++++++ plugin/pkg/client/auth/plugins_providers.go | 23 +++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 plugin/pkg/client/auth/azure/azure_stub.go create mode 100644 plugin/pkg/client/auth/gcp/gcp_stub.go create mode 100644 plugin/pkg/client/auth/plugins_providers.go diff --git a/plugin/pkg/client/auth/azure/azure_stub.go b/plugin/pkg/client/auth/azure/azure_stub.go new file mode 100644 index 0000000000..22d3c6b3fe --- /dev/null +++ b/plugin/pkg/client/auth/azure/azure_stub.go @@ -0,0 +1,36 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package azure + +import ( + "errors" + + "k8s.io/client-go/rest" + "k8s.io/klog/v2" +) + +func init() { + if err := rest.RegisterAuthProviderPlugin("azure", newAzureAuthProvider); err != nil { + klog.Fatalf("Failed to register azure auth plugin: %v", err) + } +} + +func newAzureAuthProvider(_ string, _ map[string]string, _ rest.AuthProviderConfigPersister) (rest.AuthProvider, error) { + return nil, errors.New(`The azure auth plugin has been removed. +Please use the https://github.com/Azure/kubelogin kubectl/client-go credential plugin instead. +See https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins for further details`) +} diff --git a/plugin/pkg/client/auth/gcp/gcp_stub.go b/plugin/pkg/client/auth/gcp/gcp_stub.go new file mode 100644 index 0000000000..99585f9391 --- /dev/null +++ b/plugin/pkg/client/auth/gcp/gcp_stub.go @@ -0,0 +1,36 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package gcp + +import ( + "errors" + + "k8s.io/client-go/rest" + "k8s.io/klog/v2" +) + +func init() { + if err := rest.RegisterAuthProviderPlugin("gcp", newGCPAuthProvider); err != nil { + klog.Fatalf("Failed to register gcp auth plugin: %v", err) + } +} + +func newGCPAuthProvider(_ string, _ map[string]string, _ rest.AuthProviderConfigPersister) (rest.AuthProvider, error) { + return nil, errors.New(`The gcp auth plugin has been removed. +Please use the "gke-gcloud-auth-plugin" kubectl/client-go credential plugin instead. +See https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke for further details`) +} diff --git a/plugin/pkg/client/auth/plugins_providers.go b/plugin/pkg/client/auth/plugins_providers.go new file mode 100644 index 0000000000..2d178ce374 --- /dev/null +++ b/plugin/pkg/client/auth/plugins_providers.go @@ -0,0 +1,23 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package auth + +import ( + // Initialize client auth plugins for cloud providers. + _ "k8s.io/client-go/plugin/pkg/client/auth/azure" + _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" +) From 35cab326ad02285637a370fcb5a555eb85d1c71a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Ma=C5=82ek?= Date: Sat, 4 May 2024 00:21:14 +0200 Subject: [PATCH 033/159] fix(api): make LocalObjectReference.Name and HostAlias.IP required (#124553) * fix(api): LocalObjectReference Name a "" default and make HostAlias.IP required * chore(api): add LocalObjectReference comment * chore(api): add omitempty to LocalObjectReference's Name * chore(api): add kubebuilder:default annotation * chore(api): ./hack/update-codegen.sh Kubernetes-commit: 8dbeaa5786bab14772873cc90af70ccb9b06b4c1 --- applyconfigurations/internal/internal.go | 9 +++++++++ go.mod | 4 ++-- go.sum | 8 ++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index f3314a39ee..610b4d13d8 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -4759,6 +4759,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: name type: scalar: string + default: "" - name: optional type: scalar: boolean @@ -4772,6 +4773,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: name type: scalar: string + default: "" - name: optional type: scalar: boolean @@ -4809,6 +4811,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: name type: scalar: string + default: "" - name: optional type: scalar: boolean @@ -4827,6 +4830,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: name type: scalar: string + default: "" - name: optional type: scalar: boolean @@ -5650,6 +5654,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: ip type: scalar: string + default: "" - name: io.k8s.api.core.v1.HostIP map: fields: @@ -5879,6 +5884,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: name type: scalar: string + default: "" elementRelationship: atomic - name: io.k8s.api.core.v1.LocalVolumeSource map: @@ -7617,6 +7623,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: name type: scalar: string + default: "" - name: optional type: scalar: boolean @@ -7630,6 +7637,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: name type: scalar: string + default: "" - name: optional type: scalar: boolean @@ -7646,6 +7654,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: name type: scalar: string + default: "" - name: optional type: scalar: boolean diff --git a/go.mod b/go.mod index 49fb47bb15..b691350b76 100644 --- a/go.mod +++ b/go.mod @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.18.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 - k8s.io/api v0.0.0-20240429213425-c4ac111f8f96 - k8s.io/apimachinery v0.0.0-20240429213236-d5c9711b77ee + k8s.io/api v0.0.0-20240504002703-92d2eac37b2a + k8s.io/apimachinery v0.0.0-20240503202409-c9c3e94f52f0 k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b diff --git a/go.sum b/go.sum index e70b478fa8..c1ef8037ca 100644 --- a/go.sum +++ b/go.sum @@ -153,10 +153,10 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240429213425-c4ac111f8f96 h1:yHnkZVz2tsRQPzwI9hfhRR6Bzhn6VdN9KCuHeZSjTaQ= -k8s.io/api v0.0.0-20240429213425-c4ac111f8f96/go.mod h1:9u2hv4hNvL2CuAClOovlI26iuQi5Hof8z8o5s6vcaaQ= -k8s.io/apimachinery v0.0.0-20240429213236-d5c9711b77ee h1:ufifSA/u9dYbZYX6YVgFCfewd6zuuJPnhq8OVA0taL0= -k8s.io/apimachinery v0.0.0-20240429213236-d5c9711b77ee/go.mod h1:+hpAhBheGa7Ub4X6JfKqjEeACgGYZqZv+ILGzigzVGU= +k8s.io/api v0.0.0-20240504002703-92d2eac37b2a h1:5caNAKMlpW7WSCZ+MmGv5lRmtwJ582l0GYlyqj7UbEA= +k8s.io/api v0.0.0-20240504002703-92d2eac37b2a/go.mod h1:63wOlHLR6A1SAeEfLi6u/gVTKmQklvs6IL52WjMSKn0= +k8s.io/apimachinery v0.0.0-20240503202409-c9c3e94f52f0 h1:7WYV6yFZ33GBiOXTMsfUjlaZvdWfda0JRXrn/xxekAY= +k8s.io/apimachinery v0.0.0-20240503202409-c9c3e94f52f0/go.mod h1:+hpAhBheGa7Ub4X6JfKqjEeACgGYZqZv+ILGzigzVGU= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 988ddc2b6cb9836b8023638505d7f6aaf2a4c69c Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Wed, 8 May 2024 11:04:34 -0400 Subject: [PATCH 034/159] Update to latest golang.org/x/oauth2 v0.20.0 Signed-off-by: Davanum Srinivas Kubernetes-commit: 04c40ac96134d7f7bf697d0a58caf0f8b0380075 --- go.mod | 13 +++++++++---- go.sum | 22 +++++++++++----------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index abc0a72937..b9afc700ee 100644 --- a/go.mod +++ b/go.mod @@ -20,12 +20,12 @@ require ( github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.4 golang.org/x/net v0.23.0 - golang.org/x/oauth2 v0.18.0 + golang.org/x/oauth2 v0.20.0 golang.org/x/term v0.18.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 - k8s.io/api v0.0.0-20240506162732-aa3ed7cd8078 - k8s.io/apimachinery v0.0.0-20240503202409-c9c3e94f52f0 + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -54,8 +54,13 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/sys v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/appengine v1.6.7 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace ( + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go +) diff --git a/go.sum b/go.sum index bd867a9b87..15221adf85 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,8 @@ +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -8,6 +11,7 @@ github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxER github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= @@ -22,7 +26,6 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= 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.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 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= @@ -95,22 +98,24 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= -golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= +golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= +golang.org/x/oauth2 v0.20.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= @@ -122,7 +127,6 @@ golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= @@ -138,8 +142,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -153,10 +156,7 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240506162732-aa3ed7cd8078 h1:fmtjZgpgDd+rPhhc3uwCanQccJnkR8uJmPRGMl8rP8I= -k8s.io/api v0.0.0-20240506162732-aa3ed7cd8078/go.mod h1:63wOlHLR6A1SAeEfLi6u/gVTKmQklvs6IL52WjMSKn0= -k8s.io/apimachinery v0.0.0-20240503202409-c9c3e94f52f0 h1:7WYV6yFZ33GBiOXTMsfUjlaZvdWfda0JRXrn/xxekAY= -k8s.io/apimachinery v0.0.0-20240503202409-c9c3e94f52f0/go.mod h1:+hpAhBheGa7Ub4X6JfKqjEeACgGYZqZv+ILGzigzVGU= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 8a8d0731deec3d9e5d5271bbaa9f26a2a67fe007 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Wed, 8 May 2024 13:58:30 -0700 Subject: [PATCH 035/159] Merge pull request #124757 from dims/update-to-latest-golang.org/x/oauth2-v0.20.0 Update to latest golang.org/x/oauth2 v0.20.0 Kubernetes-commit: 22578c545ffc04a505a7a64c9b8f6c78fefa07ef --- go.mod | 10 ++-------- go.sum | 13 ++++--------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index b9afc700ee..10fe4d8adb 100644 --- a/go.mod +++ b/go.mod @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.18.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 - k8s.io/api v0.0.0 - k8s.io/apimachinery v0.0.0 + k8s.io/api v0.0.0-20240508202814-7ccc2456a96f + k8s.io/apimachinery v0.0.0-20240503202409-c9c3e94f52f0 k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -58,9 +58,3 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace ( - k8s.io/api => ../api - k8s.io/apimachinery => ../apimachinery - k8s.io/client-go => ../client-go -) diff --git a/go.sum b/go.sum index 15221adf85..2b68998541 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,5 @@ -cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -11,7 +8,6 @@ github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxER github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= @@ -98,16 +94,13 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -142,7 +135,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -156,7 +148,10 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= +k8s.io/api v0.0.0-20240508202814-7ccc2456a96f h1:JD5C6Ov1+pP7Ze8s7O/+0YfhlAH2NrkuSLWCn0F1KRU= +k8s.io/api v0.0.0-20240508202814-7ccc2456a96f/go.mod h1:63wOlHLR6A1SAeEfLi6u/gVTKmQklvs6IL52WjMSKn0= +k8s.io/apimachinery v0.0.0-20240503202409-c9c3e94f52f0 h1:7WYV6yFZ33GBiOXTMsfUjlaZvdWfda0JRXrn/xxekAY= +k8s.io/apimachinery v0.0.0-20240503202409-c9c3e94f52f0/go.mod h1:+hpAhBheGa7Ub4X6JfKqjEeACgGYZqZv+ILGzigzVGU= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 0280901a4dd560e2a26b62fa8e7dcc4b941b4390 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Mon, 29 Apr 2024 15:18:54 +0200 Subject: [PATCH 036/159] client-go/reflector: warns when the bookmark event for initial events hasn't been received Kubernetes-commit: 93960f489069a744afda1be42f82349e25d7e4d7 --- tools/cache/reflector.go | 90 +++++++++++++++++++++++++ tools/cache/reflector_watchlist_test.go | 71 +++++++++++++++++++ 2 files changed, 161 insertions(+) diff --git a/tools/cache/reflector.go b/tools/cache/reflector.go index 157436da75..67e6feb978 100644 --- a/tools/cache/reflector.go +++ b/tools/cache/reflector.go @@ -732,6 +732,8 @@ func watchHandler(start time.Time, stopCh <-chan struct{}, ) error { eventCount := 0 + initialEventsEndBookmarkWarningTicker := newInitialEventsEndBookmarkTicker(name, clock, start, exitOnInitialEventsEndBookmark != nil) + defer initialEventsEndBookmarkWarningTicker.Stop() if exitOnInitialEventsEndBookmark != nil { // set it to false just in case somebody // made it positive @@ -809,6 +811,9 @@ loop: klog.V(4).Infof("exiting %v Watch because received the bookmark that marks the end of initial events stream, total %v items received in %v", name, eventCount, watchDuration) return nil } + initialEventsEndBookmarkWarningTicker.observeLastEventTimeStamp(clock.Now()) + case <-initialEventsEndBookmarkWarningTicker.C(): + initialEventsEndBookmarkWarningTicker.warnIfExpired() } } @@ -929,3 +934,88 @@ func isWatchErrorRetriable(err error) bool { } return false } + +// initialEventsEndBookmarkTicker a ticker that produces a warning if the bookmark event +// which marks the end of the watch stream, has not been received within the defined tick interval. +// +// Note: +// The methods exposed by this type are not thread-safe. +type initialEventsEndBookmarkTicker struct { + clock.Ticker + clock clock.Clock + name string + + watchStart time.Time + tickInterval time.Duration + lastEventObserveTime time.Time +} + +// newInitialEventsEndBookmarkTicker returns a noop ticker if exitOnInitialEventsEndBookmarkRequested is false. +// Otherwise, it returns a ticker that exposes a method producing a warning if the bookmark event, +// which marks the end of the watch stream, has not been received within the defined tick interval. +// +// Note that the caller controls whether to call t.C() and t.Stop(). +// +// In practice, the reflector exits the watchHandler as soon as the bookmark event is received and calls the t.C() method. +func newInitialEventsEndBookmarkTicker(name string, c clock.Clock, watchStart time.Time, exitOnInitialEventsEndBookmarkRequested bool) *initialEventsEndBookmarkTicker { + return newInitialEventsEndBookmarkTickerInternal(name, c, watchStart, 10*time.Second, exitOnInitialEventsEndBookmarkRequested) +} + +func newInitialEventsEndBookmarkTickerInternal(name string, c clock.Clock, watchStart time.Time, tickInterval time.Duration, exitOnInitialEventsEndBookmarkRequested bool) *initialEventsEndBookmarkTicker { + clockWithTicker, ok := c.(clock.WithTicker) + if !ok || !exitOnInitialEventsEndBookmarkRequested { + if exitOnInitialEventsEndBookmarkRequested { + klog.Warningf("clock does not support WithTicker interface but exitOnInitialEventsEndBookmark was requested") + } + return &initialEventsEndBookmarkTicker{ + Ticker: &noopTicker{}, + } + } + + return &initialEventsEndBookmarkTicker{ + Ticker: clockWithTicker.NewTicker(tickInterval), + clock: c, + name: name, + watchStart: watchStart, + tickInterval: tickInterval, + } +} + +func (t *initialEventsEndBookmarkTicker) observeLastEventTimeStamp(lastEventObserveTime time.Time) { + t.lastEventObserveTime = lastEventObserveTime +} + +func (t *initialEventsEndBookmarkTicker) warnIfExpired() { + if err := t.produceWarningIfExpired(); err != nil { + klog.Warning(err) + } +} + +// produceWarningIfExpired returns an error that represents a warning when +// the time elapsed since the last received event exceeds the tickInterval. +// +// Note that this method should be called when t.C() yields a value. +func (t *initialEventsEndBookmarkTicker) produceWarningIfExpired() error { + if _, ok := t.Ticker.(*noopTicker); ok { + return nil /*noop ticker*/ + } + if t.lastEventObserveTime.IsZero() { + return fmt.Errorf("%s: awaiting required bookmark event for initial events stream, no events received for %v", t.name, t.clock.Since(t.watchStart)) + } + elapsedTime := t.clock.Now().Sub(t.lastEventObserveTime) + hasBookmarkTimerExpired := elapsedTime >= t.tickInterval + + if !hasBookmarkTimerExpired { + return nil + } + return fmt.Errorf("%s: hasn't received required bookmark event marking the end of initial events stream, received last event %v ago", t.name, elapsedTime) +} + +var _ clock.Ticker = &noopTicker{} + +// TODO(#115478): move to k8s/utils repo +type noopTicker struct{} + +func (t *noopTicker) C() <-chan time.Time { return nil } + +func (t *noopTicker) Stop() {} diff --git a/tools/cache/reflector_watchlist_test.go b/tools/cache/reflector_watchlist_test.go index a2eec9193f..c2fbeca82e 100644 --- a/tools/cache/reflector_watchlist_test.go +++ b/tools/cache/reflector_watchlist_test.go @@ -17,13 +17,16 @@ limitations under the License. package cache import ( + "errors" "fmt" "sort" "sync" "testing" + "time" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" + "github.com/stretchr/testify/require" v1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -32,10 +35,78 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" + testingclock "k8s.io/utils/clock/testing" "k8s.io/utils/pointer" "k8s.io/utils/ptr" ) +func TestInitialEventsEndBookmarkTicker(t *testing.T) { + assertNoEvents := func(t *testing.T, c <-chan time.Time) { + select { + case e := <-c: + t.Errorf("Unexpected: %#v event received, expected no events", e) + default: + return + } + } + + t.Run("testing NoopInitialEventsEndBookmarkTicker", func(t *testing.T) { + clock := testingclock.NewFakeClock(time.Now()) + target := newInitialEventsEndBookmarkTickerInternal("testName", clock, clock.Now(), time.Second, false) + + clock.Step(30 * time.Second) + assertNoEvents(t, target.C()) + actualWarning := target.produceWarningIfExpired() + + require.Empty(t, actualWarning, "didn't expect any warning") + // validate if the other methods don't produce panic + target.warnIfExpired() + target.observeLastEventTimeStamp(clock.Now()) + + // make sure that after calling the other methods + // nothing hasn't changed + actualWarning = target.produceWarningIfExpired() + require.Empty(t, actualWarning, "didn't expect any warning") + assertNoEvents(t, target.C()) + + target.Stop() + }) + + t.Run("testing InitialEventsEndBookmarkTicker backed by a fake clock", func(t *testing.T) { + clock := testingclock.NewFakeClock(time.Now()) + target := newInitialEventsEndBookmarkTickerInternal("testName", clock, clock.Now(), time.Second, true) + clock.Step(500 * time.Millisecond) + assertNoEvents(t, target.C()) + + clock.Step(500 * time.Millisecond) + <-target.C() + actualWarning := target.produceWarningIfExpired() + require.Equal(t, errors.New("testName: awaiting required bookmark event for initial events stream, no events received for 1s"), actualWarning) + + clock.Step(time.Second) + <-target.C() + actualWarning = target.produceWarningIfExpired() + require.Equal(t, errors.New("testName: awaiting required bookmark event for initial events stream, no events received for 2s"), actualWarning) + + target.observeLastEventTimeStamp(clock.Now()) + clock.Step(500 * time.Millisecond) + assertNoEvents(t, target.C()) + + clock.Step(500 * time.Millisecond) + <-target.C() + actualWarning = target.produceWarningIfExpired() + require.Equal(t, errors.New("testName: hasn't received required bookmark event marking the end of initial events stream, received last event 1s ago"), actualWarning) + + clock.Step(time.Second) + <-target.C() + actualWarning = target.produceWarningIfExpired() + require.Equal(t, errors.New("testName: hasn't received required bookmark event marking the end of initial events stream, received last event 2s ago"), actualWarning) + + target.Stop() + assertNoEvents(t, target.C()) + }) +} + func TestWatchList(t *testing.T) { scenarios := []struct { name string From 86f83bc818996f67998fb043611595d2a612284c Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Mon, 20 May 2024 06:46:50 -0700 Subject: [PATCH 037/159] Merge pull request #124614 from p0lyn0mial/upstream-reflector-warn-no-bookmark-event client-go/reflector: warns when the bookmark event for initial events hasn't been received Kubernetes-commit: b10a141fd2c291feea78c4e36483933b25368224 --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 10fe4d8adb..339c3da9a6 100644 --- a/go.mod +++ b/go.mod @@ -24,8 +24,8 @@ require ( golang.org/x/term v0.18.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 - k8s.io/api v0.0.0-20240508202814-7ccc2456a96f - k8s.io/apimachinery v0.0.0-20240503202409-c9c3e94f52f0 + k8s.io/api v0.0.0-20240516203440-664bdd58a30d + k8s.io/apimachinery v0.0.0-20240510224318-1da46c3f5a5b k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b diff --git a/go.sum b/go.sum index 2b68998541..368f51c5a7 100644 --- a/go.sum +++ b/go.sum @@ -148,10 +148,10 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240508202814-7ccc2456a96f h1:JD5C6Ov1+pP7Ze8s7O/+0YfhlAH2NrkuSLWCn0F1KRU= -k8s.io/api v0.0.0-20240508202814-7ccc2456a96f/go.mod h1:63wOlHLR6A1SAeEfLi6u/gVTKmQklvs6IL52WjMSKn0= -k8s.io/apimachinery v0.0.0-20240503202409-c9c3e94f52f0 h1:7WYV6yFZ33GBiOXTMsfUjlaZvdWfda0JRXrn/xxekAY= -k8s.io/apimachinery v0.0.0-20240503202409-c9c3e94f52f0/go.mod h1:+hpAhBheGa7Ub4X6JfKqjEeACgGYZqZv+ILGzigzVGU= +k8s.io/api v0.0.0-20240516203440-664bdd58a30d h1:0j0GmUGa2xvgJJiTzGQhNRKa2ByzpqDlBhggVRVmrfY= +k8s.io/api v0.0.0-20240516203440-664bdd58a30d/go.mod h1:GIl44YEE/I5fp0xgOEQrSjkLfe5trkF4SgIeRHHviOk= +k8s.io/apimachinery v0.0.0-20240510224318-1da46c3f5a5b h1:UTQPecSyfYRHmREs/0iVer4dQClGGZuYKTyHqOAScYQ= +k8s.io/apimachinery v0.0.0-20240510224318-1da46c3f5a5b/go.mod h1:+hpAhBheGa7Ub4X6JfKqjEeACgGYZqZv+ILGzigzVGU= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 4a341960220d609e0008838da601fca7754a875b Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Tue, 30 Apr 2024 08:24:53 +0200 Subject: [PATCH 038/159] replace ENABLE_CLIENT_GO_WATCH_LIST_ALPHA with WatchListClient gate Kubernetes-commit: 9248cccc27fdd52a9a99fd9ad6e47ada9ee8b568 --- tools/cache/reflector.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/cache/reflector.go b/tools/cache/reflector.go index 67e6feb978..7b08160684 100644 --- a/tools/cache/reflector.go +++ b/tools/cache/reflector.go @@ -22,7 +22,6 @@ import ( "fmt" "io" "math/rand" - "os" "reflect" "strings" "sync" @@ -39,6 +38,7 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" + clientfeatures "k8s.io/client-go/features" "k8s.io/client-go/tools/pager" "k8s.io/klog/v2" "k8s.io/utils/clock" @@ -254,9 +254,7 @@ func NewReflectorWithOptions(lw ListerWatcher, expectedType interface{}, store S // don't overwrite UseWatchList if already set // because the higher layers (e.g. storage/cacher) disabled it on purpose if r.UseWatchList == nil { - if s := os.Getenv("ENABLE_CLIENT_GO_WATCH_LIST_ALPHA"); len(s) > 0 { - r.UseWatchList = ptr.To(true) - } + r.UseWatchList = ptr.To(clientfeatures.FeatureGates().Enabled(clientfeatures.WatchListClient)) } return r From c7396197f39ed43fb0369c054360fcb989d65c88 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Tue, 21 May 2024 02:05:35 -0700 Subject: [PATCH 039/159] Merge pull request #122791 from p0lyn0mial/upstream-cleanup-watch-list-env-var cleanup: replace ENABLE_CLIENT_GO_WATCH_LIST_ALPHA with WatchListClient gate Kubernetes-commit: 8c1983ffc0b6fe2293fc721cef8d961d79aafc53 From 6bdde7723ebdbb117b6c01e6f97626931fb802db Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Mon, 22 Apr 2024 14:01:22 +0200 Subject: [PATCH 040/159] client-go/consistency-detector: change the signature of checkWatchListConsistencyIfRequested the signature of the method was tightly connected to the reflector, making it difficult to use for anything other than a reflector. this simple refactor makes the method more generic. Kubernetes-commit: 83c7542abc8c542c01ecb67376f134b2071c5304 --- tools/cache/reflector.go | 9 +++- .../reflector_data_consistency_detector.go | 51 ++++++++++--------- ...eflector_data_consistency_detector_test.go | 41 +++++++++------ 3 files changed, 62 insertions(+), 39 deletions(-) diff --git a/tools/cache/reflector.go b/tools/cache/reflector.go index 7b08160684..a617147bda 100644 --- a/tools/cache/reflector.go +++ b/tools/cache/reflector.go @@ -695,7 +695,7 @@ func (r *Reflector) watchList(stopCh <-chan struct{}) (watch.Interface, error) { // we utilize the temporaryStore to ensure independence from the current store implementation. // as of today, the store is implemented as a queue and will be drained by the higher-level // component as soon as it finishes replacing the content. - checkWatchListConsistencyIfRequested(stopCh, r.name, resourceVersion, r.listerWatcher, temporaryStore) + checkWatchListDataConsistencyIfRequested(wait.ContextForChannel(stopCh), r.name, resourceVersion, wrapListFuncWithContext(r.listerWatcher.List), temporaryStore.List) if err = r.store.Replace(temporaryStore.List(), resourceVersion); err != nil { return nil, fmt.Errorf("unable to sync watch-list result: %v", err) @@ -933,6 +933,13 @@ func isWatchErrorRetriable(err error) bool { return false } +// wrapListFuncWithContext simply wraps ListFunction into another function that accepts a context and ignores it. +func wrapListFuncWithContext(listFn ListFunc) func(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { + return func(_ context.Context, options metav1.ListOptions) (runtime.Object, error) { + return listFn(options) + } +} + // initialEventsEndBookmarkTicker a ticker that produces a warning if the bookmark event // which marks the end of the watch stream, has not been received within the defined tick interval. // diff --git a/tools/cache/reflector_data_consistency_detector.go b/tools/cache/reflector_data_consistency_detector.go index aa3027d714..0aacee4a06 100644 --- a/tools/cache/reflector_data_consistency_detector.go +++ b/tools/cache/reflector_data_consistency_detector.go @@ -18,6 +18,7 @@ package cache import ( "context" + "fmt" "os" "sort" "strconv" @@ -32,42 +33,46 @@ import ( "k8s.io/klog/v2" ) -var dataConsistencyDetectionEnabled = false +var dataConsistencyDetectionForWatchListEnabled = false func init() { - dataConsistencyDetectionEnabled, _ = strconv.ParseBool(os.Getenv("KUBE_WATCHLIST_INCONSISTENCY_DETECTOR")) + dataConsistencyDetectionForWatchListEnabled, _ = strconv.ParseBool(os.Getenv("KUBE_WATCHLIST_INCONSISTENCY_DETECTOR")) } -// checkWatchListConsistencyIfRequested performs a data consistency check only when +type retrieveItemsFunc[U any] func() []U + +type listFunc[T runtime.Object] func(ctx context.Context, options metav1.ListOptions) (T, error) + +// checkWatchListDataConsistencyIfRequested performs a data consistency check only when // the KUBE_WATCHLIST_INCONSISTENCY_DETECTOR environment variable was set during a binary startup. // // The consistency check is meant to be enforced only in the CI, not in production. // The check ensures that data retrieved by the watch-list api call -// is exactly the same as data received by the standard list api call. +// is exactly the same as data received by the standard list api call against etcd. // // Note that this function will panic when data inconsistency is detected. // This is intentional because we want to catch it in the CI. -func checkWatchListConsistencyIfRequested(stopCh <-chan struct{}, identity string, lastSyncedResourceVersion string, listerWatcher Lister, store Store) { - if !dataConsistencyDetectionEnabled { +func checkWatchListDataConsistencyIfRequested[T runtime.Object, U any](ctx context.Context, identity string, lastSyncedResourceVersion string, listFn listFunc[T], retrieveItemsFn retrieveItemsFunc[U]) { + if !dataConsistencyDetectionForWatchListEnabled { return } - checkWatchListConsistency(stopCh, identity, lastSyncedResourceVersion, listerWatcher, store) + // for informers we pass an empty ListOptions because + // listFn might be wrapped for filtering during informer construction. + checkDataConsistency(ctx, identity, lastSyncedResourceVersion, listFn, metav1.ListOptions{}, retrieveItemsFn) } -// checkWatchListConsistency exists solely for testing purposes. -// we cannot use checkWatchListConsistencyIfRequested because +// checkDataConsistency exists solely for testing purposes. +// we cannot use checkWatchListDataConsistencyIfRequested because // it is guarded by an environmental variable. // we cannot manipulate the environmental variable because // it will affect other tests in this package. -func checkWatchListConsistency(stopCh <-chan struct{}, identity string, lastSyncedResourceVersion string, listerWatcher Lister, store Store) { - klog.Warningf("%s: data consistency check for the watch-list feature is enabled, this will result in an additional call to the API server.", identity) - opts := metav1.ListOptions{ - ResourceVersion: lastSyncedResourceVersion, - ResourceVersionMatch: metav1.ResourceVersionMatchExact, - } +func checkDataConsistency[T runtime.Object, U any](ctx context.Context, identity string, lastSyncedResourceVersion string, listFn listFunc[T], listOptions metav1.ListOptions, retrieveItemsFn retrieveItemsFunc[U]) { + klog.Warningf("data consistency check for %s is enabled, this will result in an additional call to the API server.", identity) + listOptions.ResourceVersion = lastSyncedResourceVersion + listOptions.ResourceVersionMatch = metav1.ResourceVersionMatchExact var list runtime.Object - err := wait.PollUntilContextCancel(wait.ContextForChannel(stopCh), time.Second, true, func(_ context.Context) (done bool, err error) { - list, err = listerWatcher.List(opts) + err := wait.PollUntilContextCancel(ctx, time.Second, true, func(_ context.Context) (done bool, err error) { + list, err = listFn(ctx, listOptions) if err != nil { // the consistency check will only be enabled in the CI // and LIST calls in general will be retired by the client-go library @@ -78,7 +83,7 @@ func checkWatchListConsistency(stopCh <-chan struct{}, identity string, lastSync return true, nil }) if err != nil { - klog.Errorf("failed to list data from the server, the watch-list consistency check won't be performed, stopCh was closed, err: %v", err) + klog.Errorf("failed to list data from the server, the data consistency check for %s won't be performed, stopCh was closed, err: %v", identity, err) return } @@ -88,14 +93,14 @@ func checkWatchListConsistency(stopCh <-chan struct{}, identity string, lastSync } listItems := toMetaObjectSliceOrDie(rawListItems) - storeItems := toMetaObjectSliceOrDie(store.List()) + retrievedItems := toMetaObjectSliceOrDie(retrieveItemsFn()) sort.Sort(byUID(listItems)) - sort.Sort(byUID(storeItems)) + sort.Sort(byUID(retrievedItems)) - if !cmp.Equal(listItems, storeItems) { - klog.Infof("%s: data received by the new watch-list api call is different than received by the standard list api call, diff: %v", identity, cmp.Diff(listItems, storeItems)) - msg := "data inconsistency detected for the watch-list feature, panicking!" + if !cmp.Equal(listItems, retrievedItems) { + klog.Infof("previously received data for %s is different than received by the standard list api call against etcd, diff: %v", identity, cmp.Diff(listItems, retrievedItems)) + msg := fmt.Sprintf("data inconsistency detected for %s, panicking!", identity) panic(msg) } } diff --git a/tools/cache/reflector_data_consistency_detector_test.go b/tools/cache/reflector_data_consistency_detector_test.go index 3c7eda7def..a878e488b3 100644 --- a/tools/cache/reflector_data_consistency_detector_test.go +++ b/tools/cache/reflector_data_consistency_detector_test.go @@ -17,6 +17,7 @@ limitations under the License. package cache import ( + "context" "fmt" "testing" @@ -25,62 +26,71 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" + "k8s.io/utils/ptr" ) -func TestWatchListConsistency(t *testing.T) { +func TestDataConsistencyChecker(t *testing.T) { scenarios := []struct { name string - podList *v1.PodList - storeContent []*v1.Pod + podList *v1.PodList + storeContent []*v1.Pod + requestOptions metav1.ListOptions expectedRequestOptions []metav1.ListOptions expectedListRequests int expectPanic bool }{ { - name: "watchlist consistency check won't panic when data is consistent", + name: "data consistency check won't panic when data is consistent", podList: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "2"}, Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2")}, }, + requestOptions: metav1.ListOptions{TimeoutSeconds: ptr.To(int64(39))}, storeContent: []*v1.Pod{makePod("p1", "1"), makePod("p2", "2")}, expectedListRequests: 1, expectedRequestOptions: []metav1.ListOptions{ { ResourceVersion: "2", ResourceVersionMatch: metav1.ResourceVersionMatchExact, + TimeoutSeconds: ptr.To(int64(39)), }, }, }, { - name: "watchlist consistency check won't panic when there is no data", + name: "data consistency check won't panic when there is no data", podList: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "2"}, }, + requestOptions: metav1.ListOptions{TimeoutSeconds: ptr.To(int64(39))}, expectedListRequests: 1, expectedRequestOptions: []metav1.ListOptions{ { ResourceVersion: "2", ResourceVersionMatch: metav1.ResourceVersionMatchExact, + TimeoutSeconds: ptr.To(int64(39)), }, }, }, { - name: "watchlist consistency panics when data is inconsistent", + name: "data consistency panics when data is inconsistent", podList: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "2"}, Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2"), *makePod("p3", "3")}, }, + requestOptions: metav1.ListOptions{TimeoutSeconds: ptr.To(int64(39))}, storeContent: []*v1.Pod{makePod("p1", "1"), makePod("p2", "2")}, expectedListRequests: 1, expectedRequestOptions: []metav1.ListOptions{ { ResourceVersion: "2", ResourceVersionMatch: metav1.ResourceVersionMatchExact, + TimeoutSeconds: ptr.To(int64(39)), }, }, expectPanic: true, @@ -90,15 +100,18 @@ func TestWatchListConsistency(t *testing.T) { for _, scenario := range scenarios { t.Run(scenario.name, func(t *testing.T) { listWatcher, store, _, stopCh := testData() + ctx := wait.ContextForChannel(stopCh) for _, obj := range scenario.storeContent { require.NoError(t, store.Add(obj)) } listWatcher.customListResponse = scenario.podList if scenario.expectPanic { - require.Panics(t, func() { checkWatchListConsistency(stopCh, "", scenario.podList.ResourceVersion, listWatcher, store) }) + require.Panics(t, func() { + checkDataConsistency(ctx, "", scenario.podList.ResourceVersion, wrapListFuncWithContext(listWatcher.List), scenario.requestOptions, store.List) + }) } else { - checkWatchListConsistency(stopCh, "", scenario.podList.ResourceVersion, listWatcher, store) + checkDataConsistency(ctx, "", scenario.podList.ResourceVersion, wrapListFuncWithContext(listWatcher.List), scenario.requestOptions, store.List) } verifyListCounter(t, listWatcher, scenario.expectedListRequests) @@ -108,20 +121,18 @@ func TestWatchListConsistency(t *testing.T) { } func TestDriveWatchLisConsistencyIfRequired(t *testing.T) { - stopCh := make(chan struct{}) - defer close(stopCh) - checkWatchListConsistencyIfRequested(stopCh, "", "", nil, nil) + ctx := context.TODO() + checkWatchListDataConsistencyIfRequested[runtime.Object, runtime.Object](ctx, "", "", nil, nil) } -func TestWatchListConsistencyRetry(t *testing.T) { +func TestDataConsistencyCheckerRetry(t *testing.T) { store := NewStore(MetaNamespaceKeyFunc) - stopCh := make(chan struct{}) - defer close(stopCh) + ctx := context.TODO() stopListErrorAfter := 5 errLister := &errorLister{stopErrorAfter: stopListErrorAfter} - checkWatchListConsistency(stopCh, "", "", errLister, store) + checkDataConsistency(ctx, "", "", wrapListFuncWithContext(errLister.List), metav1.ListOptions{}, store.List) require.Equal(t, errLister.listCounter, errLister.stopErrorAfter) } From b444e6c32e6d1192b4cf89953374c9a4e04bdd73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Tyczy=C5=84ski?= Date: Mon, 29 Apr 2024 14:19:46 +0200 Subject: [PATCH 041/159] Implement ResilientWatchCacheInitialization Kubernetes-commit: a8ef6e9f0104a44023162bb8229fb677ec80beb1 --- tools/cache/reflector_test.go | 48 ++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/tools/cache/reflector_test.go b/tools/cache/reflector_test.go index 336202e24f..32946345d3 100644 --- a/tools/cache/reflector_test.go +++ b/tools/cache/reflector_test.go @@ -697,13 +697,59 @@ func TestBackoffOnTooManyRequests(t *testing.T) { } stopCh := make(chan struct{}) - r.ListAndWatch(stopCh) + if err := r.ListAndWatch(stopCh); err != nil { + t.Fatal(err) + } close(stopCh) if bm.calls != 2 { t.Errorf("unexpected watch backoff calls: %d", bm.calls) } } +func TestNoRelistOnTooManyRequests(t *testing.T) { + err := apierrors.NewTooManyRequests("too many requests", 1) + clock := &clock.RealClock{} + bm := &fakeBackoff{clock: clock} + listCalls, watchCalls := 0, 0 + + lw := &testLW{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + listCalls++ + return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "1"}}, nil + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + watchCalls++ + if watchCalls < 5 { + return nil, err + } + w := watch.NewFake() + w.Stop() + return w, nil + }, + } + + r := &Reflector{ + name: "test-reflector", + listerWatcher: lw, + store: NewFIFO(MetaNamespaceKeyFunc), + backoffManager: bm, + clock: clock, + watchErrorHandler: WatchErrorHandler(DefaultWatchErrorHandler), + } + + stopCh := make(chan struct{}) + if err := r.ListAndWatch(stopCh); err != nil { + t.Fatal(err) + } + close(stopCh) + if listCalls != 1 { + t.Errorf("unexpected list calls: %d", listCalls) + } + if watchCalls != 5 { + t.Errorf("unexpected watch calls: %d", watchCalls) + } +} + func TestRetryInternalError(t *testing.T) { testCases := []struct { name string From ebbf7d7dc321718d6eb867150fc4fe6886492e75 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Tue, 30 Apr 2024 12:16:55 +0200 Subject: [PATCH 042/159] client-go/tools/record: fix and test Broadcaster shutdown + logging Constructing a Broadcaster already starts a watch which runs in the background. Shutdown must be called to avoid leaking the goroutine. Providing a context was supposed to remove the need to call Shutdown, but that did not actually work because the logic for "must check for cancellation" was accidentally inverted. While at it, structured log output also gets tested together with checking for goroutine leaks. Kubernetes-commit: ff779f1cb56cf896405e52f7923188b99b88bb00 --- tools/record/event.go | 4 +- tools/record/event_test.go | 105 +++++++++++++++++++++++++++++-------- tools/record/main_test.go | 5 +- 3 files changed, 89 insertions(+), 25 deletions(-) diff --git a/tools/record/event.go b/tools/record/event.go index 0745fb4a35..0b3b14f8da 100644 --- a/tools/record/event.go +++ b/tools/record/event.go @@ -203,8 +203,8 @@ func NewBroadcaster(opts ...BroadcasterOption) EventBroadcaster { // - The context was nil. // - The context was context.Background() to begin with. // - // Both cases get checked here. - haveCtxCancelation := ctx.Done() == nil + // Both cases get checked here: we have cancelation if (and only if) there is a channel. + haveCtxCancelation := ctx.Done() != nil eventBroadcaster.cancelationCtx, eventBroadcaster.cancel = context.WithCancel(ctx) diff --git a/tools/record/event_test.go b/tools/record/event_test.go index f1bdef78e3..a988a4afc9 100644 --- a/tools/record/event_test.go +++ b/tools/record/event_test.go @@ -19,6 +19,7 @@ package record import ( "context" "encoding/json" + stderrors "errors" "fmt" "net/http" "strconv" @@ -26,6 +27,9 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "go.uber.org/goleak" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -34,6 +38,8 @@ import ( "k8s.io/client-go/kubernetes/scheme" restclient "k8s.io/client-go/rest" ref "k8s.io/client-go/tools/reference" + "k8s.io/klog/v2" + "k8s.io/klog/v2/ktesting" "k8s.io/utils/clock" testclocks "k8s.io/utils/clock/testing" ) @@ -104,13 +110,38 @@ func OnPatchFactory(testCache map[string]*v1.Event, patchEvent chan<- *v1.Event) } } +// newBroadcasterForTests creates a new broadcaster which produces per-test log +// output if StartStructuredLogging is used. Will be shut down automatically +// after the test. +func newBroadcasterForTests(tb testing.TB) EventBroadcaster { + _, ctx := ktesting.NewTestContext(tb) + caster := NewBroadcaster(WithSleepDuration(0), WithContext(ctx)) + tb.Cleanup(caster.Shutdown) + return caster +} + +func TestBroadcasterShutdown(t *testing.T) { + _, ctx := ktesting.NewTestContext(t) + ctx, cancel := context.WithCancelCause(ctx) + + // Start a broadcaster with background activity. + caster := NewBroadcaster(WithContext(ctx)) + caster.StartStructuredLogging(0) + + // Stop it. + cancel(stderrors.New("time to stop")) + + // Ensure that the broadcaster goroutine is not left running. + goleak.VerifyNone(t) +} + func TestNonRacyShutdown(t *testing.T) { // Attempt to simulate previously racy conditions, and ensure that no race // occurs: Nominally, calling "Eventf" *followed by* shutdown from the same // thread should be a safe operation, but it's not if we launch recorder.Action // in a goroutine. - caster := NewBroadcasterForTests(0) + caster := newBroadcasterForTests(t) clock := testclocks.NewFakeClock(time.Now()) recorder := recorderWithFakeClock(t, v1.EventSource{Component: "eventTest"}, caster, clock) @@ -151,14 +182,15 @@ func TestEventf(t *testing.T) { t.Fatal(err) } table := []struct { - obj k8sruntime.Object - eventtype string - reason string - messageFmt string - elements []interface{} - expect *v1.Event - expectLog string - expectUpdate bool + obj k8sruntime.Object + eventtype string + reason string + messageFmt string + elements []interface{} + expect *v1.Event + expectLog string + expectStructuredLog string + expectUpdate bool }{ { obj: testRef, @@ -186,7 +218,9 @@ func TestEventf(t *testing.T) { Count: 1, Type: v1.EventTypeNormal, }, - expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"bar", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[2]"}): type: 'Normal' reason: 'Started' some verbose message: 1`, + expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"bar", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[2]"}): type: 'Normal' reason: 'Started' some verbose message: 1`, + expectStructuredLog: `INFO Event occurred object="baz/foo" fieldPath="spec.containers[2]" kind="Pod" apiVersion="v1" type="Normal" reason="Started" message="some verbose message: 1" +`, expectUpdate: false, }, { @@ -214,7 +248,9 @@ func TestEventf(t *testing.T) { Count: 1, Type: v1.EventTypeNormal, }, - expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"bar", APIVersion:"v1", ResourceVersion:"", FieldPath:""}): type: 'Normal' reason: 'Killed' some other verbose message: 1`, + expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"bar", APIVersion:"v1", ResourceVersion:"", FieldPath:""}): type: 'Normal' reason: 'Killed' some other verbose message: 1`, + expectStructuredLog: `INFO Event occurred object="baz/foo" fieldPath="" kind="Pod" apiVersion="v1" type="Normal" reason="Killed" message="some other verbose message: 1" +`, expectUpdate: false, }, { @@ -243,7 +279,9 @@ func TestEventf(t *testing.T) { Count: 2, Type: v1.EventTypeNormal, }, - expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"bar", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[2]"}): type: 'Normal' reason: 'Started' some verbose message: 1`, + expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"bar", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[2]"}): type: 'Normal' reason: 'Started' some verbose message: 1`, + expectStructuredLog: `INFO Event occurred object="baz/foo" fieldPath="spec.containers[2]" kind="Pod" apiVersion="v1" type="Normal" reason="Started" message="some verbose message: 1" +`, expectUpdate: true, }, { @@ -272,7 +310,9 @@ func TestEventf(t *testing.T) { Count: 1, Type: v1.EventTypeNormal, }, - expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"differentUid", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[3]"}): type: 'Normal' reason: 'Started' some verbose message: 1`, + expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"differentUid", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[3]"}): type: 'Normal' reason: 'Started' some verbose message: 1`, + expectStructuredLog: `INFO Event occurred object="baz/foo" fieldPath="spec.containers[3]" kind="Pod" apiVersion="v1" type="Normal" reason="Started" message="some verbose message: 1" +`, expectUpdate: false, }, { @@ -301,7 +341,9 @@ func TestEventf(t *testing.T) { Count: 3, Type: v1.EventTypeNormal, }, - expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"bar", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[2]"}): type: 'Normal' reason: 'Started' some verbose message: 1`, + expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"bar", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[2]"}): type: 'Normal' reason: 'Started' some verbose message: 1`, + expectStructuredLog: `INFO Event occurred object="baz/foo" fieldPath="spec.containers[2]" kind="Pod" apiVersion="v1" type="Normal" reason="Started" message="some verbose message: 1" +`, expectUpdate: true, }, { @@ -330,7 +372,9 @@ func TestEventf(t *testing.T) { Count: 1, Type: v1.EventTypeNormal, }, - expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"differentUid", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[3]"}): type: 'Normal' reason: 'Stopped' some verbose message: 1`, + expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"differentUid", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[3]"}): type: 'Normal' reason: 'Stopped' some verbose message: 1`, + expectStructuredLog: `INFO Event occurred object="baz/foo" fieldPath="spec.containers[3]" kind="Pod" apiVersion="v1" type="Normal" reason="Stopped" message="some verbose message: 1" +`, expectUpdate: false, }, { @@ -359,7 +403,9 @@ func TestEventf(t *testing.T) { Count: 2, Type: v1.EventTypeNormal, }, - expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"differentUid", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[3]"}): type: 'Normal' reason: 'Stopped' some verbose message: 1`, + expectLog: `Event(v1.ObjectReference{Kind:"Pod", Namespace:"baz", Name:"foo", UID:"differentUid", APIVersion:"v1", ResourceVersion:"", FieldPath:"spec.containers[3]"}): type: 'Normal' reason: 'Stopped' some verbose message: 1`, + expectStructuredLog: `INFO Event occurred object="baz/foo" fieldPath="spec.containers[3]" kind="Pod" apiVersion="v1" type="Normal" reason="Stopped" message="some verbose message: 1" +`, expectUpdate: true, }, } @@ -377,23 +423,36 @@ func TestEventf(t *testing.T) { }, OnPatch: OnPatchFactory(testCache, patchEvent), } - eventBroadcaster := NewBroadcasterForTests(0) + logger := ktesting.NewLogger(t, ktesting.NewConfig(ktesting.BufferLogs(true))) + logSink := logger.GetSink().(ktesting.Underlier) + ctx := klog.NewContext(context.Background(), logger) + eventBroadcaster := NewBroadcaster(WithSleepDuration(0), WithContext(ctx)) + defer eventBroadcaster.Shutdown() sinkWatcher := eventBroadcaster.StartRecordingToSink(&testEvents) clock := testclocks.NewFakeClock(time.Now()) recorder := recorderWithFakeClock(t, v1.EventSource{Component: "eventTest"}, eventBroadcaster, clock) for index, item := range table { clock.Step(1 * time.Second) + //nolint:logcheck // Intentionally testing StartLogging here. logWatcher := eventBroadcaster.StartLogging(func(formatter string, args ...interface{}) { if e, a := item.expectLog, fmt.Sprintf(formatter, args...); e != a { t.Errorf("Expected '%v', got '%v'", e, a) } logCalled <- struct{}{} }) + oldEnd := len(logSink.GetBuffer().String()) + structuredLogWatcher := eventBroadcaster.StartStructuredLogging(0) recorder.Eventf(item.obj, item.eventtype, item.reason, item.messageFmt, item.elements...) <-logCalled + // We don't get notified by the structured test logger directly. + // Instead, we periodically check what new output it has produced. + assert.EventuallyWithT(t, func(t *assert.CollectT) { + assert.Equal(t, item.expectStructuredLog, logSink.GetBuffer().String()[oldEnd:], "new structured log output") + }, time.Minute, time.Millisecond) + // validate event if item.expectUpdate { actualEvent := <-patchEvent @@ -403,6 +462,7 @@ func TestEventf(t *testing.T) { validateEvent(strconv.Itoa(index), actualEvent, item.expect, t) } logWatcher.Stop() + structuredLogWatcher.Stop() } sinkWatcher.Stop() } @@ -561,8 +621,9 @@ func TestLotsOfEvents(t *testing.T) { }, } - eventBroadcaster := NewBroadcasterForTests(0) + eventBroadcaster := newBroadcasterForTests(t) sinkWatcher := eventBroadcaster.StartRecordingToSink(&testEvents) + //nolint:logcheck // Intentionally using StartLogging here to get notified. logWatcher := eventBroadcaster.StartLogging(func(formatter string, args ...interface{}) { loggerCalled <- struct{}{} }) @@ -658,7 +719,7 @@ func TestEventfNoNamespace(t *testing.T) { }, OnPatch: OnPatchFactory(testCache, patchEvent), } - eventBroadcaster := NewBroadcasterForTests(0) + eventBroadcaster := newBroadcasterForTests(t) sinkWatcher := eventBroadcaster.StartRecordingToSink(&testEvents) clock := testclocks.NewFakeClock(time.Now()) @@ -953,7 +1014,7 @@ func TestMultiSinkCache(t *testing.T) { OnPatch: OnPatchFactory(testCache2, patchEvent2), } - eventBroadcaster := NewBroadcasterForTests(0) + eventBroadcaster := newBroadcasterForTests(t) clock := testclocks.NewFakeClock(time.Now()) recorder := recorderWithFakeClock(t, v1.EventSource{Component: "eventTest"}, eventBroadcaster, clock) @@ -971,6 +1032,9 @@ func TestMultiSinkCache(t *testing.T) { validateEvent(strconv.Itoa(index), actualEvent, item.expect, t) } } + // Stop before creating more events, otherwise the On* callbacks above + // get stuck writing to the channel that we don't read from anymore. + sinkWatcher.Stop() // Another StartRecordingToSink call should start to record events with new clean cache. sinkWatcher2 := eventBroadcaster.StartRecordingToSink(&testEvents2) @@ -988,6 +1052,5 @@ func TestMultiSinkCache(t *testing.T) { } } - sinkWatcher.Stop() sinkWatcher2.Stop() } diff --git a/tools/record/main_test.go b/tools/record/main_test.go index 58f81f7491..04df262cee 100644 --- a/tools/record/main_test.go +++ b/tools/record/main_test.go @@ -17,10 +17,11 @@ limitations under the License. package record import ( - "os" "testing" + + "go.uber.org/goleak" ) func TestMain(m *testing.M) { - os.Exit(m.Run()) + goleak.VerifyTestMain(m) } From 3aa51ce5081ec93a1a983cbcc8651f2afc6ab8e8 Mon Sep 17 00:00:00 2001 From: Ben Luddy Date: Fri, 17 May 2024 13:02:26 -0400 Subject: [PATCH 043/159] Update indirect dependencies with ./hack/update-vendor.sh. Implementing custom marshaling on several API types for CBOR makes the upstream CBOR library an indirect dependency of several staging modules. Kubernetes-commit: d7cccf3e792ad08d9ab2e7aac394f8e6ddcf3466 --- go.mod | 12 ++++++++++-- go.sum | 15 +++++++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 9f0251c0bb..9163c051d1 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240529224029-d93eaf6729fd - k8s.io/apimachinery v0.0.0-20240529203233-63ab494c70e6 + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -38,6 +38,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/fxamacker/cbor/v2 v2.6.0 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect @@ -54,9 +55,16 @@ require ( github.com/onsi/gomega v1.33.1 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/x448/float16 v0.8.4 // indirect golang.org/x/sys v0.20.0 // indirect golang.org/x/text v0.15.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace ( + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go +) diff --git a/go.sum b/go.sum index 89e86974c8..e4680399d2 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,8 @@ +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -7,6 +10,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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/fxamacker/cbor/v2 v2.6.0 h1:sU6J2usfADwWlYDAFhZBQ6TnLFBHxgesMrQfQgk1tWA= +github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= @@ -95,6 +100,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +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/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -102,8 +109,10 @@ go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -138,6 +147,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -153,10 +163,7 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240529224029-d93eaf6729fd h1:voEDf2CuLj5eRTo2rz2qNJwYUP9aPfOZy21SA++W71Q= -k8s.io/api v0.0.0-20240529224029-d93eaf6729fd/go.mod h1:4/2Gq0qr5DtTHoaH7lfOKW6+ZMSOJwvVvbojJlldJh8= -k8s.io/apimachinery v0.0.0-20240529203233-63ab494c70e6 h1:MyOUvhoFRNxMeVhvXMui7xb2huAQiys6tlcNBzvPSb8= -k8s.io/apimachinery v0.0.0-20240529203233-63ab494c70e6/go.mod h1:ClkKrTMwhmMjgsEHpX2w3F+YKj0ctDOaAxqL7clxG0U= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 2f2b8000974dfdee82e4eab86770d4afa43e6eab Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Wed, 22 May 2024 10:22:09 +0200 Subject: [PATCH 044/159] dependencies: ginkgo v2.19.0, gomega v1.33.1 Ginkgo v2.18.0 allows tweaking the output so that it's easier to follow while a job runs in Prow (https://github.com/onsi/ginkgo/issues/1347). Using this in hack/ginkgo-e2e.sh will follow in a separate commit. Gomega gets bumped to the latest release to keep it up-to-date. Ginkgo v1.19.0 adds support for --label-filter with labels that represent sets (like our Feature:). Kubernetes-commit: 37e2dd6857084a172ef5210caee1fefa8dd8159a --- go.mod | 19 +++++++++++++------ go.sum | 49 +++++++++++++++++++++++++++---------------------- 2 files changed, 40 insertions(+), 28 deletions(-) diff --git a/go.mod b/go.mod index 4c28a3d3d3..430fb77acf 100644 --- a/go.mod +++ b/go.mod @@ -19,13 +19,13 @@ require ( github.com/peterbourgon/diskv v2.0.1+incompatible github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.4 - golang.org/x/net v0.23.0 + golang.org/x/net v0.25.0 golang.org/x/oauth2 v0.20.0 - golang.org/x/term v0.18.0 + golang.org/x/term v0.20.0 golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 - k8s.io/api v0.0.0-20240516203440-664bdd58a30d - k8s.io/apimachinery v0.0.0-20240523043213-5c8637dbd9df + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -50,11 +50,18 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect + github.com/onsi/gomega v1.33.1 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace ( + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go +) diff --git a/go.sum b/go.sum index c083475f7b..47226d484d 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,8 @@ +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -8,6 +11,7 @@ github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxER github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= @@ -16,8 +20,8 @@ github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2Kv github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +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/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= @@ -34,8 +38,8 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM= +github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -71,10 +75,10 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq 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.15.0 h1:79HwNRBAZHOEwrczrgSOPy+eFTTlIGELKy5as+ClttY= -github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= -github.com/onsi/gomega v1.31.0 h1:54UJxxj6cPInHS3a35wm6BK/F9nHYueZ1NVujHDrnXE= -github.com/onsi/gomega v1.31.0/go.mod h1:DW9aCi7U6Yi40wNVAvT6kzFnEVEI5n3DloYBiKiT6zk= +github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= +github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= +github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= +github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -94,19 +98,22 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -115,26 +122,27 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= +golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -148,10 +156,7 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240516203440-664bdd58a30d h1:0j0GmUGa2xvgJJiTzGQhNRKa2ByzpqDlBhggVRVmrfY= -k8s.io/api v0.0.0-20240516203440-664bdd58a30d/go.mod h1:GIl44YEE/I5fp0xgOEQrSjkLfe5trkF4SgIeRHHviOk= -k8s.io/apimachinery v0.0.0-20240523043213-5c8637dbd9df h1:8gUIgtpvsB04mpZKdHNcI0AVWYExv0LJNV1Rfrpp4Qs= -k8s.io/apimachinery v0.0.0-20240523043213-5c8637dbd9df/go.mod h1:+hpAhBheGa7Ub4X6JfKqjEeACgGYZqZv+ILGzigzVGU= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 98df4f79ac021fde43ac192b1679dde9a0ecc59d Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Wed, 22 May 2024 15:42:47 +0200 Subject: [PATCH 045/159] client-go/features: add Set method to envvar impl Kubernetes-commit: a07654baa54d53d7649e981c0c65eb8d1210e4af --- features/envvar.go | 62 +++++++++++++++-- features/envvar_test.go | 137 +++++++++++++++++++++++++++++--------- features/features_test.go | 9 +++ 3 files changed, 172 insertions(+), 36 deletions(-) diff --git a/features/envvar.go b/features/envvar.go index f9edfdf0d9..8c3f887dc4 100644 --- a/features/envvar.go +++ b/features/envvar.go @@ -47,6 +47,10 @@ var _ Gates = &envVarFeatureGates{} // // Please note that environmental variables can only be set to the boolean value. // Incorrect values will be ignored and logged. +// +// Features can also be set directly via the Set method. +// In that case, these features take precedence over +// features set via environmental variables. func newEnvVarFeatureGates(features map[Feature]FeatureSpec) *envVarFeatureGates { known := map[Feature]FeatureSpec{} for name, spec := range features { @@ -57,7 +61,8 @@ func newEnvVarFeatureGates(features map[Feature]FeatureSpec) *envVarFeatureGates callSiteName: naming.GetNameFromCallsite(internalPackages...), known: known, } - fg.enabled.Store(map[Feature]bool{}) + fg.enabledViaEnvVar.Store(map[Feature]bool{}) + fg.enabledViaSetMethod = map[Feature]bool{} return fg } @@ -74,17 +79,34 @@ type envVarFeatureGates struct { // known holds known feature gates known map[Feature]FeatureSpec - // enabled holds a map[Feature]bool + // enabledViaEnvVar holds a map[Feature]bool // with values explicitly set via env var - enabled atomic.Value + enabledViaEnvVar atomic.Value + + // lockEnabledViaSetMethod protects enabledViaSetMethod + lockEnabledViaSetMethod sync.RWMutex + + // enabledViaSetMethod holds values explicitly set + // via Set method, features stored in this map take + // precedence over features stored in enabledViaEnvVar + enabledViaSetMethod map[Feature]bool // readEnvVars holds the boolean value which // indicates whether readEnvVarsOnce has been called. readEnvVars atomic.Bool } -// Enabled returns true if the key is enabled. If the key is not known, this call will panic. +// Enabled returns true if the key is enabled. If the key is not known, this call will panic. func (f *envVarFeatureGates) Enabled(key Feature) bool { + if v, ok := f.wasFeatureEnabledViaSetMethod(key); ok { + // ensue that the state of all known features + // is loaded from environment variables + // on the first call to Enabled method. + if !f.hasAlreadyReadEnvVar() { + _ = f.getEnabledMapFromEnvVar() + } + return v + } if v, ok := f.getEnabledMapFromEnvVar()[key]; ok { return v } @@ -94,6 +116,26 @@ func (f *envVarFeatureGates) Enabled(key Feature) bool { panic(fmt.Errorf("feature %q is not registered in FeatureGates %q", key, f.callSiteName)) } +// Set sets the given feature to the given value. +// +// Features set via this method take precedence over +// the features set via environment variables. +func (f *envVarFeatureGates) Set(featureName Feature, featureValue bool) error { + feature, ok := f.known[featureName] + if !ok { + return fmt.Errorf("feature %q is not registered in FeatureGates %q", featureName, f.callSiteName) + } + if feature.LockToDefault && feature.Default != featureValue { + return fmt.Errorf("cannot set feature gate %q to %v, feature is locked to %v", featureName, featureValue, feature.Default) + } + + f.lockEnabledViaSetMethod.Lock() + defer f.lockEnabledViaSetMethod.Unlock() + f.enabledViaSetMethod[featureName] = featureValue + + return nil +} + // getEnabledMapFromEnvVar will fill the enabled map on the first call. // This is the only time a known feature can be set to a value // read from the corresponding environmental variable. @@ -119,7 +161,7 @@ func (f *envVarFeatureGates) getEnabledMapFromEnvVar() map[Feature]bool { featureGatesState[feature] = boolVal } } - f.enabled.Store(featureGatesState) + f.enabledViaEnvVar.Store(featureGatesState) f.readEnvVars.Store(true) for feature, featureSpec := range f.known { @@ -130,7 +172,15 @@ func (f *envVarFeatureGates) getEnabledMapFromEnvVar() map[Feature]bool { klog.V(1).InfoS("Feature gate default state", "feature", feature, "enabled", featureSpec.Default) } }) - return f.enabled.Load().(map[Feature]bool) + return f.enabledViaEnvVar.Load().(map[Feature]bool) +} + +func (f *envVarFeatureGates) wasFeatureEnabledViaSetMethod(key Feature) (bool, bool) { + f.lockEnabledViaSetMethod.RLock() + defer f.lockEnabledViaSetMethod.RUnlock() + + value, found := f.enabledViaSetMethod[key] + return value, found } func (f *envVarFeatureGates) hasAlreadyReadEnvVar() bool { diff --git a/features/envvar_test.go b/features/envvar_test.go index 247c7cb799..87a12da592 100644 --- a/features/envvar_test.go +++ b/features/envvar_test.go @@ -23,21 +23,21 @@ import ( "github.com/stretchr/testify/require" ) +var defaultTestFeatures = map[Feature]FeatureSpec{ + "TestAlpha": { + Default: false, + LockToDefault: false, + PreRelease: "Alpha", + }, + "TestBeta": { + Default: true, + LockToDefault: false, + PreRelease: "Beta", + }, +} + func TestEnvVarFeatureGates(t *testing.T) { - defaultTestFeatures := map[Feature]FeatureSpec{ - "TestAlpha": { - Default: false, - LockToDefault: false, - PreRelease: "Alpha", - }, - "TestBeta": { - Default: true, - LockToDefault: false, - PreRelease: "Beta", - }, - } expectedDefaultFeaturesState := map[Feature]bool{"TestAlpha": false, "TestBeta": true} - copyExpectedStateMap := func(toCopy map[Feature]bool) map[Feature]bool { m := map[Feature]bool{} for k, v := range toCopy { @@ -47,11 +47,14 @@ func TestEnvVarFeatureGates(t *testing.T) { } scenarios := []struct { - name string - features map[Feature]FeatureSpec - envVariables map[string]string - expectedFeaturesState map[Feature]bool - expectedInternalEnabledFeatureState map[Feature]bool + name string + features map[Feature]FeatureSpec + envVariables map[string]string + setMethodFeatures map[Feature]bool + + expectedFeaturesState map[Feature]bool + expectedInternalEnabledViaEnvVarFeatureState map[Feature]bool + expectedInternalEnabledViaSetMethodFeatureState map[Feature]bool }{ { name: "can add empty features", @@ -76,7 +79,7 @@ func TestEnvVarFeatureGates(t *testing.T) { expectedDefaultFeaturesStateCopy["TestAlpha"] = true return expectedDefaultFeaturesStateCopy }(), - expectedInternalEnabledFeatureState: map[Feature]bool{"TestAlpha": true}, + expectedInternalEnabledViaEnvVarFeatureState: map[Feature]bool{"TestAlpha": true}, }, { name: "incorrect env var value gets ignored", @@ -111,9 +114,25 @@ func TestEnvVarFeatureGates(t *testing.T) { PreRelease: "Alpha", }, }, - envVariables: map[string]string{"KUBE_FEATURE_TestAlpha": "True"}, - expectedFeaturesState: map[Feature]bool{"TestAlpha": true}, - expectedInternalEnabledFeatureState: map[Feature]bool{"TestAlpha": true}, + envVariables: map[string]string{"KUBE_FEATURE_TestAlpha": "True"}, + expectedFeaturesState: map[Feature]bool{"TestAlpha": true}, + expectedInternalEnabledViaEnvVarFeatureState: map[Feature]bool{"TestAlpha": true}, + }, + { + name: "setting a feature via the Set method works", + features: defaultTestFeatures, + setMethodFeatures: map[Feature]bool{"TestAlpha": true}, + expectedFeaturesState: map[Feature]bool{"TestAlpha": true}, + expectedInternalEnabledViaSetMethodFeatureState: map[Feature]bool{"TestAlpha": true}, + }, + { + name: "setting a feature via the Set method wins", + features: defaultTestFeatures, + setMethodFeatures: map[Feature]bool{"TestAlpha": false}, + envVariables: map[string]string{"KUBE_FEATURE_TestAlpha": "True"}, + expectedFeaturesState: map[Feature]bool{"TestAlpha": false}, + expectedInternalEnabledViaEnvVarFeatureState: map[Feature]bool{"TestAlpha": true}, + expectedInternalEnabledViaSetMethodFeatureState: map[Feature]bool{"TestAlpha": false}, }, } for _, scenario := range scenarios { @@ -123,20 +142,33 @@ func TestEnvVarFeatureGates(t *testing.T) { } target := newEnvVarFeatureGates(scenario.features) + for k, v := range scenario.setMethodFeatures { + err := target.Set(k, v) + require.NoError(t, err) + } for expectedFeature, expectedValue := range scenario.expectedFeaturesState { actualValue := target.Enabled(expectedFeature) require.Equal(t, actualValue, expectedValue, "expected feature=%v, to be=%v, not=%v", expectedFeature, expectedValue, actualValue) } - enabledInternalMap := target.enabled.Load().(map[Feature]bool) - require.Len(t, enabledInternalMap, len(scenario.expectedInternalEnabledFeatureState)) - - for expectedFeature, expectedInternalPresence := range scenario.expectedInternalEnabledFeatureState { - featureInternalValue, featureSet := enabledInternalMap[expectedFeature] - require.Equal(t, expectedInternalPresence, featureSet, "feature %v present = %v, expected = %v", expectedFeature, featureSet, expectedInternalPresence) + enabledViaEnvVarInternalMap := target.enabledViaEnvVar.Load().(map[Feature]bool) + require.Len(t, enabledViaEnvVarInternalMap, len(scenario.expectedInternalEnabledViaEnvVarFeatureState)) + for expectedFeatureName, expectedFeatureValue := range scenario.expectedInternalEnabledViaEnvVarFeatureState { + actualFeatureValue, wasExpectedFeatureFound := enabledViaEnvVarInternalMap[expectedFeatureName] + if !wasExpectedFeatureFound { + t.Errorf("feature %v has not been found in enabledViaEnvVarInternalMap", expectedFeatureName) + } + require.Equal(t, expectedFeatureValue, actualFeatureValue, "feature %v has incorrect value = %v, expected = %v", expectedFeatureName, actualFeatureValue, expectedFeatureValue) + } - expectedFeatureInternalValue := scenario.expectedFeaturesState[expectedFeature] - require.Equal(t, expectedFeatureInternalValue, featureInternalValue) + enabledViaSetMethodInternalMap := target.enabledViaSetMethod + require.Len(t, enabledViaSetMethodInternalMap, len(scenario.expectedInternalEnabledViaSetMethodFeatureState)) + for expectedFeatureName, expectedFeatureValue := range scenario.expectedInternalEnabledViaSetMethodFeatureState { + actualFeatureValue, wasExpectedFeatureFound := enabledViaSetMethodInternalMap[expectedFeatureName] + if !wasExpectedFeatureFound { + t.Errorf("feature %v has not been found in enabledViaSetMethod", expectedFeatureName) + } + require.Equal(t, expectedFeatureValue, actualFeatureValue, "feature %v has incorrect value = %v, expected = %v", expectedFeatureName, actualFeatureValue, expectedFeatureValue) } }) } @@ -154,3 +186,48 @@ func TestHasAlreadyReadEnvVar(t *testing.T) { _ = target.getEnabledMapFromEnvVar() require.True(t, target.hasAlreadyReadEnvVar()) } + +func TestEnvVarFeatureGatesSetNegative(t *testing.T) { + scenarios := []struct { + name string + features map[Feature]FeatureSpec + featureName Feature + featureValue bool + + expectedErr func(string) error + }{ + { + name: "empty feature name returns an error", + features: defaultTestFeatures, + expectedErr: func(callSiteName string) error { + return fmt.Errorf("feature %q is not registered in FeatureGates %q", "", callSiteName) + }, + }, + { + name: "setting unknown feature returns an error", + features: defaultTestFeatures, + featureName: "Unknown", + expectedErr: func(callSiteName string) error { + return fmt.Errorf("feature %q is not registered in FeatureGates %q", "Unknown", callSiteName) + }, + }, + { + name: "setting locked feature returns an error", + features: map[Feature]FeatureSpec{"LockedFeature": {LockToDefault: true, Default: true}}, + featureName: "LockedFeature", + featureValue: false, + expectedErr: func(_ string) error { + return fmt.Errorf("cannot set feature gate %q to %v, feature is locked to %v", "LockedFeature", false, true) + }, + }, + } + + for _, scenario := range scenarios { + t.Run(scenario.name, func(t *testing.T) { + target := newEnvVarFeatureGates(scenario.features) + + err := target.Set(scenario.featureName, scenario.featureValue) + require.Equal(t, scenario.expectedErr(target.callSiteName), err) + }) + } +} diff --git a/features/features_test.go b/features/features_test.go index a6089be5cd..5a68303768 100644 --- a/features/features_test.go +++ b/features/features_test.go @@ -30,6 +30,15 @@ func TestAddFeaturesToExistingFeatureGates(t *testing.T) { require.Equal(t, defaultKubernetesFeatureGates, fakeFeatureGates.specs) } +func TestReplaceFeatureGatesWithWarningIndicator(t *testing.T) { + defaultFeatureGates := FeatureGates() + require.Panics(t, func() { defaultFeatureGates.Enabled("Foo") }, "reading an unregistered feature gate Foo should panic") + + if !replaceFeatureGatesWithWarningIndicator(defaultFeatureGates) { + t.Error("replacing the default feature gates after reading a value hasn't produced a warning") + } +} + type fakeRegistry struct { specs map[Feature]FeatureSpec } From e8eae94e4533342fef912a684c466ded8415577d Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Thu, 23 May 2024 14:44:11 +0200 Subject: [PATCH 046/159] client-go/features/testing: intro SetFeatureGatesDuringTest Kubernetes-commit: 3d97808b95b355bb8e56d4d720342e9a7ab95ced --- features/testing/features.go | 90 ++++++++++++++++++++ features/testing/features_init_test.go | 113 +++++++++++++++++++++++-- 2 files changed, 196 insertions(+), 7 deletions(-) create mode 100644 features/testing/features.go diff --git a/features/testing/features.go b/features/testing/features.go new file mode 100644 index 0000000000..4f4c3ed4de --- /dev/null +++ b/features/testing/features.go @@ -0,0 +1,90 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package testing + +import ( + "fmt" + "strings" + "sync" + "testing" + + clientfeatures "k8s.io/client-go/features" +) + +var ( + overriddenFeaturesLock sync.Mutex + overriddenFeatures map[clientfeatures.Feature]string +) + +func init() { + overriddenFeatures = map[clientfeatures.Feature]string{} +} + +type featureGatesSetter interface { + clientfeatures.Gates + + Set(clientfeatures.Feature, bool) error +} + +// SetFeatureDuringTest sets the specified feature to the specified value for the duration of the test. +// +// Example use: +// +// clientfeaturestesting.SetFeatureDuringTest(t, clientfeatures.WatchListClient, true) +func SetFeatureDuringTest(tb testing.TB, feature clientfeatures.Feature, featureValue bool) { + if err := setFeatureDuringTestInternal(tb, feature, featureValue); err != nil { + tb.Fatal(err) + } +} + +func setFeatureDuringTestInternal(tb testing.TB, feature clientfeatures.Feature, featureValue bool) error { + overriddenFeaturesLock.Lock() + defer overriddenFeaturesLock.Unlock() + + currentFeatureGates := clientfeatures.FeatureGates() + featureGates, ok := currentFeatureGates.(featureGatesSetter) + if !ok { + panic(fmt.Errorf("clientfeatures.FeatureGates(): %T does not implement featureGatesSetter interface", currentFeatureGates)) + } + + originalFeatureValue := featureGates.Enabled(feature) + if overridingTestName, ok := overriddenFeatures[feature]; ok { + if !sameTestOrSubtest(tb, overridingTestName) { + return fmt.Errorf("client-go feature %q is currently overridden by %q test and cannot be also modified by %q", feature, overridingTestName, tb.Name()) + } + } + + if err := featureGates.Set(feature, featureValue); err != nil { + return err + } + overriddenFeatures[feature] = tb.Name() + + tb.Cleanup(func() { + overriddenFeaturesLock.Lock() + defer overriddenFeaturesLock.Unlock() + delete(overriddenFeatures, feature) + if err := featureGates.Set(feature, originalFeatureValue); err != nil { + tb.Errorf("failed restoring client-go feature: %v to its original value: %v, err: %v", feature, originalFeatureValue, err) + } + }) + return nil +} + +// copied from component-base/featuregate/testing +func sameTestOrSubtest(tb testing.TB, testName string) bool { + return tb.Name() == testName || strings.HasPrefix(tb.Name(), testName+"/") +} diff --git a/features/testing/features_init_test.go b/features/testing/features_init_test.go index bc22e58b6e..5048f9df9e 100644 --- a/features/testing/features_init_test.go +++ b/features/testing/features_init_test.go @@ -30,24 +30,123 @@ func TestDriveInitDefaultFeatureGates(t *testing.T) { featureGates := features.FeatureGates() assertFunctionPanicsWithMessage(t, func() { featureGates.Enabled("FakeFeatureGate") }, "features.FeatureGates().Enabled", fmt.Sprintf("feature %q is not registered in FeatureGate", "FakeFeatureGate")) - fakeFeatureGates := &alwaysEnabledFakeGates{} - require.True(t, fakeFeatureGates.Enabled("FakeFeatureGate")) + fakeGates := &fakeFeatureGates{features: map[features.Feature]bool{"FakeFeatureGate": true}} + require.True(t, fakeGates.Enabled("FakeFeatureGate")) - features.ReplaceFeatureGates(fakeFeatureGates) + features.ReplaceFeatureGates(fakeGates) featureGates = features.FeatureGates() assertFeatureGatesType(t, featureGates) require.True(t, featureGates.Enabled("FakeFeatureGate")) } -type alwaysEnabledFakeGates struct{} +func TestSetFeatureGatesDuringTest(t *testing.T) { + featureA := features.Feature("FeatureA") + featureB := features.Feature("FeatureB") + fakeGates := &fakeFeatureGates{map[features.Feature]bool{featureA: true, featureB: true}} + features.ReplaceFeatureGates(fakeGates) + t.Cleanup(func() { + // since cleanup functions will be called in last added, first called order. + // check if the original feature wasn't restored + require.True(t, features.FeatureGates().Enabled(featureA), "the original feature = %v wasn't restored", featureA) + }) + + SetFeatureDuringTest(t, featureA, false) + + require.False(t, features.FeatureGates().Enabled(featureA)) + require.True(t, features.FeatureGates().Enabled(featureB)) +} + +func TestSetFeatureGatesDuringTestPanics(t *testing.T) { + fakeGates := &fakeFeatureGates{features: map[features.Feature]bool{"FakeFeatureGate": true}} + + features.ReplaceFeatureGates(fakeGates) + assertFunctionPanicsWithMessage(t, func() { SetFeatureDuringTest(t, "UnknownFeature", false) }, "SetFeatureDuringTest", fmt.Sprintf("feature %q is not registered in featureGates", "UnknownFeature")) + + readOnlyGates := &readOnlyAlwaysDisabledFeatureGates{} + features.ReplaceFeatureGates(readOnlyGates) + assertFunctionPanicsWithMessage(t, func() { SetFeatureDuringTest(t, "FakeFeature", false) }, "SetFeatureDuringTest", fmt.Sprintf("clientfeatures.FeatureGates(): %T does not implement featureGatesSetter interface", readOnlyGates)) +} + +func TestOverridesForSetFeatureGatesDuringTest(t *testing.T) { + scenarios := []struct { + name string + firstTestName string + secondTestName string + expectError bool + }{ + { + name: "concurrent tests setting the same feature fail", + firstTestName: "fooTest", + secondTestName: "barTest", + expectError: true, + }, + + { + name: "same test setting the same feature does not fail", + firstTestName: "fooTest", + secondTestName: "fooTest", + expectError: false, + }, + + { + name: "subtests setting the same feature don't not fail", + firstTestName: "fooTest", + secondTestName: "fooTest/scenario1", + expectError: false, + }, + } + for _, scenario := range scenarios { + t.Run(scenario.name, func(t *testing.T) { + featureA := features.Feature("FeatureA") + fakeGates := &fakeFeatureGates{map[features.Feature]bool{featureA: true}} + fakeTesting := &fakeT{fakeTestName: scenario.firstTestName, TB: t} + + features.ReplaceFeatureGates(fakeGates) + require.NoError(t, setFeatureDuringTestInternal(fakeTesting, featureA, true)) + require.True(t, features.FeatureGates().Enabled(featureA)) + + fakeTesting.fakeTestName = scenario.secondTestName + err := setFeatureDuringTestInternal(fakeTesting, featureA, false) + require.Equal(t, scenario.expectError, err != nil) + }) + } +} + +type fakeFeatureGates struct { + features map[features.Feature]bool +} + +func (f *fakeFeatureGates) Enabled(feature features.Feature) bool { + featureValue, ok := f.features[feature] + if !ok { + panic(fmt.Errorf("feature %q is not registered in featureGates", feature)) + } + return featureValue +} + +func (f *fakeFeatureGates) Set(feature features.Feature, value bool) error { + f.features[feature] = value + return nil +} + +type readOnlyAlwaysDisabledFeatureGates struct{} + +func (f *readOnlyAlwaysDisabledFeatureGates) Enabled(feature features.Feature) bool { + return false +} + +type fakeT struct { + fakeTestName string + testing.TB +} -func (f *alwaysEnabledFakeGates) Enabled(features.Feature) bool { - return true +func (t *fakeT) Name() string { + return t.fakeTestName } func assertFeatureGatesType(t *testing.T, fg features.Gates) { - _, ok := fg.(*alwaysEnabledFakeGates) + _, ok := fg.(*fakeFeatureGates) if !ok { t.Fatalf("passed features.FeatureGates() is NOT of type *alwaysEnabledFakeGates, it is of type = %T", fg) } From e89e40c1870b5a50fe71d26be26e3e8c29e744b6 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Thu, 23 May 2024 16:33:43 +0200 Subject: [PATCH 047/159] client-go/rest: add TestWatchListWhenFeatureGateDisabled unit test Kubernetes-commit: 8c0c1f720182f138c3151d3d67a80fa67b86a240 --- rest/request_watchlist_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/rest/request_watchlist_test.go b/rest/request_watchlist_test.go index 4ebfe81bb0..badd871fab 100644 --- a/rest/request_watchlist_test.go +++ b/rest/request_watchlist_test.go @@ -31,6 +31,8 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/watch" + clientfeatures "k8s.io/client-go/features" + clientfeaturestesting "k8s.io/client-go/features/testing" ) func TestWatchListResult(t *testing.T) { @@ -320,6 +322,22 @@ func TestWatchListFailure(t *testing.T) { } } +func TestWatchListWhenFeatureGateDisabled(t *testing.T) { + clientfeaturestesting.SetFeatureDuringTest(t, clientfeatures.WatchListClient, false) + expectedError := fmt.Errorf("%q feature gate is not enabled", clientfeatures.WatchListClient) + target := &Request{} + + res := target.WatchList(context.TODO()) + + resErr := res.Into(nil) + if resErr == nil { + t.Fatal("expected to get an error, got nil") + } + if resErr.Error() != expectedError.Error() { + t.Fatalf("unexpected error: %v, expected: %v", resErr, expectedError) + } +} + func makePod(rv uint64) *v1.Pod { return &v1.Pod{ ObjectMeta: metav1.ObjectMeta{ From 0123e78ef6df9bf9af410f136ac991bba2839d9b Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Mon, 27 May 2024 01:27:26 -0700 Subject: [PATCH 048/159] Merge pull request #124446 from p0lyn0mial/watch-list-consistency-detector-more-generic client-go/consistency-detector: change the signature of checkWatchListConsistencyIfRequested Kubernetes-commit: f5d62f738a686ddc6221a85374113af80790129e --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 339c3da9a6..4c28a3d3d3 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 k8s.io/api v0.0.0-20240516203440-664bdd58a30d - k8s.io/apimachinery v0.0.0-20240510224318-1da46c3f5a5b + k8s.io/apimachinery v0.0.0-20240523043213-5c8637dbd9df k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b diff --git a/go.sum b/go.sum index 368f51c5a7..c083475f7b 100644 --- a/go.sum +++ b/go.sum @@ -150,8 +150,8 @@ 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.0.0-20240516203440-664bdd58a30d h1:0j0GmUGa2xvgJJiTzGQhNRKa2ByzpqDlBhggVRVmrfY= k8s.io/api v0.0.0-20240516203440-664bdd58a30d/go.mod h1:GIl44YEE/I5fp0xgOEQrSjkLfe5trkF4SgIeRHHviOk= -k8s.io/apimachinery v0.0.0-20240510224318-1da46c3f5a5b h1:UTQPecSyfYRHmREs/0iVer4dQClGGZuYKTyHqOAScYQ= -k8s.io/apimachinery v0.0.0-20240510224318-1da46c3f5a5b/go.mod h1:+hpAhBheGa7Ub4X6JfKqjEeACgGYZqZv+ILGzigzVGU= +k8s.io/apimachinery v0.0.0-20240523043213-5c8637dbd9df h1:8gUIgtpvsB04mpZKdHNcI0AVWYExv0LJNV1Rfrpp4Qs= +k8s.io/apimachinery v0.0.0-20240523043213-5c8637dbd9df/go.mod h1:+hpAhBheGa7Ub4X6JfKqjEeACgGYZqZv+ILGzigzVGU= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 00036b79c414e3b294fb5a0c0e9cde8d51637240 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Mon, 27 May 2024 11:10:00 +0200 Subject: [PATCH 049/159] client-go/tools/cache/reflector_data_consistency_detector: refactor unit tests Kubernetes-commit: 18837d60ae12ac70380ce5cf21cfd8e0d221263a --- ...eflector_data_consistency_detector_test.go | 58 ++++++++++--------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/tools/cache/reflector_data_consistency_detector_test.go b/tools/cache/reflector_data_consistency_detector_test.go index a878e488b3..81affb75d7 100644 --- a/tools/cache/reflector_data_consistency_detector_test.go +++ b/tools/cache/reflector_data_consistency_detector_test.go @@ -26,8 +26,6 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/apimachinery/pkg/watch" "k8s.io/utils/ptr" ) @@ -35,8 +33,8 @@ func TestDataConsistencyChecker(t *testing.T) { scenarios := []struct { name string - podList *v1.PodList - storeContent []*v1.Pod + listResponse *v1.PodList + retrievedItems []*v1.Pod requestOptions metav1.ListOptions expectedRequestOptions []metav1.ListOptions @@ -45,12 +43,12 @@ func TestDataConsistencyChecker(t *testing.T) { }{ { name: "data consistency check won't panic when data is consistent", - podList: &v1.PodList{ + listResponse: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "2"}, Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2")}, }, requestOptions: metav1.ListOptions{TimeoutSeconds: ptr.To(int64(39))}, - storeContent: []*v1.Pod{makePod("p1", "1"), makePod("p2", "2")}, + retrievedItems: []*v1.Pod{makePod("p1", "1"), makePod("p2", "2")}, expectedListRequests: 1, expectedRequestOptions: []metav1.ListOptions{ { @@ -63,7 +61,7 @@ func TestDataConsistencyChecker(t *testing.T) { { name: "data consistency check won't panic when there is no data", - podList: &v1.PodList{ + listResponse: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "2"}, }, requestOptions: metav1.ListOptions{TimeoutSeconds: ptr.To(int64(39))}, @@ -79,12 +77,12 @@ func TestDataConsistencyChecker(t *testing.T) { { name: "data consistency panics when data is inconsistent", - podList: &v1.PodList{ + listResponse: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "2"}, Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2"), *makePod("p3", "3")}, }, requestOptions: metav1.ListOptions{TimeoutSeconds: ptr.To(int64(39))}, - storeContent: []*v1.Pod{makePod("p1", "1"), makePod("p2", "2")}, + retrievedItems: []*v1.Pod{makePod("p1", "1"), makePod("p2", "2")}, expectedListRequests: 1, expectedRequestOptions: []metav1.ListOptions{ { @@ -99,23 +97,22 @@ func TestDataConsistencyChecker(t *testing.T) { for _, scenario := range scenarios { t.Run(scenario.name, func(t *testing.T) { - listWatcher, store, _, stopCh := testData() - ctx := wait.ContextForChannel(stopCh) - for _, obj := range scenario.storeContent { - require.NoError(t, store.Add(obj)) + ctx := context.TODO() + fakeLister := &listWrapper{response: scenario.listResponse} + retrievedItemsFunc := func() []*v1.Pod { + return scenario.retrievedItems } - listWatcher.customListResponse = scenario.podList if scenario.expectPanic { require.Panics(t, func() { - checkDataConsistency(ctx, "", scenario.podList.ResourceVersion, wrapListFuncWithContext(listWatcher.List), scenario.requestOptions, store.List) + checkDataConsistency(ctx, "", scenario.listResponse.ResourceVersion, fakeLister.List, scenario.requestOptions, retrievedItemsFunc) }) } else { - checkDataConsistency(ctx, "", scenario.podList.ResourceVersion, wrapListFuncWithContext(listWatcher.List), scenario.requestOptions, store.List) + checkDataConsistency(ctx, "", scenario.listResponse.ResourceVersion, fakeLister.List, scenario.requestOptions, retrievedItemsFunc) } - verifyListCounter(t, listWatcher, scenario.expectedListRequests) - verifyRequestOptions(t, listWatcher, scenario.expectedRequestOptions) + require.Equal(t, fakeLister.counter, scenario.expectedListRequests) + require.Equal(t, fakeLister.requestOptions, scenario.expectedRequestOptions) }) } } @@ -126,14 +123,15 @@ func TestDriveWatchLisConsistencyIfRequired(t *testing.T) { } func TestDataConsistencyCheckerRetry(t *testing.T) { - store := NewStore(MetaNamespaceKeyFunc) ctx := context.TODO() - + retrievedItemsFunc := func() []*v1.Pod { + return nil + } stopListErrorAfter := 5 - errLister := &errorLister{stopErrorAfter: stopListErrorAfter} + fakeErrLister := &errorLister{stopErrorAfter: stopListErrorAfter} - checkDataConsistency(ctx, "", "", wrapListFuncWithContext(errLister.List), metav1.ListOptions{}, store.List) - require.Equal(t, errLister.listCounter, errLister.stopErrorAfter) + checkDataConsistency(ctx, "", "", fakeErrLister.List, metav1.ListOptions{}, retrievedItemsFunc) + require.Equal(t, fakeErrLister.listCounter, fakeErrLister.stopErrorAfter) } type errorLister struct { @@ -141,7 +139,7 @@ type errorLister struct { stopErrorAfter int } -func (lw *errorLister) List(_ metav1.ListOptions) (runtime.Object, error) { +func (lw *errorLister) List(_ context.Context, _ metav1.ListOptions) (runtime.Object, error) { lw.listCounter++ if lw.listCounter == lw.stopErrorAfter { return &v1.PodList{}, nil @@ -149,6 +147,14 @@ func (lw *errorLister) List(_ metav1.ListOptions) (runtime.Object, error) { return nil, fmt.Errorf("nasty error") } -func (lw *errorLister) Watch(_ metav1.ListOptions) (watch.Interface, error) { - panic("not implemented") +type listWrapper struct { + counter int + requestOptions []metav1.ListOptions + response *v1.PodList +} + +func (lw *listWrapper) List(_ context.Context, opts metav1.ListOptions) (*v1.PodList, error) { + lw.counter++ + lw.requestOptions = append(lw.requestOptions, opts) + return lw.response, nil } From fd6b8e65512939de29308d52ee75b9eca083f064 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Mon, 27 May 2024 03:26:50 -0700 Subject: [PATCH 050/159] Merge pull request #125144 from p0lyn0mial/upstream-client-go-consistency-detector-refactor-units client-go/tools/cache/reflector_data_consistency_detector: refactor unit tests Kubernetes-commit: 58fe98e2cc7f8efac886765af230a48285d7b9b6 From e428fc295cffb733afb7e183f7b451f609e53e1e Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Mon, 27 May 2024 11:10:43 +0200 Subject: [PATCH 051/159] move client-go/tools/cache/reflector_data_consistency_detector to client-go/util/consistencydetector Kubernetes-commit: 272dfc9d7e61481dfcdc4d6a021385d9cd85ba5f --- .../consistencydetector/data_consistency_detector.go | 0 .../consistencydetector/data_consistency_detector_test.go | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename tools/cache/reflector_data_consistency_detector.go => util/consistencydetector/data_consistency_detector.go (100%) rename tools/cache/reflector_data_consistency_detector_test.go => util/consistencydetector/data_consistency_detector_test.go (100%) diff --git a/tools/cache/reflector_data_consistency_detector.go b/util/consistencydetector/data_consistency_detector.go similarity index 100% rename from tools/cache/reflector_data_consistency_detector.go rename to util/consistencydetector/data_consistency_detector.go diff --git a/tools/cache/reflector_data_consistency_detector_test.go b/util/consistencydetector/data_consistency_detector_test.go similarity index 100% rename from tools/cache/reflector_data_consistency_detector_test.go rename to util/consistencydetector/data_consistency_detector_test.go From 92f0985ce1b048b4f2fee3367485359ca9c7e30b Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Mon, 27 May 2024 11:13:18 +0200 Subject: [PATCH 052/159] client-go/util/consistencydetector: update after moving to the new package Kubernetes-commit: faf5110c8a2394f9d098da6e5097ce6deed1b18b --- util/consistencydetector/data_consistency_detector.go | 2 +- util/consistencydetector/data_consistency_detector_test.go | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/util/consistencydetector/data_consistency_detector.go b/util/consistencydetector/data_consistency_detector.go index 0aacee4a06..ce5348381f 100644 --- a/util/consistencydetector/data_consistency_detector.go +++ b/util/consistencydetector/data_consistency_detector.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package cache +package consistencydetector import ( "context" diff --git a/util/consistencydetector/data_consistency_detector_test.go b/util/consistencydetector/data_consistency_detector_test.go index 81affb75d7..8ce0e31276 100644 --- a/util/consistencydetector/data_consistency_detector_test.go +++ b/util/consistencydetector/data_consistency_detector_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package cache +package consistencydetector import ( "context" @@ -26,6 +26,7 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/types" "k8s.io/utils/ptr" ) @@ -158,3 +159,7 @@ func (lw *listWrapper) List(_ context.Context, opts metav1.ListOptions) (*v1.Pod lw.requestOptions = append(lw.requestOptions, opts) return lw.response, nil } + +func makePod(name, rv string) *v1.Pod { + return &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: name, ResourceVersion: rv, UID: types.UID(name)}} +} From e6e45e172b0dd760852f0b264f40b97a02d053b6 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Mon, 27 May 2024 11:16:17 +0200 Subject: [PATCH 053/159] client-go/util/consistencydetector: make the detector public Kubernetes-commit: e421046f64c90b58577a79f92dd463ab03479d79 --- .../consistencydetector/data_consistency_detector.go | 12 ++++++------ .../data_consistency_detector_test.go | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/util/consistencydetector/data_consistency_detector.go b/util/consistencydetector/data_consistency_detector.go index ce5348381f..084f13226f 100644 --- a/util/consistencydetector/data_consistency_detector.go +++ b/util/consistencydetector/data_consistency_detector.go @@ -39,9 +39,9 @@ func init() { dataConsistencyDetectionForWatchListEnabled, _ = strconv.ParseBool(os.Getenv("KUBE_WATCHLIST_INCONSISTENCY_DETECTOR")) } -type retrieveItemsFunc[U any] func() []U +type RetrieveItemsFunc[U any] func() []U -type listFunc[T runtime.Object] func(ctx context.Context, options metav1.ListOptions) (T, error) +type ListFunc[T runtime.Object] func(ctx context.Context, options metav1.ListOptions) (T, error) // checkWatchListDataConsistencyIfRequested performs a data consistency check only when // the KUBE_WATCHLIST_INCONSISTENCY_DETECTOR environment variable was set during a binary startup. @@ -52,21 +52,21 @@ type listFunc[T runtime.Object] func(ctx context.Context, options metav1.ListOpt // // Note that this function will panic when data inconsistency is detected. // This is intentional because we want to catch it in the CI. -func checkWatchListDataConsistencyIfRequested[T runtime.Object, U any](ctx context.Context, identity string, lastSyncedResourceVersion string, listFn listFunc[T], retrieveItemsFn retrieveItemsFunc[U]) { +func checkWatchListDataConsistencyIfRequested[T runtime.Object, U any](ctx context.Context, identity string, lastSyncedResourceVersion string, listFn ListFunc[T], retrieveItemsFn RetrieveItemsFunc[U]) { if !dataConsistencyDetectionForWatchListEnabled { return } // for informers we pass an empty ListOptions because // listFn might be wrapped for filtering during informer construction. - checkDataConsistency(ctx, identity, lastSyncedResourceVersion, listFn, metav1.ListOptions{}, retrieveItemsFn) + CheckDataConsistency(ctx, identity, lastSyncedResourceVersion, listFn, metav1.ListOptions{}, retrieveItemsFn) } -// checkDataConsistency exists solely for testing purposes. +// CheckDataConsistency exists solely for testing purposes. // we cannot use checkWatchListDataConsistencyIfRequested because // it is guarded by an environmental variable. // we cannot manipulate the environmental variable because // it will affect other tests in this package. -func checkDataConsistency[T runtime.Object, U any](ctx context.Context, identity string, lastSyncedResourceVersion string, listFn listFunc[T], listOptions metav1.ListOptions, retrieveItemsFn retrieveItemsFunc[U]) { +func CheckDataConsistency[T runtime.Object, U any](ctx context.Context, identity string, lastSyncedResourceVersion string, listFn ListFunc[T], listOptions metav1.ListOptions, retrieveItemsFn RetrieveItemsFunc[U]) { klog.Warningf("data consistency check for %s is enabled, this will result in an additional call to the API server.", identity) listOptions.ResourceVersion = lastSyncedResourceVersion listOptions.ResourceVersionMatch = metav1.ResourceVersionMatchExact diff --git a/util/consistencydetector/data_consistency_detector_test.go b/util/consistencydetector/data_consistency_detector_test.go index 8ce0e31276..9cbe036eaa 100644 --- a/util/consistencydetector/data_consistency_detector_test.go +++ b/util/consistencydetector/data_consistency_detector_test.go @@ -106,10 +106,10 @@ func TestDataConsistencyChecker(t *testing.T) { if scenario.expectPanic { require.Panics(t, func() { - checkDataConsistency(ctx, "", scenario.listResponse.ResourceVersion, fakeLister.List, scenario.requestOptions, retrievedItemsFunc) + CheckDataConsistency(ctx, "", scenario.listResponse.ResourceVersion, fakeLister.List, scenario.requestOptions, retrievedItemsFunc) }) } else { - checkDataConsistency(ctx, "", scenario.listResponse.ResourceVersion, fakeLister.List, scenario.requestOptions, retrievedItemsFunc) + CheckDataConsistency(ctx, "", scenario.listResponse.ResourceVersion, fakeLister.List, scenario.requestOptions, retrievedItemsFunc) } require.Equal(t, fakeLister.counter, scenario.expectedListRequests) @@ -131,7 +131,7 @@ func TestDataConsistencyCheckerRetry(t *testing.T) { stopListErrorAfter := 5 fakeErrLister := &errorLister{stopErrorAfter: stopListErrorAfter} - checkDataConsistency(ctx, "", "", fakeErrLister.List, metav1.ListOptions{}, retrievedItemsFunc) + CheckDataConsistency(ctx, "", "", fakeErrLister.List, metav1.ListOptions{}, retrievedItemsFunc) require.Equal(t, fakeErrLister.listCounter, fakeErrLister.stopErrorAfter) } From 538b7809aa2c684406730c577f274401eb62a0e5 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Mon, 27 May 2024 11:22:28 +0200 Subject: [PATCH 054/159] move checkWatchListDataConsistencyIfRequested back to client-go/tools/cache Kubernetes-commit: cb44f83b3d500bb2ed29f7634095bc64c9b21729 --- .../reflector_data_consistency_detector.go | 51 +++++++++++++++++++ ...eflector_data_consistency_detector_test.go | 29 +++++++++++ .../data_consistency_detector.go | 26 ---------- .../data_consistency_detector_test.go | 5 -- 4 files changed, 80 insertions(+), 31 deletions(-) create mode 100644 tools/cache/reflector_data_consistency_detector.go create mode 100644 tools/cache/reflector_data_consistency_detector_test.go diff --git a/tools/cache/reflector_data_consistency_detector.go b/tools/cache/reflector_data_consistency_detector.go new file mode 100644 index 0000000000..bd857de7a5 --- /dev/null +++ b/tools/cache/reflector_data_consistency_detector.go @@ -0,0 +1,51 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cache + +import ( + "context" + "os" + "strconv" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/util/consistencydetector" +) + +var dataConsistencyDetectionForWatchListEnabled = false + +func init() { + dataConsistencyDetectionForWatchListEnabled, _ = strconv.ParseBool(os.Getenv("KUBE_WATCHLIST_INCONSISTENCY_DETECTOR")) +} + +// checkWatchListDataConsistencyIfRequested performs a data consistency check only when +// the KUBE_WATCHLIST_INCONSISTENCY_DETECTOR environment variable was set during a binary startup. +// +// The consistency check is meant to be enforced only in the CI, not in production. +// The check ensures that data retrieved by the watch-list api call +// is exactly the same as data received by the standard list api call against etcd. +// +// Note that this function will panic when data inconsistency is detected. +// This is intentional because we want to catch it in the CI. +func checkWatchListDataConsistencyIfRequested[T runtime.Object, U any](ctx context.Context, identity string, lastSyncedResourceVersion string, listFn consistencydetector.ListFunc[T], retrieveItemsFn consistencydetector.RetrieveItemsFunc[U]) { + if !dataConsistencyDetectionForWatchListEnabled { + return + } + // for informers we pass an empty ListOptions because + // listFn might be wrapped for filtering during informer construction. + consistencydetector.CheckDataConsistency(ctx, identity, lastSyncedResourceVersion, listFn, metav1.ListOptions{}, retrieveItemsFn) +} diff --git a/tools/cache/reflector_data_consistency_detector_test.go b/tools/cache/reflector_data_consistency_detector_test.go new file mode 100644 index 0000000000..7d0d8bb624 --- /dev/null +++ b/tools/cache/reflector_data_consistency_detector_test.go @@ -0,0 +1,29 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package cache + +import ( + "context" + "testing" + + "k8s.io/apimachinery/pkg/runtime" +) + +func TestDriveWatchLisConsistencyIfRequired(t *testing.T) { + ctx := context.TODO() + checkWatchListDataConsistencyIfRequested[runtime.Object, runtime.Object](ctx, "", "", nil, nil) +} diff --git a/util/consistencydetector/data_consistency_detector.go b/util/consistencydetector/data_consistency_detector.go index 084f13226f..64288eb865 100644 --- a/util/consistencydetector/data_consistency_detector.go +++ b/util/consistencydetector/data_consistency_detector.go @@ -19,9 +19,7 @@ package consistencydetector import ( "context" "fmt" - "os" "sort" - "strconv" "time" "github.com/google/go-cmp/cmp" @@ -33,34 +31,10 @@ import ( "k8s.io/klog/v2" ) -var dataConsistencyDetectionForWatchListEnabled = false - -func init() { - dataConsistencyDetectionForWatchListEnabled, _ = strconv.ParseBool(os.Getenv("KUBE_WATCHLIST_INCONSISTENCY_DETECTOR")) -} - type RetrieveItemsFunc[U any] func() []U type ListFunc[T runtime.Object] func(ctx context.Context, options metav1.ListOptions) (T, error) -// checkWatchListDataConsistencyIfRequested performs a data consistency check only when -// the KUBE_WATCHLIST_INCONSISTENCY_DETECTOR environment variable was set during a binary startup. -// -// The consistency check is meant to be enforced only in the CI, not in production. -// The check ensures that data retrieved by the watch-list api call -// is exactly the same as data received by the standard list api call against etcd. -// -// Note that this function will panic when data inconsistency is detected. -// This is intentional because we want to catch it in the CI. -func checkWatchListDataConsistencyIfRequested[T runtime.Object, U any](ctx context.Context, identity string, lastSyncedResourceVersion string, listFn ListFunc[T], retrieveItemsFn RetrieveItemsFunc[U]) { - if !dataConsistencyDetectionForWatchListEnabled { - return - } - // for informers we pass an empty ListOptions because - // listFn might be wrapped for filtering during informer construction. - CheckDataConsistency(ctx, identity, lastSyncedResourceVersion, listFn, metav1.ListOptions{}, retrieveItemsFn) -} - // CheckDataConsistency exists solely for testing purposes. // we cannot use checkWatchListDataConsistencyIfRequested because // it is guarded by an environmental variable. diff --git a/util/consistencydetector/data_consistency_detector_test.go b/util/consistencydetector/data_consistency_detector_test.go index 9cbe036eaa..c6d21754e0 100644 --- a/util/consistencydetector/data_consistency_detector_test.go +++ b/util/consistencydetector/data_consistency_detector_test.go @@ -118,11 +118,6 @@ func TestDataConsistencyChecker(t *testing.T) { } } -func TestDriveWatchLisConsistencyIfRequired(t *testing.T) { - ctx := context.TODO() - checkWatchListDataConsistencyIfRequested[runtime.Object, runtime.Object](ctx, "", "", nil, nil) -} - func TestDataConsistencyCheckerRetry(t *testing.T) { ctx := context.TODO() retrievedItemsFunc := func() []*v1.Pod { From b7ea49a19972f7cb5fcd74456d2fcf337cf9d847 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Mon, 27 May 2024 15:11:50 +0200 Subject: [PATCH 055/159] client-go/util/consistencydetector: add CheckListFromCacheDataConsistencyIfRequested Kubernetes-commit: 48014bd7bdc331efea509a752694393ac929f270 --- .../list_data_consistency_detector.go | 70 +++++++++++++++++ .../list_data_consistency_detector_test.go | 77 +++++++++++++++++++ 2 files changed, 147 insertions(+) create mode 100644 util/consistencydetector/list_data_consistency_detector.go create mode 100644 util/consistencydetector/list_data_consistency_detector_test.go diff --git a/util/consistencydetector/list_data_consistency_detector.go b/util/consistencydetector/list_data_consistency_detector.go new file mode 100644 index 0000000000..7610c05c28 --- /dev/null +++ b/util/consistencydetector/list_data_consistency_detector.go @@ -0,0 +1,70 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package consistencydetector + +import ( + "context" + "os" + "strconv" + + "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +var dataConsistencyDetectionForListFromCacheEnabled = false + +func init() { + dataConsistencyDetectionForListFromCacheEnabled, _ = strconv.ParseBool(os.Getenv("KUBE_LIST_FROM_CACHE_INCONSISTENCY_DETECTOR")) +} + +// CheckListFromCacheDataConsistencyIfRequested performs a data consistency check only when +// the KUBE_LIST_FROM_CACHE_INCONSISTENCY_DETECTOR environment variable was set during a binary startup +// for requests that have a high chance of being served from the watch-cache. +// +// The consistency check is meant to be enforced only in the CI, not in production. +// The check ensures that data retrieved by a list api call from the watch-cache +// is exactly the same as data received by the list api call from etcd. +// +// Note that this function will panic when data inconsistency is detected. +// This is intentional because we want to catch it in the CI. +// +// Note that this function doesn't examine the ListOptions to determine +// if the original request has hit the cache because it would be challenging +// to maintain consistency with the server-side implementation. +// For simplicity, we assume that the first request retrieved data from +// the cache (even though this might not be true for some requests) +// and issue the second call to get data from etcd for comparison. +func CheckListFromCacheDataConsistencyIfRequested[T runtime.Object](ctx context.Context, identity string, listItemsFn ListFunc[T], optionsUsedToReceiveList metav1.ListOptions, receivedList runtime.Object) { + if !dataConsistencyDetectionForListFromCacheEnabled { + return + } + checkListFromCacheDataConsistencyIfRequestedInternal(ctx, identity, listItemsFn, optionsUsedToReceiveList, receivedList) +} + +func checkListFromCacheDataConsistencyIfRequestedInternal[T runtime.Object](ctx context.Context, identity string, listItemsFn ListFunc[T], optionsUsedToReceiveList metav1.ListOptions, receivedList runtime.Object) { + receivedListMeta, err := meta.ListAccessor(receivedList) + if err != nil { + panic(err) + } + rawListItems, err := meta.ExtractListWithAlloc(receivedList) + if err != nil { + panic(err) // this should never happen + } + lastSyncedResourceVersion := receivedListMeta.GetResourceVersion() + CheckDataConsistency(ctx, identity, lastSyncedResourceVersion, listItemsFn, optionsUsedToReceiveList, func() []runtime.Object { return rawListItems }) +} diff --git a/util/consistencydetector/list_data_consistency_detector_test.go b/util/consistencydetector/list_data_consistency_detector_test.go new file mode 100644 index 0000000000..3e61e1f2b9 --- /dev/null +++ b/util/consistencydetector/list_data_consistency_detector_test.go @@ -0,0 +1,77 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package consistencydetector + +import ( + "context" + "testing" + + "github.com/stretchr/testify/require" + + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/utils/ptr" +) + +var ( + emptyListFunc = func(_ context.Context, opts metav1.ListOptions) (*v1.PodList, error) { + return nil, nil + } + emptyListOptions = metav1.ListOptions{} +) + +func TestDriveCheckListFromCacheDataConsistencyIfRequested(t *testing.T) { + ctx := context.TODO() + + CheckListFromCacheDataConsistencyIfRequested(ctx, "", emptyListFunc, emptyListOptions, nil) +} + +func TestCheckListFromCacheDataConsistencyIfRequestedInternalPanics(t *testing.T) { + ctx := context.TODO() + pod := makePod("p1", "1") + + wrappedTarget := func() { + checkListFromCacheDataConsistencyIfRequestedInternal(ctx, "", emptyListFunc, emptyListOptions, pod) + } + + require.PanicsWithError(t, "object does not implement the List interfaces", wrappedTarget) +} + +func TestCheckListFromCacheDataConsistencyIfRequestedInternalHappyPath(t *testing.T) { + ctx := context.TODO() + listOptions := metav1.ListOptions{TimeoutSeconds: ptr.To(int64(39))} + expectedRequestOptions := metav1.ListOptions{ + ResourceVersion: "2", + ResourceVersionMatch: metav1.ResourceVersionMatchExact, + TimeoutSeconds: ptr.To(int64(39)), + } + listResponse := &v1.PodList{ + ListMeta: metav1.ListMeta{ResourceVersion: "2"}, + Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2")}, + } + retrievedList := &v1.PodList{ + ListMeta: metav1.ListMeta{ResourceVersion: "2"}, + Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2")}, + } + fakeLister := &listWrapper{response: listResponse} + + checkListFromCacheDataConsistencyIfRequestedInternal(ctx, "", fakeLister.List, listOptions, retrievedList) + + require.Equal(t, 1, fakeLister.counter) + require.Equal(t, 1, len(fakeLister.requestOptions)) + require.Equal(t, fakeLister.requestOptions[0], expectedRequestOptions) +} From c559583d364bbc7496a97ed3bae2c495eddca0bb Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Mon, 27 May 2024 06:24:08 -0700 Subject: [PATCH 056/159] Merge pull request #125146 from p0lyn0mial/upstream-client-go-consistency-detector-move-to-new-package client-go: move data consistency detector to a new package Kubernetes-commit: 9d5db28f5f5d5a35012dd6162af374420e6e1f4c From 9f33e96b6a6e2ed231a3c8e61bb28a37716774ac Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Mon, 27 May 2024 15:31:15 +0200 Subject: [PATCH 057/159] make update Kubernetes-commit: 448180db60fc1d62174a18d1dd995d8deb081428 --- .../v1/mutatingwebhookconfiguration.go | 11 +++++++++++ .../v1/validatingadmissionpolicy.go | 11 +++++++++++ .../v1/validatingadmissionpolicybinding.go | 11 +++++++++++ .../v1/validatingwebhookconfiguration.go | 11 +++++++++++ .../v1alpha1/validatingadmissionpolicy.go | 11 +++++++++++ .../v1alpha1/validatingadmissionpolicybinding.go | 11 +++++++++++ .../v1beta1/mutatingwebhookconfiguration.go | 11 +++++++++++ .../v1beta1/validatingadmissionpolicy.go | 11 +++++++++++ .../v1beta1/validatingadmissionpolicybinding.go | 11 +++++++++++ .../v1beta1/validatingwebhookconfiguration.go | 11 +++++++++++ .../apiserverinternal/v1alpha1/storageversion.go | 11 +++++++++++ kubernetes/typed/apps/v1/controllerrevision.go | 11 +++++++++++ kubernetes/typed/apps/v1/daemonset.go | 11 +++++++++++ kubernetes/typed/apps/v1/deployment.go | 11 +++++++++++ kubernetes/typed/apps/v1/replicaset.go | 11 +++++++++++ kubernetes/typed/apps/v1/statefulset.go | 11 +++++++++++ kubernetes/typed/apps/v1beta1/controllerrevision.go | 11 +++++++++++ kubernetes/typed/apps/v1beta1/deployment.go | 11 +++++++++++ kubernetes/typed/apps/v1beta1/statefulset.go | 11 +++++++++++ kubernetes/typed/apps/v1beta2/controllerrevision.go | 11 +++++++++++ kubernetes/typed/apps/v1beta2/daemonset.go | 11 +++++++++++ kubernetes/typed/apps/v1beta2/deployment.go | 11 +++++++++++ kubernetes/typed/apps/v1beta2/replicaset.go | 11 +++++++++++ kubernetes/typed/apps/v1beta2/statefulset.go | 11 +++++++++++ .../typed/autoscaling/v1/horizontalpodautoscaler.go | 11 +++++++++++ .../typed/autoscaling/v2/horizontalpodautoscaler.go | 11 +++++++++++ .../autoscaling/v2beta1/horizontalpodautoscaler.go | 11 +++++++++++ .../autoscaling/v2beta2/horizontalpodautoscaler.go | 11 +++++++++++ kubernetes/typed/batch/v1/cronjob.go | 11 +++++++++++ kubernetes/typed/batch/v1/job.go | 11 +++++++++++ kubernetes/typed/batch/v1beta1/cronjob.go | 11 +++++++++++ .../certificates/v1/certificatesigningrequest.go | 11 +++++++++++ .../typed/certificates/v1alpha1/clustertrustbundle.go | 11 +++++++++++ .../certificates/v1beta1/certificatesigningrequest.go | 11 +++++++++++ kubernetes/typed/coordination/v1/lease.go | 11 +++++++++++ kubernetes/typed/coordination/v1beta1/lease.go | 11 +++++++++++ kubernetes/typed/core/v1/componentstatus.go | 11 +++++++++++ kubernetes/typed/core/v1/configmap.go | 11 +++++++++++ kubernetes/typed/core/v1/endpoints.go | 11 +++++++++++ kubernetes/typed/core/v1/event.go | 11 +++++++++++ kubernetes/typed/core/v1/limitrange.go | 11 +++++++++++ kubernetes/typed/core/v1/namespace.go | 11 +++++++++++ kubernetes/typed/core/v1/node.go | 11 +++++++++++ kubernetes/typed/core/v1/persistentvolume.go | 11 +++++++++++ kubernetes/typed/core/v1/persistentvolumeclaim.go | 11 +++++++++++ kubernetes/typed/core/v1/pod.go | 11 +++++++++++ kubernetes/typed/core/v1/podtemplate.go | 11 +++++++++++ kubernetes/typed/core/v1/replicationcontroller.go | 11 +++++++++++ kubernetes/typed/core/v1/resourcequota.go | 11 +++++++++++ kubernetes/typed/core/v1/secret.go | 11 +++++++++++ kubernetes/typed/core/v1/service.go | 11 +++++++++++ kubernetes/typed/core/v1/serviceaccount.go | 11 +++++++++++ kubernetes/typed/discovery/v1/endpointslice.go | 11 +++++++++++ kubernetes/typed/discovery/v1beta1/endpointslice.go | 11 +++++++++++ kubernetes/typed/events/v1/event.go | 11 +++++++++++ kubernetes/typed/events/v1beta1/event.go | 11 +++++++++++ kubernetes/typed/extensions/v1beta1/daemonset.go | 11 +++++++++++ kubernetes/typed/extensions/v1beta1/deployment.go | 11 +++++++++++ kubernetes/typed/extensions/v1beta1/ingress.go | 11 +++++++++++ kubernetes/typed/extensions/v1beta1/networkpolicy.go | 11 +++++++++++ kubernetes/typed/extensions/v1beta1/replicaset.go | 11 +++++++++++ kubernetes/typed/flowcontrol/v1/flowschema.go | 11 +++++++++++ .../flowcontrol/v1/prioritylevelconfiguration.go | 11 +++++++++++ kubernetes/typed/flowcontrol/v1beta1/flowschema.go | 11 +++++++++++ .../flowcontrol/v1beta1/prioritylevelconfiguration.go | 11 +++++++++++ kubernetes/typed/flowcontrol/v1beta2/flowschema.go | 11 +++++++++++ .../flowcontrol/v1beta2/prioritylevelconfiguration.go | 11 +++++++++++ kubernetes/typed/flowcontrol/v1beta3/flowschema.go | 11 +++++++++++ .../flowcontrol/v1beta3/prioritylevelconfiguration.go | 11 +++++++++++ kubernetes/typed/networking/v1/ingress.go | 11 +++++++++++ kubernetes/typed/networking/v1/ingressclass.go | 11 +++++++++++ kubernetes/typed/networking/v1/networkpolicy.go | 11 +++++++++++ kubernetes/typed/networking/v1alpha1/ipaddress.go | 11 +++++++++++ kubernetes/typed/networking/v1alpha1/servicecidr.go | 11 +++++++++++ kubernetes/typed/networking/v1beta1/ingress.go | 11 +++++++++++ kubernetes/typed/networking/v1beta1/ingressclass.go | 11 +++++++++++ kubernetes/typed/node/v1/runtimeclass.go | 11 +++++++++++ kubernetes/typed/node/v1alpha1/runtimeclass.go | 11 +++++++++++ kubernetes/typed/node/v1beta1/runtimeclass.go | 11 +++++++++++ kubernetes/typed/policy/v1/poddisruptionbudget.go | 11 +++++++++++ .../typed/policy/v1beta1/poddisruptionbudget.go | 11 +++++++++++ kubernetes/typed/rbac/v1/clusterrole.go | 11 +++++++++++ kubernetes/typed/rbac/v1/clusterrolebinding.go | 11 +++++++++++ kubernetes/typed/rbac/v1/role.go | 11 +++++++++++ kubernetes/typed/rbac/v1/rolebinding.go | 11 +++++++++++ kubernetes/typed/rbac/v1alpha1/clusterrole.go | 11 +++++++++++ kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go | 11 +++++++++++ kubernetes/typed/rbac/v1alpha1/role.go | 11 +++++++++++ kubernetes/typed/rbac/v1alpha1/rolebinding.go | 11 +++++++++++ kubernetes/typed/rbac/v1beta1/clusterrole.go | 11 +++++++++++ kubernetes/typed/rbac/v1beta1/clusterrolebinding.go | 11 +++++++++++ kubernetes/typed/rbac/v1beta1/role.go | 11 +++++++++++ kubernetes/typed/rbac/v1beta1/rolebinding.go | 11 +++++++++++ .../typed/resource/v1alpha2/podschedulingcontext.go | 11 +++++++++++ kubernetes/typed/resource/v1alpha2/resourceclaim.go | 11 +++++++++++ .../resource/v1alpha2/resourceclaimparameters.go | 11 +++++++++++ .../typed/resource/v1alpha2/resourceclaimtemplate.go | 11 +++++++++++ kubernetes/typed/resource/v1alpha2/resourceclass.go | 11 +++++++++++ .../resource/v1alpha2/resourceclassparameters.go | 11 +++++++++++ kubernetes/typed/resource/v1alpha2/resourceslice.go | 11 +++++++++++ kubernetes/typed/scheduling/v1/priorityclass.go | 11 +++++++++++ kubernetes/typed/scheduling/v1alpha1/priorityclass.go | 11 +++++++++++ kubernetes/typed/scheduling/v1beta1/priorityclass.go | 11 +++++++++++ kubernetes/typed/storage/v1/csidriver.go | 11 +++++++++++ kubernetes/typed/storage/v1/csinode.go | 11 +++++++++++ kubernetes/typed/storage/v1/csistoragecapacity.go | 11 +++++++++++ kubernetes/typed/storage/v1/storageclass.go | 11 +++++++++++ kubernetes/typed/storage/v1/volumeattachment.go | 11 +++++++++++ .../typed/storage/v1alpha1/csistoragecapacity.go | 11 +++++++++++ kubernetes/typed/storage/v1alpha1/volumeattachment.go | 11 +++++++++++ .../typed/storage/v1alpha1/volumeattributesclass.go | 11 +++++++++++ kubernetes/typed/storage/v1beta1/csidriver.go | 11 +++++++++++ kubernetes/typed/storage/v1beta1/csinode.go | 11 +++++++++++ .../typed/storage/v1beta1/csistoragecapacity.go | 11 +++++++++++ kubernetes/typed/storage/v1beta1/storageclass.go | 11 +++++++++++ kubernetes/typed/storage/v1beta1/volumeattachment.go | 11 +++++++++++ .../v1alpha1/storageversionmigration.go | 11 +++++++++++ 117 files changed, 1287 insertions(+) diff --git a/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go index edbc826d19..93eb62aa80 100644 --- a/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go @@ -31,6 +31,7 @@ import ( admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // MutatingWebhookConfigurationsGetter has a method to return a MutatingWebhookConfigurationInterface. @@ -79,6 +80,16 @@ func (c *mutatingWebhookConfigurations) Get(ctx context.Context, name string, op // List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. func (c *mutatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.MutatingWebhookConfigurationList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for mutatingwebhookconfigurations", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. +func (c *mutatingWebhookConfigurations) list(ctx context.Context, opts metav1.ListOptions) (result *v1.MutatingWebhookConfigurationList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go b/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go index 0b0b05acd4..9bd895051d 100644 --- a/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go +++ b/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go @@ -31,6 +31,7 @@ import ( admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ValidatingAdmissionPoliciesGetter has a method to return a ValidatingAdmissionPolicyInterface. @@ -81,6 +82,16 @@ func (c *validatingAdmissionPolicies) Get(ctx context.Context, name string, opti // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. func (c *validatingAdmissionPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicies", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. +func (c *validatingAdmissionPolicies) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicybinding.go b/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicybinding.go index 83a8ef163d..872bacc650 100644 --- a/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicybinding.go +++ b/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicybinding.go @@ -31,6 +31,7 @@ import ( admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ValidatingAdmissionPolicyBindingsGetter has a method to return a ValidatingAdmissionPolicyBindingInterface. @@ -79,6 +80,16 @@ func (c *validatingAdmissionPolicyBindings) Get(ctx context.Context, name string // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyBindingList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicybindings", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. +func (c *validatingAdmissionPolicyBindings) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyBindingList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go index 065e3c8341..585dc22dea 100644 --- a/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go @@ -31,6 +31,7 @@ import ( admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ValidatingWebhookConfigurationsGetter has a method to return a ValidatingWebhookConfigurationInterface. @@ -79,6 +80,16 @@ func (c *validatingWebhookConfigurations) Get(ctx context.Context, name string, // List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. func (c *validatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingWebhookConfigurationList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingwebhookconfigurations", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. +func (c *validatingWebhookConfigurations) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingWebhookConfigurationList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicy.go b/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicy.go index 1d994b5abf..dafd922379 100644 --- a/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicy.go +++ b/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicy.go @@ -31,6 +31,7 @@ import ( admissionregistrationv1alpha1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ValidatingAdmissionPoliciesGetter has a method to return a ValidatingAdmissionPolicyInterface. @@ -81,6 +82,16 @@ func (c *validatingAdmissionPolicies) Get(ctx context.Context, name string, opti // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. func (c *validatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicies", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. +func (c *validatingAdmissionPolicies) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go b/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go index 39823ca82b..c8a6c768b8 100644 --- a/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go +++ b/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go @@ -31,6 +31,7 @@ import ( admissionregistrationv1alpha1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ValidatingAdmissionPolicyBindingsGetter has a method to return a ValidatingAdmissionPolicyBindingInterface. @@ -79,6 +80,16 @@ func (c *validatingAdmissionPolicyBindings) Get(ctx context.Context, name string // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyBindingList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicybindings", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. +func (c *validatingAdmissionPolicyBindings) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyBindingList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index ca6bb8bd50..8e1833448c 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -31,6 +31,7 @@ import ( admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // MutatingWebhookConfigurationsGetter has a method to return a MutatingWebhookConfigurationInterface. @@ -79,6 +80,16 @@ func (c *mutatingWebhookConfigurations) Get(ctx context.Context, name string, op // List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. func (c *mutatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MutatingWebhookConfigurationList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for mutatingwebhookconfigurations", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. +func (c *mutatingWebhookConfigurations) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MutatingWebhookConfigurationList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicy.go b/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicy.go index bea51b587f..2cb47362e8 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicy.go +++ b/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicy.go @@ -31,6 +31,7 @@ import ( admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ValidatingAdmissionPoliciesGetter has a method to return a ValidatingAdmissionPolicyInterface. @@ -81,6 +82,16 @@ func (c *validatingAdmissionPolicies) Get(ctx context.Context, name string, opti // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. func (c *validatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicies", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. +func (c *validatingAdmissionPolicies) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicybinding.go b/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicybinding.go index bba37bb047..6f05360790 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicybinding.go +++ b/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicybinding.go @@ -31,6 +31,7 @@ import ( admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ValidatingAdmissionPolicyBindingsGetter has a method to return a ValidatingAdmissionPolicyBindingInterface. @@ -79,6 +80,16 @@ func (c *validatingAdmissionPolicyBindings) Get(ctx context.Context, name string // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyBindingList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicybindings", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. +func (c *validatingAdmissionPolicyBindings) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyBindingList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go index 5ba5974d7a..671ec8116e 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -31,6 +31,7 @@ import ( admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ValidatingWebhookConfigurationsGetter has a method to return a ValidatingWebhookConfigurationInterface. @@ -79,6 +80,16 @@ func (c *validatingWebhookConfigurations) Get(ctx context.Context, name string, // List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. func (c *validatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingWebhookConfigurationList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingwebhookconfigurations", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. +func (c *validatingWebhookConfigurations) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingWebhookConfigurationList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/apiserverinternal/v1alpha1/storageversion.go b/kubernetes/typed/apiserverinternal/v1alpha1/storageversion.go index 18789c7f82..7f0d60ce35 100644 --- a/kubernetes/typed/apiserverinternal/v1alpha1/storageversion.go +++ b/kubernetes/typed/apiserverinternal/v1alpha1/storageversion.go @@ -31,6 +31,7 @@ import ( apiserverinternalv1alpha1 "k8s.io/client-go/applyconfigurations/apiserverinternal/v1alpha1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // StorageVersionsGetter has a method to return a StorageVersionInterface. @@ -81,6 +82,16 @@ func (c *storageVersions) Get(ctx context.Context, name string, options v1.GetOp // List takes label and field selectors, and returns the list of StorageVersions that match those selectors. func (c *storageVersions) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for storageversions", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of StorageVersions that match those selectors. +func (c *storageVersions) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/apps/v1/controllerrevision.go b/kubernetes/typed/apps/v1/controllerrevision.go index f4b198265d..6a12cc3982 100644 --- a/kubernetes/typed/apps/v1/controllerrevision.go +++ b/kubernetes/typed/apps/v1/controllerrevision.go @@ -31,6 +31,7 @@ import ( appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ControllerRevisionsGetter has a method to return a ControllerRevisionInterface. @@ -82,6 +83,16 @@ func (c *controllerRevisions) Get(ctx context.Context, name string, options meta // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. func (c *controllerRevisions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ControllerRevisionList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for controllerrevisions", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. +func (c *controllerRevisions) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ControllerRevisionList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/apps/v1/daemonset.go b/kubernetes/typed/apps/v1/daemonset.go index 53e5392879..251d98e0be 100644 --- a/kubernetes/typed/apps/v1/daemonset.go +++ b/kubernetes/typed/apps/v1/daemonset.go @@ -31,6 +31,7 @@ import ( appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // DaemonSetsGetter has a method to return a DaemonSetInterface. @@ -84,6 +85,16 @@ func (c *daemonSets) Get(ctx context.Context, name string, options metav1.GetOpt // List takes label and field selectors, and returns the list of DaemonSets that match those selectors. func (c *daemonSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DaemonSetList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for daemonsets", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of DaemonSets that match those selectors. +func (c *daemonSets) list(ctx context.Context, opts metav1.ListOptions) (result *v1.DaemonSetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/apps/v1/deployment.go b/kubernetes/typed/apps/v1/deployment.go index ccc2049ff7..c97894f156 100644 --- a/kubernetes/typed/apps/v1/deployment.go +++ b/kubernetes/typed/apps/v1/deployment.go @@ -33,6 +33,7 @@ import ( applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // DeploymentsGetter has a method to return a DeploymentInterface. @@ -90,6 +91,16 @@ func (c *deployments) Get(ctx context.Context, name string, options metav1.GetOp // List takes label and field selectors, and returns the list of Deployments that match those selectors. func (c *deployments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DeploymentList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of Deployments that match those selectors. +func (c *deployments) list(ctx context.Context, opts metav1.ListOptions) (result *v1.DeploymentList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/apps/v1/replicaset.go b/kubernetes/typed/apps/v1/replicaset.go index 917ed521f4..e28f784f94 100644 --- a/kubernetes/typed/apps/v1/replicaset.go +++ b/kubernetes/typed/apps/v1/replicaset.go @@ -33,6 +33,7 @@ import ( applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ReplicaSetsGetter has a method to return a ReplicaSetInterface. @@ -90,6 +91,16 @@ func (c *replicaSets) Get(ctx context.Context, name string, options metav1.GetOp // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. func (c *replicaSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicaSetList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicasets", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ReplicaSets that match those selectors. +func (c *replicaSets) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicaSetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/apps/v1/statefulset.go b/kubernetes/typed/apps/v1/statefulset.go index d1fbb915d8..2e94e1a6a0 100644 --- a/kubernetes/typed/apps/v1/statefulset.go +++ b/kubernetes/typed/apps/v1/statefulset.go @@ -33,6 +33,7 @@ import ( applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // StatefulSetsGetter has a method to return a StatefulSetInterface. @@ -90,6 +91,16 @@ func (c *statefulSets) Get(ctx context.Context, name string, options metav1.GetO // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. func (c *statefulSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.StatefulSetList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for statefulsets", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of StatefulSets that match those selectors. +func (c *statefulSets) list(ctx context.Context, opts metav1.ListOptions) (result *v1.StatefulSetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/apps/v1beta1/controllerrevision.go b/kubernetes/typed/apps/v1beta1/controllerrevision.go index 0c3f49ba14..044101c952 100644 --- a/kubernetes/typed/apps/v1beta1/controllerrevision.go +++ b/kubernetes/typed/apps/v1beta1/controllerrevision.go @@ -31,6 +31,7 @@ import ( appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ControllerRevisionsGetter has a method to return a ControllerRevisionInterface. @@ -82,6 +83,16 @@ func (c *controllerRevisions) Get(ctx context.Context, name string, options v1.G // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. func (c *controllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ControllerRevisionList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for controllerrevisions", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. +func (c *controllerRevisions) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ControllerRevisionList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/apps/v1beta1/deployment.go b/kubernetes/typed/apps/v1beta1/deployment.go index 281758c435..47edb1c8f2 100644 --- a/kubernetes/typed/apps/v1beta1/deployment.go +++ b/kubernetes/typed/apps/v1beta1/deployment.go @@ -31,6 +31,7 @@ import ( appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // DeploymentsGetter has a method to return a DeploymentInterface. @@ -84,6 +85,16 @@ func (c *deployments) Get(ctx context.Context, name string, options v1.GetOption // List takes label and field selectors, and returns the list of Deployments that match those selectors. func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of Deployments that match those selectors. +func (c *deployments) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/apps/v1beta1/statefulset.go b/kubernetes/typed/apps/v1beta1/statefulset.go index 3f1aebcffb..e39d7cf5ec 100644 --- a/kubernetes/typed/apps/v1beta1/statefulset.go +++ b/kubernetes/typed/apps/v1beta1/statefulset.go @@ -31,6 +31,7 @@ import ( appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // StatefulSetsGetter has a method to return a StatefulSetInterface. @@ -84,6 +85,16 @@ func (c *statefulSets) Get(ctx context.Context, name string, options v1.GetOptio // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. func (c *statefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for statefulsets", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of StatefulSets that match those selectors. +func (c *statefulSets) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/apps/v1beta2/controllerrevision.go b/kubernetes/typed/apps/v1beta2/controllerrevision.go index e1643277a6..9a97558ea5 100644 --- a/kubernetes/typed/apps/v1beta2/controllerrevision.go +++ b/kubernetes/typed/apps/v1beta2/controllerrevision.go @@ -31,6 +31,7 @@ import ( appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ControllerRevisionsGetter has a method to return a ControllerRevisionInterface. @@ -82,6 +83,16 @@ func (c *controllerRevisions) Get(ctx context.Context, name string, options v1.G // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. func (c *controllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for controllerrevisions", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. +func (c *controllerRevisions) list(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/apps/v1beta2/daemonset.go b/kubernetes/typed/apps/v1beta2/daemonset.go index 1391df87d2..2411dda802 100644 --- a/kubernetes/typed/apps/v1beta2/daemonset.go +++ b/kubernetes/typed/apps/v1beta2/daemonset.go @@ -31,6 +31,7 @@ import ( appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // DaemonSetsGetter has a method to return a DaemonSetInterface. @@ -84,6 +85,16 @@ func (c *daemonSets) Get(ctx context.Context, name string, options v1.GetOptions // 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 *v1beta2.DaemonSetList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for daemonsets", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// 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 *v1beta2.DaemonSetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/apps/v1beta2/deployment.go b/kubernetes/typed/apps/v1beta2/deployment.go index 5bda0d92c1..ced67eb0d8 100644 --- a/kubernetes/typed/apps/v1beta2/deployment.go +++ b/kubernetes/typed/apps/v1beta2/deployment.go @@ -31,6 +31,7 @@ import ( appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // DeploymentsGetter has a method to return a DeploymentInterface. @@ -84,6 +85,16 @@ func (c *deployments) Get(ctx context.Context, name string, options v1.GetOption // List takes label and field selectors, and returns the list of Deployments that match those selectors. func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DeploymentList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of Deployments that match those selectors. +func (c *deployments) list(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DeploymentList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/apps/v1beta2/replicaset.go b/kubernetes/typed/apps/v1beta2/replicaset.go index 988d898f79..17f9a737d0 100644 --- a/kubernetes/typed/apps/v1beta2/replicaset.go +++ b/kubernetes/typed/apps/v1beta2/replicaset.go @@ -31,6 +31,7 @@ import ( appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ReplicaSetsGetter has a method to return a ReplicaSetInterface. @@ -84,6 +85,16 @@ func (c *replicaSets) Get(ctx context.Context, name string, options v1.GetOption // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. func (c *replicaSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ReplicaSetList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicasets", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ReplicaSets that match those selectors. +func (c *replicaSets) list(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ReplicaSetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/apps/v1beta2/statefulset.go b/kubernetes/typed/apps/v1beta2/statefulset.go index 0416675d6d..0ddb1095f9 100644 --- a/kubernetes/typed/apps/v1beta2/statefulset.go +++ b/kubernetes/typed/apps/v1beta2/statefulset.go @@ -31,6 +31,7 @@ import ( appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // StatefulSetsGetter has a method to return a StatefulSetInterface. @@ -88,6 +89,16 @@ func (c *statefulSets) Get(ctx context.Context, name string, options v1.GetOptio // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. func (c *statefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.StatefulSetList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for statefulsets", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of StatefulSets that match those selectors. +func (c *statefulSets) list(ctx context.Context, opts v1.ListOptions) (result *v1beta2.StatefulSetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go index 19afde66db..bba4531831 100644 --- a/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go @@ -31,6 +31,7 @@ import ( autoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface. @@ -84,6 +85,16 @@ func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. func (c *horizontalPodAutoscalers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. +func (c *horizontalPodAutoscalers) list(ctx context.Context, opts metav1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/autoscaling/v2/horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v2/horizontalpodautoscaler.go index 3a077d71da..2eb1165e63 100644 --- a/kubernetes/typed/autoscaling/v2/horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v2/horizontalpodautoscaler.go @@ -31,6 +31,7 @@ import ( autoscalingv2 "k8s.io/client-go/applyconfigurations/autoscaling/v2" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface. @@ -84,6 +85,16 @@ func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2.HorizontalPodAutoscalerList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. +func (c *horizontalPodAutoscalers) list(ctx context.Context, opts v1.ListOptions) (result *v2.HorizontalPodAutoscalerList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go index 5080912a12..5912300c21 100644 --- a/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go @@ -31,6 +31,7 @@ import ( autoscalingv2beta1 "k8s.io/client-go/applyconfigurations/autoscaling/v2beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface. @@ -84,6 +85,16 @@ func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta1.HorizontalPodAutoscalerList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. +func (c *horizontalPodAutoscalers) list(ctx context.Context, opts v1.ListOptions) (result *v2beta1.HorizontalPodAutoscalerList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go index 0ddb9108b3..518e0c26a0 100644 --- a/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go @@ -31,6 +31,7 @@ import ( autoscalingv2beta2 "k8s.io/client-go/applyconfigurations/autoscaling/v2beta2" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface. @@ -84,6 +85,16 @@ func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta2.HorizontalPodAutoscalerList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. +func (c *horizontalPodAutoscalers) list(ctx context.Context, opts v1.ListOptions) (result *v2beta2.HorizontalPodAutoscalerList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/batch/v1/cronjob.go b/kubernetes/typed/batch/v1/cronjob.go index 9250263215..a16ec5ba51 100644 --- a/kubernetes/typed/batch/v1/cronjob.go +++ b/kubernetes/typed/batch/v1/cronjob.go @@ -31,6 +31,7 @@ import ( batchv1 "k8s.io/client-go/applyconfigurations/batch/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // CronJobsGetter has a method to return a CronJobInterface. @@ -84,6 +85,16 @@ func (c *cronJobs) Get(ctx context.Context, name string, options metav1.GetOptio // List takes label and field selectors, and returns the list of CronJobs that match those selectors. func (c *cronJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CronJobList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for cronjobs", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of CronJobs that match those selectors. +func (c *cronJobs) list(ctx context.Context, opts metav1.ListOptions) (result *v1.CronJobList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/batch/v1/job.go b/kubernetes/typed/batch/v1/job.go index c076c80af2..6663bceb27 100644 --- a/kubernetes/typed/batch/v1/job.go +++ b/kubernetes/typed/batch/v1/job.go @@ -31,6 +31,7 @@ import ( batchv1 "k8s.io/client-go/applyconfigurations/batch/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // JobsGetter has a method to return a JobInterface. @@ -84,6 +85,16 @@ func (c *jobs) Get(ctx context.Context, name string, options metav1.GetOptions) // List takes label and field selectors, and returns the list of Jobs that match those selectors. func (c *jobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.JobList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for jobs", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of Jobs that match those selectors. +func (c *jobs) list(ctx context.Context, opts metav1.ListOptions) (result *v1.JobList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/batch/v1beta1/cronjob.go b/kubernetes/typed/batch/v1beta1/cronjob.go index d687339ae9..0401f2249a 100644 --- a/kubernetes/typed/batch/v1beta1/cronjob.go +++ b/kubernetes/typed/batch/v1beta1/cronjob.go @@ -31,6 +31,7 @@ import ( batchv1beta1 "k8s.io/client-go/applyconfigurations/batch/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // CronJobsGetter has a method to return a CronJobInterface. @@ -84,6 +85,16 @@ func (c *cronJobs) Get(ctx context.Context, name string, options v1.GetOptions) // List takes label and field selectors, and returns the list of CronJobs that match those selectors. func (c *cronJobs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CronJobList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for cronjobs", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of CronJobs that match those selectors. +func (c *cronJobs) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CronJobList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/certificates/v1/certificatesigningrequest.go b/kubernetes/typed/certificates/v1/certificatesigningrequest.go index 0d6b68b296..79c9daf3e5 100644 --- a/kubernetes/typed/certificates/v1/certificatesigningrequest.go +++ b/kubernetes/typed/certificates/v1/certificatesigningrequest.go @@ -31,6 +31,7 @@ import ( certificatesv1 "k8s.io/client-go/applyconfigurations/certificates/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // CertificateSigningRequestsGetter has a method to return a CertificateSigningRequestInterface. @@ -83,6 +84,16 @@ func (c *certificateSigningRequests) Get(ctx context.Context, name string, optio // List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. func (c *certificateSigningRequests) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CertificateSigningRequestList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for certificatesigningrequests", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. +func (c *certificateSigningRequests) list(ctx context.Context, opts metav1.ListOptions) (result *v1.CertificateSigningRequestList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/certificates/v1alpha1/clustertrustbundle.go b/kubernetes/typed/certificates/v1alpha1/clustertrustbundle.go index 970fb15e6e..c4e0ca65a0 100644 --- a/kubernetes/typed/certificates/v1alpha1/clustertrustbundle.go +++ b/kubernetes/typed/certificates/v1alpha1/clustertrustbundle.go @@ -31,6 +31,7 @@ import ( certificatesv1alpha1 "k8s.io/client-go/applyconfigurations/certificates/v1alpha1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ClusterTrustBundlesGetter has a method to return a ClusterTrustBundleInterface. @@ -79,6 +80,16 @@ func (c *clusterTrustBundles) Get(ctx context.Context, name string, options v1.G // List takes label and field selectors, and returns the list of ClusterTrustBundles that match those selectors. func (c *clusterTrustBundles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterTrustBundleList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clustertrustbundles", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ClusterTrustBundles that match those selectors. +func (c *clusterTrustBundles) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterTrustBundleList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go b/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go index ec0b9d266f..d88d4020c2 100644 --- a/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go +++ b/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go @@ -31,6 +31,7 @@ import ( certificatesv1beta1 "k8s.io/client-go/applyconfigurations/certificates/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // CertificateSigningRequestsGetter has a method to return a CertificateSigningRequestInterface. @@ -81,6 +82,16 @@ func (c *certificateSigningRequests) Get(ctx context.Context, name string, optio // List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. func (c *certificateSigningRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CertificateSigningRequestList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for certificatesigningrequests", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. +func (c *certificateSigningRequests) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CertificateSigningRequestList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/coordination/v1/lease.go b/kubernetes/typed/coordination/v1/lease.go index 9e6b169a81..032787c672 100644 --- a/kubernetes/typed/coordination/v1/lease.go +++ b/kubernetes/typed/coordination/v1/lease.go @@ -31,6 +31,7 @@ import ( coordinationv1 "k8s.io/client-go/applyconfigurations/coordination/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // LeasesGetter has a method to return a LeaseInterface. @@ -82,6 +83,16 @@ func (c *leases) Get(ctx context.Context, name string, options metav1.GetOptions // List takes label and field selectors, and returns the list of Leases that match those selectors. func (c *leases) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LeaseList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for leases", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of Leases that match those selectors. +func (c *leases) list(ctx context.Context, opts metav1.ListOptions) (result *v1.LeaseList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/coordination/v1beta1/lease.go b/kubernetes/typed/coordination/v1beta1/lease.go index 1bbd57bdd1..e6841ffd98 100644 --- a/kubernetes/typed/coordination/v1beta1/lease.go +++ b/kubernetes/typed/coordination/v1beta1/lease.go @@ -31,6 +31,7 @@ import ( coordinationv1beta1 "k8s.io/client-go/applyconfigurations/coordination/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // LeasesGetter has a method to return a LeaseInterface. @@ -82,6 +83,16 @@ func (c *leases) Get(ctx context.Context, name string, options v1.GetOptions) (r // List takes label and field selectors, and returns the list of Leases that match those selectors. func (c *leases) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.LeaseList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for leases", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of Leases that match those selectors. +func (c *leases) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.LeaseList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/core/v1/componentstatus.go b/kubernetes/typed/core/v1/componentstatus.go index 0fef56429d..f2ea72e466 100644 --- a/kubernetes/typed/core/v1/componentstatus.go +++ b/kubernetes/typed/core/v1/componentstatus.go @@ -31,6 +31,7 @@ import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ComponentStatusesGetter has a method to return a ComponentStatusInterface. @@ -79,6 +80,16 @@ func (c *componentStatuses) Get(ctx context.Context, name string, options metav1 // List takes label and field selectors, and returns the list of ComponentStatuses that match those selectors. func (c *componentStatuses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ComponentStatusList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for componentstatuses", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ComponentStatuses that match those selectors. +func (c *componentStatuses) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ComponentStatusList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/core/v1/configmap.go b/kubernetes/typed/core/v1/configmap.go index b68177720b..27d19b8bd3 100644 --- a/kubernetes/typed/core/v1/configmap.go +++ b/kubernetes/typed/core/v1/configmap.go @@ -31,6 +31,7 @@ import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ConfigMapsGetter has a method to return a ConfigMapInterface. @@ -82,6 +83,16 @@ func (c *configMaps) Get(ctx context.Context, name string, options metav1.GetOpt // List takes label and field selectors, and returns the list of ConfigMaps that match those selectors. func (c *configMaps) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ConfigMapList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for configmaps", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ConfigMaps that match those selectors. +func (c *configMaps) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ConfigMapList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/core/v1/endpoints.go b/kubernetes/typed/core/v1/endpoints.go index cdf464b069..cf811572ba 100644 --- a/kubernetes/typed/core/v1/endpoints.go +++ b/kubernetes/typed/core/v1/endpoints.go @@ -31,6 +31,7 @@ import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // EndpointsGetter has a method to return a EndpointsInterface. @@ -82,6 +83,16 @@ func (c *endpoints) Get(ctx context.Context, name string, options metav1.GetOpti // List takes label and field selectors, and returns the list of Endpoints that match those selectors. func (c *endpoints) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointsList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for endpoints", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of Endpoints that match those selectors. +func (c *endpoints) list(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointsList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/core/v1/event.go b/kubernetes/typed/core/v1/event.go index 8274d85ffe..9873dbdb08 100644 --- a/kubernetes/typed/core/v1/event.go +++ b/kubernetes/typed/core/v1/event.go @@ -31,6 +31,7 @@ import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // EventsGetter has a method to return a EventInterface. @@ -82,6 +83,16 @@ func (c *events) Get(ctx context.Context, name string, options metav1.GetOptions // List takes label and field selectors, and returns the list of Events that match those selectors. func (c *events) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for events", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of Events that match those selectors. +func (c *events) list(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/core/v1/limitrange.go b/kubernetes/typed/core/v1/limitrange.go index e6883b607c..92f6b2f545 100644 --- a/kubernetes/typed/core/v1/limitrange.go +++ b/kubernetes/typed/core/v1/limitrange.go @@ -31,6 +31,7 @@ import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // LimitRangesGetter has a method to return a LimitRangeInterface. @@ -82,6 +83,16 @@ func (c *limitRanges) Get(ctx context.Context, name string, options metav1.GetOp // List takes label and field selectors, and returns the list of LimitRanges that match those selectors. func (c *limitRanges) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LimitRangeList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for limitranges", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of LimitRanges that match those selectors. +func (c *limitRanges) list(ctx context.Context, opts metav1.ListOptions) (result *v1.LimitRangeList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/core/v1/namespace.go b/kubernetes/typed/core/v1/namespace.go index 06c77b4c45..709d53ad85 100644 --- a/kubernetes/typed/core/v1/namespace.go +++ b/kubernetes/typed/core/v1/namespace.go @@ -31,6 +31,7 @@ import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // NamespacesGetter has a method to return a NamespaceInterface. @@ -80,6 +81,16 @@ func (c *namespaces) Get(ctx context.Context, name string, options metav1.GetOpt // List takes label and field selectors, and returns the list of Namespaces that match those selectors. func (c *namespaces) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NamespaceList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for namespaces", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of Namespaces that match those selectors. +func (c *namespaces) list(ctx context.Context, opts metav1.ListOptions) (result *v1.NamespaceList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/core/v1/node.go b/kubernetes/typed/core/v1/node.go index d9725b2f95..4a4fc825cc 100644 --- a/kubernetes/typed/core/v1/node.go +++ b/kubernetes/typed/core/v1/node.go @@ -31,6 +31,7 @@ import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // NodesGetter has a method to return a NodeInterface. @@ -81,6 +82,16 @@ func (c *nodes) Get(ctx context.Context, name string, options metav1.GetOptions) // List takes label and field selectors, and returns the list of Nodes that match those selectors. func (c *nodes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NodeList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for nodes", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of Nodes that match those selectors. +func (c *nodes) list(ctx context.Context, opts metav1.ListOptions) (result *v1.NodeList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/core/v1/persistentvolume.go b/kubernetes/typed/core/v1/persistentvolume.go index a8e2295977..63442dd9b0 100644 --- a/kubernetes/typed/core/v1/persistentvolume.go +++ b/kubernetes/typed/core/v1/persistentvolume.go @@ -31,6 +31,7 @@ import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // PersistentVolumesGetter has a method to return a PersistentVolumeInterface. @@ -81,6 +82,16 @@ func (c *persistentVolumes) Get(ctx context.Context, name string, options metav1 // List takes label and field selectors, and returns the list of PersistentVolumes that match those selectors. func (c *persistentVolumes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for persistentvolumes", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of PersistentVolumes that match those selectors. +func (c *persistentVolumes) list(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/core/v1/persistentvolumeclaim.go b/kubernetes/typed/core/v1/persistentvolumeclaim.go index 2e7f4fb44f..3b3c61c6b7 100644 --- a/kubernetes/typed/core/v1/persistentvolumeclaim.go +++ b/kubernetes/typed/core/v1/persistentvolumeclaim.go @@ -31,6 +31,7 @@ import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // PersistentVolumeClaimsGetter has a method to return a PersistentVolumeClaimInterface. @@ -84,6 +85,16 @@ func (c *persistentVolumeClaims) Get(ctx context.Context, name string, options m // List takes label and field selectors, and returns the list of PersistentVolumeClaims that match those selectors. func (c *persistentVolumeClaims) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeClaimList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for persistentvolumeclaims", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of PersistentVolumeClaims that match those selectors. +func (c *persistentVolumeClaims) list(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeClaimList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/core/v1/pod.go b/kubernetes/typed/core/v1/pod.go index 63122cf3fb..a275bd2c78 100644 --- a/kubernetes/typed/core/v1/pod.go +++ b/kubernetes/typed/core/v1/pod.go @@ -31,6 +31,7 @@ import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // PodsGetter has a method to return a PodInterface. @@ -86,6 +87,16 @@ func (c *pods) Get(ctx context.Context, name string, options metav1.GetOptions) // List takes label and field selectors, and returns the list of Pods that match those selectors. func (c *pods) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for pods", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of Pods that match those selectors. +func (c *pods) list(ctx context.Context, opts metav1.ListOptions) (result *v1.PodList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/core/v1/podtemplate.go b/kubernetes/typed/core/v1/podtemplate.go index ff90fc0e62..f657046535 100644 --- a/kubernetes/typed/core/v1/podtemplate.go +++ b/kubernetes/typed/core/v1/podtemplate.go @@ -31,6 +31,7 @@ import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // PodTemplatesGetter has a method to return a PodTemplateInterface. @@ -82,6 +83,16 @@ func (c *podTemplates) Get(ctx context.Context, name string, options metav1.GetO // List takes label and field selectors, and returns the list of PodTemplates that match those selectors. func (c *podTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodTemplateList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for podtemplates", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of PodTemplates that match those selectors. +func (c *podTemplates) list(ctx context.Context, opts metav1.ListOptions) (result *v1.PodTemplateList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/core/v1/replicationcontroller.go b/kubernetes/typed/core/v1/replicationcontroller.go index 49c75d967b..1ff2371f1e 100644 --- a/kubernetes/typed/core/v1/replicationcontroller.go +++ b/kubernetes/typed/core/v1/replicationcontroller.go @@ -32,6 +32,7 @@ import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ReplicationControllersGetter has a method to return a ReplicationControllerInterface. @@ -88,6 +89,16 @@ func (c *replicationControllers) Get(ctx context.Context, name string, options m // List takes label and field selectors, and returns the list of ReplicationControllers that match those selectors. func (c *replicationControllers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicationControllerList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicationcontrollers", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ReplicationControllers that match those selectors. +func (c *replicationControllers) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicationControllerList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/core/v1/resourcequota.go b/kubernetes/typed/core/v1/resourcequota.go index 8444d164ed..32d0e33ebd 100644 --- a/kubernetes/typed/core/v1/resourcequota.go +++ b/kubernetes/typed/core/v1/resourcequota.go @@ -31,6 +31,7 @@ import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ResourceQuotasGetter has a method to return a ResourceQuotaInterface. @@ -84,6 +85,16 @@ func (c *resourceQuotas) Get(ctx context.Context, name string, options metav1.Ge // List takes label and field selectors, and returns the list of ResourceQuotas that match those selectors. func (c *resourceQuotas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ResourceQuotaList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourcequotas", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ResourceQuotas that match those selectors. +func (c *resourceQuotas) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ResourceQuotaList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/core/v1/secret.go b/kubernetes/typed/core/v1/secret.go index 4aba330381..d0eee66918 100644 --- a/kubernetes/typed/core/v1/secret.go +++ b/kubernetes/typed/core/v1/secret.go @@ -31,6 +31,7 @@ import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // SecretsGetter has a method to return a SecretInterface. @@ -82,6 +83,16 @@ func (c *secrets) Get(ctx context.Context, name string, options metav1.GetOption // List takes label and field selectors, and returns the list of Secrets that match those selectors. func (c *secrets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SecretList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for secrets", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of Secrets that match those selectors. +func (c *secrets) list(ctx context.Context, opts metav1.ListOptions) (result *v1.SecretList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/core/v1/service.go b/kubernetes/typed/core/v1/service.go index 3fe22ba444..b87f5acdc9 100644 --- a/kubernetes/typed/core/v1/service.go +++ b/kubernetes/typed/core/v1/service.go @@ -31,6 +31,7 @@ import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ServicesGetter has a method to return a ServiceInterface. @@ -83,6 +84,16 @@ func (c *services) Get(ctx context.Context, name string, options metav1.GetOptio // List takes label and field selectors, and returns the list of Services that match those selectors. func (c *services) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for services", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of Services that match those selectors. +func (c *services) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/core/v1/serviceaccount.go b/kubernetes/typed/core/v1/serviceaccount.go index bdf589b960..ea08445ec4 100644 --- a/kubernetes/typed/core/v1/serviceaccount.go +++ b/kubernetes/typed/core/v1/serviceaccount.go @@ -32,6 +32,7 @@ import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ServiceAccountsGetter has a method to return a ServiceAccountInterface. @@ -85,6 +86,16 @@ func (c *serviceAccounts) Get(ctx context.Context, name string, options metav1.G // List takes label and field selectors, and returns the list of ServiceAccounts that match those selectors. func (c *serviceAccounts) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceAccountList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for serviceaccounts", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ServiceAccounts that match those selectors. +func (c *serviceAccounts) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceAccountList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/discovery/v1/endpointslice.go b/kubernetes/typed/discovery/v1/endpointslice.go index 63e616b033..eb9503bddc 100644 --- a/kubernetes/typed/discovery/v1/endpointslice.go +++ b/kubernetes/typed/discovery/v1/endpointslice.go @@ -31,6 +31,7 @@ import ( discoveryv1 "k8s.io/client-go/applyconfigurations/discovery/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // EndpointSlicesGetter has a method to return a EndpointSliceInterface. @@ -82,6 +83,16 @@ func (c *endpointSlices) Get(ctx context.Context, name string, options metav1.Ge // List takes label and field selectors, and returns the list of EndpointSlices that match those selectors. func (c *endpointSlices) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointSliceList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for endpointslices", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of EndpointSlices that match those selectors. +func (c *endpointSlices) list(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointSliceList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/discovery/v1beta1/endpointslice.go b/kubernetes/typed/discovery/v1beta1/endpointslice.go index 2ade833029..97f9bbb1e8 100644 --- a/kubernetes/typed/discovery/v1beta1/endpointslice.go +++ b/kubernetes/typed/discovery/v1beta1/endpointslice.go @@ -31,6 +31,7 @@ import ( discoveryv1beta1 "k8s.io/client-go/applyconfigurations/discovery/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // EndpointSlicesGetter has a method to return a EndpointSliceInterface. @@ -82,6 +83,16 @@ func (c *endpointSlices) Get(ctx context.Context, name string, options v1.GetOpt // List takes label and field selectors, and returns the list of EndpointSlices that match those selectors. func (c *endpointSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EndpointSliceList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for endpointslices", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of EndpointSlices that match those selectors. +func (c *endpointSlices) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EndpointSliceList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/events/v1/event.go b/kubernetes/typed/events/v1/event.go index c9f2bbed50..b34940c804 100644 --- a/kubernetes/typed/events/v1/event.go +++ b/kubernetes/typed/events/v1/event.go @@ -31,6 +31,7 @@ import ( eventsv1 "k8s.io/client-go/applyconfigurations/events/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // EventsGetter has a method to return a EventInterface. @@ -82,6 +83,16 @@ func (c *events) Get(ctx context.Context, name string, options metav1.GetOptions // List takes label and field selectors, and returns the list of Events that match those selectors. func (c *events) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for events", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of Events that match those selectors. +func (c *events) list(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/events/v1beta1/event.go b/kubernetes/typed/events/v1beta1/event.go index dfdf8b8979..cc7174aa5d 100644 --- a/kubernetes/typed/events/v1beta1/event.go +++ b/kubernetes/typed/events/v1beta1/event.go @@ -31,6 +31,7 @@ import ( eventsv1beta1 "k8s.io/client-go/applyconfigurations/events/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // EventsGetter has a method to return a EventInterface. @@ -82,6 +83,16 @@ func (c *events) Get(ctx context.Context, name string, options v1.GetOptions) (r // List takes label and field selectors, and returns the list of Events that match those selectors. func (c *events) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EventList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for events", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of Events that match those selectors. +func (c *events) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EventList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/extensions/v1beta1/daemonset.go b/kubernetes/typed/extensions/v1beta1/daemonset.go index ffe219fdaa..128d585e3e 100644 --- a/kubernetes/typed/extensions/v1beta1/daemonset.go +++ b/kubernetes/typed/extensions/v1beta1/daemonset.go @@ -31,6 +31,7 @@ import ( extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // DaemonSetsGetter has a method to return a DaemonSetInterface. @@ -84,6 +85,16 @@ func (c *daemonSets) Get(ctx context.Context, name string, options v1.GetOptions // 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 *v1beta1.DaemonSetList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for daemonsets", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// 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 *v1beta1.DaemonSetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/extensions/v1beta1/deployment.go b/kubernetes/typed/extensions/v1beta1/deployment.go index c41d8dbc26..245e05ad93 100644 --- a/kubernetes/typed/extensions/v1beta1/deployment.go +++ b/kubernetes/typed/extensions/v1beta1/deployment.go @@ -31,6 +31,7 @@ import ( extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // DeploymentsGetter has a method to return a DeploymentInterface. @@ -88,6 +89,16 @@ func (c *deployments) Get(ctx context.Context, name string, options v1.GetOption // List takes label and field selectors, and returns the list of Deployments that match those selectors. func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of Deployments that match those selectors. +func (c *deployments) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/extensions/v1beta1/ingress.go b/kubernetes/typed/extensions/v1beta1/ingress.go index dd4012cc23..c5c0376c32 100644 --- a/kubernetes/typed/extensions/v1beta1/ingress.go +++ b/kubernetes/typed/extensions/v1beta1/ingress.go @@ -31,6 +31,7 @@ import ( extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // IngressesGetter has a method to return a IngressInterface. @@ -84,6 +85,16 @@ func (c *ingresses) Get(ctx context.Context, name string, options v1.GetOptions) // List takes label and field selectors, and returns the list of Ingresses that match those selectors. func (c *ingresses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingresses", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of Ingresses that match those selectors. +func (c *ingresses) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/extensions/v1beta1/networkpolicy.go b/kubernetes/typed/extensions/v1beta1/networkpolicy.go index 978b26db03..9bbe425796 100644 --- a/kubernetes/typed/extensions/v1beta1/networkpolicy.go +++ b/kubernetes/typed/extensions/v1beta1/networkpolicy.go @@ -31,6 +31,7 @@ import ( extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // NetworkPoliciesGetter has a method to return a NetworkPolicyInterface. @@ -82,6 +83,16 @@ func (c *networkPolicies) Get(ctx context.Context, name string, options v1.GetOp // 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 *v1beta1.NetworkPolicyList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for networkpolicies", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// 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 *v1beta1.NetworkPolicyList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/extensions/v1beta1/replicaset.go b/kubernetes/typed/extensions/v1beta1/replicaset.go index 3c907a3a04..1ac971cfae 100644 --- a/kubernetes/typed/extensions/v1beta1/replicaset.go +++ b/kubernetes/typed/extensions/v1beta1/replicaset.go @@ -31,6 +31,7 @@ import ( extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ReplicaSetsGetter has a method to return a ReplicaSetInterface. @@ -88,6 +89,16 @@ func (c *replicaSets) Get(ctx context.Context, name string, options v1.GetOption // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. func (c *replicaSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ReplicaSetList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicasets", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ReplicaSets that match those selectors. +func (c *replicaSets) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ReplicaSetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/flowcontrol/v1/flowschema.go b/kubernetes/typed/flowcontrol/v1/flowschema.go index bd36c5e6a4..504338ea55 100644 --- a/kubernetes/typed/flowcontrol/v1/flowschema.go +++ b/kubernetes/typed/flowcontrol/v1/flowschema.go @@ -31,6 +31,7 @@ import ( flowcontrolv1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // FlowSchemasGetter has a method to return a FlowSchemaInterface. @@ -81,6 +82,16 @@ func (c *flowSchemas) Get(ctx context.Context, name string, options metav1.GetOp // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. func (c *flowSchemas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FlowSchemaList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of FlowSchemas that match those selectors. +func (c *flowSchemas) list(ctx context.Context, opts metav1.ListOptions) (result *v1.FlowSchemaList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go index 797fe94035..15328d0dc0 100644 --- a/kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go @@ -31,6 +31,7 @@ import ( flowcontrolv1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface. @@ -81,6 +82,16 @@ func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, opti // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. func (c *priorityLevelConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityLevelConfigurationList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. +func (c *priorityLevelConfigurations) list(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityLevelConfigurationList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/flowcontrol/v1beta1/flowschema.go b/kubernetes/typed/flowcontrol/v1beta1/flowschema.go index a9d38becf9..b6a6ea5844 100644 --- a/kubernetes/typed/flowcontrol/v1beta1/flowschema.go +++ b/kubernetes/typed/flowcontrol/v1beta1/flowschema.go @@ -31,6 +31,7 @@ import ( flowcontrolv1beta1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // FlowSchemasGetter has a method to return a FlowSchemaInterface. @@ -81,6 +82,16 @@ func (c *flowSchemas) Get(ctx context.Context, name string, options v1.GetOption // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. func (c *flowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.FlowSchemaList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of FlowSchemas that match those selectors. +func (c *flowSchemas) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.FlowSchemaList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/flowcontrol/v1beta1/prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1beta1/prioritylevelconfiguration.go index 41f35cbccd..7dff545309 100644 --- a/kubernetes/typed/flowcontrol/v1beta1/prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1beta1/prioritylevelconfiguration.go @@ -31,6 +31,7 @@ import ( flowcontrolv1beta1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface. @@ -81,6 +82,16 @@ func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, opti // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. func (c *priorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityLevelConfigurationList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. +func (c *priorityLevelConfigurations) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityLevelConfigurationList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/flowcontrol/v1beta2/flowschema.go b/kubernetes/typed/flowcontrol/v1beta2/flowschema.go index 3a1f12b6a2..326405096e 100644 --- a/kubernetes/typed/flowcontrol/v1beta2/flowschema.go +++ b/kubernetes/typed/flowcontrol/v1beta2/flowschema.go @@ -31,6 +31,7 @@ import ( flowcontrolv1beta2 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // FlowSchemasGetter has a method to return a FlowSchemaInterface. @@ -81,6 +82,16 @@ func (c *flowSchemas) Get(ctx context.Context, name string, options v1.GetOption // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. func (c *flowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.FlowSchemaList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of FlowSchemas that match those selectors. +func (c *flowSchemas) list(ctx context.Context, opts v1.ListOptions) (result *v1beta2.FlowSchemaList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/flowcontrol/v1beta2/prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1beta2/prioritylevelconfiguration.go index f028869f17..a1621fc2da 100644 --- a/kubernetes/typed/flowcontrol/v1beta2/prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1beta2/prioritylevelconfiguration.go @@ -31,6 +31,7 @@ import ( flowcontrolv1beta2 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface. @@ -81,6 +82,16 @@ func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, opti // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. func (c *priorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.PriorityLevelConfigurationList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. +func (c *priorityLevelConfigurations) list(ctx context.Context, opts v1.ListOptions) (result *v1beta2.PriorityLevelConfigurationList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/flowcontrol/v1beta3/flowschema.go b/kubernetes/typed/flowcontrol/v1beta3/flowschema.go index 5fa39d6baf..93bd355321 100644 --- a/kubernetes/typed/flowcontrol/v1beta3/flowschema.go +++ b/kubernetes/typed/flowcontrol/v1beta3/flowschema.go @@ -31,6 +31,7 @@ import ( flowcontrolv1beta3 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // FlowSchemasGetter has a method to return a FlowSchemaInterface. @@ -81,6 +82,16 @@ func (c *flowSchemas) Get(ctx context.Context, name string, options v1.GetOption // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. func (c *flowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta3.FlowSchemaList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of FlowSchemas that match those selectors. +func (c *flowSchemas) list(ctx context.Context, opts v1.ListOptions) (result *v1beta3.FlowSchemaList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/flowcontrol/v1beta3/prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1beta3/prioritylevelconfiguration.go index 49f05257c9..d419be5f8a 100644 --- a/kubernetes/typed/flowcontrol/v1beta3/prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1beta3/prioritylevelconfiguration.go @@ -31,6 +31,7 @@ import ( flowcontrolv1beta3 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface. @@ -81,6 +82,16 @@ func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, opti // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. func (c *priorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta3.PriorityLevelConfigurationList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. +func (c *priorityLevelConfigurations) list(ctx context.Context, opts v1.ListOptions) (result *v1beta3.PriorityLevelConfigurationList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/networking/v1/ingress.go b/kubernetes/typed/networking/v1/ingress.go index 9923d6cbae..dbdf32b90c 100644 --- a/kubernetes/typed/networking/v1/ingress.go +++ b/kubernetes/typed/networking/v1/ingress.go @@ -31,6 +31,7 @@ import ( networkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // IngressesGetter has a method to return a IngressInterface. @@ -84,6 +85,16 @@ func (c *ingresses) Get(ctx context.Context, name string, options metav1.GetOpti // List takes label and field selectors, and returns the list of Ingresses that match those selectors. func (c *ingresses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingresses", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of Ingresses that match those selectors. +func (c *ingresses) list(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/networking/v1/ingressclass.go b/kubernetes/typed/networking/v1/ingressclass.go index 16c8e48bf0..4ca832c90b 100644 --- a/kubernetes/typed/networking/v1/ingressclass.go +++ b/kubernetes/typed/networking/v1/ingressclass.go @@ -31,6 +31,7 @@ import ( networkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // IngressClassesGetter has a method to return a IngressClassInterface. @@ -79,6 +80,16 @@ func (c *ingressClasses) Get(ctx context.Context, name string, options metav1.Ge // List takes label and field selectors, and returns the list of IngressClasses that match those selectors. func (c *ingressClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressClassList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingressclasses", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of IngressClasses that match those selectors. +func (c *ingressClasses) list(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressClassList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/networking/v1/networkpolicy.go b/kubernetes/typed/networking/v1/networkpolicy.go index d7454ce145..1fd8bd0347 100644 --- a/kubernetes/typed/networking/v1/networkpolicy.go +++ b/kubernetes/typed/networking/v1/networkpolicy.go @@ -31,6 +31,7 @@ import ( networkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // NetworkPoliciesGetter has a method to return a NetworkPolicyInterface. @@ -82,6 +83,16 @@ func (c *networkPolicies) Get(ctx context.Context, name string, options metav1.G // List takes label and field selectors, and returns the list of NetworkPolicies that match those selectors. func (c *networkPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NetworkPolicyList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for networkpolicies", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of NetworkPolicies that match those selectors. +func (c *networkPolicies) list(ctx context.Context, opts metav1.ListOptions) (result *v1.NetworkPolicyList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/networking/v1alpha1/ipaddress.go b/kubernetes/typed/networking/v1alpha1/ipaddress.go index fff193d68d..fcf63fc85e 100644 --- a/kubernetes/typed/networking/v1alpha1/ipaddress.go +++ b/kubernetes/typed/networking/v1alpha1/ipaddress.go @@ -31,6 +31,7 @@ import ( networkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // IPAddressesGetter has a method to return a IPAddressInterface. @@ -79,6 +80,16 @@ func (c *iPAddresses) Get(ctx context.Context, name string, options v1.GetOption // 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) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ipaddresses", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// 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 diff --git a/kubernetes/typed/networking/v1alpha1/servicecidr.go b/kubernetes/typed/networking/v1alpha1/servicecidr.go index 100f290a19..392f30d2e3 100644 --- a/kubernetes/typed/networking/v1alpha1/servicecidr.go +++ b/kubernetes/typed/networking/v1alpha1/servicecidr.go @@ -31,6 +31,7 @@ import ( networkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ServiceCIDRsGetter has a method to return a ServiceCIDRInterface. @@ -81,6 +82,16 @@ func (c *serviceCIDRs) Get(ctx context.Context, name string, options v1.GetOptio // List takes label and field selectors, and returns the list of ServiceCIDRs that match those selectors. func (c *serviceCIDRs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ServiceCIDRList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for servicecidrs", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ServiceCIDRs that match those selectors. +func (c *serviceCIDRs) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ServiceCIDRList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/networking/v1beta1/ingress.go b/kubernetes/typed/networking/v1beta1/ingress.go index b309281afa..92df698e8d 100644 --- a/kubernetes/typed/networking/v1beta1/ingress.go +++ b/kubernetes/typed/networking/v1beta1/ingress.go @@ -31,6 +31,7 @@ import ( networkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // IngressesGetter has a method to return a IngressInterface. @@ -84,6 +85,16 @@ func (c *ingresses) Get(ctx context.Context, name string, options v1.GetOptions) // List takes label and field selectors, and returns the list of Ingresses that match those selectors. func (c *ingresses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingresses", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of Ingresses that match those selectors. +func (c *ingresses) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/networking/v1beta1/ingressclass.go b/kubernetes/typed/networking/v1beta1/ingressclass.go index 50ccdfdbba..577a4d87e2 100644 --- a/kubernetes/typed/networking/v1beta1/ingressclass.go +++ b/kubernetes/typed/networking/v1beta1/ingressclass.go @@ -31,6 +31,7 @@ import ( networkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // IngressClassesGetter has a method to return a IngressClassInterface. @@ -79,6 +80,16 @@ func (c *ingressClasses) Get(ctx context.Context, name string, options v1.GetOpt // List takes label and field selectors, and returns the list of IngressClasses that match those selectors. func (c *ingressClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressClassList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingressclasses", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of IngressClasses that match those selectors. +func (c *ingressClasses) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressClassList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/node/v1/runtimeclass.go b/kubernetes/typed/node/v1/runtimeclass.go index 5ec38b203e..c8911b1e67 100644 --- a/kubernetes/typed/node/v1/runtimeclass.go +++ b/kubernetes/typed/node/v1/runtimeclass.go @@ -31,6 +31,7 @@ import ( nodev1 "k8s.io/client-go/applyconfigurations/node/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // RuntimeClassesGetter has a method to return a RuntimeClassInterface. @@ -79,6 +80,16 @@ func (c *runtimeClasses) Get(ctx context.Context, name string, options metav1.Ge // List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. func (c *runtimeClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RuntimeClassList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for runtimeclasses", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. +func (c *runtimeClasses) list(ctx context.Context, opts metav1.ListOptions) (result *v1.RuntimeClassList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/node/v1alpha1/runtimeclass.go b/kubernetes/typed/node/v1alpha1/runtimeclass.go index 039a7ace15..c9fdaae5ad 100644 --- a/kubernetes/typed/node/v1alpha1/runtimeclass.go +++ b/kubernetes/typed/node/v1alpha1/runtimeclass.go @@ -31,6 +31,7 @@ import ( nodev1alpha1 "k8s.io/client-go/applyconfigurations/node/v1alpha1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // RuntimeClassesGetter has a method to return a RuntimeClassInterface. @@ -79,6 +80,16 @@ func (c *runtimeClasses) Get(ctx context.Context, name string, options v1.GetOpt // List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. func (c *runtimeClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RuntimeClassList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for runtimeclasses", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. +func (c *runtimeClasses) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RuntimeClassList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/node/v1beta1/runtimeclass.go b/kubernetes/typed/node/v1beta1/runtimeclass.go index f8990adf1e..341a1e0969 100644 --- a/kubernetes/typed/node/v1beta1/runtimeclass.go +++ b/kubernetes/typed/node/v1beta1/runtimeclass.go @@ -31,6 +31,7 @@ import ( nodev1beta1 "k8s.io/client-go/applyconfigurations/node/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // RuntimeClassesGetter has a method to return a RuntimeClassInterface. @@ -79,6 +80,16 @@ func (c *runtimeClasses) Get(ctx context.Context, name string, options v1.GetOpt // List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. func (c *runtimeClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RuntimeClassList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for runtimeclasses", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. +func (c *runtimeClasses) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RuntimeClassList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/policy/v1/poddisruptionbudget.go b/kubernetes/typed/policy/v1/poddisruptionbudget.go index 58db3acf9e..37d93a2b25 100644 --- a/kubernetes/typed/policy/v1/poddisruptionbudget.go +++ b/kubernetes/typed/policy/v1/poddisruptionbudget.go @@ -31,6 +31,7 @@ import ( policyv1 "k8s.io/client-go/applyconfigurations/policy/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // PodDisruptionBudgetsGetter has a method to return a PodDisruptionBudgetInterface. @@ -84,6 +85,16 @@ func (c *podDisruptionBudgets) Get(ctx context.Context, name string, options met // List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. func (c *podDisruptionBudgets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodDisruptionBudgetList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for poddisruptionbudgets", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. +func (c *podDisruptionBudgets) list(ctx context.Context, opts metav1.ListOptions) (result *v1.PodDisruptionBudgetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go b/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go index 1687289921..86fa7a689d 100644 --- a/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go +++ b/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go @@ -31,6 +31,7 @@ import ( policyv1beta1 "k8s.io/client-go/applyconfigurations/policy/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // PodDisruptionBudgetsGetter has a method to return a PodDisruptionBudgetInterface. @@ -84,6 +85,16 @@ func (c *podDisruptionBudgets) Get(ctx context.Context, name string, options v1. // List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. func (c *podDisruptionBudgets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PodDisruptionBudgetList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for poddisruptionbudgets", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. +func (c *podDisruptionBudgets) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PodDisruptionBudgetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/rbac/v1/clusterrole.go b/kubernetes/typed/rbac/v1/clusterrole.go index 000d737f0f..c072389a70 100644 --- a/kubernetes/typed/rbac/v1/clusterrole.go +++ b/kubernetes/typed/rbac/v1/clusterrole.go @@ -31,6 +31,7 @@ import ( rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ClusterRolesGetter has a method to return a ClusterRoleInterface. @@ -79,6 +80,16 @@ func (c *clusterRoles) Get(ctx context.Context, name string, options metav1.GetO // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. func (c *clusterRoles) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterroles", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ClusterRoles that match those selectors. +func (c *clusterRoles) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/rbac/v1/clusterrolebinding.go b/kubernetes/typed/rbac/v1/clusterrolebinding.go index 31db43d984..09003ceb24 100644 --- a/kubernetes/typed/rbac/v1/clusterrolebinding.go +++ b/kubernetes/typed/rbac/v1/clusterrolebinding.go @@ -31,6 +31,7 @@ import ( rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ClusterRoleBindingsGetter has a method to return a ClusterRoleBindingInterface. @@ -79,6 +80,16 @@ func (c *clusterRoleBindings) Get(ctx context.Context, name string, options meta // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. func (c *clusterRoleBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleBindingList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterrolebindings", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. +func (c *clusterRoleBindings) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleBindingList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/rbac/v1/role.go b/kubernetes/typed/rbac/v1/role.go index 93810a3ffa..fd2b92c033 100644 --- a/kubernetes/typed/rbac/v1/role.go +++ b/kubernetes/typed/rbac/v1/role.go @@ -31,6 +31,7 @@ import ( rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // RolesGetter has a method to return a RoleInterface. @@ -82,6 +83,16 @@ func (c *roles) Get(ctx context.Context, name string, options metav1.GetOptions) // List takes label and field selectors, and returns the list of Roles that match those selectors. func (c *roles) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for roles", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of Roles that match those selectors. +func (c *roles) list(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/rbac/v1/rolebinding.go b/kubernetes/typed/rbac/v1/rolebinding.go index 2ace938604..567c4b51c7 100644 --- a/kubernetes/typed/rbac/v1/rolebinding.go +++ b/kubernetes/typed/rbac/v1/rolebinding.go @@ -31,6 +31,7 @@ import ( rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // RoleBindingsGetter has a method to return a RoleBindingInterface. @@ -82,6 +83,16 @@ func (c *roleBindings) Get(ctx context.Context, name string, options metav1.GetO // List takes label and field selectors, and returns the list of RoleBindings that match those selectors. func (c *roleBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleBindingList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for rolebindings", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of RoleBindings that match those selectors. +func (c *roleBindings) list(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleBindingList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/rbac/v1alpha1/clusterrole.go b/kubernetes/typed/rbac/v1alpha1/clusterrole.go index d6d30e99ef..b8021be3ad 100644 --- a/kubernetes/typed/rbac/v1alpha1/clusterrole.go +++ b/kubernetes/typed/rbac/v1alpha1/clusterrole.go @@ -31,6 +31,7 @@ import ( rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ClusterRolesGetter has a method to return a ClusterRoleInterface. @@ -79,6 +80,16 @@ func (c *clusterRoles) Get(ctx context.Context, name string, options v1.GetOptio // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. func (c *clusterRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterroles", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ClusterRoles that match those selectors. +func (c *clusterRoles) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go b/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go index 2eded92ac2..f55f7db39c 100644 --- a/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go +++ b/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go @@ -31,6 +31,7 @@ import ( rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ClusterRoleBindingsGetter has a method to return a ClusterRoleBindingInterface. @@ -79,6 +80,16 @@ func (c *clusterRoleBindings) Get(ctx context.Context, name string, options v1.G // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. func (c *clusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleBindingList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterrolebindings", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. +func (c *clusterRoleBindings) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleBindingList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/rbac/v1alpha1/role.go b/kubernetes/typed/rbac/v1alpha1/role.go index 43c16fde74..babc5d245d 100644 --- a/kubernetes/typed/rbac/v1alpha1/role.go +++ b/kubernetes/typed/rbac/v1alpha1/role.go @@ -31,6 +31,7 @@ import ( rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // RolesGetter has a method to return a RoleInterface. @@ -82,6 +83,16 @@ func (c *roles) Get(ctx context.Context, name string, options v1.GetOptions) (re // List takes label and field selectors, and returns the list of Roles that match those selectors. func (c *roles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for roles", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of Roles that match those selectors. +func (c *roles) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/rbac/v1alpha1/rolebinding.go b/kubernetes/typed/rbac/v1alpha1/rolebinding.go index 3129c9b4e8..1804457ea3 100644 --- a/kubernetes/typed/rbac/v1alpha1/rolebinding.go +++ b/kubernetes/typed/rbac/v1alpha1/rolebinding.go @@ -31,6 +31,7 @@ import ( rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // RoleBindingsGetter has a method to return a RoleBindingInterface. @@ -82,6 +83,16 @@ func (c *roleBindings) Get(ctx context.Context, name string, options v1.GetOptio // List takes label and field selectors, and returns the list of RoleBindings that match those selectors. func (c *roleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleBindingList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for rolebindings", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of RoleBindings that match those selectors. +func (c *roleBindings) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleBindingList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/rbac/v1beta1/clusterrole.go b/kubernetes/typed/rbac/v1beta1/clusterrole.go index a3d67f0315..e61f4ce375 100644 --- a/kubernetes/typed/rbac/v1beta1/clusterrole.go +++ b/kubernetes/typed/rbac/v1beta1/clusterrole.go @@ -31,6 +31,7 @@ import ( rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ClusterRolesGetter has a method to return a ClusterRoleInterface. @@ -79,6 +80,16 @@ func (c *clusterRoles) Get(ctx context.Context, name string, options v1.GetOptio // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. func (c *clusterRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterroles", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ClusterRoles that match those selectors. +func (c *clusterRoles) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go b/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go index ae39cbb9ae..a80e99be31 100644 --- a/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go +++ b/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go @@ -31,6 +31,7 @@ import ( rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ClusterRoleBindingsGetter has a method to return a ClusterRoleBindingInterface. @@ -79,6 +80,16 @@ func (c *clusterRoleBindings) Get(ctx context.Context, name string, options v1.G // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. func (c *clusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleBindingList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterrolebindings", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. +func (c *clusterRoleBindings) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleBindingList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/rbac/v1beta1/role.go b/kubernetes/typed/rbac/v1beta1/role.go index e789e42fe7..2dbb713d54 100644 --- a/kubernetes/typed/rbac/v1beta1/role.go +++ b/kubernetes/typed/rbac/v1beta1/role.go @@ -31,6 +31,7 @@ import ( rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // RolesGetter has a method to return a RoleInterface. @@ -82,6 +83,16 @@ func (c *roles) Get(ctx context.Context, name string, options v1.GetOptions) (re // List takes label and field selectors, and returns the list of Roles that match those selectors. func (c *roles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for roles", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of Roles that match those selectors. +func (c *roles) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/rbac/v1beta1/rolebinding.go b/kubernetes/typed/rbac/v1beta1/rolebinding.go index 1461ba3b6e..dfb60abc44 100644 --- a/kubernetes/typed/rbac/v1beta1/rolebinding.go +++ b/kubernetes/typed/rbac/v1beta1/rolebinding.go @@ -31,6 +31,7 @@ import ( rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // RoleBindingsGetter has a method to return a RoleBindingInterface. @@ -82,6 +83,16 @@ func (c *roleBindings) Get(ctx context.Context, name string, options v1.GetOptio // List takes label and field selectors, and returns the list of RoleBindings that match those selectors. func (c *roleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleBindingList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for rolebindings", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of RoleBindings that match those selectors. +func (c *roleBindings) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleBindingList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/resource/v1alpha2/podschedulingcontext.go b/kubernetes/typed/resource/v1alpha2/podschedulingcontext.go index 72e81a29e3..f5158bb63d 100644 --- a/kubernetes/typed/resource/v1alpha2/podschedulingcontext.go +++ b/kubernetes/typed/resource/v1alpha2/podschedulingcontext.go @@ -31,6 +31,7 @@ import ( resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // PodSchedulingContextsGetter has a method to return a PodSchedulingContextInterface. @@ -84,6 +85,16 @@ func (c *podSchedulingContexts) Get(ctx context.Context, name string, options v1 // List takes label and field selectors, and returns the list of PodSchedulingContexts that match those selectors. func (c *podSchedulingContexts) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.PodSchedulingContextList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for podschedulingcontexts", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of PodSchedulingContexts that match those selectors. +func (c *podSchedulingContexts) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.PodSchedulingContextList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/resource/v1alpha2/resourceclaim.go b/kubernetes/typed/resource/v1alpha2/resourceclaim.go index cfb27c9db6..bd1e574f46 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceclaim.go +++ b/kubernetes/typed/resource/v1alpha2/resourceclaim.go @@ -31,6 +31,7 @@ import ( resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ResourceClaimsGetter has a method to return a ResourceClaimInterface. @@ -84,6 +85,16 @@ func (c *resourceClaims) Get(ctx context.Context, name string, options v1.GetOpt // List takes label and field selectors, and returns the list of ResourceClaims that match those selectors. func (c *resourceClaims) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclaims", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ResourceClaims that match those selectors. +func (c *resourceClaims) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go b/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go index d08afcb611..4f37f1672b 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go +++ b/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go @@ -31,6 +31,7 @@ import ( resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ResourceClaimParametersGetter has a method to return a ResourceClaimParametersInterface. @@ -82,6 +83,16 @@ func (c *resourceClaimParameters) Get(ctx context.Context, name string, options // List takes label and field selectors, and returns the list of ResourceClaimParameters that match those selectors. func (c *resourceClaimParameters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimParametersList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclaimparameters", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ResourceClaimParameters that match those selectors. +func (c *resourceClaimParameters) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimParametersList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/resource/v1alpha2/resourceclaimtemplate.go b/kubernetes/typed/resource/v1alpha2/resourceclaimtemplate.go index 3f4e320064..b9d7ab8333 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceclaimtemplate.go +++ b/kubernetes/typed/resource/v1alpha2/resourceclaimtemplate.go @@ -31,6 +31,7 @@ import ( resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ResourceClaimTemplatesGetter has a method to return a ResourceClaimTemplateInterface. @@ -82,6 +83,16 @@ func (c *resourceClaimTemplates) Get(ctx context.Context, name string, options v // List takes label and field selectors, and returns the list of ResourceClaimTemplates that match those selectors. func (c *resourceClaimTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimTemplateList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclaimtemplates", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ResourceClaimTemplates that match those selectors. +func (c *resourceClaimTemplates) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimTemplateList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/resource/v1alpha2/resourceclass.go b/kubernetes/typed/resource/v1alpha2/resourceclass.go index 95a4ac5668..6a30db0bfd 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceclass.go +++ b/kubernetes/typed/resource/v1alpha2/resourceclass.go @@ -31,6 +31,7 @@ import ( resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ResourceClassesGetter has a method to return a ResourceClassInterface. @@ -79,6 +80,16 @@ func (c *resourceClasses) Get(ctx context.Context, name string, options v1.GetOp // List takes label and field selectors, and returns the list of ResourceClasses that match those selectors. func (c *resourceClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclasses", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ResourceClasses that match those selectors. +func (c *resourceClasses) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go b/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go index 8ac9be0784..7603c8b05f 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go +++ b/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go @@ -31,6 +31,7 @@ import ( resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ResourceClassParametersGetter has a method to return a ResourceClassParametersInterface. @@ -82,6 +83,16 @@ func (c *resourceClassParameters) Get(ctx context.Context, name string, options // List takes label and field selectors, and returns the list of ResourceClassParameters that match those selectors. func (c *resourceClassParameters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassParametersList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclassparameters", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ResourceClassParameters that match those selectors. +func (c *resourceClassParameters) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassParametersList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/resource/v1alpha2/resourceslice.go b/kubernetes/typed/resource/v1alpha2/resourceslice.go index 302f370d52..29440c5794 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceslice.go +++ b/kubernetes/typed/resource/v1alpha2/resourceslice.go @@ -31,6 +31,7 @@ import ( resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // ResourceSlicesGetter has a method to return a ResourceSliceInterface. @@ -79,6 +80,16 @@ func (c *resourceSlices) Get(ctx context.Context, name string, options v1.GetOpt // List takes label and field selectors, and returns the list of ResourceSlices that match those selectors. func (c *resourceSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceSliceList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceslices", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of ResourceSlices that match those selectors. +func (c *resourceSlices) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceSliceList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/scheduling/v1/priorityclass.go b/kubernetes/typed/scheduling/v1/priorityclass.go index c68ec5da41..c7eb4c6167 100644 --- a/kubernetes/typed/scheduling/v1/priorityclass.go +++ b/kubernetes/typed/scheduling/v1/priorityclass.go @@ -31,6 +31,7 @@ import ( schedulingv1 "k8s.io/client-go/applyconfigurations/scheduling/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // PriorityClassesGetter has a method to return a PriorityClassInterface. @@ -79,6 +80,16 @@ func (c *priorityClasses) Get(ctx context.Context, name string, options metav1.G // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. func (c *priorityClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityClassList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for priorityclasses", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of PriorityClasses that match those selectors. +func (c *priorityClasses) list(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityClassList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/scheduling/v1alpha1/priorityclass.go b/kubernetes/typed/scheduling/v1alpha1/priorityclass.go index a9b8c19c78..40ce343795 100644 --- a/kubernetes/typed/scheduling/v1alpha1/priorityclass.go +++ b/kubernetes/typed/scheduling/v1alpha1/priorityclass.go @@ -31,6 +31,7 @@ import ( schedulingv1alpha1 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // PriorityClassesGetter has a method to return a PriorityClassInterface. @@ -79,6 +80,16 @@ func (c *priorityClasses) Get(ctx context.Context, name string, options v1.GetOp // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. func (c *priorityClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PriorityClassList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for priorityclasses", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of PriorityClasses that match those selectors. +func (c *priorityClasses) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PriorityClassList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/scheduling/v1beta1/priorityclass.go b/kubernetes/typed/scheduling/v1beta1/priorityclass.go index 155476e4c7..d22d9bafc5 100644 --- a/kubernetes/typed/scheduling/v1beta1/priorityclass.go +++ b/kubernetes/typed/scheduling/v1beta1/priorityclass.go @@ -31,6 +31,7 @@ import ( schedulingv1beta1 "k8s.io/client-go/applyconfigurations/scheduling/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // PriorityClassesGetter has a method to return a PriorityClassInterface. @@ -79,6 +80,16 @@ func (c *priorityClasses) Get(ctx context.Context, name string, options v1.GetOp // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. func (c *priorityClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityClassList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for priorityclasses", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of PriorityClasses that match those selectors. +func (c *priorityClasses) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityClassList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/storage/v1/csidriver.go b/kubernetes/typed/storage/v1/csidriver.go index d9dc4151e2..afb1066931 100644 --- a/kubernetes/typed/storage/v1/csidriver.go +++ b/kubernetes/typed/storage/v1/csidriver.go @@ -31,6 +31,7 @@ import ( storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // CSIDriversGetter has a method to return a CSIDriverInterface. @@ -79,6 +80,16 @@ func (c *cSIDrivers) Get(ctx context.Context, name string, options metav1.GetOpt // List takes label and field selectors, and returns the list of CSIDrivers that match those selectors. func (c *cSIDrivers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CSIDriverList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csidrivers", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of CSIDrivers that match those selectors. +func (c *cSIDrivers) list(ctx context.Context, opts metav1.ListOptions) (result *v1.CSIDriverList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/storage/v1/csinode.go b/kubernetes/typed/storage/v1/csinode.go index 17dbc8c1c8..4d5ce7899b 100644 --- a/kubernetes/typed/storage/v1/csinode.go +++ b/kubernetes/typed/storage/v1/csinode.go @@ -31,6 +31,7 @@ import ( storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // CSINodesGetter has a method to return a CSINodeInterface. @@ -79,6 +80,16 @@ func (c *cSINodes) Get(ctx context.Context, name string, options metav1.GetOptio // List takes label and field selectors, and returns the list of CSINodes that match those selectors. func (c *cSINodes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CSINodeList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csinodes", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of CSINodes that match those selectors. +func (c *cSINodes) list(ctx context.Context, opts metav1.ListOptions) (result *v1.CSINodeList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/storage/v1/csistoragecapacity.go b/kubernetes/typed/storage/v1/csistoragecapacity.go index 6bb50e0da9..4c3e1f249a 100644 --- a/kubernetes/typed/storage/v1/csistoragecapacity.go +++ b/kubernetes/typed/storage/v1/csistoragecapacity.go @@ -31,6 +31,7 @@ import ( storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // CSIStorageCapacitiesGetter has a method to return a CSIStorageCapacityInterface. @@ -82,6 +83,16 @@ func (c *cSIStorageCapacities) Get(ctx context.Context, name string, options met // List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. func (c *cSIStorageCapacities) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CSIStorageCapacityList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csistoragecapacities", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. +func (c *cSIStorageCapacities) list(ctx context.Context, opts metav1.ListOptions) (result *v1.CSIStorageCapacityList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/storage/v1/storageclass.go b/kubernetes/typed/storage/v1/storageclass.go index 8e97d90a0f..cce61b2c06 100644 --- a/kubernetes/typed/storage/v1/storageclass.go +++ b/kubernetes/typed/storage/v1/storageclass.go @@ -31,6 +31,7 @@ import ( storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // StorageClassesGetter has a method to return a StorageClassInterface. @@ -79,6 +80,16 @@ func (c *storageClasses) Get(ctx context.Context, name string, options metav1.Ge // List takes label and field selectors, and returns the list of StorageClasses that match those selectors. func (c *storageClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.StorageClassList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for storageclasses", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of StorageClasses that match those selectors. +func (c *storageClasses) list(ctx context.Context, opts metav1.ListOptions) (result *v1.StorageClassList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/storage/v1/volumeattachment.go b/kubernetes/typed/storage/v1/volumeattachment.go index c1dbec84f4..c29fe44866 100644 --- a/kubernetes/typed/storage/v1/volumeattachment.go +++ b/kubernetes/typed/storage/v1/volumeattachment.go @@ -31,6 +31,7 @@ import ( storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // VolumeAttachmentsGetter has a method to return a VolumeAttachmentInterface. @@ -81,6 +82,16 @@ func (c *volumeAttachments) Get(ctx context.Context, name string, options metav1 // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. func (c *volumeAttachments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VolumeAttachmentList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for volumeattachments", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. +func (c *volumeAttachments) list(ctx context.Context, opts metav1.ListOptions) (result *v1.VolumeAttachmentList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/storage/v1alpha1/csistoragecapacity.go b/kubernetes/typed/storage/v1alpha1/csistoragecapacity.go index bf5d64dddc..2d464baa6f 100644 --- a/kubernetes/typed/storage/v1alpha1/csistoragecapacity.go +++ b/kubernetes/typed/storage/v1alpha1/csistoragecapacity.go @@ -31,6 +31,7 @@ import ( storagev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // CSIStorageCapacitiesGetter has a method to return a CSIStorageCapacityInterface. @@ -82,6 +83,16 @@ func (c *cSIStorageCapacities) Get(ctx context.Context, name string, options v1. // List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. func (c *cSIStorageCapacities) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.CSIStorageCapacityList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csistoragecapacities", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. +func (c *cSIStorageCapacities) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.CSIStorageCapacityList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/storage/v1alpha1/volumeattachment.go b/kubernetes/typed/storage/v1alpha1/volumeattachment.go index 58abb748f9..69aa9d8a27 100644 --- a/kubernetes/typed/storage/v1alpha1/volumeattachment.go +++ b/kubernetes/typed/storage/v1alpha1/volumeattachment.go @@ -31,6 +31,7 @@ import ( storagev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // VolumeAttachmentsGetter has a method to return a VolumeAttachmentInterface. @@ -81,6 +82,16 @@ func (c *volumeAttachments) Get(ctx context.Context, name string, options v1.Get // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. func (c *volumeAttachments) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttachmentList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for volumeattachments", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. +func (c *volumeAttachments) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttachmentList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go b/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go index 6633a4dc15..e049d94b2c 100644 --- a/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go +++ b/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go @@ -31,6 +31,7 @@ import ( storagev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // VolumeAttributesClassesGetter has a method to return a VolumeAttributesClassInterface. @@ -79,6 +80,16 @@ func (c *volumeAttributesClasses) Get(ctx context.Context, name string, options // List takes label and field selectors, and returns the list of VolumeAttributesClasses that match those selectors. func (c *volumeAttributesClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttributesClassList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for volumeattributesclasses", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of VolumeAttributesClasses that match those selectors. +func (c *volumeAttributesClasses) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttributesClassList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/storage/v1beta1/csidriver.go b/kubernetes/typed/storage/v1beta1/csidriver.go index 04e677db05..861a9c0512 100644 --- a/kubernetes/typed/storage/v1beta1/csidriver.go +++ b/kubernetes/typed/storage/v1beta1/csidriver.go @@ -31,6 +31,7 @@ import ( storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // CSIDriversGetter has a method to return a CSIDriverInterface. @@ -79,6 +80,16 @@ func (c *cSIDrivers) Get(ctx context.Context, name string, options v1.GetOptions // List takes label and field selectors, and returns the list of CSIDrivers that match those selectors. func (c *cSIDrivers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIDriverList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csidrivers", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of CSIDrivers that match those selectors. +func (c *cSIDrivers) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIDriverList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/storage/v1beta1/csinode.go b/kubernetes/typed/storage/v1beta1/csinode.go index c3760b5ce5..effe3d98a0 100644 --- a/kubernetes/typed/storage/v1beta1/csinode.go +++ b/kubernetes/typed/storage/v1beta1/csinode.go @@ -31,6 +31,7 @@ import ( storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // CSINodesGetter has a method to return a CSINodeInterface. @@ -79,6 +80,16 @@ func (c *cSINodes) Get(ctx context.Context, name string, options v1.GetOptions) // List takes label and field selectors, and returns the list of CSINodes that match those selectors. func (c *cSINodes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSINodeList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csinodes", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of CSINodes that match those selectors. +func (c *cSINodes) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSINodeList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/storage/v1beta1/csistoragecapacity.go b/kubernetes/typed/storage/v1beta1/csistoragecapacity.go index 98ba936dc4..eb4e044556 100644 --- a/kubernetes/typed/storage/v1beta1/csistoragecapacity.go +++ b/kubernetes/typed/storage/v1beta1/csistoragecapacity.go @@ -31,6 +31,7 @@ import ( storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // CSIStorageCapacitiesGetter has a method to return a CSIStorageCapacityInterface. @@ -82,6 +83,16 @@ func (c *cSIStorageCapacities) Get(ctx context.Context, name string, options v1. // List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. func (c *cSIStorageCapacities) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIStorageCapacityList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csistoragecapacities", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. +func (c *cSIStorageCapacities) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIStorageCapacityList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/storage/v1beta1/storageclass.go b/kubernetes/typed/storage/v1beta1/storageclass.go index 9b4ef231c8..b38a78db6c 100644 --- a/kubernetes/typed/storage/v1beta1/storageclass.go +++ b/kubernetes/typed/storage/v1beta1/storageclass.go @@ -31,6 +31,7 @@ import ( storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // StorageClassesGetter has a method to return a StorageClassInterface. @@ -79,6 +80,16 @@ func (c *storageClasses) Get(ctx context.Context, name string, options v1.GetOpt // List takes label and field selectors, and returns the list of StorageClasses that match those selectors. func (c *storageClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StorageClassList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for storageclasses", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of StorageClasses that match those selectors. +func (c *storageClasses) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StorageClassList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/storage/v1beta1/volumeattachment.go b/kubernetes/typed/storage/v1beta1/volumeattachment.go index 35a8b64fcc..e82276772c 100644 --- a/kubernetes/typed/storage/v1beta1/volumeattachment.go +++ b/kubernetes/typed/storage/v1beta1/volumeattachment.go @@ -31,6 +31,7 @@ import ( storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // VolumeAttachmentsGetter has a method to return a VolumeAttachmentInterface. @@ -81,6 +82,16 @@ func (c *volumeAttachments) Get(ctx context.Context, name string, options v1.Get // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. func (c *volumeAttachments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeAttachmentList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for volumeattachments", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. +func (c *volumeAttachments) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeAttachmentList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second diff --git a/kubernetes/typed/storagemigration/v1alpha1/storageversionmigration.go b/kubernetes/typed/storagemigration/v1alpha1/storageversionmigration.go index be66a5b946..17fe4ac2ee 100644 --- a/kubernetes/typed/storagemigration/v1alpha1/storageversionmigration.go +++ b/kubernetes/typed/storagemigration/v1alpha1/storageversionmigration.go @@ -31,6 +31,7 @@ import ( storagemigrationv1alpha1 "k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1" scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" + consistencydetector "k8s.io/client-go/util/consistencydetector" ) // StorageVersionMigrationsGetter has a method to return a StorageVersionMigrationInterface. @@ -81,6 +82,16 @@ func (c *storageVersionMigrations) Get(ctx context.Context, name string, options // List takes label and field selectors, and returns the list of StorageVersionMigrations that match those selectors. func (c *storageVersionMigrations) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionMigrationList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for storageversionmigrations", c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +// list takes label and field selectors, and returns the list of StorageVersionMigrations that match those selectors. +func (c *storageVersionMigrations) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionMigrationList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second From 785fca481fa172ada910a95c9b7c7372cfbab410 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Tue, 28 May 2024 12:22:59 +0200 Subject: [PATCH 058/159] client-go/util/consistencydetector: improve validation of list parameters (RV, ListOptions) Kubernetes-commit: 327ae9866bda463ae43bd133a2522d5beea5ed35 --- .../data_consistency_detector.go | 24 +++++++++++++++++++ .../data_consistency_detector_test.go | 19 +++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/util/consistencydetector/data_consistency_detector.go b/util/consistencydetector/data_consistency_detector.go index 64288eb865..2a5d209875 100644 --- a/util/consistencydetector/data_consistency_detector.go +++ b/util/consistencydetector/data_consistency_detector.go @@ -41,6 +41,10 @@ type ListFunc[T runtime.Object] func(ctx context.Context, options metav1.ListOpt // we cannot manipulate the environmental variable because // it will affect other tests in this package. func CheckDataConsistency[T runtime.Object, U any](ctx context.Context, identity string, lastSyncedResourceVersion string, listFn ListFunc[T], listOptions metav1.ListOptions, retrieveItemsFn RetrieveItemsFunc[U]) { + if !canFormAdditionalListCall(lastSyncedResourceVersion, listOptions) { + klog.V(4).Infof("data consistency check for %s is enabled but the parameters (RV, ListOptions) doesn't allow for creating a valid LIST request. Skipping the data consistency check.", identity) + return + } klog.Warningf("data consistency check for %s is enabled, this will result in an additional call to the API server.", identity) listOptions.ResourceVersion = lastSyncedResourceVersion listOptions.ResourceVersionMatch = metav1.ResourceVersionMatchExact @@ -79,6 +83,26 @@ func CheckDataConsistency[T runtime.Object, U any](ctx context.Context, identity } } +// canFormAdditionalListCall ensures that we can form a valid LIST requests +// for checking data consistency. +func canFormAdditionalListCall(resourceVersion string, options metav1.ListOptions) bool { + // since we are setting ResourceVersionMatch to metav1.ResourceVersionMatchExact + // we need to make sure that the continuation hasn't been set + // https://github.com/kubernetes/kubernetes/blob/be4afb9ef90b19ccb6f7e595cbdb247e088b2347/staging/src/k8s.io/apimachinery/pkg/apis/meta/internalversion/validation/validation.go#L38 + if len(options.Continue) > 0 { + return false + } + + // since we are setting ResourceVersionMatch to metav1.ResourceVersionMatchExact + // we need to make sure that the RV is valid because the validation code forbids RV == "0" + // https://github.com/kubernetes/kubernetes/blob/be4afb9ef90b19ccb6f7e595cbdb247e088b2347/staging/src/k8s.io/apimachinery/pkg/apis/meta/internalversion/validation/validation.go#L44 + if resourceVersion == "0" { + return false + } + + return true +} + type byUID []metav1.Object func (a byUID) Len() int { return len(a) } diff --git a/util/consistencydetector/data_consistency_detector_test.go b/util/consistencydetector/data_consistency_detector_test.go index c6d21754e0..a7c6928996 100644 --- a/util/consistencydetector/data_consistency_detector_test.go +++ b/util/consistencydetector/data_consistency_detector_test.go @@ -76,6 +76,22 @@ func TestDataConsistencyChecker(t *testing.T) { }, }, + { + name: "data consistency check won't be performed when Continuation was set", + requestOptions: metav1.ListOptions{Continue: "fake continuation token"}, + expectedListRequests: 0, + }, + + { + name: "data consistency check won't be performed when ResourceVersion was set to 0", + listResponse: &v1.PodList{ + ListMeta: metav1.ListMeta{ResourceVersion: "0"}, + Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2")}, + }, + requestOptions: metav1.ListOptions{}, + expectedListRequests: 0, + }, + { name: "data consistency panics when data is inconsistent", listResponse: &v1.PodList{ @@ -99,6 +115,9 @@ func TestDataConsistencyChecker(t *testing.T) { for _, scenario := range scenarios { t.Run(scenario.name, func(t *testing.T) { ctx := context.TODO() + if scenario.listResponse == nil { + scenario.listResponse = &v1.PodList{} + } fakeLister := &listWrapper{response: scenario.listResponse} retrievedItemsFunc := func() []*v1.Pod { return scenario.retrievedItems From b4e1cfcfab6c4b571c02674acb90a306791c1786 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Wed, 29 May 2024 14:10:49 +0200 Subject: [PATCH 059/159] client-go record: avoid panic when watch creation failed The previous attempt to fix this in https://github.com/kubernetes/kubernetes/commit/6aa779f4ed3d3acdad2f2bf17fb27e11e23aabe4#diff-efa2cd1347df22ace5a516ea794152d00ef2a079db135c81787ed920ecb73658 didn't address the root cause (or perhaps created it, not sure): the goroutine must not be started if watch creation failed. Instead, the error gets logged (as before) and an empty watch gets returned to the caller (new). This is necessary because the function doesn't have an error return value and changing that now would be disruptive. The empty watch is valid and usable, so callers won't crash when they calls Stop. This showed up recently in failed unit tests, probably because test cancellation makes this error more likely: "Unable start event watcher (will not retry!)" err="broadcaster already stopped" logger="TestGarbageCollectorConstruction leaked goroutine" The logger value and a preceding warning show that this occurs after test completion. Kubernetes-commit: 080432c46a7a49c3abf86d7fc5f2a5d7abc92239 --- tools/record/event.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/record/event.go b/tools/record/event.go index 0b3b14f8da..55947d2094 100644 --- a/tools/record/event.go +++ b/tools/record/event.go @@ -395,7 +395,11 @@ func (e *eventBroadcasterImpl) StartStructuredLogging(verbosity klog.Level) watc func (e *eventBroadcasterImpl) StartEventWatcher(eventHandler func(*v1.Event)) watch.Interface { watcher, err := e.Watch() if err != nil { + // This function traditionally returns no error even though it can fail. + // Instead, it logs the error and returns an empty watch. The empty + // watch ensures that callers don't crash when calling Stop. klog.FromContext(e.cancelationCtx).Error(err, "Unable start event watcher (will not retry!)") + return watch.NewEmptyWatch() } go func() { defer utilruntime.HandleCrash() From 9c87eb0815332c52855cd1603a576fb4c36a1ec5 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Wed, 29 May 2024 06:20:33 -0700 Subject: [PATCH 060/159] Merge pull request #125190 from pohly/record-event-panic client-go record: avoid panic when watch creation failed Kubernetes-commit: ea0ab06b6915945c20a86d1de588e4ac7a5b6d58 From 7adab2f2f695776ca1e932f6c31ab13cf29dbd44 Mon Sep 17 00:00:00 2001 From: Shingo Omura Date: Thu, 30 May 2024 07:40:29 +0900 Subject: [PATCH 061/159] KEP-3619: Fine-grained SupplementalGroups control (#117842) * Add `Linux{Sandbox,Container}SecurityContext.SupplementalGroupsPolicy` and `ContainerStatus.user` in cri-api * Add `PodSecurityContext.SupplementalGroupsPolicy`, `ContainerStatus.User` and its featuregate * Implement DropDisabledPodFields for PodSecurityContext.SupplementalGroupsPolicy and ContainerStatus.User fields * Implement kubelet so to wire between SecurityContext.SupplementalGroupsPolicy/ContainerStatus.User and cri-api in kubelet * Clarify `SupplementalGroupsPolicy` is an OS depdendent field. * Make `ContainerStatus.User` is initially attached user identity to the first process in the ContainerStatus It is because, the process identity can be dynamic if the initially attached identity has enough privilege calling setuid/setgid/setgroups syscalls in Linux. * Rewording suggestion applied * Add TODO comment for updating SupplementalGroupsPolicy default value in v1.34 * Added validations for SupplementalGroupsPolicy and ContainerUser * No need featuregate check in validation when adding new field with no default value * fix typo: identitiy -> identity Kubernetes-commit: 552fd7e85084b4cbd3ae8e81ff13433e28dc8327 --- .../core/v1/containerstatus.go | 9 +++ applyconfigurations/core/v1/containeruser.go | 39 ++++++++++++ .../core/v1/linuxcontaineruser.go | 59 +++++++++++++++++++ .../core/v1/podsecuritycontext.go | 31 ++++++---- applyconfigurations/internal/internal.go | 29 +++++++++ applyconfigurations/utils.go | 4 ++ go.mod | 2 +- go.sum | 4 +- 8 files changed, 163 insertions(+), 14 deletions(-) create mode 100644 applyconfigurations/core/v1/containeruser.go create mode 100644 applyconfigurations/core/v1/linuxcontaineruser.go diff --git a/applyconfigurations/core/v1/containerstatus.go b/applyconfigurations/core/v1/containerstatus.go index e3f774bbb3..5918f3603d 100644 --- a/applyconfigurations/core/v1/containerstatus.go +++ b/applyconfigurations/core/v1/containerstatus.go @@ -37,6 +37,7 @@ type ContainerStatusApplyConfiguration struct { AllocatedResources *corev1.ResourceList `json:"allocatedResources,omitempty"` Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"` VolumeMounts []VolumeMountStatusApplyConfiguration `json:"volumeMounts,omitempty"` + User *ContainerUserApplyConfiguration `json:"user,omitempty"` } // ContainerStatusApplyConfiguration constructs an declarative configuration of the ContainerStatus type for use with @@ -145,3 +146,11 @@ func (b *ContainerStatusApplyConfiguration) WithVolumeMounts(values ...*VolumeMo } return b } + +// WithUser sets the User field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the User field is set to the value of the last call. +func (b *ContainerStatusApplyConfiguration) WithUser(value *ContainerUserApplyConfiguration) *ContainerStatusApplyConfiguration { + b.User = value + return b +} diff --git a/applyconfigurations/core/v1/containeruser.go b/applyconfigurations/core/v1/containeruser.go new file mode 100644 index 0000000000..e538a46d6e --- /dev/null +++ b/applyconfigurations/core/v1/containeruser.go @@ -0,0 +1,39 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ContainerUserApplyConfiguration represents an declarative configuration of the ContainerUser type for use +// with apply. +type ContainerUserApplyConfiguration struct { + Linux *LinuxContainerUserApplyConfiguration `json:"linux,omitempty"` +} + +// ContainerUserApplyConfiguration constructs an declarative configuration of the ContainerUser type for use with +// apply. +func ContainerUser() *ContainerUserApplyConfiguration { + return &ContainerUserApplyConfiguration{} +} + +// WithLinux sets the Linux field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Linux field is set to the value of the last call. +func (b *ContainerUserApplyConfiguration) WithLinux(value *LinuxContainerUserApplyConfiguration) *ContainerUserApplyConfiguration { + b.Linux = value + return b +} diff --git a/applyconfigurations/core/v1/linuxcontaineruser.go b/applyconfigurations/core/v1/linuxcontaineruser.go new file mode 100644 index 0000000000..fdafd78e11 --- /dev/null +++ b/applyconfigurations/core/v1/linuxcontaineruser.go @@ -0,0 +1,59 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// LinuxContainerUserApplyConfiguration represents an declarative configuration of the LinuxContainerUser type for use +// with apply. +type LinuxContainerUserApplyConfiguration struct { + UID *int64 `json:"uid,omitempty"` + GID *int64 `json:"gid,omitempty"` + SupplementalGroups []int64 `json:"supplementalGroups,omitempty"` +} + +// LinuxContainerUserApplyConfiguration constructs an declarative configuration of the LinuxContainerUser type for use with +// apply. +func LinuxContainerUser() *LinuxContainerUserApplyConfiguration { + return &LinuxContainerUserApplyConfiguration{} +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *LinuxContainerUserApplyConfiguration) WithUID(value int64) *LinuxContainerUserApplyConfiguration { + b.UID = &value + return b +} + +// WithGID sets the GID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GID field is set to the value of the last call. +func (b *LinuxContainerUserApplyConfiguration) WithGID(value int64) *LinuxContainerUserApplyConfiguration { + b.GID = &value + return b +} + +// WithSupplementalGroups adds the given value to the SupplementalGroups field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SupplementalGroups field. +func (b *LinuxContainerUserApplyConfiguration) WithSupplementalGroups(values ...int64) *LinuxContainerUserApplyConfiguration { + for i := range values { + b.SupplementalGroups = append(b.SupplementalGroups, values[i]) + } + return b +} diff --git a/applyconfigurations/core/v1/podsecuritycontext.go b/applyconfigurations/core/v1/podsecuritycontext.go index 6b340294eb..344c40fb85 100644 --- a/applyconfigurations/core/v1/podsecuritycontext.go +++ b/applyconfigurations/core/v1/podsecuritycontext.go @@ -25,17 +25,18 @@ import ( // PodSecurityContextApplyConfiguration represents an declarative configuration of the PodSecurityContext type for use // with apply. type PodSecurityContextApplyConfiguration struct { - SELinuxOptions *SELinuxOptionsApplyConfiguration `json:"seLinuxOptions,omitempty"` - WindowsOptions *WindowsSecurityContextOptionsApplyConfiguration `json:"windowsOptions,omitempty"` - RunAsUser *int64 `json:"runAsUser,omitempty"` - RunAsGroup *int64 `json:"runAsGroup,omitempty"` - RunAsNonRoot *bool `json:"runAsNonRoot,omitempty"` - SupplementalGroups []int64 `json:"supplementalGroups,omitempty"` - FSGroup *int64 `json:"fsGroup,omitempty"` - Sysctls []SysctlApplyConfiguration `json:"sysctls,omitempty"` - FSGroupChangePolicy *corev1.PodFSGroupChangePolicy `json:"fsGroupChangePolicy,omitempty"` - SeccompProfile *SeccompProfileApplyConfiguration `json:"seccompProfile,omitempty"` - AppArmorProfile *AppArmorProfileApplyConfiguration `json:"appArmorProfile,omitempty"` + SELinuxOptions *SELinuxOptionsApplyConfiguration `json:"seLinuxOptions,omitempty"` + WindowsOptions *WindowsSecurityContextOptionsApplyConfiguration `json:"windowsOptions,omitempty"` + RunAsUser *int64 `json:"runAsUser,omitempty"` + RunAsGroup *int64 `json:"runAsGroup,omitempty"` + RunAsNonRoot *bool `json:"runAsNonRoot,omitempty"` + SupplementalGroups []int64 `json:"supplementalGroups,omitempty"` + SupplementalGroupsPolicy *corev1.SupplementalGroupsPolicy `json:"supplementalGroupsPolicy,omitempty"` + FSGroup *int64 `json:"fsGroup,omitempty"` + Sysctls []SysctlApplyConfiguration `json:"sysctls,omitempty"` + FSGroupChangePolicy *corev1.PodFSGroupChangePolicy `json:"fsGroupChangePolicy,omitempty"` + SeccompProfile *SeccompProfileApplyConfiguration `json:"seccompProfile,omitempty"` + AppArmorProfile *AppArmorProfileApplyConfiguration `json:"appArmorProfile,omitempty"` } // PodSecurityContextApplyConfiguration constructs an declarative configuration of the PodSecurityContext type for use with @@ -94,6 +95,14 @@ func (b *PodSecurityContextApplyConfiguration) WithSupplementalGroups(values ... return b } +// WithSupplementalGroupsPolicy sets the SupplementalGroupsPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SupplementalGroupsPolicy field is set to the value of the last call. +func (b *PodSecurityContextApplyConfiguration) WithSupplementalGroupsPolicy(value corev1.SupplementalGroupsPolicy) *PodSecurityContextApplyConfiguration { + b.SupplementalGroupsPolicy = &value + return b +} + // WithFSGroup sets the FSGroup field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the FSGroup field is set to the value of the last call. diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 610b4d13d8..4b500dee0e 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -5084,6 +5084,9 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.api.core.v1.ContainerState default: {} + - name: user + type: + namedType: io.k8s.api.core.v1.ContainerUser - name: volumeMounts type: list: @@ -5092,6 +5095,12 @@ var schemaYAML = typed.YAMLObject(`types: elementRelationship: associative keys: - mountPath +- name: io.k8s.api.core.v1.ContainerUser + map: + fields: + - name: linux + type: + namedType: io.k8s.api.core.v1.LinuxContainerUser - name: io.k8s.api.core.v1.DaemonEndpoint map: fields: @@ -5851,6 +5860,23 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.core.v1.LimitRangeItem elementRelationship: atomic +- name: io.k8s.api.core.v1.LinuxContainerUser + map: + fields: + - name: gid + type: + scalar: numeric + default: 0 + - name: supplementalGroups + type: + list: + elementType: + scalar: numeric + elementRelationship: atomic + - name: uid + type: + scalar: numeric + default: 0 - name: io.k8s.api.core.v1.LoadBalancerIngress map: fields: @@ -6822,6 +6848,9 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: numeric elementRelationship: atomic + - name: supplementalGroupsPolicy + type: + scalar: string - name: sysctls type: list: diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index 75d9c5c048..623c10376b 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -681,6 +681,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationscorev1.ContainerStateWaitingApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ContainerStatus"): return &applyconfigurationscorev1.ContainerStatusApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ContainerUser"): + return &applyconfigurationscorev1.ContainerUserApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("CSIPersistentVolumeSource"): return &applyconfigurationscorev1.CSIPersistentVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("CSIVolumeSource"): @@ -767,6 +769,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationscorev1.LimitRangeItemApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("LimitRangeSpec"): return &applyconfigurationscorev1.LimitRangeSpecApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("LinuxContainerUser"): + return &applyconfigurationscorev1.LinuxContainerUserApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("LoadBalancerIngress"): return &applyconfigurationscorev1.LoadBalancerIngressApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("LoadBalancerStatus"): diff --git a/go.mod b/go.mod index 664bb1999a..9f0251c0bb 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240529203521-42619825cf01 + k8s.io/api v0.0.0-20240529224029-d93eaf6729fd k8s.io/apimachinery v0.0.0-20240529203233-63ab494c70e6 k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 diff --git a/go.sum b/go.sum index 94faeba7e7..89e86974c8 100644 --- a/go.sum +++ b/go.sum @@ -153,8 +153,8 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240529203521-42619825cf01 h1:174qeH6d5KbPVqH3AiRwaPF3KLywgsXd3Urb8fB/brY= -k8s.io/api v0.0.0-20240529203521-42619825cf01/go.mod h1:4/2Gq0qr5DtTHoaH7lfOKW6+ZMSOJwvVvbojJlldJh8= +k8s.io/api v0.0.0-20240529224029-d93eaf6729fd h1:voEDf2CuLj5eRTo2rz2qNJwYUP9aPfOZy21SA++W71Q= +k8s.io/api v0.0.0-20240529224029-d93eaf6729fd/go.mod h1:4/2Gq0qr5DtTHoaH7lfOKW6+ZMSOJwvVvbojJlldJh8= k8s.io/apimachinery v0.0.0-20240529203233-63ab494c70e6 h1:MyOUvhoFRNxMeVhvXMui7xb2huAQiys6tlcNBzvPSb8= k8s.io/apimachinery v0.0.0-20240529203233-63ab494c70e6/go.mod h1:ClkKrTMwhmMjgsEHpX2w3F+YKj0ctDOaAxqL7clxG0U= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= From 8c9cb8838f71fc47ff6d246863f181c7b8e66e93 Mon Sep 17 00:00:00 2001 From: Karl Isenberg Date: Mon, 3 Jun 2024 12:15:38 -0700 Subject: [PATCH 062/159] Improve Reflector unit tests - Add tests to confirm that Stop is always called. - Add TODOs to show were Stop is not currently being called (to fix in a future PR) Kubernetes-commit: ab5aa4762fd5206d0dbd8412d7c6f3b76533a122 --- tools/cache/reflector_test.go | 270 +++++++++++++++++++++++++++++----- 1 file changed, 230 insertions(+), 40 deletions(-) diff --git a/tools/cache/reflector_test.go b/tools/cache/reflector_test.go index 84a8d2697f..336202e24f 100644 --- a/tools/cache/reflector_test.go +++ b/tools/cache/reflector_test.go @@ -28,6 +28,7 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" v1 "k8s.io/api/core/v1" @@ -97,19 +98,35 @@ func TestRunUntil(t *testing.T) { return &v1.PodList{ListMeta: metav1.ListMeta{ResourceVersion: "1"}}, nil }, } - go r.Run(stopCh) + doneCh := make(chan struct{}) + go func() { + defer close(doneCh) + r.Run(stopCh) + }() // Synchronously add a dummy pod into the watch channel so we // know the RunUntil go routine is in the watch handler. fw.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "bar"}}) + close(stopCh) - select { - case _, ok := <-fw.ResultChan(): - if ok { - t.Errorf("Watch channel left open after stopping the watch") + resultCh := fw.ResultChan() + for { + select { + case <-doneCh: + if resultCh == nil { + return // both closed + } + doneCh = nil + case _, ok := <-resultCh: + if ok { + t.Fatalf("Watch channel left open after stopping the watch") + } + if doneCh == nil { + return // both closed + } + resultCh = nil + case <-time.After(wait.ForeverTestTimeout): + t.Fatalf("the cancellation is at least %s late", wait.ForeverTestTimeout.String()) } - case <-time.After(wait.ForeverTestTimeout): - t.Errorf("the cancellation is at least %s late", wait.ForeverTestTimeout.String()) - break } } @@ -126,24 +143,59 @@ func TestReflectorResyncChan(t *testing.T) { } } -// TestEstablishedWatchStoppedAfterStopCh ensures that -// an established watch will be closed right after -// the StopCh was also closed. -func TestEstablishedWatchStoppedAfterStopCh(t *testing.T) { - ctx, ctxCancel := context.WithCancel(context.TODO()) - ctxCancel() - w := watch.NewFake() - require.False(t, w.IsStopped()) - - // w is stopped when the stopCh is closed - target := NewReflector(nil, &v1.Pod{}, nil, 0) - err := target.watch(w, ctx.Done(), nil) +// TestReflectorWatchStoppedBefore ensures that neither List nor Watch are +// called if the stop channel is closed before Reflector.watch is called. +func TestReflectorWatchStoppedBefore(t *testing.T) { + stopCh := make(chan struct{}) + close(stopCh) + + lw := &ListWatch{ + ListFunc: func(_ metav1.ListOptions) (runtime.Object, error) { + t.Fatal("ListFunc called unexpectedly") + return nil, nil + }, + WatchFunc: func(_ metav1.ListOptions) (watch.Interface, error) { + // If WatchFunc is never called, the watcher it returns doesn't need to be stopped. + t.Fatal("WatchFunc called unexpectedly") + return nil, nil + }, + } + target := NewReflector(lw, &v1.Pod{}, nil, 0) + + err := target.watch(nil, stopCh, nil) require.NoError(t, err) - require.True(t, w.IsStopped()) +} + +// TestReflectorWatchStoppedAfter ensures that neither the watcher is stopped if +// the stop channel is closed after Reflector.watch has started watching. +func TestReflectorWatchStoppedAfter(t *testing.T) { + stopCh := make(chan struct{}) + + var watchers []*watch.FakeWatcher - // noop when the w is nil and the ctx is closed - err = target.watch(nil, ctx.Done(), nil) + lw := &ListWatch{ + ListFunc: func(_ metav1.ListOptions) (runtime.Object, error) { + t.Fatal("ListFunc called unexpectedly") + return nil, nil + }, + WatchFunc: func(_ metav1.ListOptions) (watch.Interface, error) { + // Simulate the stop channel being closed after watching has started + go func() { + time.Sleep(10 * time.Millisecond) + close(stopCh) + }() + // Use a fake watcher that never sends events + w := watch.NewFake() + watchers = append(watchers, w) + return w, nil + }, + } + target := NewReflector(lw, &v1.Pod{}, nil, 0) + + err := target.watch(nil, stopCh, nil) require.NoError(t, err) + require.Equal(t, 1, len(watchers)) + require.True(t, watchers[0].IsStopped()) } func BenchmarkReflectorResyncChanMany(b *testing.B) { @@ -158,22 +210,148 @@ func BenchmarkReflectorResyncChanMany(b *testing.B) { } } -func TestReflectorWatchHandlerError(t *testing.T) { +// TestReflectorHandleWatchStoppedBefore ensures that handleWatch stops when +// stopCh is already closed before handleWatch was called. It also ensures that +// ResultChan is only called once and that Stop is called after ResultChan. +func TestReflectorHandleWatchStoppedBefore(t *testing.T) { s := NewStore(MetaNamespaceKeyFunc) g := NewReflector(&testLW{}, &v1.Pod{}, s, 0) - fw := watch.NewFake() - go func() { - fw.Stop() - }() + stopCh := make(chan struct{}) + // Simulate the watch channel being closed before the watchHandler is called + close(stopCh) + var calls []string + resultCh := make(chan watch.Event) + fw := watch.MockWatcher{ + StopFunc: func() { + calls = append(calls, "Stop") + close(resultCh) + }, + ResultChanFunc: func() <-chan watch.Event { + calls = append(calls, "ResultChan") + return resultCh + }, + } + err := watchHandler(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, g.setLastSyncResourceVersion, nil, g.clock, nevererrc, stopCh) + if err == nil { + t.Errorf("unexpected non-error") + } + // Ensure the watcher methods are called exactly once in this exact order. + // TODO(karlkfi): Fix watchHandler to call Stop() + // assert.Equal(t, []string{"ResultChan", "Stop"}, calls) + assert.Equal(t, []string{"ResultChan"}, calls) +} + +// TestReflectorHandleWatchStoppedAfter ensures that handleWatch stops when +// stopCh is closed after handleWatch was called. It also ensures that +// ResultChan is only called once and that Stop is called after ResultChan. +func TestReflectorHandleWatchStoppedAfter(t *testing.T) { + s := NewStore(MetaNamespaceKeyFunc) + g := NewReflector(&testLW{}, &v1.Pod{}, s, 0) + var calls []string + stopCh := make(chan struct{}) + resultCh := make(chan watch.Event) + fw := watch.MockWatcher{ + StopFunc: func() { + calls = append(calls, "Stop") + close(resultCh) + }, + ResultChanFunc: func() <-chan watch.Event { + calls = append(calls, "ResultChan") + resultCh = make(chan watch.Event) + // Simulate the watch handler being stopped asynchronously by the + // caller, after watching has started. + go func() { + time.Sleep(10 * time.Millisecond) + close(stopCh) + }() + return resultCh + }, + } + err := watchHandler(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, g.setLastSyncResourceVersion, nil, g.clock, nevererrc, stopCh) + if err == nil { + t.Errorf("unexpected non-error") + } + // Ensure the watcher methods are called exactly once in this exact order. + // TODO(karlkfi): Fix watchHandler to call Stop() + // assert.Equal(t, []string{"ResultChan", "Stop"}, calls) + assert.Equal(t, []string{"ResultChan"}, calls) +} + +// TestReflectorHandleWatchResultChanClosedBefore ensures that handleWatch +// stops when the result channel is closed before handleWatch was called. +func TestReflectorHandleWatchResultChanClosedBefore(t *testing.T) { + s := NewStore(MetaNamespaceKeyFunc) + g := NewReflector(&testLW{}, &v1.Pod{}, s, 0) + var calls []string + resultCh := make(chan watch.Event) + fw := watch.MockWatcher{ + StopFunc: func() { + calls = append(calls, "Stop") + }, + ResultChanFunc: func() <-chan watch.Event { + calls = append(calls, "ResultChan") + return resultCh + }, + } + // Simulate the result channel being closed by the producer before handleWatch is called. + close(resultCh) err := watchHandler(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, g.setLastSyncResourceVersion, nil, g.clock, nevererrc, wait.NeverStop) if err == nil { t.Errorf("unexpected non-error") } + // Ensure the watcher methods are called exactly once in this exact order. + // TODO(karlkfi): Fix watchHandler to call Stop() + // assert.Equal(t, []string{"ResultChan", "Stop"}, calls) + assert.Equal(t, []string{"ResultChan"}, calls) +} + +// TestReflectorHandleWatchResultChanClosedAfter ensures that handleWatch +// stops when the result channel is closed after handleWatch has started watching. +func TestReflectorHandleWatchResultChanClosedAfter(t *testing.T) { + s := NewStore(MetaNamespaceKeyFunc) + g := NewReflector(&testLW{}, &v1.Pod{}, s, 0) + var calls []string + resultCh := make(chan watch.Event) + fw := watch.MockWatcher{ + StopFunc: func() { + calls = append(calls, "Stop") + }, + ResultChanFunc: func() <-chan watch.Event { + calls = append(calls, "ResultChan") + resultCh = make(chan watch.Event) + // Simulate the result channel being closed by the producer, after + // watching has started. + go func() { + time.Sleep(10 * time.Millisecond) + close(resultCh) + }() + return resultCh + }, + } + err := watchHandler(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, g.setLastSyncResourceVersion, nil, g.clock, nevererrc, wait.NeverStop) + if err == nil { + t.Errorf("unexpected non-error") + } + // Ensure the watcher methods are called exactly once in this exact order. + // TODO(karlkfi): Fix watchHandler to call Stop() + // assert.Equal(t, []string{"ResultChan", "Stop"}, calls) + assert.Equal(t, []string{"ResultChan"}, calls) } func TestReflectorWatchHandler(t *testing.T) { s := NewStore(MetaNamespaceKeyFunc) g := NewReflector(&testLW{}, &v1.Pod{}, s, 0) + // Wrap setLastSyncResourceVersion so we can tell the watchHandler to stop + // watching after all the events have been consumed. This avoids race + // conditions which can happen if the producer calls Stop(), instead of the + // consumer. + stopCh := make(chan struct{}) + setLastSyncResourceVersion := func(rv string) { + g.setLastSyncResourceVersion(rv) + if rv == "32" { + close(stopCh) + } + } fw := watch.NewFake() s.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "foo"}}) s.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "bar"}}) @@ -184,8 +362,8 @@ func TestReflectorWatchHandler(t *testing.T) { fw.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "baz", ResourceVersion: "32"}}) fw.Stop() }() - err := watchHandler(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, g.setLastSyncResourceVersion, nil, g.clock, nevererrc, wait.NeverStop) - if err != nil { + err := watchHandler(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, setLastSyncResourceVersion, nil, g.clock, nevererrc, stopCh) + if !errors.Is(err, errorStopRequested) { t.Errorf("unexpected error %v", err) } @@ -193,6 +371,7 @@ func TestReflectorWatchHandler(t *testing.T) { return &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: id, ResourceVersion: rv}} } + // Validate that the Store was updated by the events table := []struct { Pod *v1.Pod exists bool @@ -215,12 +394,7 @@ func TestReflectorWatchHandler(t *testing.T) { } } - // RV should send the last version we see. - if e, a := "32", g.LastSyncResourceVersion(); e != a { - t.Errorf("expected %v, got %v", e, a) - } - - // last sync resource version should be the last version synced with store + // Validate that setLastSyncResourceVersion was called with the RV from the last event. if e, a := "32", g.LastSyncResourceVersion(); e != a { t.Errorf("expected %v, got %v", e, a) } @@ -230,8 +404,8 @@ func TestReflectorStopWatch(t *testing.T) { s := NewStore(MetaNamespaceKeyFunc) g := NewReflector(&testLW{}, &v1.Pod{}, s, 0) fw := watch.NewFake() - stopWatch := make(chan struct{}, 1) - stopWatch <- struct{}{} + stopWatch := make(chan struct{}) + close(stopWatch) err := watchHandler(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, g.setLastSyncResourceVersion, nil, g.clock, nevererrc, stopWatch) if err != errorStopRequested { t.Errorf("expected stop error, got %q", err) @@ -361,6 +535,7 @@ func TestReflectorListAndWatchWithErrors(t *testing.T) { } } watchRet, watchErr := item.events, item.watchErr + stopCh := make(chan struct{}) lw := &testLW{ WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if watchErr != nil { @@ -372,7 +547,13 @@ func TestReflectorListAndWatchWithErrors(t *testing.T) { for _, e := range watchRet { fw.Action(e.Type, e.Object) } - fw.Stop() + // Because FakeWatcher doesn't buffer events, it's safe to + // close the stop channel immediately without missing events. + // But usually, the event producer would instead close the + // result channel, and wait for the consumer to stop the + // watcher, to avoid race conditions. + // TODO: Fix the FakeWatcher to separate watcher.Stop from close(resultCh) + close(stopCh) }() return fw, nil }, @@ -381,7 +562,16 @@ func TestReflectorListAndWatchWithErrors(t *testing.T) { }, } r := NewReflector(lw, &v1.Pod{}, s, 0) - r.ListAndWatch(wait.NeverStop) + err := r.ListAndWatch(stopCh) + if item.listErr != nil && !errors.Is(err, item.listErr) { + t.Errorf("unexpected ListAndWatch error: %v", err) + } + if item.watchErr != nil && !errors.Is(err, item.watchErr) { + t.Errorf("unexpected ListAndWatch error: %v", err) + } + if item.listErr == nil && item.watchErr == nil { + assert.NoError(t, err) + } } } From 7c5e9038dd9c177c8f3566e97a845e345c66221e Mon Sep 17 00:00:00 2001 From: Karl Isenberg Date: Mon, 3 Jun 2024 17:31:59 -0700 Subject: [PATCH 063/159] Update TestNewInformerWatcher for WatchListClient - Switch to using the ProxyWatcher to validate the dance between closing the stop channel and closing the result channel. - Use the new clientfeaturestesting.SetFeatureDuringTest to test with the WatchListClient enabled and disabled. These should result in almost the exact same output events from the informer (list ordering not garenteed), but with different input events recieved from the apiserver. Kubernetes-commit: 28e3a728e5e6fe651d7a17839d33ce42204c0b4e --- tools/watch/informerwatcher_test.go | 265 +++++++++++++++++++--------- 1 file changed, 182 insertions(+), 83 deletions(-) diff --git a/tools/watch/informerwatcher_test.go b/tools/watch/informerwatcher_test.go index cd5eb44077..1f8e16c2ec 100644 --- a/tools/watch/informerwatcher_test.go +++ b/tools/watch/informerwatcher_test.go @@ -32,7 +32,10 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/dump" + "k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/watch" + clientfeatures "k8s.io/client-go/features" + clientfeaturestesting "k8s.io/client-go/features/testing" fakeclientset "k8s.io/client-go/kubernetes/fake" testcore "k8s.io/client-go/testing" "k8s.io/client-go/tools/cache" @@ -134,96 +137,180 @@ func (a byEventTypeAndName) Less(i, j int) bool { return a[i].Object.(*corev1.Secret).Name < a[j].Object.(*corev1.Secret).Name } +func newTestSecret(name, key, value string) *corev1.Secret { + return &corev1.Secret{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + }, + StringData: map[string]string{ + key: value, + }, + } +} + func TestNewInformerWatcher(t *testing.T) { // Make sure there are no 2 same types of events on a secret with the same name or that might be flaky. tt := []struct { - name string - objects []runtime.Object - events []watch.Event + name string + watchListFeatureEnabled bool + objects []runtime.Object + inputEvents []watch.Event + outputEvents []watch.Event }{ { - name: "basic test", + name: "WatchListClient feature disabled", + watchListFeatureEnabled: false, objects: []runtime.Object{ - &corev1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pod-1", - }, - StringData: map[string]string{ - "foo-1": "initial", - }, + newTestSecret("pod-1", "foo-1", "initial"), + newTestSecret("pod-2", "foo-2", "initial"), + newTestSecret("pod-3", "foo-3", "initial"), + }, + inputEvents: []watch.Event{ + { + Type: watch.Added, + Object: newTestSecret("pod-4", "foo-4", "initial"), }, - &corev1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pod-2", - }, - StringData: map[string]string{ - "foo-2": "initial", - }, + { + Type: watch.Modified, + Object: newTestSecret("pod-2", "foo-2", "new"), }, - &corev1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pod-3", - }, - StringData: map[string]string{ - "foo-3": "initial", - }, + { + Type: watch.Deleted, + Object: newTestSecret("pod-3", "foo-3", "initial"), }, }, - events: []watch.Event{ + outputEvents: []watch.Event{ + // When WatchListClient is disabled, ListAndWatch creates fake + // ADDED events for each object listed. { - Type: watch.Added, - Object: &corev1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pod-4", - }, - StringData: map[string]string{ - "foo-4": "initial", - }, - }, + Type: watch.Added, + Object: newTestSecret("pod-1", "foo-1", "initial"), }, { - Type: watch.Modified, - Object: &corev1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - Name: "pod-2", - }, - StringData: map[string]string{ - "foo-2": "new", - }, - }, + Type: watch.Added, + Object: newTestSecret("pod-2", "foo-2", "initial"), + }, + { + Type: watch.Added, + Object: newTestSecret("pod-3", "foo-3", "initial"), + }, + // Normal events follow. + { + Type: watch.Added, + Object: newTestSecret("pod-4", "foo-4", "initial"), + }, + { + Type: watch.Modified, + Object: newTestSecret("pod-2", "foo-2", "new"), + }, + { + Type: watch.Deleted, + Object: newTestSecret("pod-3", "foo-3", "initial"), + }, + }, + }, + { + name: "WatchListClient feature enabled", + watchListFeatureEnabled: true, + objects: []runtime.Object{ + newTestSecret("pod-1", "foo-1", "initial"), + newTestSecret("pod-2", "foo-2", "initial"), + newTestSecret("pod-3", "foo-3", "initial"), + }, + inputEvents: []watch.Event{ + { + Type: watch.Added, + Object: newTestSecret("pod-1", "foo-1", "initial"), + }, + { + Type: watch.Added, + Object: newTestSecret("pod-2", "foo-2", "initial"), }, { - Type: watch.Deleted, + Type: watch.Added, + Object: newTestSecret("pod-3", "foo-3", "initial"), + }, + // ListWatch bookmark indicates that initial listing is done + { + Type: watch.Bookmark, Object: &corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ - Name: "pod-3", + Annotations: map[string]string{ + metav1.InitialEventsAnnotationKey: "true", + }, }, }, }, + { + Type: watch.Added, + Object: newTestSecret("pod-4", "foo-4", "initial"), + }, + { + Type: watch.Modified, + Object: newTestSecret("pod-2", "foo-2", "new"), + }, + { + Type: watch.Deleted, + Object: newTestSecret("pod-3", "foo-3", "initial"), + }, + }, + outputEvents: []watch.Event{ + // When WatchListClient is enabled, WatchList receives + // ADDED events from the server for each existing object. + { + Type: watch.Added, + Object: newTestSecret("pod-1", "foo-1", "initial"), + }, + { + Type: watch.Added, + Object: newTestSecret("pod-2", "foo-2", "initial"), + }, + { + Type: watch.Added, + Object: newTestSecret("pod-3", "foo-3", "initial"), + }, + // Bookmark event at the end of listing is not sent to the client. + // Normal events follow. + { + Type: watch.Added, + Object: newTestSecret("pod-4", "foo-4", "initial"), + }, + { + Type: watch.Modified, + Object: newTestSecret("pod-2", "foo-2", "new"), + }, + { + Type: watch.Deleted, + Object: newTestSecret("pod-3", "foo-3", "initial"), + }, }, }, } for _, tc := range tt { t.Run(tc.name, func(t *testing.T) { - var expected []watch.Event - for _, o := range tc.objects { - expected = append(expected, watch.Event{ - Type: watch.Added, - Object: o.DeepCopyObject(), - }) - } - for _, e := range tc.events { - expected = append(expected, *e.DeepCopy()) - } + clientfeaturestesting.SetFeatureDuringTest(t, clientfeatures.WatchListClient, tc.watchListFeatureEnabled) fake := fakeclientset.NewSimpleClientset(tc.objects...) - fakeWatch := watch.NewFakeWithChanSize(len(tc.events), false) - fake.PrependWatchReactor("secrets", testcore.DefaultWatchReactor(fakeWatch, nil)) - - for _, e := range tc.events { - fakeWatch.Action(e.Type, e.Object) - } + inputCh := make(chan watch.Event) + inputWatcher := watch.NewProxyWatcher(inputCh) + // Indexer should stop the input watcher when the output watcher is stopped. + // But stop it at the end of the test, just in case. + defer inputWatcher.Stop() + inputStopCh := inputWatcher.StopChan() + fake.PrependWatchReactor("secrets", testcore.DefaultWatchReactor(inputWatcher, nil)) + // Send events and then close the done channel + inputDoneCh := make(chan struct{}) + go func() { + defer close(inputDoneCh) + for _, e := range tc.inputEvents { + select { + case inputCh <- e: + case <-inputStopCh: + return + } + } + }() lw := &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { @@ -233,46 +320,58 @@ func TestNewInformerWatcher(t *testing.T) { return fake.CoreV1().Secrets("").Watch(context.TODO(), options) }, } - _, _, w, done := NewIndexerInformerWatcher(lw, &corev1.Secret{}) - + _, _, outputWatcher, informerDoneCh := NewIndexerInformerWatcher(lw, &corev1.Secret{}) + outputCh := outputWatcher.ResultChan() + timeoutCh := time.After(wait.ForeverTestTimeout) var result []watch.Event loop: for { - var event watch.Event - var ok bool select { - case event, ok = <-w.ResultChan(): + case event, ok := <-outputCh: if !ok { - t.Errorf("Failed to read event: channel is already closed!") - return + t.Errorf("Output result channel closed prematurely") + break loop } - result = append(result, *event.DeepCopy()) - case <-time.After(time.Second * 1): - // All the events are buffered -> this means we are done - // Also the one sec will make sure that we would detect RetryWatcher's incorrect behaviour after last event + if len(result) >= len(tc.outputEvents) { + break loop + } + case <-timeoutCh: + t.Error("Timed out waiting for events") break loop } } - // Informers don't guarantee event order so we need to sort these arrays to compare them - sort.Sort(byEventTypeAndName(expected)) + // Informers don't guarantee event order so we need to sort these arrays to compare them. + sort.Sort(byEventTypeAndName(tc.outputEvents)) sort.Sort(byEventTypeAndName(result)) - if !reflect.DeepEqual(expected, result) { - t.Errorf("\nexpected: %s,\ngot: %s,\ndiff: %s", dump.Pretty(expected), dump.Pretty(result), cmp.Diff(expected, result)) + if !reflect.DeepEqual(tc.outputEvents, result) { + t.Errorf("\nexpected: %s,\ngot: %s,\ndiff: %s", dump.Pretty(tc.outputEvents), dump.Pretty(result), cmp.Diff(tc.outputEvents, result)) return } - // Fill in some data to test watch closing while there are some events to be read - for _, e := range tc.events { - fakeWatch.Action(e.Type, e.Object) - } + // Send some more events, but don't read them. + // Stop producing events when the consumer stops the watcher. + go func() { + defer close(inputCh) + for _, e := range tc.inputEvents { + select { + case inputCh <- e: + case <-inputStopCh: + return + } + } + }() // Stop before reading all the data to make sure the informer can deal with closed channel - w.Stop() + outputWatcher.Stop() - <-done + select { + case <-informerDoneCh: + case <-time.After(wait.ForeverTestTimeout): + t.Error("Timed out waiting for informer to cleanup") + } }) } From 7c6e307a725ff986370e762cc8819f6f60276d86 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Mon, 3 Jun 2024 16:42:08 -0700 Subject: [PATCH 064/159] Merge pull request #125299 from karlkfi/karl-reflector-fix-2 Improve Reflector unit tests Kubernetes-commit: 5bf1e95541d90e37f6c6637b5b45d8783e7907aa --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 09f44c6962..34afbf2f4e 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( google.golang.org/protobuf v1.33.0 gopkg.in/evanphx/json-patch.v4 v4.12.0 k8s.io/api v0.0.0-20240531003526-c114cd746b5a - k8s.io/apimachinery v0.0.0-20240530220031-733a95eb52c3 + k8s.io/apimachinery v0.0.0-20240603234208-703232ea6da4 k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b diff --git a/go.sum b/go.sum index 22e078b5cc..3d023a1f7b 100644 --- a/go.sum +++ b/go.sum @@ -159,8 +159,8 @@ 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.0.0-20240531003526-c114cd746b5a h1:P8nQ3iz4FxeKN26Y8fz9qoEkUZy/DkQPtBmkVyriAS0= k8s.io/api v0.0.0-20240531003526-c114cd746b5a/go.mod h1:2VfykmUr8OqDStfcJWPvSW182MtoxAMeWsJHXwxqzXo= -k8s.io/apimachinery v0.0.0-20240530220031-733a95eb52c3 h1:wKdO12WPN63kX3M6aJQqn6IaacuD1sZw1CswMGfjmJk= -k8s.io/apimachinery v0.0.0-20240530220031-733a95eb52c3/go.mod h1:ClkKrTMwhmMjgsEHpX2w3F+YKj0ctDOaAxqL7clxG0U= +k8s.io/apimachinery v0.0.0-20240603234208-703232ea6da4 h1:On2XjWF6loaEJ/GLZH+ZyovYHWfOZUgl9qUdC8Mn05o= +k8s.io/apimachinery v0.0.0-20240603234208-703232ea6da4/go.mod h1:ClkKrTMwhmMjgsEHpX2w3F+YKj0ctDOaAxqL7clxG0U= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 5d84e91dbf4b609b429d5c978d1b6ae0649f9d5a Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Tue, 4 Jun 2024 10:23:19 +0200 Subject: [PATCH 065/159] client-go/dynamic: use CheckListFromCacheDataConsistencyIfRequested Kubernetes-commit: 79370c6d676814758c60bbc1b71a882583be2214 --- dynamic/simple.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dynamic/simple.go b/dynamic/simple.go index 4b54859530..9ea8ef3694 100644 --- a/dynamic/simple.go +++ b/dynamic/simple.go @@ -29,6 +29,7 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/rest" + "k8s.io/client-go/util/consistencydetector" ) type DynamicClient struct { @@ -292,7 +293,16 @@ func (c *dynamicResourceClient) Get(ctx context.Context, name string, opts metav return uncastObj.(*unstructured.Unstructured), nil } -func (c *dynamicResourceClient) List(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) { +func (c *dynamicResourceClient) List(ctx context.Context, opts metav1.ListOptions) (result *unstructured.UnstructuredList, err error) { + defer func() { + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, fmt.Sprintf("list request for %v", c.resource), c.list, opts, result) + } + }() + return c.list(ctx, opts) +} + +func (c *dynamicResourceClient) list(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) { if err := validateNamespaceWithOptionalName(c.namespace); err != nil { return nil, err } From c7d706847a0c99e261790e1435c390613f85227c Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Tue, 4 Jun 2024 18:37:37 +0200 Subject: [PATCH 066/159] client-go/consistencydetector: handles the watch cache legacy case Kubernetes-commit: fe8a2d222cc4208ee8f89fd2912d35cf58ec5941 --- .../data_consistency_detector.go | 38 ++++++++++--- .../data_consistency_detector_test.go | 53 +++++++++++++++++++ 2 files changed, 84 insertions(+), 7 deletions(-) diff --git a/util/consistencydetector/data_consistency_detector.go b/util/consistencydetector/data_consistency_detector.go index 2a5d209875..b33d08032f 100644 --- a/util/consistencydetector/data_consistency_detector.go +++ b/util/consistencydetector/data_consistency_detector.go @@ -46,8 +46,9 @@ func CheckDataConsistency[T runtime.Object, U any](ctx context.Context, identity return } klog.Warningf("data consistency check for %s is enabled, this will result in an additional call to the API server.", identity) - listOptions.ResourceVersion = lastSyncedResourceVersion - listOptions.ResourceVersionMatch = metav1.ResourceVersionMatchExact + + retrievedItems := toMetaObjectSliceOrDie(retrieveItemsFn()) + listOptions = prepareListCallOptions(lastSyncedResourceVersion, listOptions, len(retrievedItems)) var list runtime.Object err := wait.PollUntilContextCancel(ctx, time.Second, true, func(_ context.Context) (done bool, err error) { list, err = listFn(ctx, listOptions) @@ -69,9 +70,7 @@ func CheckDataConsistency[T runtime.Object, U any](ctx context.Context, identity if err != nil { panic(err) // this should never happen } - listItems := toMetaObjectSliceOrDie(rawListItems) - retrievedItems := toMetaObjectSliceOrDie(retrieveItemsFn()) sort.Sort(byUID(listItems)) sort.Sort(byUID(retrievedItems)) @@ -85,24 +84,49 @@ func CheckDataConsistency[T runtime.Object, U any](ctx context.Context, identity // canFormAdditionalListCall ensures that we can form a valid LIST requests // for checking data consistency. -func canFormAdditionalListCall(resourceVersion string, options metav1.ListOptions) bool { +func canFormAdditionalListCall(lastSyncedResourceVersion string, listOptions metav1.ListOptions) bool { // since we are setting ResourceVersionMatch to metav1.ResourceVersionMatchExact // we need to make sure that the continuation hasn't been set // https://github.com/kubernetes/kubernetes/blob/be4afb9ef90b19ccb6f7e595cbdb247e088b2347/staging/src/k8s.io/apimachinery/pkg/apis/meta/internalversion/validation/validation.go#L38 - if len(options.Continue) > 0 { + if len(listOptions.Continue) > 0 { return false } // since we are setting ResourceVersionMatch to metav1.ResourceVersionMatchExact // we need to make sure that the RV is valid because the validation code forbids RV == "0" // https://github.com/kubernetes/kubernetes/blob/be4afb9ef90b19ccb6f7e595cbdb247e088b2347/staging/src/k8s.io/apimachinery/pkg/apis/meta/internalversion/validation/validation.go#L44 - if resourceVersion == "0" { + if lastSyncedResourceVersion == "0" { return false } return true } +// prepareListCallOptions changes the input list options so that +// the list call goes directly to etcd +func prepareListCallOptions(lastSyncedResourceVersion string, listOptions metav1.ListOptions, retrievedItemsCount int) metav1.ListOptions { + // this is our legacy case: + // + // the watch cache skips the Limit if the ResourceVersion was set to "0" + // thus, to compare with data retrieved directly from etcd + // we need to skip the limit to for the list call as well. + // + // note that when the number of retrieved items is less than the request limit, + // it means either the watch cache is disabled, or there is not enough data. + // in both cases, we can use the limit because we will be able to compare + // the data with the items retrieved from etcd. + if listOptions.ResourceVersion == "0" && listOptions.Limit > 0 && int64(retrievedItemsCount) > listOptions.Limit { + listOptions.Limit = 0 + } + + // set the RV and RVM so that we get the snapshot of data + // directly from etcd. + listOptions.ResourceVersion = lastSyncedResourceVersion + listOptions.ResourceVersionMatch = metav1.ResourceVersionMatchExact + + return listOptions +} + type byUID []metav1.Object func (a byUID) Len() int { return len(a) } diff --git a/util/consistencydetector/data_consistency_detector_test.go b/util/consistencydetector/data_consistency_detector_test.go index a7c6928996..59682a68ab 100644 --- a/util/consistencydetector/data_consistency_detector_test.go +++ b/util/consistencydetector/data_consistency_detector_test.go @@ -60,6 +60,59 @@ func TestDataConsistencyChecker(t *testing.T) { }, }, + { + name: "legacy, the limit is removed from the list options when it wasn't honored by the watch cache", + listResponse: &v1.PodList{ + ListMeta: metav1.ListMeta{ResourceVersion: "2"}, + Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2"), *makePod("p3", "3")}, + }, + requestOptions: metav1.ListOptions{ResourceVersion: "0", Limit: 2}, + retrievedItems: []*v1.Pod{makePod("p1", "1"), makePod("p2", "2"), makePod("p3", "3")}, + expectedListRequests: 1, + expectedRequestOptions: []metav1.ListOptions{ + { + ResourceVersion: "2", + ResourceVersionMatch: metav1.ResourceVersionMatchExact, + }, + }, + }, + + { + name: "the limit is NOT removed from the list options for non-legacy request", + listResponse: &v1.PodList{ + ListMeta: metav1.ListMeta{ResourceVersion: "2"}, + Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2"), *makePod("p3", "3")}, + }, + requestOptions: metav1.ListOptions{ResourceVersion: "2", Limit: 2}, + retrievedItems: []*v1.Pod{makePod("p1", "1"), makePod("p2", "2"), makePod("p3", "3")}, + expectedListRequests: 1, + expectedRequestOptions: []metav1.ListOptions{ + { + Limit: 2, + ResourceVersion: "2", + ResourceVersionMatch: metav1.ResourceVersionMatchExact, + }, + }, + }, + + { + name: "legacy, the limit is NOT removed from the list options when the watch cache is disabled", + listResponse: &v1.PodList{ + ListMeta: metav1.ListMeta{ResourceVersion: "2"}, + Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2"), *makePod("p3", "3")}, + }, + requestOptions: metav1.ListOptions{ResourceVersion: "0", Limit: 5}, + retrievedItems: []*v1.Pod{makePod("p1", "1"), makePod("p2", "2"), makePod("p3", "3")}, + expectedListRequests: 1, + expectedRequestOptions: []metav1.ListOptions{ + { + Limit: 5, + ResourceVersion: "2", + ResourceVersionMatch: metav1.ResourceVersionMatchExact, + }, + }, + }, + { name: "data consistency check won't panic when there is no data", listResponse: &v1.PodList{ From b03e5b8438ce5abf36bac817490639abfbcd0441 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Wed, 5 Jun 2024 05:37:20 -0700 Subject: [PATCH 067/159] Merge pull request #125335 from p0lyn0mial/upstream-consistency-decector-handles-legacy-case client-go/consistencydetector: handles the watch cache legacy case Kubernetes-commit: dae37c21645c0fc04bbb0202ad1eba6ba4438d23 From bbe85a4a80dce7ef3b25e4dbf024d09be90faf6a Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Wed, 5 Jun 2024 22:41:09 +0200 Subject: [PATCH 068/159] fix TestDriveCheckListFromCacheDataConsistencyIfRequested Kubernetes-commit: 82794c4963144bf5298089030733f993a44f7c3b --- .../list_data_consistency_detector_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/consistencydetector/list_data_consistency_detector_test.go b/util/consistencydetector/list_data_consistency_detector_test.go index 3e61e1f2b9..655d9c9982 100644 --- a/util/consistencydetector/list_data_consistency_detector_test.go +++ b/util/consistencydetector/list_data_consistency_detector_test.go @@ -29,7 +29,7 @@ import ( var ( emptyListFunc = func(_ context.Context, opts metav1.ListOptions) (*v1.PodList, error) { - return nil, nil + return &v1.PodList{}, nil } emptyListOptions = metav1.ListOptions{} ) @@ -37,7 +37,7 @@ var ( func TestDriveCheckListFromCacheDataConsistencyIfRequested(t *testing.T) { ctx := context.TODO() - CheckListFromCacheDataConsistencyIfRequested(ctx, "", emptyListFunc, emptyListOptions, nil) + CheckListFromCacheDataConsistencyIfRequested(ctx, "", emptyListFunc, emptyListOptions, &v1.PodList{}) } func TestCheckListFromCacheDataConsistencyIfRequestedInternalPanics(t *testing.T) { From 82627741cb4de61f15169f913484821033480cae Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Thu, 6 Jun 2024 14:14:33 +0200 Subject: [PATCH 069/159] client-go/consistencydetector: refactor TestDataConsistencyChecker to work with unstructured data Kubernetes-commit: d535f55ef9dd391712db09ac69dd083089457366 --- .../data_consistency_detector_test.go | 48 +++++++++++-------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/util/consistencydetector/data_consistency_detector_test.go b/util/consistencydetector/data_consistency_detector_test.go index 59682a68ab..f4165fe889 100644 --- a/util/consistencydetector/data_consistency_detector_test.go +++ b/util/consistencydetector/data_consistency_detector_test.go @@ -34,22 +34,24 @@ func TestDataConsistencyChecker(t *testing.T) { scenarios := []struct { name string - listResponse *v1.PodList - retrievedItems []*v1.Pod - requestOptions metav1.ListOptions + lastSyncedResourceVersion string + listResponse runtime.Object + retrievedItems []runtime.Object + requestOptions metav1.ListOptions expectedRequestOptions []metav1.ListOptions expectedListRequests int expectPanic bool }{ { - name: "data consistency check won't panic when data is consistent", + name: "data consistency check won't panic when data is consistent", + lastSyncedResourceVersion: "2", listResponse: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "2"}, Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2")}, }, requestOptions: metav1.ListOptions{TimeoutSeconds: ptr.To(int64(39))}, - retrievedItems: []*v1.Pod{makePod("p1", "1"), makePod("p2", "2")}, + retrievedItems: []runtime.Object{makePod("p1", "1"), makePod("p2", "2")}, expectedListRequests: 1, expectedRequestOptions: []metav1.ListOptions{ { @@ -61,13 +63,14 @@ func TestDataConsistencyChecker(t *testing.T) { }, { - name: "legacy, the limit is removed from the list options when it wasn't honored by the watch cache", + name: "legacy, the limit is removed from the list options when it wasn't honored by the watch cache", + lastSyncedResourceVersion: "2", listResponse: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "2"}, Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2"), *makePod("p3", "3")}, }, requestOptions: metav1.ListOptions{ResourceVersion: "0", Limit: 2}, - retrievedItems: []*v1.Pod{makePod("p1", "1"), makePod("p2", "2"), makePod("p3", "3")}, + retrievedItems: []runtime.Object{makePod("p1", "1"), makePod("p2", "2"), makePod("p3", "3")}, expectedListRequests: 1, expectedRequestOptions: []metav1.ListOptions{ { @@ -78,13 +81,14 @@ func TestDataConsistencyChecker(t *testing.T) { }, { - name: "the limit is NOT removed from the list options for non-legacy request", + name: "the limit is NOT removed from the list options for non-legacy request", + lastSyncedResourceVersion: "2", listResponse: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "2"}, Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2"), *makePod("p3", "3")}, }, requestOptions: metav1.ListOptions{ResourceVersion: "2", Limit: 2}, - retrievedItems: []*v1.Pod{makePod("p1", "1"), makePod("p2", "2"), makePod("p3", "3")}, + retrievedItems: []runtime.Object{makePod("p1", "1"), makePod("p2", "2"), makePod("p3", "3")}, expectedListRequests: 1, expectedRequestOptions: []metav1.ListOptions{ { @@ -96,13 +100,14 @@ func TestDataConsistencyChecker(t *testing.T) { }, { - name: "legacy, the limit is NOT removed from the list options when the watch cache is disabled", + name: "legacy, the limit is NOT removed from the list options when the watch cache is disabled", + lastSyncedResourceVersion: "2", listResponse: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "2"}, Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2"), *makePod("p3", "3")}, }, requestOptions: metav1.ListOptions{ResourceVersion: "0", Limit: 5}, - retrievedItems: []*v1.Pod{makePod("p1", "1"), makePod("p2", "2"), makePod("p3", "3")}, + retrievedItems: []runtime.Object{makePod("p1", "1"), makePod("p2", "2"), makePod("p3", "3")}, expectedListRequests: 1, expectedRequestOptions: []metav1.ListOptions{ { @@ -114,7 +119,8 @@ func TestDataConsistencyChecker(t *testing.T) { }, { - name: "data consistency check won't panic when there is no data", + name: "data consistency check won't panic when there is no data", + lastSyncedResourceVersion: "2", listResponse: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "2"}, }, @@ -136,7 +142,8 @@ func TestDataConsistencyChecker(t *testing.T) { }, { - name: "data consistency check won't be performed when ResourceVersion was set to 0", + name: "data consistency check won't be performed when ResourceVersion was set to 0", + lastSyncedResourceVersion: "0", listResponse: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "0"}, Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2")}, @@ -146,13 +153,14 @@ func TestDataConsistencyChecker(t *testing.T) { }, { - name: "data consistency panics when data is inconsistent", + name: "data consistency panics when data is inconsistent", + lastSyncedResourceVersion: "2", listResponse: &v1.PodList{ ListMeta: metav1.ListMeta{ResourceVersion: "2"}, Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2"), *makePod("p3", "3")}, }, requestOptions: metav1.ListOptions{TimeoutSeconds: ptr.To(int64(39))}, - retrievedItems: []*v1.Pod{makePod("p1", "1"), makePod("p2", "2")}, + retrievedItems: []runtime.Object{makePod("p1", "1"), makePod("p2", "2")}, expectedListRequests: 1, expectedRequestOptions: []metav1.ListOptions{ { @@ -172,16 +180,16 @@ func TestDataConsistencyChecker(t *testing.T) { scenario.listResponse = &v1.PodList{} } fakeLister := &listWrapper{response: scenario.listResponse} - retrievedItemsFunc := func() []*v1.Pod { + retrievedItemsFunc := func() []runtime.Object { return scenario.retrievedItems } if scenario.expectPanic { require.Panics(t, func() { - CheckDataConsistency(ctx, "", scenario.listResponse.ResourceVersion, fakeLister.List, scenario.requestOptions, retrievedItemsFunc) + CheckDataConsistency(ctx, "", scenario.lastSyncedResourceVersion, fakeLister.List, scenario.requestOptions, retrievedItemsFunc) }) } else { - CheckDataConsistency(ctx, "", scenario.listResponse.ResourceVersion, fakeLister.List, scenario.requestOptions, retrievedItemsFunc) + CheckDataConsistency(ctx, "", scenario.lastSyncedResourceVersion, fakeLister.List, scenario.requestOptions, retrievedItemsFunc) } require.Equal(t, fakeLister.counter, scenario.expectedListRequests) @@ -218,10 +226,10 @@ func (lw *errorLister) List(_ context.Context, _ metav1.ListOptions) (runtime.Ob type listWrapper struct { counter int requestOptions []metav1.ListOptions - response *v1.PodList + response runtime.Object } -func (lw *listWrapper) List(_ context.Context, opts metav1.ListOptions) (*v1.PodList, error) { +func (lw *listWrapper) List(_ context.Context, opts metav1.ListOptions) (runtime.Object, error) { lw.counter++ lw.requestOptions = append(lw.requestOptions, opts) return lw.response, nil From 098e7c5a9bc67b50bdddeba36f5dd02b0d1593a6 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Thu, 6 Jun 2024 09:16:38 -0700 Subject: [PATCH 070/159] Merge pull request #125356 from p0lyn0mial/upstream-improve-testdrivechecklistfromcache-test improve TestDriveCheckListFromCacheDataConsistencyIfRequested Kubernetes-commit: 4e2a6201a43f4c8bbb633ae8edc8cc47b1a39ee7 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 34afbf2f4e..d1adb5f712 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240531003526-c114cd746b5a + k8s.io/api v0.0.0-20240605203554-c0840f2e39d3 k8s.io/apimachinery v0.0.0-20240603234208-703232ea6da4 k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 diff --git a/go.sum b/go.sum index 3d023a1f7b..ec9de6701b 100644 --- a/go.sum +++ b/go.sum @@ -157,8 +157,8 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240531003526-c114cd746b5a h1:P8nQ3iz4FxeKN26Y8fz9qoEkUZy/DkQPtBmkVyriAS0= -k8s.io/api v0.0.0-20240531003526-c114cd746b5a/go.mod h1:2VfykmUr8OqDStfcJWPvSW182MtoxAMeWsJHXwxqzXo= +k8s.io/api v0.0.0-20240605203554-c0840f2e39d3 h1:xyY+alozd0hMtW6l/nPRvuKw++ci+kcETN3ncQ/9XkY= +k8s.io/api v0.0.0-20240605203554-c0840f2e39d3/go.mod h1:A81Hv2cdUeI+qLTFOIAFAg/t5jV5W88m9ygoJiL4vxI= k8s.io/apimachinery v0.0.0-20240603234208-703232ea6da4 h1:On2XjWF6loaEJ/GLZH+ZyovYHWfOZUgl9qUdC8Mn05o= k8s.io/apimachinery v0.0.0-20240603234208-703232ea6da4/go.mod h1:ClkKrTMwhmMjgsEHpX2w3F+YKj0ctDOaAxqL7clxG0U= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= From 20d0a8ee8261b8bb8a2a493a9aabf1e9d03b5706 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Fri, 7 Jun 2024 10:33:11 +0200 Subject: [PATCH 071/159] client-go/consistencydetector: extend TestDataConsistencyChecker to test unstructured data Kubernetes-commit: c8971c456f23627a91dc79bb8bc840a32dea611f --- .../data_consistency_detector_test.go | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/util/consistencydetector/data_consistency_detector_test.go b/util/consistencydetector/data_consistency_detector_test.go index f4165fe889..300e8d9ea0 100644 --- a/util/consistencydetector/data_consistency_detector_test.go +++ b/util/consistencydetector/data_consistency_detector_test.go @@ -25,6 +25,7 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/utils/ptr" @@ -62,6 +63,34 @@ func TestDataConsistencyChecker(t *testing.T) { }, }, + { + name: "data consistency check works with unstructured data (dynamic client)", + lastSyncedResourceVersion: "2", + listResponse: &unstructured.UnstructuredList{ + Object: map[string]interface{}{ + "apiVersion": "vTest", + "kind": "rTestList", + }, + Items: []unstructured.Unstructured{ + *makeUnstructuredObject("vTest", "rTest", "item1"), + *makeUnstructuredObject("vTest", "rTest", "item2"), + }, + }, + requestOptions: metav1.ListOptions{TimeoutSeconds: ptr.To(int64(39))}, + retrievedItems: []runtime.Object{ + makeUnstructuredObject("vTest", "rTest", "item1"), + makeUnstructuredObject("vTest", "rTest", "item2"), + }, + expectedListRequests: 1, + expectedRequestOptions: []metav1.ListOptions{ + { + ResourceVersion: "2", + ResourceVersionMatch: metav1.ResourceVersionMatchExact, + TimeoutSeconds: ptr.To(int64(39)), + }, + }, + }, + { name: "legacy, the limit is removed from the list options when it wasn't honored by the watch cache", lastSyncedResourceVersion: "2", @@ -238,3 +267,15 @@ func (lw *listWrapper) List(_ context.Context, opts metav1.ListOptions) (runtime func makePod(name, rv string) *v1.Pod { return &v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: name, ResourceVersion: rv, UID: types.UID(name)}} } + +func makeUnstructuredObject(version, kind, name string) *unstructured.Unstructured { + return &unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": version, + "kind": kind, + "metadata": map[string]interface{}{ + "name": name, + }, + }, + } +} From 2d885a2ed5f7a375f321c0c37d618f7f4b823e13 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Fri, 7 Jun 2024 10:43:28 +0200 Subject: [PATCH 072/159] client-go/util/consistencydetector: refactor TestCheckListFromCacheDataConsistencyIfRequestedInternalHappyPath to work with unstructured data Kubernetes-commit: c5904424b2b03cec1befaf16c55bb97df57669bc --- .../list_data_consistency_detector_test.go | 58 ++++++++++++------- 1 file changed, 38 insertions(+), 20 deletions(-) diff --git a/util/consistencydetector/list_data_consistency_detector_test.go b/util/consistencydetector/list_data_consistency_detector_test.go index 655d9c9982..0a0debd7e3 100644 --- a/util/consistencydetector/list_data_consistency_detector_test.go +++ b/util/consistencydetector/list_data_consistency_detector_test.go @@ -24,6 +24,7 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/ptr" ) @@ -52,26 +53,43 @@ func TestCheckListFromCacheDataConsistencyIfRequestedInternalPanics(t *testing.T } func TestCheckListFromCacheDataConsistencyIfRequestedInternalHappyPath(t *testing.T) { - ctx := context.TODO() - listOptions := metav1.ListOptions{TimeoutSeconds: ptr.To(int64(39))} - expectedRequestOptions := metav1.ListOptions{ - ResourceVersion: "2", - ResourceVersionMatch: metav1.ResourceVersionMatchExact, - TimeoutSeconds: ptr.To(int64(39)), - } - listResponse := &v1.PodList{ - ListMeta: metav1.ListMeta{ResourceVersion: "2"}, - Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2")}, + scenarios := []struct { + name string + listResponse runtime.Object + retrievedList runtime.Object + retrievedListOptions metav1.ListOptions + + expectedRequestOptions metav1.ListOptions + }{ + { + name: "list detector works with a typed list", + listResponse: &v1.PodList{ + ListMeta: metav1.ListMeta{ResourceVersion: "2"}, + Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2")}, + }, + retrievedListOptions: metav1.ListOptions{TimeoutSeconds: ptr.To(int64(39))}, + retrievedList: &v1.PodList{ + ListMeta: metav1.ListMeta{ResourceVersion: "2"}, + Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2")}, + }, + expectedRequestOptions: metav1.ListOptions{ + ResourceVersion: "2", + ResourceVersionMatch: metav1.ResourceVersionMatchExact, + TimeoutSeconds: ptr.To(int64(39)), + }, + }, } - retrievedList := &v1.PodList{ - ListMeta: metav1.ListMeta{ResourceVersion: "2"}, - Items: []v1.Pod{*makePod("p1", "1"), *makePod("p2", "2")}, + for _, scenario := range scenarios { + t.Run(scenario.name, func(t *testing.T) { + ctx := context.TODO() + listOptions := metav1.ListOptions{TimeoutSeconds: ptr.To(int64(39))} + fakeLister := &listWrapper{response: scenario.listResponse} + + checkListFromCacheDataConsistencyIfRequestedInternal(ctx, "", fakeLister.List, listOptions, scenario.retrievedList) + + require.Equal(t, 1, fakeLister.counter) + require.Equal(t, 1, len(fakeLister.requestOptions)) + require.Equal(t, fakeLister.requestOptions[0], scenario.expectedRequestOptions) + }) } - fakeLister := &listWrapper{response: listResponse} - - checkListFromCacheDataConsistencyIfRequestedInternal(ctx, "", fakeLister.List, listOptions, retrievedList) - - require.Equal(t, 1, fakeLister.counter) - require.Equal(t, 1, len(fakeLister.requestOptions)) - require.Equal(t, fakeLister.requestOptions[0], expectedRequestOptions) } From 503a0905c06f816e1ffb5cadbd78d1c0041caaf0 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Fri, 7 Jun 2024 10:55:01 +0200 Subject: [PATCH 073/159] client-go/util/consistencydetector: extend TestCheckListFromCacheDataConsistencyIfRequestedInternalHappyPath to work with unstructured list Kubernetes-commit: a2a48a475b4c98daeea3f83b8a89aa070ea4082b --- .../list_data_consistency_detector_test.go | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/util/consistencydetector/list_data_consistency_detector_test.go b/util/consistencydetector/list_data_consistency_detector_test.go index 0a0debd7e3..945e073102 100644 --- a/util/consistencydetector/list_data_consistency_detector_test.go +++ b/util/consistencydetector/list_data_consistency_detector_test.go @@ -24,6 +24,7 @@ import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/ptr" ) @@ -78,6 +79,43 @@ func TestCheckListFromCacheDataConsistencyIfRequestedInternalHappyPath(t *testin TimeoutSeconds: ptr.To(int64(39)), }, }, + { + name: "list detector works with a unstructured list", + listResponse: &unstructured.UnstructuredList{ + Object: map[string]interface{}{ + "apiVersion": "vTest", + "kind": "rTestList", + "metadata": map[string]interface{}{ + "resourceVersion": "3", + }, + }, + Items: []unstructured.Unstructured{ + *makeUnstructuredObject("vTest", "rTest", "item1"), + *makeUnstructuredObject("vTest", "rTest", "item2"), + *makeUnstructuredObject("vTest", "rTest", "item3"), + }, + }, + retrievedListOptions: metav1.ListOptions{TimeoutSeconds: ptr.To(int64(39))}, + retrievedList: &unstructured.UnstructuredList{ + Object: map[string]interface{}{ + "apiVersion": "vTest", + "kind": "rTestList", + "metadata": map[string]interface{}{ + "resourceVersion": "3", + }, + }, + Items: []unstructured.Unstructured{ + *makeUnstructuredObject("vTest", "rTest", "item1"), + *makeUnstructuredObject("vTest", "rTest", "item2"), + *makeUnstructuredObject("vTest", "rTest", "item3"), + }, + }, + expectedRequestOptions: metav1.ListOptions{ + ResourceVersion: "3", + ResourceVersionMatch: metav1.ResourceVersionMatchExact, + TimeoutSeconds: ptr.To(int64(39)), + }, + }, } for _, scenario := range scenarios { t.Run(scenario.name, func(t *testing.T) { From 8fc5a6465187fe1fe154e7508c811e1a2b7b0cbc Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Fri, 7 Jun 2024 07:50:55 -0700 Subject: [PATCH 074/159] Merge pull request #125383 from p0lyn0mial/upstream-unstructured-testchecklistconsistency client-go/consistencydetector: refactor TestCheckListFromCacheDataConsistencyIfRequestedInternalHappyPath to work with unstructured data Kubernetes-commit: 51f89c3b2d114fea99d3a0e8401c639f39e27877 From 4d57b6a3406d804aa830c4ebd577f009ada9005b Mon Sep 17 00:00:00 2001 From: Ben Luddy Date: Thu, 9 May 2024 14:30:58 -0400 Subject: [PATCH 075/159] Bump fxamacker/cbor/v2 to v2.7.0-beta. This library release makes a number of behaviors configurable in ways that are required for CBOR support in Kubernetes. Kubernetes-commit: c4279660cad039bc15495311cf7863640b6308f9 --- go.mod | 12 +++++++++--- go.sum | 15 +++++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index d1adb5f712..0beaf69248 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240605203554-c0840f2e39d3 - k8s.io/apimachinery v0.0.0-20240603234208-703232ea6da4 + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -38,7 +38,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect - github.com/fxamacker/cbor/v2 v2.6.0 // indirect + github.com/fxamacker/cbor/v2 v2.7.0-beta // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect @@ -62,3 +62,9 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace ( + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go +) diff --git a/go.sum b/go.sum index ec9de6701b..a61d5e5169 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,8 @@ +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -7,8 +10,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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/fxamacker/cbor/v2 v2.6.0 h1:sU6J2usfADwWlYDAFhZBQ6TnLFBHxgesMrQfQgk1tWA= -github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= +github.com/fxamacker/cbor/v2 v2.7.0-beta h1:m5bO941uTVpSms26QjzEJxUZaC3S/h1pSJexBCu4wAA= +github.com/fxamacker/cbor/v2 v2.7.0-beta/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= @@ -106,8 +109,10 @@ go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -142,6 +147,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -157,10 +163,7 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240605203554-c0840f2e39d3 h1:xyY+alozd0hMtW6l/nPRvuKw++ci+kcETN3ncQ/9XkY= -k8s.io/api v0.0.0-20240605203554-c0840f2e39d3/go.mod h1:A81Hv2cdUeI+qLTFOIAFAg/t5jV5W88m9ygoJiL4vxI= -k8s.io/apimachinery v0.0.0-20240603234208-703232ea6da4 h1:On2XjWF6loaEJ/GLZH+ZyovYHWfOZUgl9qUdC8Mn05o= -k8s.io/apimachinery v0.0.0-20240603234208-703232ea6da4/go.mod h1:ClkKrTMwhmMjgsEHpX2w3F+YKj0ctDOaAxqL7clxG0U= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 911684686f22b3c03d5d9c955addbc35b7de5534 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Mon, 10 Jun 2024 13:36:40 -0700 Subject: [PATCH 076/159] Merge pull request #125408 from benluddy/bump-cbor-v2.7.0 KEP-4222: Bump github.com/fxamacker/cbor/v2. Kubernetes-commit: 6346b9d1327c4b8be2398d9715bdae5475e27569 --- go.mod | 10 ++-------- go.sum | 11 ++++------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 0beaf69248..46450b3fbb 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0 - k8s.io/apimachinery v0.0.0 + k8s.io/api v0.0.0-20240611003639-590e50434bf1 + k8s.io/apimachinery v0.0.0-20240611003333-1a6a62ad18e9 k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -62,9 +62,3 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace ( - k8s.io/api => ../api - k8s.io/apimachinery => ../apimachinery - k8s.io/client-go => ../client-go -) diff --git a/go.sum b/go.sum index a61d5e5169..587aa97f9f 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,5 @@ -cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -109,10 +106,8 @@ go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -147,7 +142,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -163,7 +157,10 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= +k8s.io/api v0.0.0-20240611003639-590e50434bf1 h1:oxDdCGF5j63Mpb6Des2N1CCsNubC8scZdBm1DRAkwRM= +k8s.io/api v0.0.0-20240611003639-590e50434bf1/go.mod h1:5Cjw9MqZjRGElVN/sncIVEj4uQqmgd5uRSkUupucc3U= +k8s.io/apimachinery v0.0.0-20240611003333-1a6a62ad18e9 h1:uEYcGyr07zLyUWoDL38erRxiSRNnusAK211luE2Lb/c= +k8s.io/apimachinery v0.0.0-20240611003333-1a6a62ad18e9/go.mod h1:3nAExNh3CrzC6eKT9a32j/rv+uJ8Zod87oOmgUjZNAY= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 14559c0fecebb3ba77cb349c01ddd159e7747173 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Mon, 10 Jun 2024 22:52:47 +0200 Subject: [PATCH 077/159] client-go/consistencydetector: introduce CheckWatchListFromCacheDataConsistencyIfRequested Kubernetes-commit: f7f3809c513cd051c2c45bbef0655cf5a3eceea2 --- .../list_data_consistency_detector_test.go | 6 +++ .../watch_list_data_consistency_detector.go | 54 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 util/consistencydetector/watch_list_data_consistency_detector.go diff --git a/util/consistencydetector/list_data_consistency_detector_test.go b/util/consistencydetector/list_data_consistency_detector_test.go index 945e073102..e0a250166d 100644 --- a/util/consistencydetector/list_data_consistency_detector_test.go +++ b/util/consistencydetector/list_data_consistency_detector_test.go @@ -36,6 +36,12 @@ var ( emptyListOptions = metav1.ListOptions{} ) +func TestDriveCheckWatchListFromCacheDataConsistencyIfRequested(t *testing.T) { + ctx := context.TODO() + + CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "", emptyListFunc, emptyListOptions, &v1.PodList{}) +} + func TestDriveCheckListFromCacheDataConsistencyIfRequested(t *testing.T) { ctx := context.TODO() diff --git a/util/consistencydetector/watch_list_data_consistency_detector.go b/util/consistencydetector/watch_list_data_consistency_detector.go new file mode 100644 index 0000000000..cda5fc205f --- /dev/null +++ b/util/consistencydetector/watch_list_data_consistency_detector.go @@ -0,0 +1,54 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package consistencydetector + +import ( + "context" + "os" + "strconv" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +var dataConsistencyDetectionForWatchListEnabled = false + +func init() { + dataConsistencyDetectionForWatchListEnabled, _ = strconv.ParseBool(os.Getenv("KUBE_WATCHLIST_INCONSISTENCY_DETECTOR")) +} + +// IsDataConsistencyDetectionForWatchListEnabled returns true when +// the KUBE_WATCHLIST_INCONSISTENCY_DETECTOR environment variable was set during a binary startup. +func IsDataConsistencyDetectionForWatchListEnabled() bool { + return dataConsistencyDetectionForWatchListEnabled +} + +// CheckWatchListFromCacheDataConsistencyIfRequested performs a data consistency check only when +// the KUBE_WATCHLIST_INCONSISTENCY_DETECTOR environment variable was set during a binary startup. +// +// The consistency check is meant to be enforced only in the CI, not in production. +// The check ensures that data retrieved by the watch-list api call +// is exactly the same as data received by the standard list api call against etcd. +// +// Note that this function will panic when data inconsistency is detected. +// This is intentional because we want to catch it in the CI. +func CheckWatchListFromCacheDataConsistencyIfRequested[T runtime.Object](ctx context.Context, identity string, listItemsFn ListFunc[T], optionsUsedToReceiveList metav1.ListOptions, receivedList runtime.Object) { + if !IsDataConsistencyDetectionForWatchListEnabled() { + return + } + checkListFromCacheDataConsistencyIfRequestedInternal(ctx, identity, listItemsFn, optionsUsedToReceiveList, receivedList) +} From b681e77bec71dd5114b228100034c4e44fe2d21c Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Mon, 10 Jun 2024 23:01:04 +0200 Subject: [PATCH 078/159] client-go/reflector: use consistencydetector.IsDataConsistencyDetectionForWatchListEnabled Kubernetes-commit: f6c68908ba37dbb7af602b8f88b5f395025d2384 --- tools/cache/reflector_data_consistency_detector.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tools/cache/reflector_data_consistency_detector.go b/tools/cache/reflector_data_consistency_detector.go index bd857de7a5..a7e0d9c436 100644 --- a/tools/cache/reflector_data_consistency_detector.go +++ b/tools/cache/reflector_data_consistency_detector.go @@ -18,20 +18,12 @@ package cache import ( "context" - "os" - "strconv" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/util/consistencydetector" ) -var dataConsistencyDetectionForWatchListEnabled = false - -func init() { - dataConsistencyDetectionForWatchListEnabled, _ = strconv.ParseBool(os.Getenv("KUBE_WATCHLIST_INCONSISTENCY_DETECTOR")) -} - // checkWatchListDataConsistencyIfRequested performs a data consistency check only when // the KUBE_WATCHLIST_INCONSISTENCY_DETECTOR environment variable was set during a binary startup. // @@ -42,7 +34,7 @@ func init() { // Note that this function will panic when data inconsistency is detected. // This is intentional because we want to catch it in the CI. func checkWatchListDataConsistencyIfRequested[T runtime.Object, U any](ctx context.Context, identity string, lastSyncedResourceVersion string, listFn consistencydetector.ListFunc[T], retrieveItemsFn consistencydetector.RetrieveItemsFunc[U]) { - if !dataConsistencyDetectionForWatchListEnabled { + if !consistencydetector.IsDataConsistencyDetectionForWatchListEnabled() { return } // for informers we pass an empty ListOptions because From 03443e7ede0e50d195b8669103ce082e735c6b94 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Tue, 11 Jun 2024 01:22:25 -0700 Subject: [PATCH 079/159] Merge pull request #125432 from p0lyn0mial/upstream-watch-list-data-consistency-detector client-go/consistencydetector: add CheckWatchListFromCacheDataConsistencyIfRequested Kubernetes-commit: 27bdade27f9f4c2b60928a18579de369c9f8c2ef From 9a760efea1165bcc5797da47491f6b9843e8af8f Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Mon, 10 Jun 2024 18:03:47 +0200 Subject: [PATCH 080/159] client-go/util/watchlist: intro CanUseWatchListForListRequest Kubernetes-commit: 38fae9b799393f6fe17d07fb8148f05b1110859b --- util/watchlist/watch_list.go | 82 ++++++++++++ util/watchlist/watch_list_test.go | 200 ++++++++++++++++++++++++++++++ 2 files changed, 282 insertions(+) create mode 100644 util/watchlist/watch_list.go create mode 100644 util/watchlist/watch_list_test.go diff --git a/util/watchlist/watch_list.go b/util/watchlist/watch_list.go new file mode 100644 index 0000000000..84106458a5 --- /dev/null +++ b/util/watchlist/watch_list.go @@ -0,0 +1,82 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package watchlist + +import ( + metainternalversion "k8s.io/apimachinery/pkg/apis/meta/internalversion" + metainternalversionvalidation "k8s.io/apimachinery/pkg/apis/meta/internalversion/validation" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + clientfeatures "k8s.io/client-go/features" + "k8s.io/utils/ptr" +) + +var scheme = runtime.NewScheme() + +func init() { + utilruntime.Must(metainternalversion.AddToScheme(scheme)) +} + +// PrepareWatchListOptionsFromListOptions creates a new ListOptions +// that can be used for a watch-list request from the given listOptions. +// +// This function also determines if the given listOptions can be used to form a watch-list request, +// which would result in streaming semantically equivalent data from the server. +func PrepareWatchListOptionsFromListOptions(listOptions metav1.ListOptions) (metav1.ListOptions, bool, error) { + if !clientfeatures.FeatureGates().Enabled(clientfeatures.WatchListClient) { + return metav1.ListOptions{}, false, nil + } + + internalListOptions := &metainternalversion.ListOptions{} + if err := scheme.Convert(&listOptions, internalListOptions, nil); err != nil { + return metav1.ListOptions{}, false, err + } + if errs := metainternalversionvalidation.ValidateListOptions(internalListOptions, true); len(errs) > 0 { + return metav1.ListOptions{}, false, nil + } + + watchListOptions := listOptions + // this is our legacy case, the cache ignores LIMIT for + // ResourceVersion == 0 and RVM=unset|NotOlderThan + if listOptions.Limit > 0 && listOptions.ResourceVersion != "0" { + return metav1.ListOptions{}, false, nil + } + watchListOptions.Limit = 0 + + // to ensure that we can create a watch-list request that returns + // semantically equivalent data for the given listOptions, + // we need to validate that the RVM for the list is supported by watch-list requests. + if listOptions.ResourceVersionMatch == metav1.ResourceVersionMatchExact { + return metav1.ListOptions{}, false, nil + } + watchListOptions.ResourceVersionMatch = metav1.ResourceVersionMatchNotOlderThan + + watchListOptions.Watch = true + watchListOptions.AllowWatchBookmarks = true + watchListOptions.SendInitialEvents = ptr.To(true) + + internalWatchListOptions := &metainternalversion.ListOptions{} + if err := scheme.Convert(&watchListOptions, internalWatchListOptions, nil); err != nil { + return metav1.ListOptions{}, false, err + } + if errs := metainternalversionvalidation.ValidateListOptions(internalWatchListOptions, true); len(errs) > 0 { + return metav1.ListOptions{}, false, nil + } + + return watchListOptions, true, nil +} diff --git a/util/watchlist/watch_list_test.go b/util/watchlist/watch_list_test.go new file mode 100644 index 0000000000..b3cc10e1a6 --- /dev/null +++ b/util/watchlist/watch_list_test.go @@ -0,0 +1,200 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package watchlist + +import ( + "testing" + + "github.com/stretchr/testify/require" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clientfeatures "k8s.io/client-go/features" + clientfeaturestesting "k8s.io/client-go/features/testing" + "k8s.io/utils/ptr" +) + +// TestPrepareWatchListOptionsFromListOptions test the following cases: +// +// +--------------------------+-----------------+---------+-----------------+ +// | ResourceVersionMatch | ResourceVersion | Limit | Continuation | +// +--------------------------+-----------------+---------+-----------------+ +// | unset/NotOlderThan/Exact | unset/0/100 | unset/4 | unset/FakeToken | +// +--------------------------+-----------------+---------+-----------------+ +func TestPrepareWatchListOptionsFromListOptions(t *testing.T) { + scenarios := []struct { + name string + listOptions metav1.ListOptions + enableWatchListFG bool + + expectToPrepareWatchListOptions bool + expectedWatchListOptions metav1.ListOptions + }{ + + { + name: "can't enable watch list for: WatchListClient=off, RVM=unset, RV=unset, Limit=unset, Continuation=unset", + enableWatchListFG: false, + expectToPrepareWatchListOptions: false, + }, + // +----------------------+-----------------+-------+--------------+ + // | ResourceVersionMatch | ResourceVersion | Limit | Continuation | + // +----------------------+-----------------+-------+--------------+ + // | unset | unset | unset | unset | + // | unset | 0 | unset | unset | + // | unset | 100 | unset | unset | + // | unset | 0 | 4 | unset | + // | unset | 0 | unset | FakeToken | + // +----------------------+-----------------+-------+--------------+ + { + name: "can enable watch list for: RVM=unset, RV=unset, Limit=unset, Continuation=unset", + enableWatchListFG: true, + expectToPrepareWatchListOptions: true, + expectedWatchListOptions: expectedWatchListOptionsFor(""), + }, + { + name: "can enable watch list for: RVM=unset, RV=0, Limit=unset, Continuation=unset", + listOptions: metav1.ListOptions{ResourceVersion: "0"}, + enableWatchListFG: true, + expectToPrepareWatchListOptions: true, + expectedWatchListOptions: expectedWatchListOptionsFor("0"), + }, + { + name: "can enable watch list for: RVM=unset, RV=100, Limit=unset, Continuation=unset", + listOptions: metav1.ListOptions{ResourceVersion: "100"}, + enableWatchListFG: true, + expectToPrepareWatchListOptions: true, + expectedWatchListOptions: expectedWatchListOptionsFor("100"), + }, + { + name: "legacy: can enable watch list for: RVM=unset, RV=0, Limit=4, Continuation=unset", + listOptions: metav1.ListOptions{ResourceVersion: "0", Limit: 4}, + enableWatchListFG: true, + expectToPrepareWatchListOptions: true, + expectedWatchListOptions: expectedWatchListOptionsFor("0"), + }, + { + name: "can't enable watch list for: RVM=unset, RV=0, Limit=unset, Continuation=FakeToken", + listOptions: metav1.ListOptions{ResourceVersion: "0", Continue: "FakeToken"}, + enableWatchListFG: true, + expectToPrepareWatchListOptions: false, + }, + // +----------------------+-----------------+-------+--------------+ + // | ResourceVersionMatch | ResourceVersion | Limit | Continuation | + // +----------------------+-----------------+-------+--------------+ + // | NotOlderThan | unset | unset | unset | + // | NotOlderThan | 0 | unset | unset | + // | NotOlderThan | 100 | unset | unset | + // | NotOlderThan | 0 | 4 | unset | + // | NotOlderThan | 0 | unset | FakeToken | + // +----------------------+-----------------+-------+--------------+ + { + name: "can't enable watch list for: RVM=NotOlderThan, RV=unset, Limit=unset, Continuation=unset", + listOptions: metav1.ListOptions{ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan}, + enableWatchListFG: true, + expectToPrepareWatchListOptions: false, + }, + { + name: "can enable watch list for: RVM=NotOlderThan, RV=0, Limit=unset, Continuation=unset", + listOptions: metav1.ListOptions{ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, ResourceVersion: "0"}, + enableWatchListFG: true, + expectToPrepareWatchListOptions: true, + expectedWatchListOptions: expectedWatchListOptionsFor("0"), + }, + { + name: "can enable watch list for: RVM=NotOlderThan, RV=100, Limit=unset, Continuation=unset", + listOptions: metav1.ListOptions{ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, ResourceVersion: "100"}, + enableWatchListFG: true, + expectToPrepareWatchListOptions: true, + expectedWatchListOptions: expectedWatchListOptionsFor("100"), + }, + { + name: "legacy: can enable watch list for: RVM=NotOlderThan, RV=0, Limit=4, Continuation=unset", + listOptions: metav1.ListOptions{ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, ResourceVersion: "0", Limit: 4}, + enableWatchListFG: true, + expectToPrepareWatchListOptions: true, + expectedWatchListOptions: expectedWatchListOptionsFor("0"), + }, + { + name: "can't enable watch list for: RVM=NotOlderThan, RV=0, Limit=unset, Continuation=FakeToken", + listOptions: metav1.ListOptions{ResourceVersionMatch: metav1.ResourceVersionMatchNotOlderThan, ResourceVersion: "0", Continue: "FakeToken"}, + enableWatchListFG: true, + expectToPrepareWatchListOptions: false, + }, + + // +----------------------+-----------------+-------+--------------+ + // | ResourceVersionMatch | ResourceVersion | Limit | Continuation | + // +----------------------+-----------------+-------+--------------+ + // | Exact | unset | unset | unset | + // | Exact | 0 | unset | unset | + // | Exact | 100 | unset | unset | + // | Exact | 0 | 4 | unset | + // | Exact | 0 | unset | FakeToken | + // +----------------------+-----------------+-------+--------------+ + { + name: "can't enable watch list for: RVM=Exact, RV=unset, Limit=unset, Continuation=unset", + listOptions: metav1.ListOptions{ResourceVersionMatch: metav1.ResourceVersionMatchExact}, + enableWatchListFG: true, + expectToPrepareWatchListOptions: false, + }, + { + name: "can enable watch list for: RVM=Exact, RV=0, Limit=unset, Continuation=unset", + listOptions: metav1.ListOptions{ResourceVersionMatch: metav1.ResourceVersionMatchExact, ResourceVersion: "0"}, + enableWatchListFG: true, + expectToPrepareWatchListOptions: false, + }, + { + name: "can enable watch list for: RVM=Exact, RV=100, Limit=unset, Continuation=unset", + listOptions: metav1.ListOptions{ResourceVersionMatch: metav1.ResourceVersionMatchExact, ResourceVersion: "100"}, + enableWatchListFG: true, + expectToPrepareWatchListOptions: false, + }, + { + name: "can't enable watch list for: RVM=Exact, RV=0, Limit=4, Continuation=unset", + listOptions: metav1.ListOptions{ResourceVersionMatch: metav1.ResourceVersionMatchExact, ResourceVersion: "0", Limit: 4}, + enableWatchListFG: true, + expectToPrepareWatchListOptions: false, + }, + { + name: "can't enable watch list for: RVM=Exact, RV=0, Limit=unset, Continuation=FakeToken", + listOptions: metav1.ListOptions{ResourceVersionMatch: metav1.ResourceVersionMatchExact, ResourceVersion: "0", Continue: "FakeToken"}, + enableWatchListFG: true, + expectToPrepareWatchListOptions: false, + }, + } + for _, scenario := range scenarios { + t.Run(scenario.name, func(t *testing.T) { + clientfeaturestesting.SetFeatureDuringTest(t, clientfeatures.WatchListClient, scenario.enableWatchListFG) + + watchListOptions, hasWatchListOptionsPrepared, err := PrepareWatchListOptionsFromListOptions(scenario.listOptions) + + require.NoError(t, err) + require.Equal(t, scenario.expectToPrepareWatchListOptions, hasWatchListOptionsPrepared) + require.Equal(t, scenario.expectedWatchListOptions, watchListOptions) + }) + } +} + +func expectedWatchListOptionsFor(rv string) metav1.ListOptions { + var watchListOptions metav1.ListOptions + + watchListOptions.ResourceVersion = rv + watchListOptions.ResourceVersionMatch = metav1.ResourceVersionMatchNotOlderThan + watchListOptions.Watch = true + watchListOptions.AllowWatchBookmarks = true + watchListOptions.SendInitialEvents = ptr.To(true) + + return watchListOptions +} From 5347b09f1d1da60e7ddfbb33238fe90fc03175c3 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Tue, 11 Jun 2024 10:42:07 +0200 Subject: [PATCH 081/159] client-go/reflector: remove reflector_data_consistency_detector_test.go Kubernetes-commit: 0c96a00217d6e2a4c9cb1cf6c0bc719d570678fc --- ...eflector_data_consistency_detector_test.go | 29 ------------------- 1 file changed, 29 deletions(-) delete mode 100644 tools/cache/reflector_data_consistency_detector_test.go diff --git a/tools/cache/reflector_data_consistency_detector_test.go b/tools/cache/reflector_data_consistency_detector_test.go deleted file mode 100644 index 7d0d8bb624..0000000000 --- a/tools/cache/reflector_data_consistency_detector_test.go +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2024 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package cache - -import ( - "context" - "testing" - - "k8s.io/apimachinery/pkg/runtime" -) - -func TestDriveWatchLisConsistencyIfRequired(t *testing.T) { - ctx := context.TODO() - checkWatchListDataConsistencyIfRequested[runtime.Object, runtime.Object](ctx, "", "", nil, nil) -} From fb1003a7e4113b2b7d9f4d68a16358897b1da0cc Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Wed, 12 Jun 2024 10:04:30 -0700 Subject: [PATCH 082/159] Merge pull request #125440 from p0lyn0mial/upstream-client-go-watchlist-can-use-watchlist-for-list-rq client-go/util/watchlist: intro CanUseWatchListForListRequest( Kubernetes-commit: 813d3f35b42c0549619dfa54754fa62244af6c14 From 48d8fc7e2eac4a1203b089ba558735b41777b6a4 Mon Sep 17 00:00:00 2001 From: Karl Isenberg Date: Wed, 12 Jun 2024 13:06:22 -0700 Subject: [PATCH 083/159] Add details to watch interface method comments The watch.Interface design is hard to change, because it would break most client-go users that perform watches. So instead of changing the interface to be more user friendly, this change updates the method comments to explain the different responsibilities of the consumer (client user) and the producer (interface implementer). Kubernetes-commit: 1f35231a1d4f7b8586a7ec589c799729eeb4f7c4 --- tools/cache/listwatch.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/cache/listwatch.go b/tools/cache/listwatch.go index 10b7e6512e..f5708ffeb1 100644 --- a/tools/cache/listwatch.go +++ b/tools/cache/listwatch.go @@ -36,6 +36,10 @@ type Lister interface { // Watcher is any object that knows how to start a watch on a resource. type Watcher interface { // Watch should begin a watch at the specified version. + // + // If Watch returns an error, it should handle its own cleanup, including + // but not limited to calling Stop() on the watch, if one was constructed. + // This allows the caller to ignore the watch, if the error is non-nil. Watch(options metav1.ListOptions) (watch.Interface, error) } From f29a36dfab639b255b7b39a1ca1cc34ce2804639 Mon Sep 17 00:00:00 2001 From: Karl Isenberg Date: Wed, 12 Jun 2024 13:14:55 -0700 Subject: [PATCH 084/159] Refactor Reflector ListAndWatch - Extract watchWithResync to simplify ListAndWatch - Wrap watchHandler with two variants, one for WatchList and one for just Watch. - Replace a bool pointer arg with a bool arg and bool return, to improve readability. - Use errors.Is to satisfy the linter - Use %w to wrap the store.Replace error, to allow unwrapping. Kubernetes-commit: 65fc1bb463c85a4c85e619bf7acac9503e23a253 --- tools/cache/reflector.go | 131 +++++++++++++++++++++++----------- tools/cache/reflector_test.go | 15 ++-- 2 files changed, 98 insertions(+), 48 deletions(-) diff --git a/tools/cache/reflector.go b/tools/cache/reflector.go index a617147bda..5e7dd57409 100644 --- a/tools/cache/reflector.go +++ b/tools/cache/reflector.go @@ -366,12 +366,7 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { } klog.V(2).Infof("Caches populated for %v from %s", r.typeDescription, r.name) - - resyncerrc := make(chan error, 1) - cancelCh := make(chan struct{}) - defer close(cancelCh) - go r.startResync(stopCh, cancelCh, resyncerrc) - return r.watch(w, stopCh, resyncerrc) + return r.watchWithResync(w, stopCh) } // startResync periodically calls r.store.Resync() method. @@ -402,6 +397,15 @@ func (r *Reflector) startResync(stopCh <-chan struct{}, cancelCh <-chan struct{} } } +// watchWithResync runs watch with startResync in the background. +func (r *Reflector) watchWithResync(w watch.Interface, stopCh <-chan struct{}) error { + resyncerrc := make(chan error, 1) + cancelCh := make(chan struct{}) + defer close(cancelCh) + go r.startResync(stopCh, cancelCh, resyncerrc) + return r.watch(w, stopCh, resyncerrc) +} + // watch simply starts a watch request with the server. func (r *Reflector) watch(w watch.Interface, stopCh <-chan struct{}, resyncerrc chan error) error { var err error @@ -451,13 +455,14 @@ func (r *Reflector) watch(w watch.Interface, stopCh <-chan struct{}, resyncerrc } } - err = watchHandler(start, w, r.store, r.expectedType, r.expectedGVK, r.name, r.typeDescription, r.setLastSyncResourceVersion, nil, r.clock, resyncerrc, stopCh) + err = handleWatch(start, w, r.store, r.expectedType, r.expectedGVK, r.name, r.typeDescription, r.setLastSyncResourceVersion, + r.clock, resyncerrc, stopCh) // Ensure that watch will not be reused across iterations. w.Stop() w = nil retry.After(err) if err != nil { - if err != errorStopRequested { + if !errors.Is(err, errorStopRequested) { switch { case isExpiredError(err): // Don't set LastSyncResourceVersionUnavailable - LIST call with ResourceVersion=RV already @@ -668,14 +673,12 @@ func (r *Reflector) watchList(stopCh <-chan struct{}) (watch.Interface, error) { } return nil, err } - bookmarkReceived := pointer.Bool(false) - err = watchHandler(start, w, temporaryStore, r.expectedType, r.expectedGVK, r.name, r.typeDescription, + watchListBookmarkReceived, err := handleListWatch(start, w, temporaryStore, r.expectedType, r.expectedGVK, r.name, r.typeDescription, func(rv string) { resourceVersion = rv }, - bookmarkReceived, r.clock, make(chan error), stopCh) if err != nil { w.Stop() // stop and retry with clean state - if err == errorStopRequested { + if errors.Is(err, errorStopRequested) { return nil, nil } if isErrorRetriableWithSideEffectsFn(err) { @@ -683,7 +686,7 @@ func (r *Reflector) watchList(stopCh <-chan struct{}) (watch.Interface, error) { } return nil, err } - if *bookmarkReceived { + if watchListBookmarkReceived { break } } @@ -697,8 +700,8 @@ func (r *Reflector) watchList(stopCh <-chan struct{}) (watch.Interface, error) { // component as soon as it finishes replacing the content. checkWatchListDataConsistencyIfRequested(wait.ContextForChannel(stopCh), r.name, resourceVersion, wrapListFuncWithContext(r.listerWatcher.List), temporaryStore.List) - if err = r.store.Replace(temporaryStore.List(), resourceVersion); err != nil { - return nil, fmt.Errorf("unable to sync watch-list result: %v", err) + if err := r.store.Replace(temporaryStore.List(), resourceVersion); err != nil { + return nil, fmt.Errorf("unable to sync watch-list result: %w", err) } initTrace.Step("SyncWith done") r.setLastSyncResourceVersion(resourceVersion) @@ -715,8 +718,12 @@ func (r *Reflector) syncWith(items []runtime.Object, resourceVersion string) err return r.store.Replace(found, resourceVersion) } -// watchHandler watches w and sets setLastSyncResourceVersion -func watchHandler(start time.Time, +// handleListWatch consumes events from w, updates the Store, and records the +// last seen ResourceVersion, to allow continuing from that ResourceVersion on +// retry. If successful, the watcher will be left open after receiving the +// initial set of objects, to allow watching for future events. +func handleListWatch( + start time.Time, w watch.Interface, store Store, expectedType reflect.Type, @@ -724,33 +731,77 @@ func watchHandler(start time.Time, name string, expectedTypeName string, setLastSyncResourceVersion func(string), - exitOnInitialEventsEndBookmark *bool, clock clock.Clock, - errc chan error, + errCh chan error, + stopCh <-chan struct{}, +) (bool, error) { + exitOnWatchListBookmarkReceived := true + return handleAnyWatch(start, w, store, expectedType, expectedGVK, name, expectedTypeName, + setLastSyncResourceVersion, exitOnWatchListBookmarkReceived, clock, errCh, stopCh) +} + +// handleListWatch consumes events from w, updates the Store, and records the +// last seen ResourceVersion, to allow continuing from that ResourceVersion on +// retry. The watcher will always be stopped on exit. +func handleWatch( + start time.Time, + w watch.Interface, + store Store, + expectedType reflect.Type, + expectedGVK *schema.GroupVersionKind, + name string, + expectedTypeName string, + setLastSyncResourceVersion func(string), + clock clock.Clock, + errCh chan error, stopCh <-chan struct{}, ) error { + exitOnWatchListBookmarkReceived := false + _, err := handleAnyWatch(start, w, store, expectedType, expectedGVK, name, expectedTypeName, + setLastSyncResourceVersion, exitOnWatchListBookmarkReceived, clock, errCh, stopCh) + return err +} + +// handleAnyWatch consumes events from w, updates the Store, and records the last +// seen ResourceVersion, to allow continuing from that ResourceVersion on retry. +// If exitOnWatchListBookmarkReceived is true, the watch events will be consumed +// until a bookmark event is received with the WatchList annotation present. +// Returns true (watchListBookmarkReceived) if the WatchList bookmark was +// received, even if exitOnWatchListBookmarkReceived is false. +// The watcher will always be stopped, unless exitOnWatchListBookmarkReceived is +// true and watchListBookmarkReceived is true. This allows the same watch stream +// to be re-used by the caller to continue watching for new events. +func handleAnyWatch(start time.Time, + w watch.Interface, + store Store, + expectedType reflect.Type, + expectedGVK *schema.GroupVersionKind, + name string, + expectedTypeName string, + setLastSyncResourceVersion func(string), + exitOnWatchListBookmarkReceived bool, + clock clock.Clock, + errCh chan error, + stopCh <-chan struct{}, +) (bool, error) { + watchListBookmarkReceived := false eventCount := 0 - initialEventsEndBookmarkWarningTicker := newInitialEventsEndBookmarkTicker(name, clock, start, exitOnInitialEventsEndBookmark != nil) + initialEventsEndBookmarkWarningTicker := newInitialEventsEndBookmarkTicker(name, clock, start, exitOnWatchListBookmarkReceived) defer initialEventsEndBookmarkWarningTicker.Stop() - if exitOnInitialEventsEndBookmark != nil { - // set it to false just in case somebody - // made it positive - *exitOnInitialEventsEndBookmark = false - } loop: for { select { case <-stopCh: - return errorStopRequested - case err := <-errc: - return err + return watchListBookmarkReceived, errorStopRequested + case err := <-errCh: + return watchListBookmarkReceived, err case event, ok := <-w.ResultChan(): if !ok { break loop } if event.Type == watch.Error { - return apierrors.FromObject(event.Object) + return watchListBookmarkReceived, apierrors.FromObject(event.Object) } if expectedType != nil { if e, a := expectedType, reflect.TypeOf(event.Object); e != a { @@ -792,9 +843,7 @@ loop: case watch.Bookmark: // A `Bookmark` means watch has synced here, just update the resourceVersion if meta.GetAnnotations()[metav1.InitialEventsAnnotationKey] == "true" { - if exitOnInitialEventsEndBookmark != nil { - *exitOnInitialEventsEndBookmark = true - } + watchListBookmarkReceived = true } default: utilruntime.HandleError(fmt.Errorf("%s: unable to understand watch event %#v", name, event)) @@ -804,10 +853,10 @@ loop: rvu.UpdateResourceVersion(resourceVersion) } eventCount++ - if exitOnInitialEventsEndBookmark != nil && *exitOnInitialEventsEndBookmark { + if exitOnWatchListBookmarkReceived && watchListBookmarkReceived { watchDuration := clock.Since(start) klog.V(4).Infof("exiting %v Watch because received the bookmark that marks the end of initial events stream, total %v items received in %v", name, eventCount, watchDuration) - return nil + return watchListBookmarkReceived, nil } initialEventsEndBookmarkWarningTicker.observeLastEventTimeStamp(clock.Now()) case <-initialEventsEndBookmarkWarningTicker.C(): @@ -817,10 +866,10 @@ loop: watchDuration := clock.Since(start) if watchDuration < 1*time.Second && eventCount == 0 { - return fmt.Errorf("very short watch: %s: Unexpected watch close - watch lasted less than a second and no items received", name) + return watchListBookmarkReceived, fmt.Errorf("very short watch: %s: Unexpected watch close - watch lasted less than a second and no items received", name) } klog.V(4).Infof("%s: Watch close - %v total %v items received", name, expectedTypeName, eventCount) - return nil + return watchListBookmarkReceived, nil } // LastSyncResourceVersion is the resource version observed when last sync with the underlying store @@ -962,14 +1011,14 @@ type initialEventsEndBookmarkTicker struct { // Note that the caller controls whether to call t.C() and t.Stop(). // // In practice, the reflector exits the watchHandler as soon as the bookmark event is received and calls the t.C() method. -func newInitialEventsEndBookmarkTicker(name string, c clock.Clock, watchStart time.Time, exitOnInitialEventsEndBookmarkRequested bool) *initialEventsEndBookmarkTicker { - return newInitialEventsEndBookmarkTickerInternal(name, c, watchStart, 10*time.Second, exitOnInitialEventsEndBookmarkRequested) +func newInitialEventsEndBookmarkTicker(name string, c clock.Clock, watchStart time.Time, exitOnWatchListBookmarkReceived bool) *initialEventsEndBookmarkTicker { + return newInitialEventsEndBookmarkTickerInternal(name, c, watchStart, 10*time.Second, exitOnWatchListBookmarkReceived) } -func newInitialEventsEndBookmarkTickerInternal(name string, c clock.Clock, watchStart time.Time, tickInterval time.Duration, exitOnInitialEventsEndBookmarkRequested bool) *initialEventsEndBookmarkTicker { +func newInitialEventsEndBookmarkTickerInternal(name string, c clock.Clock, watchStart time.Time, tickInterval time.Duration, exitOnWatchListBookmarkReceived bool) *initialEventsEndBookmarkTicker { clockWithTicker, ok := c.(clock.WithTicker) - if !ok || !exitOnInitialEventsEndBookmarkRequested { - if exitOnInitialEventsEndBookmarkRequested { + if !ok || !exitOnWatchListBookmarkReceived { + if exitOnWatchListBookmarkReceived { klog.Warningf("clock does not support WithTicker interface but exitOnInitialEventsEndBookmark was requested") } return &initialEventsEndBookmarkTicker{ diff --git a/tools/cache/reflector_test.go b/tools/cache/reflector_test.go index 32946345d3..1b4904a627 100644 --- a/tools/cache/reflector_test.go +++ b/tools/cache/reflector_test.go @@ -231,7 +231,7 @@ func TestReflectorHandleWatchStoppedBefore(t *testing.T) { return resultCh }, } - err := watchHandler(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, g.setLastSyncResourceVersion, nil, g.clock, nevererrc, stopCh) + err := handleWatch(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, g.setLastSyncResourceVersion, g.clock, nevererrc, stopCh) if err == nil { t.Errorf("unexpected non-error") } @@ -267,7 +267,7 @@ func TestReflectorHandleWatchStoppedAfter(t *testing.T) { return resultCh }, } - err := watchHandler(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, g.setLastSyncResourceVersion, nil, g.clock, nevererrc, stopCh) + err := handleWatch(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, g.setLastSyncResourceVersion, g.clock, nevererrc, stopCh) if err == nil { t.Errorf("unexpected non-error") } @@ -295,7 +295,7 @@ func TestReflectorHandleWatchResultChanClosedBefore(t *testing.T) { } // Simulate the result channel being closed by the producer before handleWatch is called. close(resultCh) - err := watchHandler(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, g.setLastSyncResourceVersion, nil, g.clock, nevererrc, wait.NeverStop) + err := handleWatch(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, g.setLastSyncResourceVersion, g.clock, nevererrc, wait.NeverStop) if err == nil { t.Errorf("unexpected non-error") } @@ -328,7 +328,7 @@ func TestReflectorHandleWatchResultChanClosedAfter(t *testing.T) { return resultCh }, } - err := watchHandler(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, g.setLastSyncResourceVersion, nil, g.clock, nevererrc, wait.NeverStop) + err := handleWatch(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, g.setLastSyncResourceVersion, g.clock, nevererrc, wait.NeverStop) if err == nil { t.Errorf("unexpected non-error") } @@ -362,8 +362,9 @@ func TestReflectorWatchHandler(t *testing.T) { fw.Add(&v1.Pod{ObjectMeta: metav1.ObjectMeta{Name: "baz", ResourceVersion: "32"}}) fw.Stop() }() - err := watchHandler(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, setLastSyncResourceVersion, nil, g.clock, nevererrc, stopCh) - if !errors.Is(err, errorStopRequested) { + err := handleWatch(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, setLastSyncResourceVersion, g.clock, nevererrc, stopCh) + // TODO(karlkfi): Fix FakeWatcher to avoid race condition between watcher.Stop() & close(stopCh) + if err != nil && !errors.Is(err, errorStopRequested) { t.Errorf("unexpected error %v", err) } @@ -406,7 +407,7 @@ func TestReflectorStopWatch(t *testing.T) { fw := watch.NewFake() stopWatch := make(chan struct{}) close(stopWatch) - err := watchHandler(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, g.setLastSyncResourceVersion, nil, g.clock, nevererrc, stopWatch) + err := handleWatch(time.Now(), fw, s, g.expectedType, g.expectedGVK, g.name, g.typeDescription, g.setLastSyncResourceVersion, g.clock, nevererrc, stopWatch) if err != errorStopRequested { t.Errorf("expected stop error, got %q", err) } From cc198ea39d10460274b36273ef19e4fd10711196 Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Thu, 13 Jun 2024 10:25:56 +0200 Subject: [PATCH 085/159] make update Kubernetes-commit: f62c80f965934eeeb2e028497bede7bcc632995d --- .../v1/mutatingwebhookconfiguration.go | 37 +++++++++++++++--- .../v1/validatingadmissionpolicy.go | 37 +++++++++++++++--- .../v1/validatingadmissionpolicybinding.go | 37 +++++++++++++++--- .../v1/validatingwebhookconfiguration.go | 37 +++++++++++++++--- .../v1alpha1/validatingadmissionpolicy.go | 37 +++++++++++++++--- .../validatingadmissionpolicybinding.go | 37 +++++++++++++++--- .../v1beta1/mutatingwebhookconfiguration.go | 37 +++++++++++++++--- .../v1beta1/validatingadmissionpolicy.go | 37 +++++++++++++++--- .../validatingadmissionpolicybinding.go | 37 +++++++++++++++--- .../v1beta1/validatingwebhookconfiguration.go | 37 +++++++++++++++--- .../v1alpha1/storageversion.go | 37 +++++++++++++++--- .../typed/apps/v1/controllerrevision.go | 38 ++++++++++++++++--- kubernetes/typed/apps/v1/daemonset.go | 38 ++++++++++++++++--- kubernetes/typed/apps/v1/deployment.go | 38 ++++++++++++++++--- kubernetes/typed/apps/v1/replicaset.go | 38 ++++++++++++++++--- kubernetes/typed/apps/v1/statefulset.go | 38 ++++++++++++++++--- .../typed/apps/v1beta1/controllerrevision.go | 38 ++++++++++++++++--- kubernetes/typed/apps/v1beta1/deployment.go | 38 ++++++++++++++++--- kubernetes/typed/apps/v1beta1/statefulset.go | 38 ++++++++++++++++--- .../typed/apps/v1beta2/controllerrevision.go | 38 ++++++++++++++++--- kubernetes/typed/apps/v1beta2/daemonset.go | 38 ++++++++++++++++--- kubernetes/typed/apps/v1beta2/deployment.go | 38 ++++++++++++++++--- kubernetes/typed/apps/v1beta2/replicaset.go | 38 ++++++++++++++++--- kubernetes/typed/apps/v1beta2/statefulset.go | 38 ++++++++++++++++--- .../autoscaling/v1/horizontalpodautoscaler.go | 38 ++++++++++++++++--- .../autoscaling/v2/horizontalpodautoscaler.go | 38 ++++++++++++++++--- .../v2beta1/horizontalpodautoscaler.go | 38 ++++++++++++++++--- .../v2beta2/horizontalpodautoscaler.go | 38 ++++++++++++++++--- kubernetes/typed/batch/v1/cronjob.go | 38 ++++++++++++++++--- kubernetes/typed/batch/v1/job.go | 38 ++++++++++++++++--- kubernetes/typed/batch/v1beta1/cronjob.go | 38 ++++++++++++++++--- .../v1/certificatesigningrequest.go | 37 +++++++++++++++--- .../v1alpha1/clustertrustbundle.go | 37 +++++++++++++++--- .../v1beta1/certificatesigningrequest.go | 37 +++++++++++++++--- kubernetes/typed/coordination/v1/lease.go | 38 ++++++++++++++++--- .../typed/coordination/v1beta1/lease.go | 38 ++++++++++++++++--- kubernetes/typed/core/v1/componentstatus.go | 37 +++++++++++++++--- kubernetes/typed/core/v1/configmap.go | 38 ++++++++++++++++--- kubernetes/typed/core/v1/endpoints.go | 38 ++++++++++++++++--- kubernetes/typed/core/v1/event.go | 38 ++++++++++++++++--- kubernetes/typed/core/v1/limitrange.go | 38 ++++++++++++++++--- kubernetes/typed/core/v1/namespace.go | 37 +++++++++++++++--- kubernetes/typed/core/v1/node.go | 37 +++++++++++++++--- kubernetes/typed/core/v1/persistentvolume.go | 37 +++++++++++++++--- .../typed/core/v1/persistentvolumeclaim.go | 38 ++++++++++++++++--- kubernetes/typed/core/v1/pod.go | 38 ++++++++++++++++--- kubernetes/typed/core/v1/podtemplate.go | 38 ++++++++++++++++--- .../typed/core/v1/replicationcontroller.go | 38 ++++++++++++++++--- kubernetes/typed/core/v1/resourcequota.go | 38 ++++++++++++++++--- kubernetes/typed/core/v1/secret.go | 38 ++++++++++++++++--- kubernetes/typed/core/v1/service.go | 38 ++++++++++++++++--- kubernetes/typed/core/v1/serviceaccount.go | 38 ++++++++++++++++--- .../typed/discovery/v1/endpointslice.go | 38 ++++++++++++++++--- .../typed/discovery/v1beta1/endpointslice.go | 38 ++++++++++++++++--- kubernetes/typed/events/v1/event.go | 38 ++++++++++++++++--- kubernetes/typed/events/v1beta1/event.go | 38 ++++++++++++++++--- .../typed/extensions/v1beta1/daemonset.go | 38 ++++++++++++++++--- .../typed/extensions/v1beta1/deployment.go | 38 ++++++++++++++++--- .../typed/extensions/v1beta1/ingress.go | 38 ++++++++++++++++--- .../typed/extensions/v1beta1/networkpolicy.go | 38 ++++++++++++++++--- .../typed/extensions/v1beta1/replicaset.go | 38 ++++++++++++++++--- kubernetes/typed/flowcontrol/v1/flowschema.go | 37 +++++++++++++++--- .../v1/prioritylevelconfiguration.go | 37 +++++++++++++++--- .../typed/flowcontrol/v1beta1/flowschema.go | 37 +++++++++++++++--- .../v1beta1/prioritylevelconfiguration.go | 37 +++++++++++++++--- .../typed/flowcontrol/v1beta2/flowschema.go | 37 +++++++++++++++--- .../v1beta2/prioritylevelconfiguration.go | 37 +++++++++++++++--- .../typed/flowcontrol/v1beta3/flowschema.go | 37 +++++++++++++++--- .../v1beta3/prioritylevelconfiguration.go | 37 +++++++++++++++--- kubernetes/typed/networking/v1/ingress.go | 38 ++++++++++++++++--- .../typed/networking/v1/ingressclass.go | 37 +++++++++++++++--- .../typed/networking/v1/networkpolicy.go | 38 ++++++++++++++++--- .../typed/networking/v1alpha1/ipaddress.go | 37 +++++++++++++++--- .../typed/networking/v1alpha1/servicecidr.go | 37 +++++++++++++++--- .../typed/networking/v1beta1/ingress.go | 38 ++++++++++++++++--- .../typed/networking/v1beta1/ingressclass.go | 37 +++++++++++++++--- kubernetes/typed/node/v1/runtimeclass.go | 37 +++++++++++++++--- .../typed/node/v1alpha1/runtimeclass.go | 37 +++++++++++++++--- kubernetes/typed/node/v1beta1/runtimeclass.go | 37 +++++++++++++++--- .../typed/policy/v1/poddisruptionbudget.go | 38 ++++++++++++++++--- .../policy/v1beta1/poddisruptionbudget.go | 38 ++++++++++++++++--- kubernetes/typed/rbac/v1/clusterrole.go | 37 +++++++++++++++--- .../typed/rbac/v1/clusterrolebinding.go | 37 +++++++++++++++--- kubernetes/typed/rbac/v1/role.go | 38 ++++++++++++++++--- kubernetes/typed/rbac/v1/rolebinding.go | 38 ++++++++++++++++--- kubernetes/typed/rbac/v1alpha1/clusterrole.go | 37 +++++++++++++++--- .../typed/rbac/v1alpha1/clusterrolebinding.go | 37 +++++++++++++++--- kubernetes/typed/rbac/v1alpha1/role.go | 38 ++++++++++++++++--- kubernetes/typed/rbac/v1alpha1/rolebinding.go | 38 ++++++++++++++++--- kubernetes/typed/rbac/v1beta1/clusterrole.go | 37 +++++++++++++++--- .../typed/rbac/v1beta1/clusterrolebinding.go | 37 +++++++++++++++--- kubernetes/typed/rbac/v1beta1/role.go | 38 ++++++++++++++++--- kubernetes/typed/rbac/v1beta1/rolebinding.go | 38 ++++++++++++++++--- .../resource/v1alpha2/podschedulingcontext.go | 38 ++++++++++++++++--- .../typed/resource/v1alpha2/resourceclaim.go | 38 ++++++++++++++++--- .../v1alpha2/resourceclaimparameters.go | 38 ++++++++++++++++--- .../v1alpha2/resourceclaimtemplate.go | 38 ++++++++++++++++--- .../typed/resource/v1alpha2/resourceclass.go | 37 +++++++++++++++--- .../v1alpha2/resourceclassparameters.go | 38 ++++++++++++++++--- .../typed/resource/v1alpha2/resourceslice.go | 37 +++++++++++++++--- .../typed/scheduling/v1/priorityclass.go | 37 +++++++++++++++--- .../scheduling/v1alpha1/priorityclass.go | 37 +++++++++++++++--- .../typed/scheduling/v1beta1/priorityclass.go | 37 +++++++++++++++--- kubernetes/typed/storage/v1/csidriver.go | 37 +++++++++++++++--- kubernetes/typed/storage/v1/csinode.go | 37 +++++++++++++++--- .../typed/storage/v1/csistoragecapacity.go | 38 ++++++++++++++++--- kubernetes/typed/storage/v1/storageclass.go | 37 +++++++++++++++--- .../typed/storage/v1/volumeattachment.go | 37 +++++++++++++++--- .../storage/v1alpha1/csistoragecapacity.go | 38 ++++++++++++++++--- .../storage/v1alpha1/volumeattachment.go | 37 +++++++++++++++--- .../storage/v1alpha1/volumeattributesclass.go | 37 +++++++++++++++--- kubernetes/typed/storage/v1beta1/csidriver.go | 37 +++++++++++++++--- kubernetes/typed/storage/v1beta1/csinode.go | 37 +++++++++++++++--- .../storage/v1beta1/csistoragecapacity.go | 38 ++++++++++++++++--- .../typed/storage/v1beta1/storageclass.go | 37 +++++++++++++++--- .../typed/storage/v1beta1/volumeattachment.go | 37 +++++++++++++++--- .../v1alpha1/storageversionmigration.go | 37 +++++++++++++++--- 117 files changed, 3806 insertions(+), 585 deletions(-) diff --git a/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go index 93eb62aa80..4a50306848 100644 --- a/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // MutatingWebhookConfigurationsGetter has a method to return a MutatingWebhookConfigurationInterface. @@ -79,13 +81,22 @@ func (c *mutatingWebhookConfigurations) Get(ctx context.Context, name string, op } // List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. -func (c *mutatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.MutatingWebhookConfigurationList, err error) { - defer func() { +func (c *mutatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (*v1.MutatingWebhookConfigurationList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for mutatingwebhookconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for mutatingwebhookconfigurations", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for mutatingwebhookconfigurations", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for mutatingwebhookconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for mutatingwebhookconfigurations", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. @@ -104,6 +115,22 @@ func (c *mutatingWebhookConfigurations) list(ctx context.Context, opts metav1.Li return } +// watchList establishes a watch stream with the server and returns the list of MutatingWebhookConfigurations +func (c *mutatingWebhookConfigurations) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.MutatingWebhookConfigurationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.MutatingWebhookConfigurationList{} + err = c.client.Get(). + Resource("mutatingwebhookconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations. func (c *mutatingWebhookConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go b/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go index 9bd895051d..33260641ac 100644 --- a/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go +++ b/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ValidatingAdmissionPoliciesGetter has a method to return a ValidatingAdmissionPolicyInterface. @@ -81,13 +83,22 @@ func (c *validatingAdmissionPolicies) Get(ctx context.Context, name string, opti } // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. -func (c *validatingAdmissionPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyList, err error) { - defer func() { +func (c *validatingAdmissionPolicies) List(ctx context.Context, opts metav1.ListOptions) (*v1.ValidatingAdmissionPolicyList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicies, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicies", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicies", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for validatingadmissionpolicies ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicies", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. @@ -106,6 +117,22 @@ func (c *validatingAdmissionPolicies) list(ctx context.Context, opts metav1.List return } +// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicies +func (c *validatingAdmissionPolicies) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ValidatingAdmissionPolicyList{} + err = c.client.Get(). + Resource("validatingadmissionpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies. func (c *validatingAdmissionPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicybinding.go b/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicybinding.go index 872bacc650..eac9f604e2 100644 --- a/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicybinding.go +++ b/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicybinding.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ValidatingAdmissionPolicyBindingsGetter has a method to return a ValidatingAdmissionPolicyBindingInterface. @@ -79,13 +81,22 @@ func (c *validatingAdmissionPolicyBindings) Get(ctx context.Context, name string } // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. -func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyBindingList, err error) { - defer func() { +func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts metav1.ListOptions) (*v1.ValidatingAdmissionPolicyBindingList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicybindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicybindings", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicybindings", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for validatingadmissionpolicybindings ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicybindings", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. @@ -104,6 +115,22 @@ func (c *validatingAdmissionPolicyBindings) list(ctx context.Context, opts metav return } +// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicyBindings +func (c *validatingAdmissionPolicyBindings) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyBindingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ValidatingAdmissionPolicyBindingList{} + err = c.client.Get(). + Resource("validatingadmissionpolicybindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings. func (c *validatingAdmissionPolicyBindings) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go index 585dc22dea..eb7df7efec 100644 --- a/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ValidatingWebhookConfigurationsGetter has a method to return a ValidatingWebhookConfigurationInterface. @@ -79,13 +81,22 @@ func (c *validatingWebhookConfigurations) Get(ctx context.Context, name string, } // List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. -func (c *validatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingWebhookConfigurationList, err error) { - defer func() { +func (c *validatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (*v1.ValidatingWebhookConfigurationList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for validatingwebhookconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingwebhookconfigurations", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingwebhookconfigurations", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for validatingwebhookconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingwebhookconfigurations", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. @@ -104,6 +115,22 @@ func (c *validatingWebhookConfigurations) list(ctx context.Context, opts metav1. return } +// watchList establishes a watch stream with the server and returns the list of ValidatingWebhookConfigurations +func (c *validatingWebhookConfigurations) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingWebhookConfigurationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ValidatingWebhookConfigurationList{} + err = c.client.Get(). + Resource("validatingwebhookconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations. func (c *validatingWebhookConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicy.go b/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicy.go index dafd922379..7c2e9fd218 100644 --- a/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicy.go +++ b/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicy.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ValidatingAdmissionPoliciesGetter has a method to return a ValidatingAdmissionPolicyInterface. @@ -81,13 +83,22 @@ func (c *validatingAdmissionPolicies) Get(ctx context.Context, name string, opti } // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. -func (c *validatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyList, err error) { - defer func() { +func (c *validatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ValidatingAdmissionPolicyList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicies, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicies", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicies", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for validatingadmissionpolicies ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicies", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. @@ -106,6 +117,22 @@ func (c *validatingAdmissionPolicies) list(ctx context.Context, opts v1.ListOpti return } +// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicies +func (c *validatingAdmissionPolicies) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.ValidatingAdmissionPolicyList{} + err = c.client.Get(). + Resource("validatingadmissionpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies. func (c *validatingAdmissionPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go b/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go index c8a6c768b8..d4e4b83374 100644 --- a/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go +++ b/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ValidatingAdmissionPolicyBindingsGetter has a method to return a ValidatingAdmissionPolicyBindingInterface. @@ -79,13 +81,22 @@ func (c *validatingAdmissionPolicyBindings) Get(ctx context.Context, name string } // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. -func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyBindingList, err error) { - defer func() { +func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ValidatingAdmissionPolicyBindingList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicybindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicybindings", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicybindings", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for validatingadmissionpolicybindings ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicybindings", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. @@ -104,6 +115,22 @@ func (c *validatingAdmissionPolicyBindings) list(ctx context.Context, opts v1.Li return } +// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicyBindings +func (c *validatingAdmissionPolicyBindings) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyBindingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.ValidatingAdmissionPolicyBindingList{} + err = c.client.Get(). + Resource("validatingadmissionpolicybindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings. func (c *validatingAdmissionPolicyBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index 8e1833448c..9ca778b6f7 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // MutatingWebhookConfigurationsGetter has a method to return a MutatingWebhookConfigurationInterface. @@ -79,13 +81,22 @@ func (c *mutatingWebhookConfigurations) Get(ctx context.Context, name string, op } // List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. -func (c *mutatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MutatingWebhookConfigurationList, err error) { - defer func() { +func (c *mutatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.MutatingWebhookConfigurationList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for mutatingwebhookconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for mutatingwebhookconfigurations", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for mutatingwebhookconfigurations", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for mutatingwebhookconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for mutatingwebhookconfigurations", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. @@ -104,6 +115,22 @@ func (c *mutatingWebhookConfigurations) list(ctx context.Context, opts v1.ListOp return } +// watchList establishes a watch stream with the server and returns the list of MutatingWebhookConfigurations +func (c *mutatingWebhookConfigurations) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MutatingWebhookConfigurationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.MutatingWebhookConfigurationList{} + err = c.client.Get(). + Resource("mutatingwebhookconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations. func (c *mutatingWebhookConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicy.go b/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicy.go index 2cb47362e8..563e887b26 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicy.go +++ b/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicy.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ValidatingAdmissionPoliciesGetter has a method to return a ValidatingAdmissionPolicyInterface. @@ -81,13 +83,22 @@ func (c *validatingAdmissionPolicies) Get(ctx context.Context, name string, opti } // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. -func (c *validatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyList, err error) { - defer func() { +func (c *validatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ValidatingAdmissionPolicyList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicies, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicies", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicies", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for validatingadmissionpolicies ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicies", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. @@ -106,6 +117,22 @@ func (c *validatingAdmissionPolicies) list(ctx context.Context, opts v1.ListOpti return } +// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicies +func (c *validatingAdmissionPolicies) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.ValidatingAdmissionPolicyList{} + err = c.client.Get(). + Resource("validatingadmissionpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies. func (c *validatingAdmissionPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicybinding.go b/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicybinding.go index 6f05360790..f7f06218f4 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicybinding.go +++ b/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicybinding.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ValidatingAdmissionPolicyBindingsGetter has a method to return a ValidatingAdmissionPolicyBindingInterface. @@ -79,13 +81,22 @@ func (c *validatingAdmissionPolicyBindings) Get(ctx context.Context, name string } // List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. -func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyBindingList, err error) { - defer func() { +func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ValidatingAdmissionPolicyBindingList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicybindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicybindings", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicybindings", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for validatingadmissionpolicybindings ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicybindings", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. @@ -104,6 +115,22 @@ func (c *validatingAdmissionPolicyBindings) list(ctx context.Context, opts v1.Li return } +// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicyBindings +func (c *validatingAdmissionPolicyBindings) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyBindingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.ValidatingAdmissionPolicyBindingList{} + err = c.client.Get(). + Resource("validatingadmissionpolicybindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings. func (c *validatingAdmissionPolicyBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go index 671ec8116e..d20801a1ff 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ValidatingWebhookConfigurationsGetter has a method to return a ValidatingWebhookConfigurationInterface. @@ -79,13 +81,22 @@ func (c *validatingWebhookConfigurations) Get(ctx context.Context, name string, } // List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. -func (c *validatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingWebhookConfigurationList, err error) { - defer func() { +func (c *validatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ValidatingWebhookConfigurationList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for validatingwebhookconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingwebhookconfigurations", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingwebhookconfigurations", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for validatingwebhookconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingwebhookconfigurations", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. @@ -104,6 +115,22 @@ func (c *validatingWebhookConfigurations) list(ctx context.Context, opts v1.List return } +// watchList establishes a watch stream with the server and returns the list of ValidatingWebhookConfigurations +func (c *validatingWebhookConfigurations) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingWebhookConfigurationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.ValidatingWebhookConfigurationList{} + err = c.client.Get(). + Resource("validatingwebhookconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations. func (c *validatingWebhookConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/apiserverinternal/v1alpha1/storageversion.go b/kubernetes/typed/apiserverinternal/v1alpha1/storageversion.go index 7f0d60ce35..100f486a29 100644 --- a/kubernetes/typed/apiserverinternal/v1alpha1/storageversion.go +++ b/kubernetes/typed/apiserverinternal/v1alpha1/storageversion.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // StorageVersionsGetter has a method to return a StorageVersionInterface. @@ -81,13 +83,22 @@ func (c *storageVersions) Get(ctx context.Context, name string, options v1.GetOp } // List takes label and field selectors, and returns the list of StorageVersions that match those selectors. -func (c *storageVersions) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionList, err error) { - defer func() { +func (c *storageVersions) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.StorageVersionList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for storageversions, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for storageversions", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for storageversions", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for storageversions ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for storageversions", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of StorageVersions that match those selectors. @@ -106,6 +117,22 @@ func (c *storageVersions) list(ctx context.Context, opts v1.ListOptions) (result return } +// watchList establishes a watch stream with the server and returns the list of StorageVersions +func (c *storageVersions) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.StorageVersionList{} + err = c.client.Get(). + Resource("storageversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested storageVersions. func (c *storageVersions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/apps/v1/controllerrevision.go b/kubernetes/typed/apps/v1/controllerrevision.go index 6a12cc3982..acf50b58c4 100644 --- a/kubernetes/typed/apps/v1/controllerrevision.go +++ b/kubernetes/typed/apps/v1/controllerrevision.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ControllerRevisionsGetter has a method to return a ControllerRevisionInterface. @@ -82,13 +84,22 @@ func (c *controllerRevisions) Get(ctx context.Context, name string, options meta } // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. -func (c *controllerRevisions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ControllerRevisionList, err error) { - defer func() { +func (c *controllerRevisions) List(ctx context.Context, opts metav1.ListOptions) (*v1.ControllerRevisionList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for controllerrevisions, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for controllerrevisions", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for controllerrevisions", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for controllerrevisions ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for controllerrevisions", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. @@ -108,6 +119,23 @@ func (c *controllerRevisions) list(ctx context.Context, opts metav1.ListOptions) return } +// watchList establishes a watch stream with the server and returns the list of ControllerRevisions +func (c *controllerRevisions) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ControllerRevisionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ControllerRevisionList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("controllerrevisions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested controllerRevisions. func (c *controllerRevisions) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/apps/v1/daemonset.go b/kubernetes/typed/apps/v1/daemonset.go index 251d98e0be..60741f088d 100644 --- a/kubernetes/typed/apps/v1/daemonset.go +++ b/kubernetes/typed/apps/v1/daemonset.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // DaemonSetsGetter has a method to return a DaemonSetInterface. @@ -84,13 +86,22 @@ func (c *daemonSets) Get(ctx context.Context, name string, options metav1.GetOpt } // List takes label and field selectors, and returns the list of DaemonSets that match those selectors. -func (c *daemonSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DaemonSetList, err error) { - defer func() { +func (c *daemonSets) List(ctx context.Context, opts metav1.ListOptions) (*v1.DaemonSetList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for daemonsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for daemonsets", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for daemonsets", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for daemonsets ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for daemonsets", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of DaemonSets that match those selectors. @@ -110,6 +121,23 @@ func (c *daemonSets) list(ctx context.Context, opts metav1.ListOptions) (result return } +// watchList establishes a watch stream with the server and returns the list of DaemonSets +func (c *daemonSets) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.DaemonSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DaemonSetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("daemonsets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested daemonSets. func (c *daemonSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/apps/v1/deployment.go b/kubernetes/typed/apps/v1/deployment.go index c97894f156..256dd69bb0 100644 --- a/kubernetes/typed/apps/v1/deployment.go +++ b/kubernetes/typed/apps/v1/deployment.go @@ -34,6 +34,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // DeploymentsGetter has a method to return a DeploymentInterface. @@ -90,13 +92,22 @@ func (c *deployments) Get(ctx context.Context, name string, options metav1.GetOp } // List takes label and field selectors, and returns the list of Deployments that match those selectors. -func (c *deployments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DeploymentList, err error) { - defer func() { +func (c *deployments) List(ctx context.Context, opts metav1.ListOptions) (*v1.DeploymentList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for deployments, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for deployments", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for deployments ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of Deployments that match those selectors. @@ -116,6 +127,23 @@ func (c *deployments) list(ctx context.Context, opts metav1.ListOptions) (result return } +// watchList establishes a watch stream with the server and returns the list of Deployments +func (c *deployments) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.DeploymentList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.DeploymentList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("deployments"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested deployments. func (c *deployments) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/apps/v1/replicaset.go b/kubernetes/typed/apps/v1/replicaset.go index e28f784f94..f8c6ca8ecb 100644 --- a/kubernetes/typed/apps/v1/replicaset.go +++ b/kubernetes/typed/apps/v1/replicaset.go @@ -34,6 +34,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ReplicaSetsGetter has a method to return a ReplicaSetInterface. @@ -90,13 +92,22 @@ func (c *replicaSets) Get(ctx context.Context, name string, options metav1.GetOp } // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. -func (c *replicaSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicaSetList, err error) { - defer func() { +func (c *replicaSets) List(ctx context.Context, opts metav1.ListOptions) (*v1.ReplicaSetList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for replicasets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicasets", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for replicasets", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for replicasets ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicasets", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ReplicaSets that match those selectors. @@ -116,6 +127,23 @@ func (c *replicaSets) list(ctx context.Context, opts metav1.ListOptions) (result return } +// watchList establishes a watch stream with the server and returns the list of ReplicaSets +func (c *replicaSets) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicaSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ReplicaSetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("replicasets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested replicaSets. func (c *replicaSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/apps/v1/statefulset.go b/kubernetes/typed/apps/v1/statefulset.go index 2e94e1a6a0..ed667566b6 100644 --- a/kubernetes/typed/apps/v1/statefulset.go +++ b/kubernetes/typed/apps/v1/statefulset.go @@ -34,6 +34,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // StatefulSetsGetter has a method to return a StatefulSetInterface. @@ -90,13 +92,22 @@ func (c *statefulSets) Get(ctx context.Context, name string, options metav1.GetO } // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. -func (c *statefulSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.StatefulSetList, err error) { - defer func() { +func (c *statefulSets) List(ctx context.Context, opts metav1.ListOptions) (*v1.StatefulSetList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for statefulsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for statefulsets", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for statefulsets", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for statefulsets ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for statefulsets", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of StatefulSets that match those selectors. @@ -116,6 +127,23 @@ func (c *statefulSets) list(ctx context.Context, opts metav1.ListOptions) (resul return } +// watchList establishes a watch stream with the server and returns the list of StatefulSets +func (c *statefulSets) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.StatefulSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.StatefulSetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("statefulsets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested statefulSets. func (c *statefulSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/apps/v1beta1/controllerrevision.go b/kubernetes/typed/apps/v1beta1/controllerrevision.go index 044101c952..efa2e74db7 100644 --- a/kubernetes/typed/apps/v1beta1/controllerrevision.go +++ b/kubernetes/typed/apps/v1beta1/controllerrevision.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ControllerRevisionsGetter has a method to return a ControllerRevisionInterface. @@ -82,13 +84,22 @@ func (c *controllerRevisions) Get(ctx context.Context, name string, options v1.G } // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. -func (c *controllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ControllerRevisionList, err error) { - defer func() { +func (c *controllerRevisions) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ControllerRevisionList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for controllerrevisions, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for controllerrevisions", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for controllerrevisions", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for controllerrevisions ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for controllerrevisions", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. @@ -108,6 +119,23 @@ func (c *controllerRevisions) list(ctx context.Context, opts v1.ListOptions) (re return } +// watchList establishes a watch stream with the server and returns the list of ControllerRevisions +func (c *controllerRevisions) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ControllerRevisionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.ControllerRevisionList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("controllerrevisions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested controllerRevisions. func (c *controllerRevisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/apps/v1beta1/deployment.go b/kubernetes/typed/apps/v1beta1/deployment.go index 47edb1c8f2..c46987acc7 100644 --- a/kubernetes/typed/apps/v1beta1/deployment.go +++ b/kubernetes/typed/apps/v1beta1/deployment.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // DeploymentsGetter has a method to return a DeploymentInterface. @@ -84,13 +86,22 @@ func (c *deployments) Get(ctx context.Context, name string, options v1.GetOption } // List takes label and field selectors, and returns the list of Deployments that match those selectors. -func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { - defer func() { +func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DeploymentList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for deployments, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for deployments", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for deployments ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of Deployments that match those selectors. @@ -110,6 +121,23 @@ func (c *deployments) list(ctx context.Context, opts v1.ListOptions) (result *v1 return } +// watchList establishes a watch stream with the server and returns the list of Deployments +func (c *deployments) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.DeploymentList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("deployments"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested deployments. func (c *deployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/apps/v1beta1/statefulset.go b/kubernetes/typed/apps/v1beta1/statefulset.go index e39d7cf5ec..bdddacec47 100644 --- a/kubernetes/typed/apps/v1beta1/statefulset.go +++ b/kubernetes/typed/apps/v1beta1/statefulset.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // StatefulSetsGetter has a method to return a StatefulSetInterface. @@ -84,13 +86,22 @@ func (c *statefulSets) Get(ctx context.Context, name string, options v1.GetOptio } // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. -func (c *statefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) { - defer func() { +func (c *statefulSets) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.StatefulSetList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for statefulsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for statefulsets", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for statefulsets", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for statefulsets ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for statefulsets", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of StatefulSets that match those selectors. @@ -110,6 +121,23 @@ func (c *statefulSets) list(ctx context.Context, opts v1.ListOptions) (result *v return } +// watchList establishes a watch stream with the server and returns the list of StatefulSets +func (c *statefulSets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.StatefulSetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("statefulsets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested statefulSets. func (c *statefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/apps/v1beta2/controllerrevision.go b/kubernetes/typed/apps/v1beta2/controllerrevision.go index 9a97558ea5..62c539efcd 100644 --- a/kubernetes/typed/apps/v1beta2/controllerrevision.go +++ b/kubernetes/typed/apps/v1beta2/controllerrevision.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ControllerRevisionsGetter has a method to return a ControllerRevisionInterface. @@ -82,13 +84,22 @@ func (c *controllerRevisions) Get(ctx context.Context, name string, options v1.G } // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. -func (c *controllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) { - defer func() { +func (c *controllerRevisions) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.ControllerRevisionList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for controllerrevisions, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for controllerrevisions", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for controllerrevisions", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for controllerrevisions ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for controllerrevisions", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. @@ -108,6 +119,23 @@ func (c *controllerRevisions) list(ctx context.Context, opts v1.ListOptions) (re return } +// watchList establishes a watch stream with the server and returns the list of ControllerRevisions +func (c *controllerRevisions) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta2.ControllerRevisionList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("controllerrevisions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested controllerRevisions. func (c *controllerRevisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/apps/v1beta2/daemonset.go b/kubernetes/typed/apps/v1beta2/daemonset.go index 2411dda802..e4006bc513 100644 --- a/kubernetes/typed/apps/v1beta2/daemonset.go +++ b/kubernetes/typed/apps/v1beta2/daemonset.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // DaemonSetsGetter has a method to return a DaemonSetInterface. @@ -84,13 +86,22 @@ func (c *daemonSets) Get(ctx context.Context, name string, options v1.GetOptions } // 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 *v1beta2.DaemonSetList, err error) { - defer func() { +func (c *daemonSets) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.DaemonSetList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for daemonsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for daemonsets", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for daemonsets", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for daemonsets ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for daemonsets", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of DaemonSets that match those selectors. @@ -110,6 +121,23 @@ func (c *daemonSets) list(ctx context.Context, opts v1.ListOptions) (result *v1b return } +// watchList establishes a watch stream with the server and returns the list of DaemonSets +func (c *daemonSets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DaemonSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta2.DaemonSetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("daemonsets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(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 diff --git a/kubernetes/typed/apps/v1beta2/deployment.go b/kubernetes/typed/apps/v1beta2/deployment.go index ced67eb0d8..43e48cdb2e 100644 --- a/kubernetes/typed/apps/v1beta2/deployment.go +++ b/kubernetes/typed/apps/v1beta2/deployment.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // DeploymentsGetter has a method to return a DeploymentInterface. @@ -84,13 +86,22 @@ func (c *deployments) Get(ctx context.Context, name string, options v1.GetOption } // List takes label and field selectors, and returns the list of Deployments that match those selectors. -func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DeploymentList, err error) { - defer func() { +func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.DeploymentList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for deployments, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for deployments", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for deployments ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of Deployments that match those selectors. @@ -110,6 +121,23 @@ func (c *deployments) list(ctx context.Context, opts v1.ListOptions) (result *v1 return } +// watchList establishes a watch stream with the server and returns the list of Deployments +func (c *deployments) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DeploymentList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta2.DeploymentList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("deployments"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested deployments. func (c *deployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/apps/v1beta2/replicaset.go b/kubernetes/typed/apps/v1beta2/replicaset.go index 17f9a737d0..5d815771ce 100644 --- a/kubernetes/typed/apps/v1beta2/replicaset.go +++ b/kubernetes/typed/apps/v1beta2/replicaset.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ReplicaSetsGetter has a method to return a ReplicaSetInterface. @@ -84,13 +86,22 @@ func (c *replicaSets) Get(ctx context.Context, name string, options v1.GetOption } // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. -func (c *replicaSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ReplicaSetList, err error) { - defer func() { +func (c *replicaSets) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.ReplicaSetList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for replicasets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicasets", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for replicasets", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for replicasets ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicasets", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ReplicaSets that match those selectors. @@ -110,6 +121,23 @@ func (c *replicaSets) list(ctx context.Context, opts v1.ListOptions) (result *v1 return } +// watchList establishes a watch stream with the server and returns the list of ReplicaSets +func (c *replicaSets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ReplicaSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta2.ReplicaSetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("replicasets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested replicaSets. func (c *replicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/apps/v1beta2/statefulset.go b/kubernetes/typed/apps/v1beta2/statefulset.go index 0ddb1095f9..923a10cb35 100644 --- a/kubernetes/typed/apps/v1beta2/statefulset.go +++ b/kubernetes/typed/apps/v1beta2/statefulset.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // StatefulSetsGetter has a method to return a StatefulSetInterface. @@ -88,13 +90,22 @@ func (c *statefulSets) Get(ctx context.Context, name string, options v1.GetOptio } // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. -func (c *statefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.StatefulSetList, err error) { - defer func() { +func (c *statefulSets) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.StatefulSetList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for statefulsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for statefulsets", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for statefulsets", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for statefulsets ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for statefulsets", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of StatefulSets that match those selectors. @@ -114,6 +125,23 @@ func (c *statefulSets) list(ctx context.Context, opts v1.ListOptions) (result *v return } +// watchList establishes a watch stream with the server and returns the list of StatefulSets +func (c *statefulSets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.StatefulSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta2.StatefulSetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("statefulsets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested statefulSets. func (c *statefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go index bba4531831..66a3d79245 100644 --- a/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface. @@ -84,13 +86,22 @@ func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options } // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. -func (c *horizontalPodAutoscalers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) { - defer func() { +func (c *horizontalPodAutoscalers) List(ctx context.Context, opts metav1.ListOptions) (*v1.HorizontalPodAutoscalerList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for horizontalpodautoscalers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for horizontalpodautoscalers", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for horizontalpodautoscalers ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. @@ -110,6 +121,23 @@ func (c *horizontalPodAutoscalers) list(ctx context.Context, opts metav1.ListOpt return } +// watchList establishes a watch stream with the server and returns the list of HorizontalPodAutoscalers +func (c *horizontalPodAutoscalers) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.HorizontalPodAutoscalerList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. func (c *horizontalPodAutoscalers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/autoscaling/v2/horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v2/horizontalpodautoscaler.go index 2eb1165e63..278614af8e 100644 --- a/kubernetes/typed/autoscaling/v2/horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v2/horizontalpodautoscaler.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface. @@ -84,13 +86,22 @@ func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options } // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. -func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2.HorizontalPodAutoscalerList, err error) { - defer func() { +func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (*v2.HorizontalPodAutoscalerList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for horizontalpodautoscalers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for horizontalpodautoscalers", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for horizontalpodautoscalers ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. @@ -110,6 +121,23 @@ func (c *horizontalPodAutoscalers) list(ctx context.Context, opts v1.ListOptions return } +// watchList establishes a watch stream with the server and returns the list of HorizontalPodAutoscalers +func (c *horizontalPodAutoscalers) watchList(ctx context.Context, opts v1.ListOptions) (result *v2.HorizontalPodAutoscalerList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v2.HorizontalPodAutoscalerList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. func (c *horizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go index 5912300c21..76c9ce3f5c 100644 --- a/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface. @@ -84,13 +86,22 @@ func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options } // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. -func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta1.HorizontalPodAutoscalerList, err error) { - defer func() { +func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (*v2beta1.HorizontalPodAutoscalerList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for horizontalpodautoscalers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for horizontalpodautoscalers", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for horizontalpodautoscalers ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. @@ -110,6 +121,23 @@ func (c *horizontalPodAutoscalers) list(ctx context.Context, opts v1.ListOptions return } +// watchList establishes a watch stream with the server and returns the list of HorizontalPodAutoscalers +func (c *horizontalPodAutoscalers) watchList(ctx context.Context, opts v1.ListOptions) (result *v2beta1.HorizontalPodAutoscalerList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v2beta1.HorizontalPodAutoscalerList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. func (c *horizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go index 518e0c26a0..3da8fa9280 100644 --- a/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface. @@ -84,13 +86,22 @@ func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options } // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. -func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta2.HorizontalPodAutoscalerList, err error) { - defer func() { +func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (*v2beta2.HorizontalPodAutoscalerList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for horizontalpodautoscalers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for horizontalpodautoscalers", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for horizontalpodautoscalers ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. @@ -110,6 +121,23 @@ func (c *horizontalPodAutoscalers) list(ctx context.Context, opts v1.ListOptions return } +// watchList establishes a watch stream with the server and returns the list of HorizontalPodAutoscalers +func (c *horizontalPodAutoscalers) watchList(ctx context.Context, opts v1.ListOptions) (result *v2beta2.HorizontalPodAutoscalerList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v2beta2.HorizontalPodAutoscalerList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("horizontalpodautoscalers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. func (c *horizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/batch/v1/cronjob.go b/kubernetes/typed/batch/v1/cronjob.go index a16ec5ba51..763176c4c4 100644 --- a/kubernetes/typed/batch/v1/cronjob.go +++ b/kubernetes/typed/batch/v1/cronjob.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // CronJobsGetter has a method to return a CronJobInterface. @@ -84,13 +86,22 @@ func (c *cronJobs) Get(ctx context.Context, name string, options metav1.GetOptio } // List takes label and field selectors, and returns the list of CronJobs that match those selectors. -func (c *cronJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CronJobList, err error) { - defer func() { +func (c *cronJobs) List(ctx context.Context, opts metav1.ListOptions) (*v1.CronJobList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for cronjobs, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for cronjobs", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for cronjobs", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for cronjobs ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for cronjobs", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of CronJobs that match those selectors. @@ -110,6 +121,23 @@ func (c *cronJobs) list(ctx context.Context, opts metav1.ListOptions) (result *v return } +// watchList establishes a watch stream with the server and returns the list of CronJobs +func (c *cronJobs) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.CronJobList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.CronJobList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("cronjobs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested cronJobs. func (c *cronJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/batch/v1/job.go b/kubernetes/typed/batch/v1/job.go index 6663bceb27..148b68aed0 100644 --- a/kubernetes/typed/batch/v1/job.go +++ b/kubernetes/typed/batch/v1/job.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // JobsGetter has a method to return a JobInterface. @@ -84,13 +86,22 @@ func (c *jobs) Get(ctx context.Context, name string, options metav1.GetOptions) } // List takes label and field selectors, and returns the list of Jobs that match those selectors. -func (c *jobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.JobList, err error) { - defer func() { +func (c *jobs) List(ctx context.Context, opts metav1.ListOptions) (*v1.JobList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for jobs, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for jobs", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for jobs", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for jobs ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for jobs", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of Jobs that match those selectors. @@ -110,6 +121,23 @@ func (c *jobs) list(ctx context.Context, opts metav1.ListOptions) (result *v1.Jo return } +// watchList establishes a watch stream with the server and returns the list of Jobs +func (c *jobs) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.JobList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.JobList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("jobs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested jobs. func (c *jobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/batch/v1beta1/cronjob.go b/kubernetes/typed/batch/v1beta1/cronjob.go index 0401f2249a..e6ee1fc143 100644 --- a/kubernetes/typed/batch/v1beta1/cronjob.go +++ b/kubernetes/typed/batch/v1beta1/cronjob.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // CronJobsGetter has a method to return a CronJobInterface. @@ -84,13 +86,22 @@ func (c *cronJobs) Get(ctx context.Context, name string, options v1.GetOptions) } // List takes label and field selectors, and returns the list of CronJobs that match those selectors. -func (c *cronJobs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CronJobList, err error) { - defer func() { +func (c *cronJobs) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CronJobList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for cronjobs, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for cronjobs", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for cronjobs", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for cronjobs ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for cronjobs", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of CronJobs that match those selectors. @@ -110,6 +121,23 @@ func (c *cronJobs) list(ctx context.Context, opts v1.ListOptions) (result *v1bet return } +// watchList establishes a watch stream with the server and returns the list of CronJobs +func (c *cronJobs) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CronJobList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.CronJobList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("cronjobs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested cronJobs. func (c *cronJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/certificates/v1/certificatesigningrequest.go b/kubernetes/typed/certificates/v1/certificatesigningrequest.go index 79c9daf3e5..bcc6841a1d 100644 --- a/kubernetes/typed/certificates/v1/certificatesigningrequest.go +++ b/kubernetes/typed/certificates/v1/certificatesigningrequest.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // CertificateSigningRequestsGetter has a method to return a CertificateSigningRequestInterface. @@ -83,13 +85,22 @@ func (c *certificateSigningRequests) Get(ctx context.Context, name string, optio } // List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. -func (c *certificateSigningRequests) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CertificateSigningRequestList, err error) { - defer func() { +func (c *certificateSigningRequests) List(ctx context.Context, opts metav1.ListOptions) (*v1.CertificateSigningRequestList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for certificatesigningrequests, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for certificatesigningrequests", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for certificatesigningrequests", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for certificatesigningrequests ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for certificatesigningrequests", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. @@ -108,6 +119,22 @@ func (c *certificateSigningRequests) list(ctx context.Context, opts metav1.ListO return } +// watchList establishes a watch stream with the server and returns the list of CertificateSigningRequests +func (c *certificateSigningRequests) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.CertificateSigningRequestList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.CertificateSigningRequestList{} + err = c.client.Get(). + Resource("certificatesigningrequests"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested certificateSigningRequests. func (c *certificateSigningRequests) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/certificates/v1alpha1/clustertrustbundle.go b/kubernetes/typed/certificates/v1alpha1/clustertrustbundle.go index c4e0ca65a0..bfb1659b27 100644 --- a/kubernetes/typed/certificates/v1alpha1/clustertrustbundle.go +++ b/kubernetes/typed/certificates/v1alpha1/clustertrustbundle.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ClusterTrustBundlesGetter has a method to return a ClusterTrustBundleInterface. @@ -79,13 +81,22 @@ func (c *clusterTrustBundles) Get(ctx context.Context, name string, options v1.G } // List takes label and field selectors, and returns the list of ClusterTrustBundles that match those selectors. -func (c *clusterTrustBundles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterTrustBundleList, err error) { - defer func() { +func (c *clusterTrustBundles) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterTrustBundleList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for clustertrustbundles, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clustertrustbundles", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for clustertrustbundles", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for clustertrustbundles ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clustertrustbundles", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ClusterTrustBundles that match those selectors. @@ -104,6 +115,22 @@ func (c *clusterTrustBundles) list(ctx context.Context, opts v1.ListOptions) (re return } +// watchList establishes a watch stream with the server and returns the list of ClusterTrustBundles +func (c *clusterTrustBundles) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterTrustBundleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.ClusterTrustBundleList{} + err = c.client.Get(). + Resource("clustertrustbundles"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested clusterTrustBundles. func (c *clusterTrustBundles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go b/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go index d88d4020c2..3abb541f50 100644 --- a/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go +++ b/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // CertificateSigningRequestsGetter has a method to return a CertificateSigningRequestInterface. @@ -81,13 +83,22 @@ func (c *certificateSigningRequests) Get(ctx context.Context, name string, optio } // List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. -func (c *certificateSigningRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CertificateSigningRequestList, err error) { - defer func() { +func (c *certificateSigningRequests) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CertificateSigningRequestList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for certificatesigningrequests, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for certificatesigningrequests", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for certificatesigningrequests", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for certificatesigningrequests ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for certificatesigningrequests", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. @@ -106,6 +117,22 @@ func (c *certificateSigningRequests) list(ctx context.Context, opts v1.ListOptio return } +// watchList establishes a watch stream with the server and returns the list of CertificateSigningRequests +func (c *certificateSigningRequests) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CertificateSigningRequestList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.CertificateSigningRequestList{} + err = c.client.Get(). + Resource("certificatesigningrequests"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested certificateSigningRequests. func (c *certificateSigningRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/coordination/v1/lease.go b/kubernetes/typed/coordination/v1/lease.go index 032787c672..669f8548cd 100644 --- a/kubernetes/typed/coordination/v1/lease.go +++ b/kubernetes/typed/coordination/v1/lease.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // LeasesGetter has a method to return a LeaseInterface. @@ -82,13 +84,22 @@ func (c *leases) Get(ctx context.Context, name string, options metav1.GetOptions } // List takes label and field selectors, and returns the list of Leases that match those selectors. -func (c *leases) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LeaseList, err error) { - defer func() { +func (c *leases) List(ctx context.Context, opts metav1.ListOptions) (*v1.LeaseList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for leases, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for leases", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for leases", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for leases ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for leases", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of Leases that match those selectors. @@ -108,6 +119,23 @@ func (c *leases) list(ctx context.Context, opts metav1.ListOptions) (result *v1. return } +// watchList establishes a watch stream with the server and returns the list of Leases +func (c *leases) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.LeaseList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.LeaseList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("leases"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested leases. func (c *leases) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/coordination/v1beta1/lease.go b/kubernetes/typed/coordination/v1beta1/lease.go index e6841ffd98..4a990053b0 100644 --- a/kubernetes/typed/coordination/v1beta1/lease.go +++ b/kubernetes/typed/coordination/v1beta1/lease.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // LeasesGetter has a method to return a LeaseInterface. @@ -82,13 +84,22 @@ func (c *leases) Get(ctx context.Context, name string, options v1.GetOptions) (r } // List takes label and field selectors, and returns the list of Leases that match those selectors. -func (c *leases) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.LeaseList, err error) { - defer func() { +func (c *leases) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.LeaseList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for leases, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for leases", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for leases", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for leases ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for leases", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of Leases that match those selectors. @@ -108,6 +119,23 @@ func (c *leases) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1 return } +// watchList establishes a watch stream with the server and returns the list of Leases +func (c *leases) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.LeaseList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.LeaseList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("leases"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested leases. func (c *leases) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/core/v1/componentstatus.go b/kubernetes/typed/core/v1/componentstatus.go index f2ea72e466..de958c6e91 100644 --- a/kubernetes/typed/core/v1/componentstatus.go +++ b/kubernetes/typed/core/v1/componentstatus.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ComponentStatusesGetter has a method to return a ComponentStatusInterface. @@ -79,13 +81,22 @@ func (c *componentStatuses) Get(ctx context.Context, name string, options metav1 } // List takes label and field selectors, and returns the list of ComponentStatuses that match those selectors. -func (c *componentStatuses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ComponentStatusList, err error) { - defer func() { +func (c *componentStatuses) List(ctx context.Context, opts metav1.ListOptions) (*v1.ComponentStatusList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for componentstatuses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for componentstatuses", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for componentstatuses", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for componentstatuses ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for componentstatuses", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ComponentStatuses that match those selectors. @@ -104,6 +115,22 @@ func (c *componentStatuses) list(ctx context.Context, opts metav1.ListOptions) ( return } +// watchList establishes a watch stream with the server and returns the list of ComponentStatuses +func (c *componentStatuses) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ComponentStatusList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ComponentStatusList{} + err = c.client.Get(). + Resource("componentstatuses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested componentStatuses. func (c *componentStatuses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/core/v1/configmap.go b/kubernetes/typed/core/v1/configmap.go index 27d19b8bd3..916786d539 100644 --- a/kubernetes/typed/core/v1/configmap.go +++ b/kubernetes/typed/core/v1/configmap.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ConfigMapsGetter has a method to return a ConfigMapInterface. @@ -82,13 +84,22 @@ func (c *configMaps) Get(ctx context.Context, name string, options metav1.GetOpt } // List takes label and field selectors, and returns the list of ConfigMaps that match those selectors. -func (c *configMaps) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ConfigMapList, err error) { - defer func() { +func (c *configMaps) List(ctx context.Context, opts metav1.ListOptions) (*v1.ConfigMapList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for configmaps, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for configmaps", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for configmaps", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for configmaps ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for configmaps", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ConfigMaps that match those selectors. @@ -108,6 +119,23 @@ func (c *configMaps) list(ctx context.Context, opts metav1.ListOptions) (result return } +// watchList establishes a watch stream with the server and returns the list of ConfigMaps +func (c *configMaps) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ConfigMapList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ConfigMapList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("configmaps"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested configMaps. func (c *configMaps) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/core/v1/endpoints.go b/kubernetes/typed/core/v1/endpoints.go index cf811572ba..02a87b5320 100644 --- a/kubernetes/typed/core/v1/endpoints.go +++ b/kubernetes/typed/core/v1/endpoints.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // EndpointsGetter has a method to return a EndpointsInterface. @@ -82,13 +84,22 @@ func (c *endpoints) Get(ctx context.Context, name string, options metav1.GetOpti } // List takes label and field selectors, and returns the list of Endpoints that match those selectors. -func (c *endpoints) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointsList, err error) { - defer func() { +func (c *endpoints) List(ctx context.Context, opts metav1.ListOptions) (*v1.EndpointsList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for endpoints, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for endpoints", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for endpoints", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for endpoints ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for endpoints", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of Endpoints that match those selectors. @@ -108,6 +119,23 @@ func (c *endpoints) list(ctx context.Context, opts metav1.ListOptions) (result * return } +// watchList establishes a watch stream with the server and returns the list of Endpoints +func (c *endpoints) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointsList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.EndpointsList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("endpoints"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested endpoints. func (c *endpoints) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/core/v1/event.go b/kubernetes/typed/core/v1/event.go index 9873dbdb08..d045c99f32 100644 --- a/kubernetes/typed/core/v1/event.go +++ b/kubernetes/typed/core/v1/event.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // EventsGetter has a method to return a EventInterface. @@ -82,13 +84,22 @@ func (c *events) Get(ctx context.Context, name string, options metav1.GetOptions } // List takes label and field selectors, and returns the list of Events that match those selectors. -func (c *events) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { - defer func() { +func (c *events) List(ctx context.Context, opts metav1.ListOptions) (*v1.EventList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for events, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for events", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for events", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for events ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for events", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of Events that match those selectors. @@ -108,6 +119,23 @@ func (c *events) list(ctx context.Context, opts metav1.ListOptions) (result *v1. return } +// watchList establishes a watch stream with the server and returns the list of Events +func (c *events) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.EventList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("events"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested events. func (c *events) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/core/v1/limitrange.go b/kubernetes/typed/core/v1/limitrange.go index 92f6b2f545..e5f54e1f66 100644 --- a/kubernetes/typed/core/v1/limitrange.go +++ b/kubernetes/typed/core/v1/limitrange.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // LimitRangesGetter has a method to return a LimitRangeInterface. @@ -82,13 +84,22 @@ func (c *limitRanges) Get(ctx context.Context, name string, options metav1.GetOp } // List takes label and field selectors, and returns the list of LimitRanges that match those selectors. -func (c *limitRanges) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LimitRangeList, err error) { - defer func() { +func (c *limitRanges) List(ctx context.Context, opts metav1.ListOptions) (*v1.LimitRangeList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for limitranges, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for limitranges", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for limitranges", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for limitranges ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for limitranges", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of LimitRanges that match those selectors. @@ -108,6 +119,23 @@ func (c *limitRanges) list(ctx context.Context, opts metav1.ListOptions) (result return } +// watchList establishes a watch stream with the server and returns the list of LimitRanges +func (c *limitRanges) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.LimitRangeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.LimitRangeList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("limitranges"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested limitRanges. func (c *limitRanges) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/core/v1/namespace.go b/kubernetes/typed/core/v1/namespace.go index 709d53ad85..6d430cf99a 100644 --- a/kubernetes/typed/core/v1/namespace.go +++ b/kubernetes/typed/core/v1/namespace.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // NamespacesGetter has a method to return a NamespaceInterface. @@ -80,13 +82,22 @@ func (c *namespaces) Get(ctx context.Context, name string, options metav1.GetOpt } // List takes label and field selectors, and returns the list of Namespaces that match those selectors. -func (c *namespaces) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NamespaceList, err error) { - defer func() { +func (c *namespaces) List(ctx context.Context, opts metav1.ListOptions) (*v1.NamespaceList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for namespaces, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for namespaces", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for namespaces", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for namespaces ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for namespaces", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of Namespaces that match those selectors. @@ -105,6 +116,22 @@ func (c *namespaces) list(ctx context.Context, opts metav1.ListOptions) (result return } +// watchList establishes a watch stream with the server and returns the list of Namespaces +func (c *namespaces) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.NamespaceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.NamespaceList{} + err = c.client.Get(). + Resource("namespaces"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested namespaces. func (c *namespaces) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/core/v1/node.go b/kubernetes/typed/core/v1/node.go index 4a4fc825cc..a3ea2a8a93 100644 --- a/kubernetes/typed/core/v1/node.go +++ b/kubernetes/typed/core/v1/node.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // NodesGetter has a method to return a NodeInterface. @@ -81,13 +83,22 @@ func (c *nodes) Get(ctx context.Context, name string, options metav1.GetOptions) } // List takes label and field selectors, and returns the list of Nodes that match those selectors. -func (c *nodes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NodeList, err error) { - defer func() { +func (c *nodes) List(ctx context.Context, opts metav1.ListOptions) (*v1.NodeList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for nodes, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for nodes", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for nodes", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for nodes ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for nodes", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of Nodes that match those selectors. @@ -106,6 +117,22 @@ func (c *nodes) list(ctx context.Context, opts metav1.ListOptions) (result *v1.N return } +// watchList establishes a watch stream with the server and returns the list of Nodes +func (c *nodes) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.NodeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.NodeList{} + err = c.client.Get(). + Resource("nodes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested nodes. func (c *nodes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/core/v1/persistentvolume.go b/kubernetes/typed/core/v1/persistentvolume.go index 63442dd9b0..c252330543 100644 --- a/kubernetes/typed/core/v1/persistentvolume.go +++ b/kubernetes/typed/core/v1/persistentvolume.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // PersistentVolumesGetter has a method to return a PersistentVolumeInterface. @@ -81,13 +83,22 @@ func (c *persistentVolumes) Get(ctx context.Context, name string, options metav1 } // List takes label and field selectors, and returns the list of PersistentVolumes that match those selectors. -func (c *persistentVolumes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeList, err error) { - defer func() { +func (c *persistentVolumes) List(ctx context.Context, opts metav1.ListOptions) (*v1.PersistentVolumeList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for persistentvolumes, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for persistentvolumes", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for persistentvolumes", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for persistentvolumes ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for persistentvolumes", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of PersistentVolumes that match those selectors. @@ -106,6 +117,22 @@ func (c *persistentVolumes) list(ctx context.Context, opts metav1.ListOptions) ( return } +// watchList establishes a watch stream with the server and returns the list of PersistentVolumes +func (c *persistentVolumes) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.PersistentVolumeList{} + err = c.client.Get(). + Resource("persistentvolumes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested persistentVolumes. func (c *persistentVolumes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/core/v1/persistentvolumeclaim.go b/kubernetes/typed/core/v1/persistentvolumeclaim.go index 3b3c61c6b7..a318240642 100644 --- a/kubernetes/typed/core/v1/persistentvolumeclaim.go +++ b/kubernetes/typed/core/v1/persistentvolumeclaim.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // PersistentVolumeClaimsGetter has a method to return a PersistentVolumeClaimInterface. @@ -84,13 +86,22 @@ func (c *persistentVolumeClaims) Get(ctx context.Context, name string, options m } // List takes label and field selectors, and returns the list of PersistentVolumeClaims that match those selectors. -func (c *persistentVolumeClaims) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeClaimList, err error) { - defer func() { +func (c *persistentVolumeClaims) List(ctx context.Context, opts metav1.ListOptions) (*v1.PersistentVolumeClaimList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for persistentvolumeclaims, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for persistentvolumeclaims", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for persistentvolumeclaims", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for persistentvolumeclaims ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for persistentvolumeclaims", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of PersistentVolumeClaims that match those selectors. @@ -110,6 +121,23 @@ func (c *persistentVolumeClaims) list(ctx context.Context, opts metav1.ListOptio return } +// watchList establishes a watch stream with the server and returns the list of PersistentVolumeClaims +func (c *persistentVolumeClaims) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeClaimList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.PersistentVolumeClaimList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("persistentvolumeclaims"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested persistentVolumeClaims. func (c *persistentVolumeClaims) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/core/v1/pod.go b/kubernetes/typed/core/v1/pod.go index a275bd2c78..23f80160a0 100644 --- a/kubernetes/typed/core/v1/pod.go +++ b/kubernetes/typed/core/v1/pod.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // PodsGetter has a method to return a PodInterface. @@ -86,13 +88,22 @@ func (c *pods) Get(ctx context.Context, name string, options metav1.GetOptions) } // List takes label and field selectors, and returns the list of Pods that match those selectors. -func (c *pods) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodList, err error) { - defer func() { +func (c *pods) List(ctx context.Context, opts metav1.ListOptions) (*v1.PodList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for pods, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for pods", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for pods", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for pods ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for pods", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of Pods that match those selectors. @@ -112,6 +123,23 @@ func (c *pods) list(ctx context.Context, opts metav1.ListOptions) (result *v1.Po return } +// watchList establishes a watch stream with the server and returns the list of Pods +func (c *pods) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.PodList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.PodList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("pods"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested pods. func (c *pods) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/core/v1/podtemplate.go b/kubernetes/typed/core/v1/podtemplate.go index f657046535..47f358809c 100644 --- a/kubernetes/typed/core/v1/podtemplate.go +++ b/kubernetes/typed/core/v1/podtemplate.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // PodTemplatesGetter has a method to return a PodTemplateInterface. @@ -82,13 +84,22 @@ func (c *podTemplates) Get(ctx context.Context, name string, options metav1.GetO } // List takes label and field selectors, and returns the list of PodTemplates that match those selectors. -func (c *podTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodTemplateList, err error) { - defer func() { +func (c *podTemplates) List(ctx context.Context, opts metav1.ListOptions) (*v1.PodTemplateList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for podtemplates, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for podtemplates", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for podtemplates", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for podtemplates ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for podtemplates", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of PodTemplates that match those selectors. @@ -108,6 +119,23 @@ func (c *podTemplates) list(ctx context.Context, opts metav1.ListOptions) (resul return } +// watchList establishes a watch stream with the server and returns the list of PodTemplates +func (c *podTemplates) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.PodTemplateList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.PodTemplateList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("podtemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested podTemplates. func (c *podTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/core/v1/replicationcontroller.go b/kubernetes/typed/core/v1/replicationcontroller.go index 1ff2371f1e..d7c4851375 100644 --- a/kubernetes/typed/core/v1/replicationcontroller.go +++ b/kubernetes/typed/core/v1/replicationcontroller.go @@ -33,6 +33,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ReplicationControllersGetter has a method to return a ReplicationControllerInterface. @@ -88,13 +90,22 @@ func (c *replicationControllers) Get(ctx context.Context, name string, options m } // List takes label and field selectors, and returns the list of ReplicationControllers that match those selectors. -func (c *replicationControllers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicationControllerList, err error) { - defer func() { +func (c *replicationControllers) List(ctx context.Context, opts metav1.ListOptions) (*v1.ReplicationControllerList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for replicationcontrollers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicationcontrollers", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for replicationcontrollers", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for replicationcontrollers ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicationcontrollers", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ReplicationControllers that match those selectors. @@ -114,6 +125,23 @@ func (c *replicationControllers) list(ctx context.Context, opts metav1.ListOptio return } +// watchList establishes a watch stream with the server and returns the list of ReplicationControllers +func (c *replicationControllers) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicationControllerList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ReplicationControllerList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("replicationcontrollers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested replicationControllers. func (c *replicationControllers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/core/v1/resourcequota.go b/kubernetes/typed/core/v1/resourcequota.go index 32d0e33ebd..3e28a0b055 100644 --- a/kubernetes/typed/core/v1/resourcequota.go +++ b/kubernetes/typed/core/v1/resourcequota.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ResourceQuotasGetter has a method to return a ResourceQuotaInterface. @@ -84,13 +86,22 @@ func (c *resourceQuotas) Get(ctx context.Context, name string, options metav1.Ge } // List takes label and field selectors, and returns the list of ResourceQuotas that match those selectors. -func (c *resourceQuotas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ResourceQuotaList, err error) { - defer func() { +func (c *resourceQuotas) List(ctx context.Context, opts metav1.ListOptions) (*v1.ResourceQuotaList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for resourcequotas, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourcequotas", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for resourcequotas", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for resourcequotas ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourcequotas", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ResourceQuotas that match those selectors. @@ -110,6 +121,23 @@ func (c *resourceQuotas) list(ctx context.Context, opts metav1.ListOptions) (res return } +// watchList establishes a watch stream with the server and returns the list of ResourceQuotas +func (c *resourceQuotas) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ResourceQuotaList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ResourceQuotaList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("resourcequotas"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested resourceQuotas. func (c *resourceQuotas) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/core/v1/secret.go b/kubernetes/typed/core/v1/secret.go index d0eee66918..61998f848a 100644 --- a/kubernetes/typed/core/v1/secret.go +++ b/kubernetes/typed/core/v1/secret.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // SecretsGetter has a method to return a SecretInterface. @@ -82,13 +84,22 @@ func (c *secrets) Get(ctx context.Context, name string, options metav1.GetOption } // List takes label and field selectors, and returns the list of Secrets that match those selectors. -func (c *secrets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SecretList, err error) { - defer func() { +func (c *secrets) List(ctx context.Context, opts metav1.ListOptions) (*v1.SecretList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for secrets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for secrets", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for secrets", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for secrets ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for secrets", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of Secrets that match those selectors. @@ -108,6 +119,23 @@ func (c *secrets) list(ctx context.Context, opts metav1.ListOptions) (result *v1 return } +// watchList establishes a watch stream with the server and returns the list of Secrets +func (c *secrets) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.SecretList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.SecretList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("secrets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested secrets. func (c *secrets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/core/v1/service.go b/kubernetes/typed/core/v1/service.go index b87f5acdc9..07c6a59da1 100644 --- a/kubernetes/typed/core/v1/service.go +++ b/kubernetes/typed/core/v1/service.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ServicesGetter has a method to return a ServiceInterface. @@ -83,13 +85,22 @@ func (c *services) Get(ctx context.Context, name string, options metav1.GetOptio } // List takes label and field selectors, and returns the list of Services that match those selectors. -func (c *services) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceList, err error) { - defer func() { +func (c *services) List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for services, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for services", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for services", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for services ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for services", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of Services that match those selectors. @@ -109,6 +120,23 @@ func (c *services) list(ctx context.Context, opts metav1.ListOptions) (result *v return } +// watchList establishes a watch stream with the server and returns the list of Services +func (c *services) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("services"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested services. func (c *services) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/core/v1/serviceaccount.go b/kubernetes/typed/core/v1/serviceaccount.go index ea08445ec4..956059161b 100644 --- a/kubernetes/typed/core/v1/serviceaccount.go +++ b/kubernetes/typed/core/v1/serviceaccount.go @@ -33,6 +33,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ServiceAccountsGetter has a method to return a ServiceAccountInterface. @@ -85,13 +87,22 @@ func (c *serviceAccounts) Get(ctx context.Context, name string, options metav1.G } // List takes label and field selectors, and returns the list of ServiceAccounts that match those selectors. -func (c *serviceAccounts) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceAccountList, err error) { - defer func() { +func (c *serviceAccounts) List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceAccountList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for serviceaccounts, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for serviceaccounts", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for serviceaccounts", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for serviceaccounts ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for serviceaccounts", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ServiceAccounts that match those selectors. @@ -111,6 +122,23 @@ func (c *serviceAccounts) list(ctx context.Context, opts metav1.ListOptions) (re return } +// watchList establishes a watch stream with the server and returns the list of ServiceAccounts +func (c *serviceAccounts) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceAccountList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceAccountList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("serviceaccounts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested serviceAccounts. func (c *serviceAccounts) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/discovery/v1/endpointslice.go b/kubernetes/typed/discovery/v1/endpointslice.go index eb9503bddc..1a364e384a 100644 --- a/kubernetes/typed/discovery/v1/endpointslice.go +++ b/kubernetes/typed/discovery/v1/endpointslice.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // EndpointSlicesGetter has a method to return a EndpointSliceInterface. @@ -82,13 +84,22 @@ func (c *endpointSlices) Get(ctx context.Context, name string, options metav1.Ge } // List takes label and field selectors, and returns the list of EndpointSlices that match those selectors. -func (c *endpointSlices) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointSliceList, err error) { - defer func() { +func (c *endpointSlices) List(ctx context.Context, opts metav1.ListOptions) (*v1.EndpointSliceList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for endpointslices, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for endpointslices", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for endpointslices", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for endpointslices ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for endpointslices", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of EndpointSlices that match those selectors. @@ -108,6 +119,23 @@ func (c *endpointSlices) list(ctx context.Context, opts metav1.ListOptions) (res return } +// watchList establishes a watch stream with the server and returns the list of EndpointSlices +func (c *endpointSlices) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointSliceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.EndpointSliceList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("endpointslices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested endpointSlices. func (c *endpointSlices) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/discovery/v1beta1/endpointslice.go b/kubernetes/typed/discovery/v1beta1/endpointslice.go index 97f9bbb1e8..00966f8501 100644 --- a/kubernetes/typed/discovery/v1beta1/endpointslice.go +++ b/kubernetes/typed/discovery/v1beta1/endpointslice.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // EndpointSlicesGetter has a method to return a EndpointSliceInterface. @@ -82,13 +84,22 @@ func (c *endpointSlices) Get(ctx context.Context, name string, options v1.GetOpt } // List takes label and field selectors, and returns the list of EndpointSlices that match those selectors. -func (c *endpointSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EndpointSliceList, err error) { - defer func() { +func (c *endpointSlices) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.EndpointSliceList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for endpointslices, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for endpointslices", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for endpointslices", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for endpointslices ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for endpointslices", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of EndpointSlices that match those selectors. @@ -108,6 +119,23 @@ func (c *endpointSlices) list(ctx context.Context, opts v1.ListOptions) (result return } +// watchList establishes a watch stream with the server and returns the list of EndpointSlices +func (c *endpointSlices) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EndpointSliceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.EndpointSliceList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("endpointslices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested endpointSlices. func (c *endpointSlices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/events/v1/event.go b/kubernetes/typed/events/v1/event.go index b34940c804..129ec9a80b 100644 --- a/kubernetes/typed/events/v1/event.go +++ b/kubernetes/typed/events/v1/event.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // EventsGetter has a method to return a EventInterface. @@ -82,13 +84,22 @@ func (c *events) Get(ctx context.Context, name string, options metav1.GetOptions } // List takes label and field selectors, and returns the list of Events that match those selectors. -func (c *events) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { - defer func() { +func (c *events) List(ctx context.Context, opts metav1.ListOptions) (*v1.EventList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for events, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for events", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for events", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for events ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for events", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of Events that match those selectors. @@ -108,6 +119,23 @@ func (c *events) list(ctx context.Context, opts metav1.ListOptions) (result *v1. return } +// watchList establishes a watch stream with the server and returns the list of Events +func (c *events) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.EventList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("events"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested events. func (c *events) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/events/v1beta1/event.go b/kubernetes/typed/events/v1beta1/event.go index cc7174aa5d..edd3ea2233 100644 --- a/kubernetes/typed/events/v1beta1/event.go +++ b/kubernetes/typed/events/v1beta1/event.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // EventsGetter has a method to return a EventInterface. @@ -82,13 +84,22 @@ func (c *events) Get(ctx context.Context, name string, options v1.GetOptions) (r } // List takes label and field selectors, and returns the list of Events that match those selectors. -func (c *events) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EventList, err error) { - defer func() { +func (c *events) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.EventList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for events, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for events", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for events", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for events ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for events", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of Events that match those selectors. @@ -108,6 +119,23 @@ func (c *events) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1 return } +// watchList establishes a watch stream with the server and returns the list of Events +func (c *events) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EventList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.EventList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("events"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested events. func (c *events) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/extensions/v1beta1/daemonset.go b/kubernetes/typed/extensions/v1beta1/daemonset.go index 128d585e3e..fc8ceaab4b 100644 --- a/kubernetes/typed/extensions/v1beta1/daemonset.go +++ b/kubernetes/typed/extensions/v1beta1/daemonset.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // DaemonSetsGetter has a method to return a DaemonSetInterface. @@ -84,13 +86,22 @@ func (c *daemonSets) Get(ctx context.Context, name string, options v1.GetOptions } // 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 *v1beta1.DaemonSetList, err error) { - defer func() { +func (c *daemonSets) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DaemonSetList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for daemonsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for daemonsets", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for daemonsets", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for daemonsets ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for daemonsets", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of DaemonSets that match those selectors. @@ -110,6 +121,23 @@ func (c *daemonSets) list(ctx context.Context, opts v1.ListOptions) (result *v1b return } +// watchList establishes a watch stream with the server and returns the list of DaemonSets +func (c *daemonSets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DaemonSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.DaemonSetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("daemonsets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(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 diff --git a/kubernetes/typed/extensions/v1beta1/deployment.go b/kubernetes/typed/extensions/v1beta1/deployment.go index 245e05ad93..794124b371 100644 --- a/kubernetes/typed/extensions/v1beta1/deployment.go +++ b/kubernetes/typed/extensions/v1beta1/deployment.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // DeploymentsGetter has a method to return a DeploymentInterface. @@ -88,13 +90,22 @@ func (c *deployments) Get(ctx context.Context, name string, options v1.GetOption } // List takes label and field selectors, and returns the list of Deployments that match those selectors. -func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { - defer func() { +func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DeploymentList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for deployments, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for deployments", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for deployments ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of Deployments that match those selectors. @@ -114,6 +125,23 @@ func (c *deployments) list(ctx context.Context, opts v1.ListOptions) (result *v1 return } +// watchList establishes a watch stream with the server and returns the list of Deployments +func (c *deployments) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.DeploymentList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("deployments"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested deployments. func (c *deployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/extensions/v1beta1/ingress.go b/kubernetes/typed/extensions/v1beta1/ingress.go index c5c0376c32..dcb8f369f2 100644 --- a/kubernetes/typed/extensions/v1beta1/ingress.go +++ b/kubernetes/typed/extensions/v1beta1/ingress.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // IngressesGetter has a method to return a IngressInterface. @@ -84,13 +86,22 @@ func (c *ingresses) Get(ctx context.Context, name string, options v1.GetOptions) } // List takes label and field selectors, and returns the list of Ingresses that match those selectors. -func (c *ingresses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { - defer func() { +func (c *ingresses) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IngressList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for ingresses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingresses", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for ingresses", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for ingresses ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingresses", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of Ingresses that match those selectors. @@ -110,6 +121,23 @@ func (c *ingresses) list(ctx context.Context, opts v1.ListOptions) (result *v1be return } +// watchList establishes a watch stream with the server and returns the list of Ingresses +func (c *ingresses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.IngressList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("ingresses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested ingresses. func (c *ingresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/extensions/v1beta1/networkpolicy.go b/kubernetes/typed/extensions/v1beta1/networkpolicy.go index 9bbe425796..7140ff5fcf 100644 --- a/kubernetes/typed/extensions/v1beta1/networkpolicy.go +++ b/kubernetes/typed/extensions/v1beta1/networkpolicy.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // NetworkPoliciesGetter has a method to return a NetworkPolicyInterface. @@ -82,13 +84,22 @@ func (c *networkPolicies) Get(ctx context.Context, name string, options v1.GetOp } // 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 *v1beta1.NetworkPolicyList, err error) { - defer func() { +func (c *networkPolicies) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.NetworkPolicyList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for networkpolicies, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for networkpolicies", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for networkpolicies", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for networkpolicies ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for networkpolicies", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of NetworkPolicies that match those selectors. @@ -108,6 +119,23 @@ func (c *networkPolicies) list(ctx context.Context, opts v1.ListOptions) (result return } +// watchList establishes a watch stream with the server and returns the list of NetworkPolicies +func (c *networkPolicies) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.NetworkPolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.NetworkPolicyList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("networkpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(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 diff --git a/kubernetes/typed/extensions/v1beta1/replicaset.go b/kubernetes/typed/extensions/v1beta1/replicaset.go index 1ac971cfae..363857e6da 100644 --- a/kubernetes/typed/extensions/v1beta1/replicaset.go +++ b/kubernetes/typed/extensions/v1beta1/replicaset.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ReplicaSetsGetter has a method to return a ReplicaSetInterface. @@ -88,13 +90,22 @@ func (c *replicaSets) Get(ctx context.Context, name string, options v1.GetOption } // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. -func (c *replicaSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ReplicaSetList, err error) { - defer func() { +func (c *replicaSets) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ReplicaSetList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for replicasets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicasets", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for replicasets", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for replicasets ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicasets", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ReplicaSets that match those selectors. @@ -114,6 +125,23 @@ func (c *replicaSets) list(ctx context.Context, opts v1.ListOptions) (result *v1 return } +// watchList establishes a watch stream with the server and returns the list of ReplicaSets +func (c *replicaSets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ReplicaSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.ReplicaSetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("replicasets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested replicaSets. func (c *replicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/flowcontrol/v1/flowschema.go b/kubernetes/typed/flowcontrol/v1/flowschema.go index 504338ea55..966e12b8d4 100644 --- a/kubernetes/typed/flowcontrol/v1/flowschema.go +++ b/kubernetes/typed/flowcontrol/v1/flowschema.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // FlowSchemasGetter has a method to return a FlowSchemaInterface. @@ -81,13 +83,22 @@ func (c *flowSchemas) Get(ctx context.Context, name string, options metav1.GetOp } // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. -func (c *flowSchemas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FlowSchemaList, err error) { - defer func() { +func (c *flowSchemas) List(ctx context.Context, opts metav1.ListOptions) (*v1.FlowSchemaList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for flowschemas, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for flowschemas", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for flowschemas ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of FlowSchemas that match those selectors. @@ -106,6 +117,22 @@ func (c *flowSchemas) list(ctx context.Context, opts metav1.ListOptions) (result return } +// watchList establishes a watch stream with the server and returns the list of FlowSchemas +func (c *flowSchemas) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.FlowSchemaList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.FlowSchemaList{} + err = c.client.Get(). + Resource("flowschemas"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested flowSchemas. func (c *flowSchemas) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go index 15328d0dc0..2859a5f47a 100644 --- a/kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface. @@ -81,13 +83,22 @@ func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, opti } // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. -func (c *priorityLevelConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityLevelConfigurationList, err error) { - defer func() { +func (c *priorityLevelConfigurations) List(ctx context.Context, opts metav1.ListOptions) (*v1.PriorityLevelConfigurationList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for prioritylevelconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for prioritylevelconfigurations", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for prioritylevelconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. @@ -106,6 +117,22 @@ func (c *priorityLevelConfigurations) list(ctx context.Context, opts metav1.List return } +// watchList establishes a watch stream with the server and returns the list of PriorityLevelConfigurations +func (c *priorityLevelConfigurations) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityLevelConfigurationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.PriorityLevelConfigurationList{} + err = c.client.Get(). + Resource("prioritylevelconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. func (c *priorityLevelConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/flowcontrol/v1beta1/flowschema.go b/kubernetes/typed/flowcontrol/v1beta1/flowschema.go index b6a6ea5844..33bd0e1c2e 100644 --- a/kubernetes/typed/flowcontrol/v1beta1/flowschema.go +++ b/kubernetes/typed/flowcontrol/v1beta1/flowschema.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // FlowSchemasGetter has a method to return a FlowSchemaInterface. @@ -81,13 +83,22 @@ func (c *flowSchemas) Get(ctx context.Context, name string, options v1.GetOption } // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. -func (c *flowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.FlowSchemaList, err error) { - defer func() { +func (c *flowSchemas) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.FlowSchemaList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for flowschemas, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for flowschemas", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for flowschemas ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of FlowSchemas that match those selectors. @@ -106,6 +117,22 @@ func (c *flowSchemas) list(ctx context.Context, opts v1.ListOptions) (result *v1 return } +// watchList establishes a watch stream with the server and returns the list of FlowSchemas +func (c *flowSchemas) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.FlowSchemaList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.FlowSchemaList{} + err = c.client.Get(). + Resource("flowschemas"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested flowSchemas. func (c *flowSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/flowcontrol/v1beta1/prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1beta1/prioritylevelconfiguration.go index 7dff545309..42ac35353c 100644 --- a/kubernetes/typed/flowcontrol/v1beta1/prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1beta1/prioritylevelconfiguration.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface. @@ -81,13 +83,22 @@ func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, opti } // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. -func (c *priorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityLevelConfigurationList, err error) { - defer func() { +func (c *priorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PriorityLevelConfigurationList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for prioritylevelconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for prioritylevelconfigurations", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for prioritylevelconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. @@ -106,6 +117,22 @@ func (c *priorityLevelConfigurations) list(ctx context.Context, opts v1.ListOpti return } +// watchList establishes a watch stream with the server and returns the list of PriorityLevelConfigurations +func (c *priorityLevelConfigurations) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityLevelConfigurationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.PriorityLevelConfigurationList{} + err = c.client.Get(). + Resource("prioritylevelconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. func (c *priorityLevelConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/flowcontrol/v1beta2/flowschema.go b/kubernetes/typed/flowcontrol/v1beta2/flowschema.go index 326405096e..88e7951ed9 100644 --- a/kubernetes/typed/flowcontrol/v1beta2/flowschema.go +++ b/kubernetes/typed/flowcontrol/v1beta2/flowschema.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // FlowSchemasGetter has a method to return a FlowSchemaInterface. @@ -81,13 +83,22 @@ func (c *flowSchemas) Get(ctx context.Context, name string, options v1.GetOption } // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. -func (c *flowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.FlowSchemaList, err error) { - defer func() { +func (c *flowSchemas) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.FlowSchemaList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for flowschemas, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for flowschemas", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for flowschemas ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of FlowSchemas that match those selectors. @@ -106,6 +117,22 @@ func (c *flowSchemas) list(ctx context.Context, opts v1.ListOptions) (result *v1 return } +// watchList establishes a watch stream with the server and returns the list of FlowSchemas +func (c *flowSchemas) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.FlowSchemaList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta2.FlowSchemaList{} + err = c.client.Get(). + Resource("flowschemas"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested flowSchemas. func (c *flowSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/flowcontrol/v1beta2/prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1beta2/prioritylevelconfiguration.go index a1621fc2da..e1cd060244 100644 --- a/kubernetes/typed/flowcontrol/v1beta2/prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1beta2/prioritylevelconfiguration.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface. @@ -81,13 +83,22 @@ func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, opti } // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. -func (c *priorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.PriorityLevelConfigurationList, err error) { - defer func() { +func (c *priorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.PriorityLevelConfigurationList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for prioritylevelconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for prioritylevelconfigurations", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for prioritylevelconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. @@ -106,6 +117,22 @@ func (c *priorityLevelConfigurations) list(ctx context.Context, opts v1.ListOpti return } +// watchList establishes a watch stream with the server and returns the list of PriorityLevelConfigurations +func (c *priorityLevelConfigurations) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.PriorityLevelConfigurationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta2.PriorityLevelConfigurationList{} + err = c.client.Get(). + Resource("prioritylevelconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. func (c *priorityLevelConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/flowcontrol/v1beta3/flowschema.go b/kubernetes/typed/flowcontrol/v1beta3/flowschema.go index 93bd355321..1f61872e17 100644 --- a/kubernetes/typed/flowcontrol/v1beta3/flowschema.go +++ b/kubernetes/typed/flowcontrol/v1beta3/flowschema.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // FlowSchemasGetter has a method to return a FlowSchemaInterface. @@ -81,13 +83,22 @@ func (c *flowSchemas) Get(ctx context.Context, name string, options v1.GetOption } // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. -func (c *flowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta3.FlowSchemaList, err error) { - defer func() { +func (c *flowSchemas) List(ctx context.Context, opts v1.ListOptions) (*v1beta3.FlowSchemaList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for flowschemas, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for flowschemas", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for flowschemas ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of FlowSchemas that match those selectors. @@ -106,6 +117,22 @@ func (c *flowSchemas) list(ctx context.Context, opts v1.ListOptions) (result *v1 return } +// watchList establishes a watch stream with the server and returns the list of FlowSchemas +func (c *flowSchemas) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta3.FlowSchemaList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta3.FlowSchemaList{} + err = c.client.Get(). + Resource("flowschemas"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested flowSchemas. func (c *flowSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/flowcontrol/v1beta3/prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1beta3/prioritylevelconfiguration.go index d419be5f8a..c834127877 100644 --- a/kubernetes/typed/flowcontrol/v1beta3/prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1beta3/prioritylevelconfiguration.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface. @@ -81,13 +83,22 @@ func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, opti } // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. -func (c *priorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta3.PriorityLevelConfigurationList, err error) { - defer func() { +func (c *priorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (*v1beta3.PriorityLevelConfigurationList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for prioritylevelconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for prioritylevelconfigurations", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for prioritylevelconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. @@ -106,6 +117,22 @@ func (c *priorityLevelConfigurations) list(ctx context.Context, opts v1.ListOpti return } +// watchList establishes a watch stream with the server and returns the list of PriorityLevelConfigurations +func (c *priorityLevelConfigurations) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta3.PriorityLevelConfigurationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta3.PriorityLevelConfigurationList{} + err = c.client.Get(). + Resource("prioritylevelconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. func (c *priorityLevelConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/networking/v1/ingress.go b/kubernetes/typed/networking/v1/ingress.go index dbdf32b90c..bb87b1c9f1 100644 --- a/kubernetes/typed/networking/v1/ingress.go +++ b/kubernetes/typed/networking/v1/ingress.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // IngressesGetter has a method to return a IngressInterface. @@ -84,13 +86,22 @@ func (c *ingresses) Get(ctx context.Context, name string, options metav1.GetOpti } // List takes label and field selectors, and returns the list of Ingresses that match those selectors. -func (c *ingresses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressList, err error) { - defer func() { +func (c *ingresses) List(ctx context.Context, opts metav1.ListOptions) (*v1.IngressList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for ingresses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingresses", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for ingresses", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for ingresses ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingresses", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of Ingresses that match those selectors. @@ -110,6 +121,23 @@ func (c *ingresses) list(ctx context.Context, opts metav1.ListOptions) (result * return } +// watchList establishes a watch stream with the server and returns the list of Ingresses +func (c *ingresses) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.IngressList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("ingresses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested ingresses. func (c *ingresses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/networking/v1/ingressclass.go b/kubernetes/typed/networking/v1/ingressclass.go index 4ca832c90b..22de5240ba 100644 --- a/kubernetes/typed/networking/v1/ingressclass.go +++ b/kubernetes/typed/networking/v1/ingressclass.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // IngressClassesGetter has a method to return a IngressClassInterface. @@ -79,13 +81,22 @@ func (c *ingressClasses) Get(ctx context.Context, name string, options metav1.Ge } // List takes label and field selectors, and returns the list of IngressClasses that match those selectors. -func (c *ingressClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressClassList, err error) { - defer func() { +func (c *ingressClasses) List(ctx context.Context, opts metav1.ListOptions) (*v1.IngressClassList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for ingressclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingressclasses", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for ingressclasses", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for ingressclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingressclasses", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of IngressClasses that match those selectors. @@ -104,6 +115,22 @@ func (c *ingressClasses) list(ctx context.Context, opts metav1.ListOptions) (res return } +// watchList establishes a watch stream with the server and returns the list of IngressClasses +func (c *ingressClasses) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressClassList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.IngressClassList{} + err = c.client.Get(). + Resource("ingressclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested ingressClasses. func (c *ingressClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/networking/v1/networkpolicy.go b/kubernetes/typed/networking/v1/networkpolicy.go index 1fd8bd0347..1fcd858258 100644 --- a/kubernetes/typed/networking/v1/networkpolicy.go +++ b/kubernetes/typed/networking/v1/networkpolicy.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // NetworkPoliciesGetter has a method to return a NetworkPolicyInterface. @@ -82,13 +84,22 @@ func (c *networkPolicies) Get(ctx context.Context, name string, options metav1.G } // List takes label and field selectors, and returns the list of NetworkPolicies that match those selectors. -func (c *networkPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NetworkPolicyList, err error) { - defer func() { +func (c *networkPolicies) List(ctx context.Context, opts metav1.ListOptions) (*v1.NetworkPolicyList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for networkpolicies, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for networkpolicies", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for networkpolicies", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for networkpolicies ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for networkpolicies", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of NetworkPolicies that match those selectors. @@ -108,6 +119,23 @@ func (c *networkPolicies) list(ctx context.Context, opts metav1.ListOptions) (re return } +// watchList establishes a watch stream with the server and returns the list of NetworkPolicies +func (c *networkPolicies) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.NetworkPolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.NetworkPolicyList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("networkpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested networkPolicies. func (c *networkPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/networking/v1alpha1/ipaddress.go b/kubernetes/typed/networking/v1alpha1/ipaddress.go index fcf63fc85e..c942f1c486 100644 --- a/kubernetes/typed/networking/v1alpha1/ipaddress.go +++ b/kubernetes/typed/networking/v1alpha1/ipaddress.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // IPAddressesGetter has a method to return a IPAddressInterface. @@ -79,13 +81,22 @@ func (c *iPAddresses) Get(ctx context.Context, name string, options v1.GetOption } // 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) { - defer func() { +func (c *iPAddresses) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.IPAddressList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for ipaddresses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ipaddresses", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for ipaddresses", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for ipaddresses ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ipaddresses", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of IPAddresses that match those selectors. @@ -104,6 +115,22 @@ func (c *iPAddresses) list(ctx context.Context, opts v1.ListOptions) (result *v1 return } +// watchList establishes a watch stream with the server and returns the list of IPAddresses +func (c *iPAddresses) watchList(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). + WatchList(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 diff --git a/kubernetes/typed/networking/v1alpha1/servicecidr.go b/kubernetes/typed/networking/v1alpha1/servicecidr.go index 392f30d2e3..b3a81ffd23 100644 --- a/kubernetes/typed/networking/v1alpha1/servicecidr.go +++ b/kubernetes/typed/networking/v1alpha1/servicecidr.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ServiceCIDRsGetter has a method to return a ServiceCIDRInterface. @@ -81,13 +83,22 @@ func (c *serviceCIDRs) Get(ctx context.Context, name string, options v1.GetOptio } // List takes label and field selectors, and returns the list of ServiceCIDRs that match those selectors. -func (c *serviceCIDRs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ServiceCIDRList, err error) { - defer func() { +func (c *serviceCIDRs) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ServiceCIDRList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for servicecidrs, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for servicecidrs", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for servicecidrs", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for servicecidrs ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for servicecidrs", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ServiceCIDRs that match those selectors. @@ -106,6 +117,22 @@ func (c *serviceCIDRs) list(ctx context.Context, opts v1.ListOptions) (result *v return } +// watchList establishes a watch stream with the server and returns the list of ServiceCIDRs +func (c *serviceCIDRs) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ServiceCIDRList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.ServiceCIDRList{} + err = c.client.Get(). + Resource("servicecidrs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested serviceCIDRs. func (c *serviceCIDRs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/networking/v1beta1/ingress.go b/kubernetes/typed/networking/v1beta1/ingress.go index 92df698e8d..e4b9b4a5cd 100644 --- a/kubernetes/typed/networking/v1beta1/ingress.go +++ b/kubernetes/typed/networking/v1beta1/ingress.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // IngressesGetter has a method to return a IngressInterface. @@ -84,13 +86,22 @@ func (c *ingresses) Get(ctx context.Context, name string, options v1.GetOptions) } // List takes label and field selectors, and returns the list of Ingresses that match those selectors. -func (c *ingresses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { - defer func() { +func (c *ingresses) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IngressList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for ingresses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingresses", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for ingresses", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for ingresses ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingresses", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of Ingresses that match those selectors. @@ -110,6 +121,23 @@ func (c *ingresses) list(ctx context.Context, opts v1.ListOptions) (result *v1be return } +// watchList establishes a watch stream with the server and returns the list of Ingresses +func (c *ingresses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.IngressList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("ingresses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested ingresses. func (c *ingresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/networking/v1beta1/ingressclass.go b/kubernetes/typed/networking/v1beta1/ingressclass.go index 577a4d87e2..1591e8d589 100644 --- a/kubernetes/typed/networking/v1beta1/ingressclass.go +++ b/kubernetes/typed/networking/v1beta1/ingressclass.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // IngressClassesGetter has a method to return a IngressClassInterface. @@ -79,13 +81,22 @@ func (c *ingressClasses) Get(ctx context.Context, name string, options v1.GetOpt } // List takes label and field selectors, and returns the list of IngressClasses that match those selectors. -func (c *ingressClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressClassList, err error) { - defer func() { +func (c *ingressClasses) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IngressClassList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for ingressclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingressclasses", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for ingressclasses", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for ingressclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingressclasses", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of IngressClasses that match those selectors. @@ -104,6 +115,22 @@ func (c *ingressClasses) list(ctx context.Context, opts v1.ListOptions) (result return } +// watchList establishes a watch stream with the server and returns the list of IngressClasses +func (c *ingressClasses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressClassList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.IngressClassList{} + err = c.client.Get(). + Resource("ingressclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested ingressClasses. func (c *ingressClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/node/v1/runtimeclass.go b/kubernetes/typed/node/v1/runtimeclass.go index c8911b1e67..7b86fe9097 100644 --- a/kubernetes/typed/node/v1/runtimeclass.go +++ b/kubernetes/typed/node/v1/runtimeclass.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // RuntimeClassesGetter has a method to return a RuntimeClassInterface. @@ -79,13 +81,22 @@ func (c *runtimeClasses) Get(ctx context.Context, name string, options metav1.Ge } // List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. -func (c *runtimeClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RuntimeClassList, err error) { - defer func() { +func (c *runtimeClasses) List(ctx context.Context, opts metav1.ListOptions) (*v1.RuntimeClassList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for runtimeclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for runtimeclasses", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for runtimeclasses", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for runtimeclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for runtimeclasses", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. @@ -104,6 +115,22 @@ func (c *runtimeClasses) list(ctx context.Context, opts metav1.ListOptions) (res return } +// watchList establishes a watch stream with the server and returns the list of RuntimeClasses +func (c *runtimeClasses) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.RuntimeClassList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.RuntimeClassList{} + err = c.client.Get(). + Resource("runtimeclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested runtimeClasses. func (c *runtimeClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/node/v1alpha1/runtimeclass.go b/kubernetes/typed/node/v1alpha1/runtimeclass.go index c9fdaae5ad..1df0b59043 100644 --- a/kubernetes/typed/node/v1alpha1/runtimeclass.go +++ b/kubernetes/typed/node/v1alpha1/runtimeclass.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // RuntimeClassesGetter has a method to return a RuntimeClassInterface. @@ -79,13 +81,22 @@ func (c *runtimeClasses) Get(ctx context.Context, name string, options v1.GetOpt } // List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. -func (c *runtimeClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RuntimeClassList, err error) { - defer func() { +func (c *runtimeClasses) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RuntimeClassList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for runtimeclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for runtimeclasses", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for runtimeclasses", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for runtimeclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for runtimeclasses", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. @@ -104,6 +115,22 @@ func (c *runtimeClasses) list(ctx context.Context, opts v1.ListOptions) (result return } +// watchList establishes a watch stream with the server and returns the list of RuntimeClasses +func (c *runtimeClasses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RuntimeClassList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.RuntimeClassList{} + err = c.client.Get(). + Resource("runtimeclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested runtimeClasses. func (c *runtimeClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/node/v1beta1/runtimeclass.go b/kubernetes/typed/node/v1beta1/runtimeclass.go index 341a1e0969..cf5f95ecd2 100644 --- a/kubernetes/typed/node/v1beta1/runtimeclass.go +++ b/kubernetes/typed/node/v1beta1/runtimeclass.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // RuntimeClassesGetter has a method to return a RuntimeClassInterface. @@ -79,13 +81,22 @@ func (c *runtimeClasses) Get(ctx context.Context, name string, options v1.GetOpt } // List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. -func (c *runtimeClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RuntimeClassList, err error) { - defer func() { +func (c *runtimeClasses) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RuntimeClassList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for runtimeclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for runtimeclasses", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for runtimeclasses", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for runtimeclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for runtimeclasses", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. @@ -104,6 +115,22 @@ func (c *runtimeClasses) list(ctx context.Context, opts v1.ListOptions) (result return } +// watchList establishes a watch stream with the server and returns the list of RuntimeClasses +func (c *runtimeClasses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RuntimeClassList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.RuntimeClassList{} + err = c.client.Get(). + Resource("runtimeclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested runtimeClasses. func (c *runtimeClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/policy/v1/poddisruptionbudget.go b/kubernetes/typed/policy/v1/poddisruptionbudget.go index 37d93a2b25..f629d67ef5 100644 --- a/kubernetes/typed/policy/v1/poddisruptionbudget.go +++ b/kubernetes/typed/policy/v1/poddisruptionbudget.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // PodDisruptionBudgetsGetter has a method to return a PodDisruptionBudgetInterface. @@ -84,13 +86,22 @@ func (c *podDisruptionBudgets) Get(ctx context.Context, name string, options met } // List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. -func (c *podDisruptionBudgets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodDisruptionBudgetList, err error) { - defer func() { +func (c *podDisruptionBudgets) List(ctx context.Context, opts metav1.ListOptions) (*v1.PodDisruptionBudgetList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for poddisruptionbudgets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for poddisruptionbudgets", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for poddisruptionbudgets", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for poddisruptionbudgets ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for poddisruptionbudgets", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. @@ -110,6 +121,23 @@ func (c *podDisruptionBudgets) list(ctx context.Context, opts metav1.ListOptions return } +// watchList establishes a watch stream with the server and returns the list of PodDisruptionBudgets +func (c *podDisruptionBudgets) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.PodDisruptionBudgetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.PodDisruptionBudgetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested podDisruptionBudgets. func (c *podDisruptionBudgets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go b/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go index 86fa7a689d..27e20786ab 100644 --- a/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go +++ b/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // PodDisruptionBudgetsGetter has a method to return a PodDisruptionBudgetInterface. @@ -84,13 +86,22 @@ func (c *podDisruptionBudgets) Get(ctx context.Context, name string, options v1. } // List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. -func (c *podDisruptionBudgets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PodDisruptionBudgetList, err error) { - defer func() { +func (c *podDisruptionBudgets) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PodDisruptionBudgetList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for poddisruptionbudgets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for poddisruptionbudgets", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for poddisruptionbudgets", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for poddisruptionbudgets ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for poddisruptionbudgets", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. @@ -110,6 +121,23 @@ func (c *podDisruptionBudgets) list(ctx context.Context, opts v1.ListOptions) (r return } +// watchList establishes a watch stream with the server and returns the list of PodDisruptionBudgets +func (c *podDisruptionBudgets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PodDisruptionBudgetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.PodDisruptionBudgetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("poddisruptionbudgets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested podDisruptionBudgets. func (c *podDisruptionBudgets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/rbac/v1/clusterrole.go b/kubernetes/typed/rbac/v1/clusterrole.go index c072389a70..6462a2d3dc 100644 --- a/kubernetes/typed/rbac/v1/clusterrole.go +++ b/kubernetes/typed/rbac/v1/clusterrole.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ClusterRolesGetter has a method to return a ClusterRoleInterface. @@ -79,13 +81,22 @@ func (c *clusterRoles) Get(ctx context.Context, name string, options metav1.GetO } // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. -func (c *clusterRoles) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleList, err error) { - defer func() { +func (c *clusterRoles) List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterRoleList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for clusterroles, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterroles", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for clusterroles", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for clusterroles ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterroles", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ClusterRoles that match those selectors. @@ -104,6 +115,22 @@ func (c *clusterRoles) list(ctx context.Context, opts metav1.ListOptions) (resul return } +// watchList establishes a watch stream with the server and returns the list of ClusterRoles +func (c *clusterRoles) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ClusterRoleList{} + err = c.client.Get(). + Resource("clusterroles"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested clusterRoles. func (c *clusterRoles) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/rbac/v1/clusterrolebinding.go b/kubernetes/typed/rbac/v1/clusterrolebinding.go index 09003ceb24..e2f3d94778 100644 --- a/kubernetes/typed/rbac/v1/clusterrolebinding.go +++ b/kubernetes/typed/rbac/v1/clusterrolebinding.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ClusterRoleBindingsGetter has a method to return a ClusterRoleBindingInterface. @@ -79,13 +81,22 @@ func (c *clusterRoleBindings) Get(ctx context.Context, name string, options meta } // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. -func (c *clusterRoleBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleBindingList, err error) { - defer func() { +func (c *clusterRoleBindings) List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterRoleBindingList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for clusterrolebindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterrolebindings", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for clusterrolebindings", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for clusterrolebindings ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterrolebindings", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. @@ -104,6 +115,22 @@ func (c *clusterRoleBindings) list(ctx context.Context, opts metav1.ListOptions) return } +// watchList establishes a watch stream with the server and returns the list of ClusterRoleBindings +func (c *clusterRoleBindings) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleBindingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ClusterRoleBindingList{} + err = c.client.Get(). + Resource("clusterrolebindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested clusterRoleBindings. func (c *clusterRoleBindings) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/rbac/v1/role.go b/kubernetes/typed/rbac/v1/role.go index fd2b92c033..cac029866a 100644 --- a/kubernetes/typed/rbac/v1/role.go +++ b/kubernetes/typed/rbac/v1/role.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // RolesGetter has a method to return a RoleInterface. @@ -82,13 +84,22 @@ func (c *roles) Get(ctx context.Context, name string, options metav1.GetOptions) } // List takes label and field selectors, and returns the list of Roles that match those selectors. -func (c *roles) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleList, err error) { - defer func() { +func (c *roles) List(ctx context.Context, opts metav1.ListOptions) (*v1.RoleList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for roles, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for roles", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for roles", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for roles ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for roles", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of Roles that match those selectors. @@ -108,6 +119,23 @@ func (c *roles) list(ctx context.Context, opts metav1.ListOptions) (result *v1.R return } +// watchList establishes a watch stream with the server and returns the list of Roles +func (c *roles) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.RoleList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("roles"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested roles. func (c *roles) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/rbac/v1/rolebinding.go b/kubernetes/typed/rbac/v1/rolebinding.go index 567c4b51c7..2cbead33a5 100644 --- a/kubernetes/typed/rbac/v1/rolebinding.go +++ b/kubernetes/typed/rbac/v1/rolebinding.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // RoleBindingsGetter has a method to return a RoleBindingInterface. @@ -82,13 +84,22 @@ func (c *roleBindings) Get(ctx context.Context, name string, options metav1.GetO } // List takes label and field selectors, and returns the list of RoleBindings that match those selectors. -func (c *roleBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleBindingList, err error) { - defer func() { +func (c *roleBindings) List(ctx context.Context, opts metav1.ListOptions) (*v1.RoleBindingList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for rolebindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for rolebindings", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for rolebindings", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for rolebindings ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for rolebindings", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of RoleBindings that match those selectors. @@ -108,6 +119,23 @@ func (c *roleBindings) list(ctx context.Context, opts metav1.ListOptions) (resul return } +// watchList establishes a watch stream with the server and returns the list of RoleBindings +func (c *roleBindings) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleBindingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.RoleBindingList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("rolebindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested roleBindings. func (c *roleBindings) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/rbac/v1alpha1/clusterrole.go b/kubernetes/typed/rbac/v1alpha1/clusterrole.go index b8021be3ad..f22b5b3e35 100644 --- a/kubernetes/typed/rbac/v1alpha1/clusterrole.go +++ b/kubernetes/typed/rbac/v1alpha1/clusterrole.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ClusterRolesGetter has a method to return a ClusterRoleInterface. @@ -79,13 +81,22 @@ func (c *clusterRoles) Get(ctx context.Context, name string, options v1.GetOptio } // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. -func (c *clusterRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleList, err error) { - defer func() { +func (c *clusterRoles) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterRoleList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for clusterroles, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterroles", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for clusterroles", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for clusterroles ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterroles", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ClusterRoles that match those selectors. @@ -104,6 +115,22 @@ func (c *clusterRoles) list(ctx context.Context, opts v1.ListOptions) (result *v return } +// watchList establishes a watch stream with the server and returns the list of ClusterRoles +func (c *clusterRoles) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.ClusterRoleList{} + err = c.client.Get(). + Resource("clusterroles"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested clusterRoles. func (c *clusterRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go b/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go index f55f7db39c..f3ef567913 100644 --- a/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go +++ b/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ClusterRoleBindingsGetter has a method to return a ClusterRoleBindingInterface. @@ -79,13 +81,22 @@ func (c *clusterRoleBindings) Get(ctx context.Context, name string, options v1.G } // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. -func (c *clusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleBindingList, err error) { - defer func() { +func (c *clusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterRoleBindingList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for clusterrolebindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterrolebindings", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for clusterrolebindings", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for clusterrolebindings ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterrolebindings", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. @@ -104,6 +115,22 @@ func (c *clusterRoleBindings) list(ctx context.Context, opts v1.ListOptions) (re return } +// watchList establishes a watch stream with the server and returns the list of ClusterRoleBindings +func (c *clusterRoleBindings) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleBindingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.ClusterRoleBindingList{} + err = c.client.Get(). + Resource("clusterrolebindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested clusterRoleBindings. func (c *clusterRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/rbac/v1alpha1/role.go b/kubernetes/typed/rbac/v1alpha1/role.go index babc5d245d..13f4b80af7 100644 --- a/kubernetes/typed/rbac/v1alpha1/role.go +++ b/kubernetes/typed/rbac/v1alpha1/role.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // RolesGetter has a method to return a RoleInterface. @@ -82,13 +84,22 @@ func (c *roles) Get(ctx context.Context, name string, options v1.GetOptions) (re } // List takes label and field selectors, and returns the list of Roles that match those selectors. -func (c *roles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleList, err error) { - defer func() { +func (c *roles) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RoleList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for roles, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for roles", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for roles", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for roles ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for roles", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of Roles that match those selectors. @@ -108,6 +119,23 @@ func (c *roles) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1 return } +// watchList establishes a watch stream with the server and returns the list of Roles +func (c *roles) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.RoleList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("roles"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested roles. func (c *roles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/rbac/v1alpha1/rolebinding.go b/kubernetes/typed/rbac/v1alpha1/rolebinding.go index 1804457ea3..30285ccaf2 100644 --- a/kubernetes/typed/rbac/v1alpha1/rolebinding.go +++ b/kubernetes/typed/rbac/v1alpha1/rolebinding.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // RoleBindingsGetter has a method to return a RoleBindingInterface. @@ -82,13 +84,22 @@ func (c *roleBindings) Get(ctx context.Context, name string, options v1.GetOptio } // List takes label and field selectors, and returns the list of RoleBindings that match those selectors. -func (c *roleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleBindingList, err error) { - defer func() { +func (c *roleBindings) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RoleBindingList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for rolebindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for rolebindings", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for rolebindings", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for rolebindings ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for rolebindings", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of RoleBindings that match those selectors. @@ -108,6 +119,23 @@ func (c *roleBindings) list(ctx context.Context, opts v1.ListOptions) (result *v return } +// watchList establishes a watch stream with the server and returns the list of RoleBindings +func (c *roleBindings) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleBindingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.RoleBindingList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("rolebindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested roleBindings. func (c *roleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/rbac/v1beta1/clusterrole.go b/kubernetes/typed/rbac/v1beta1/clusterrole.go index e61f4ce375..3df9c1c65e 100644 --- a/kubernetes/typed/rbac/v1beta1/clusterrole.go +++ b/kubernetes/typed/rbac/v1beta1/clusterrole.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ClusterRolesGetter has a method to return a ClusterRoleInterface. @@ -79,13 +81,22 @@ func (c *clusterRoles) Get(ctx context.Context, name string, options v1.GetOptio } // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. -func (c *clusterRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleList, err error) { - defer func() { +func (c *clusterRoles) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterRoleList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for clusterroles, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterroles", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for clusterroles", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for clusterroles ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterroles", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ClusterRoles that match those selectors. @@ -104,6 +115,22 @@ func (c *clusterRoles) list(ctx context.Context, opts v1.ListOptions) (result *v return } +// watchList establishes a watch stream with the server and returns the list of ClusterRoles +func (c *clusterRoles) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.ClusterRoleList{} + err = c.client.Get(). + Resource("clusterroles"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested clusterRoles. func (c *clusterRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go b/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go index a80e99be31..0820a7bcdf 100644 --- a/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go +++ b/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ClusterRoleBindingsGetter has a method to return a ClusterRoleBindingInterface. @@ -79,13 +81,22 @@ func (c *clusterRoleBindings) Get(ctx context.Context, name string, options v1.G } // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. -func (c *clusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleBindingList, err error) { - defer func() { +func (c *clusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterRoleBindingList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for clusterrolebindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterrolebindings", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for clusterrolebindings", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for clusterrolebindings ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterrolebindings", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. @@ -104,6 +115,22 @@ func (c *clusterRoleBindings) list(ctx context.Context, opts v1.ListOptions) (re return } +// watchList establishes a watch stream with the server and returns the list of ClusterRoleBindings +func (c *clusterRoleBindings) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleBindingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.ClusterRoleBindingList{} + err = c.client.Get(). + Resource("clusterrolebindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested clusterRoleBindings. func (c *clusterRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/rbac/v1beta1/role.go b/kubernetes/typed/rbac/v1beta1/role.go index 2dbb713d54..a2e9cbb97a 100644 --- a/kubernetes/typed/rbac/v1beta1/role.go +++ b/kubernetes/typed/rbac/v1beta1/role.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // RolesGetter has a method to return a RoleInterface. @@ -82,13 +84,22 @@ func (c *roles) Get(ctx context.Context, name string, options v1.GetOptions) (re } // List takes label and field selectors, and returns the list of Roles that match those selectors. -func (c *roles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleList, err error) { - defer func() { +func (c *roles) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RoleList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for roles, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for roles", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for roles", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for roles ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for roles", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of Roles that match those selectors. @@ -108,6 +119,23 @@ func (c *roles) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1. return } +// watchList establishes a watch stream with the server and returns the list of Roles +func (c *roles) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.RoleList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("roles"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested roles. func (c *roles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/rbac/v1beta1/rolebinding.go b/kubernetes/typed/rbac/v1beta1/rolebinding.go index dfb60abc44..f44cc4a6c6 100644 --- a/kubernetes/typed/rbac/v1beta1/rolebinding.go +++ b/kubernetes/typed/rbac/v1beta1/rolebinding.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // RoleBindingsGetter has a method to return a RoleBindingInterface. @@ -82,13 +84,22 @@ func (c *roleBindings) Get(ctx context.Context, name string, options v1.GetOptio } // List takes label and field selectors, and returns the list of RoleBindings that match those selectors. -func (c *roleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleBindingList, err error) { - defer func() { +func (c *roleBindings) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RoleBindingList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for rolebindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for rolebindings", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for rolebindings", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for rolebindings ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for rolebindings", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of RoleBindings that match those selectors. @@ -108,6 +119,23 @@ func (c *roleBindings) list(ctx context.Context, opts v1.ListOptions) (result *v return } +// watchList establishes a watch stream with the server and returns the list of RoleBindings +func (c *roleBindings) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleBindingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.RoleBindingList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("rolebindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested roleBindings. func (c *roleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/resource/v1alpha2/podschedulingcontext.go b/kubernetes/typed/resource/v1alpha2/podschedulingcontext.go index f5158bb63d..260d4318fe 100644 --- a/kubernetes/typed/resource/v1alpha2/podschedulingcontext.go +++ b/kubernetes/typed/resource/v1alpha2/podschedulingcontext.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // PodSchedulingContextsGetter has a method to return a PodSchedulingContextInterface. @@ -84,13 +86,22 @@ func (c *podSchedulingContexts) Get(ctx context.Context, name string, options v1 } // List takes label and field selectors, and returns the list of PodSchedulingContexts that match those selectors. -func (c *podSchedulingContexts) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.PodSchedulingContextList, err error) { - defer func() { +func (c *podSchedulingContexts) List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.PodSchedulingContextList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for podschedulingcontexts, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for podschedulingcontexts", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for podschedulingcontexts", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for podschedulingcontexts ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for podschedulingcontexts", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of PodSchedulingContexts that match those selectors. @@ -110,6 +121,23 @@ func (c *podSchedulingContexts) list(ctx context.Context, opts v1.ListOptions) ( return } +// watchList establishes a watch stream with the server and returns the list of PodSchedulingContexts +func (c *podSchedulingContexts) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.PodSchedulingContextList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha2.PodSchedulingContextList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("podschedulingcontexts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested podSchedulingContexts. func (c *podSchedulingContexts) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/resource/v1alpha2/resourceclaim.go b/kubernetes/typed/resource/v1alpha2/resourceclaim.go index bd1e574f46..4fb2de3dc0 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceclaim.go +++ b/kubernetes/typed/resource/v1alpha2/resourceclaim.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ResourceClaimsGetter has a method to return a ResourceClaimInterface. @@ -84,13 +86,22 @@ func (c *resourceClaims) Get(ctx context.Context, name string, options v1.GetOpt } // List takes label and field selectors, and returns the list of ResourceClaims that match those selectors. -func (c *resourceClaims) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimList, err error) { - defer func() { +func (c *resourceClaims) List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClaimList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for resourceclaims, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclaims", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for resourceclaims", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for resourceclaims ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclaims", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ResourceClaims that match those selectors. @@ -110,6 +121,23 @@ func (c *resourceClaims) list(ctx context.Context, opts v1.ListOptions) (result return } +// watchList establishes a watch stream with the server and returns the list of ResourceClaims +func (c *resourceClaims) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha2.ResourceClaimList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("resourceclaims"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested resourceClaims. func (c *resourceClaims) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go b/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go index 4f37f1672b..c1a733e17f 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go +++ b/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ResourceClaimParametersGetter has a method to return a ResourceClaimParametersInterface. @@ -82,13 +84,22 @@ func (c *resourceClaimParameters) Get(ctx context.Context, name string, options } // List takes label and field selectors, and returns the list of ResourceClaimParameters that match those selectors. -func (c *resourceClaimParameters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimParametersList, err error) { - defer func() { +func (c *resourceClaimParameters) List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClaimParametersList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for resourceclaimparameters, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclaimparameters", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for resourceclaimparameters", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for resourceclaimparameters ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclaimparameters", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ResourceClaimParameters that match those selectors. @@ -108,6 +119,23 @@ func (c *resourceClaimParameters) list(ctx context.Context, opts v1.ListOptions) return } +// watchList establishes a watch stream with the server and returns the list of ResourceClaimParameters +func (c *resourceClaimParameters) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimParametersList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha2.ResourceClaimParametersList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("resourceclaimparameters"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested resourceClaimParameters. func (c *resourceClaimParameters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/resource/v1alpha2/resourceclaimtemplate.go b/kubernetes/typed/resource/v1alpha2/resourceclaimtemplate.go index b9d7ab8333..6257b6a4c4 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceclaimtemplate.go +++ b/kubernetes/typed/resource/v1alpha2/resourceclaimtemplate.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ResourceClaimTemplatesGetter has a method to return a ResourceClaimTemplateInterface. @@ -82,13 +84,22 @@ func (c *resourceClaimTemplates) Get(ctx context.Context, name string, options v } // List takes label and field selectors, and returns the list of ResourceClaimTemplates that match those selectors. -func (c *resourceClaimTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimTemplateList, err error) { - defer func() { +func (c *resourceClaimTemplates) List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClaimTemplateList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for resourceclaimtemplates, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclaimtemplates", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for resourceclaimtemplates", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for resourceclaimtemplates ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclaimtemplates", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ResourceClaimTemplates that match those selectors. @@ -108,6 +119,23 @@ func (c *resourceClaimTemplates) list(ctx context.Context, opts v1.ListOptions) return } +// watchList establishes a watch stream with the server and returns the list of ResourceClaimTemplates +func (c *resourceClaimTemplates) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimTemplateList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha2.ResourceClaimTemplateList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("resourceclaimtemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested resourceClaimTemplates. func (c *resourceClaimTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/resource/v1alpha2/resourceclass.go b/kubernetes/typed/resource/v1alpha2/resourceclass.go index 6a30db0bfd..0990fcb906 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceclass.go +++ b/kubernetes/typed/resource/v1alpha2/resourceclass.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ResourceClassesGetter has a method to return a ResourceClassInterface. @@ -79,13 +81,22 @@ func (c *resourceClasses) Get(ctx context.Context, name string, options v1.GetOp } // List takes label and field selectors, and returns the list of ResourceClasses that match those selectors. -func (c *resourceClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassList, err error) { - defer func() { +func (c *resourceClasses) List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClassList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for resourceclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclasses", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for resourceclasses", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for resourceclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclasses", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ResourceClasses that match those selectors. @@ -104,6 +115,22 @@ func (c *resourceClasses) list(ctx context.Context, opts v1.ListOptions) (result return } +// watchList establishes a watch stream with the server and returns the list of ResourceClasses +func (c *resourceClasses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha2.ResourceClassList{} + err = c.client.Get(). + Resource("resourceclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested resourceClasses. func (c *resourceClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go b/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go index 7603c8b05f..cedf4300c8 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go +++ b/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ResourceClassParametersGetter has a method to return a ResourceClassParametersInterface. @@ -82,13 +84,22 @@ func (c *resourceClassParameters) Get(ctx context.Context, name string, options } // List takes label and field selectors, and returns the list of ResourceClassParameters that match those selectors. -func (c *resourceClassParameters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassParametersList, err error) { - defer func() { +func (c *resourceClassParameters) List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClassParametersList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for resourceclassparameters, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclassparameters", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for resourceclassparameters", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for resourceclassparameters ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclassparameters", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ResourceClassParameters that match those selectors. @@ -108,6 +119,23 @@ func (c *resourceClassParameters) list(ctx context.Context, opts v1.ListOptions) return } +// watchList establishes a watch stream with the server and returns the list of ResourceClassParameters +func (c *resourceClassParameters) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassParametersList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha2.ResourceClassParametersList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("resourceclassparameters"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested resourceClassParameters. func (c *resourceClassParameters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/resource/v1alpha2/resourceslice.go b/kubernetes/typed/resource/v1alpha2/resourceslice.go index 29440c5794..9f6ce4322d 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceslice.go +++ b/kubernetes/typed/resource/v1alpha2/resourceslice.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // ResourceSlicesGetter has a method to return a ResourceSliceInterface. @@ -79,13 +81,22 @@ func (c *resourceSlices) Get(ctx context.Context, name string, options v1.GetOpt } // List takes label and field selectors, and returns the list of ResourceSlices that match those selectors. -func (c *resourceSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceSliceList, err error) { - defer func() { +func (c *resourceSlices) List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceSliceList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for resourceslices, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceslices", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for resourceslices", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for resourceslices ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceslices", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of ResourceSlices that match those selectors. @@ -104,6 +115,22 @@ func (c *resourceSlices) list(ctx context.Context, opts v1.ListOptions) (result return } +// watchList establishes a watch stream with the server and returns the list of ResourceSlices +func (c *resourceSlices) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceSliceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha2.ResourceSliceList{} + err = c.client.Get(). + Resource("resourceslices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested resourceSlices. func (c *resourceSlices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/scheduling/v1/priorityclass.go b/kubernetes/typed/scheduling/v1/priorityclass.go index c7eb4c6167..ebc575e046 100644 --- a/kubernetes/typed/scheduling/v1/priorityclass.go +++ b/kubernetes/typed/scheduling/v1/priorityclass.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // PriorityClassesGetter has a method to return a PriorityClassInterface. @@ -79,13 +81,22 @@ func (c *priorityClasses) Get(ctx context.Context, name string, options metav1.G } // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. -func (c *priorityClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityClassList, err error) { - defer func() { +func (c *priorityClasses) List(ctx context.Context, opts metav1.ListOptions) (*v1.PriorityClassList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for priorityclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for priorityclasses", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for priorityclasses", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for priorityclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for priorityclasses", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of PriorityClasses that match those selectors. @@ -104,6 +115,22 @@ func (c *priorityClasses) list(ctx context.Context, opts metav1.ListOptions) (re return } +// watchList establishes a watch stream with the server and returns the list of PriorityClasses +func (c *priorityClasses) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityClassList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.PriorityClassList{} + err = c.client.Get(). + Resource("priorityclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested priorityClasses. func (c *priorityClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/scheduling/v1alpha1/priorityclass.go b/kubernetes/typed/scheduling/v1alpha1/priorityclass.go index 40ce343795..605ae7706d 100644 --- a/kubernetes/typed/scheduling/v1alpha1/priorityclass.go +++ b/kubernetes/typed/scheduling/v1alpha1/priorityclass.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // PriorityClassesGetter has a method to return a PriorityClassInterface. @@ -79,13 +81,22 @@ func (c *priorityClasses) Get(ctx context.Context, name string, options v1.GetOp } // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. -func (c *priorityClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PriorityClassList, err error) { - defer func() { +func (c *priorityClasses) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PriorityClassList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for priorityclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for priorityclasses", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for priorityclasses", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for priorityclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for priorityclasses", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of PriorityClasses that match those selectors. @@ -104,6 +115,22 @@ func (c *priorityClasses) list(ctx context.Context, opts v1.ListOptions) (result return } +// watchList establishes a watch stream with the server and returns the list of PriorityClasses +func (c *priorityClasses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PriorityClassList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.PriorityClassList{} + err = c.client.Get(). + Resource("priorityclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested priorityClasses. func (c *priorityClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/scheduling/v1beta1/priorityclass.go b/kubernetes/typed/scheduling/v1beta1/priorityclass.go index d22d9bafc5..561c9adc96 100644 --- a/kubernetes/typed/scheduling/v1beta1/priorityclass.go +++ b/kubernetes/typed/scheduling/v1beta1/priorityclass.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // PriorityClassesGetter has a method to return a PriorityClassInterface. @@ -79,13 +81,22 @@ func (c *priorityClasses) Get(ctx context.Context, name string, options v1.GetOp } // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. -func (c *priorityClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityClassList, err error) { - defer func() { +func (c *priorityClasses) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PriorityClassList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for priorityclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for priorityclasses", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for priorityclasses", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for priorityclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for priorityclasses", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of PriorityClasses that match those selectors. @@ -104,6 +115,22 @@ func (c *priorityClasses) list(ctx context.Context, opts v1.ListOptions) (result return } +// watchList establishes a watch stream with the server and returns the list of PriorityClasses +func (c *priorityClasses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityClassList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.PriorityClassList{} + err = c.client.Get(). + Resource("priorityclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested priorityClasses. func (c *priorityClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/storage/v1/csidriver.go b/kubernetes/typed/storage/v1/csidriver.go index afb1066931..b07cb4f353 100644 --- a/kubernetes/typed/storage/v1/csidriver.go +++ b/kubernetes/typed/storage/v1/csidriver.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // CSIDriversGetter has a method to return a CSIDriverInterface. @@ -79,13 +81,22 @@ func (c *cSIDrivers) Get(ctx context.Context, name string, options metav1.GetOpt } // List takes label and field selectors, and returns the list of CSIDrivers that match those selectors. -func (c *cSIDrivers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CSIDriverList, err error) { - defer func() { +func (c *cSIDrivers) List(ctx context.Context, opts metav1.ListOptions) (*v1.CSIDriverList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for csidrivers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csidrivers", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for csidrivers", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for csidrivers ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csidrivers", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of CSIDrivers that match those selectors. @@ -104,6 +115,22 @@ func (c *cSIDrivers) list(ctx context.Context, opts metav1.ListOptions) (result return } +// watchList establishes a watch stream with the server and returns the list of CSIDrivers +func (c *cSIDrivers) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.CSIDriverList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.CSIDriverList{} + err = c.client.Get(). + Resource("csidrivers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested cSIDrivers. func (c *cSIDrivers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/storage/v1/csinode.go b/kubernetes/typed/storage/v1/csinode.go index 4d5ce7899b..308ae9ce08 100644 --- a/kubernetes/typed/storage/v1/csinode.go +++ b/kubernetes/typed/storage/v1/csinode.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // CSINodesGetter has a method to return a CSINodeInterface. @@ -79,13 +81,22 @@ func (c *cSINodes) Get(ctx context.Context, name string, options metav1.GetOptio } // List takes label and field selectors, and returns the list of CSINodes that match those selectors. -func (c *cSINodes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CSINodeList, err error) { - defer func() { +func (c *cSINodes) List(ctx context.Context, opts metav1.ListOptions) (*v1.CSINodeList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for csinodes, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csinodes", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for csinodes", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for csinodes ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csinodes", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of CSINodes that match those selectors. @@ -104,6 +115,22 @@ func (c *cSINodes) list(ctx context.Context, opts metav1.ListOptions) (result *v return } +// watchList establishes a watch stream with the server and returns the list of CSINodes +func (c *cSINodes) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.CSINodeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.CSINodeList{} + err = c.client.Get(). + Resource("csinodes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested cSINodes. func (c *cSINodes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/storage/v1/csistoragecapacity.go b/kubernetes/typed/storage/v1/csistoragecapacity.go index 4c3e1f249a..f80825633c 100644 --- a/kubernetes/typed/storage/v1/csistoragecapacity.go +++ b/kubernetes/typed/storage/v1/csistoragecapacity.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // CSIStorageCapacitiesGetter has a method to return a CSIStorageCapacityInterface. @@ -82,13 +84,22 @@ func (c *cSIStorageCapacities) Get(ctx context.Context, name string, options met } // List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. -func (c *cSIStorageCapacities) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CSIStorageCapacityList, err error) { - defer func() { +func (c *cSIStorageCapacities) List(ctx context.Context, opts metav1.ListOptions) (*v1.CSIStorageCapacityList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for csistoragecapacities, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csistoragecapacities", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for csistoragecapacities", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for csistoragecapacities ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csistoragecapacities", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. @@ -108,6 +119,23 @@ func (c *cSIStorageCapacities) list(ctx context.Context, opts metav1.ListOptions return } +// watchList establishes a watch stream with the server and returns the list of CSIStorageCapacities +func (c *cSIStorageCapacities) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.CSIStorageCapacityList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.CSIStorageCapacityList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("csistoragecapacities"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested cSIStorageCapacities. func (c *cSIStorageCapacities) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/storage/v1/storageclass.go b/kubernetes/typed/storage/v1/storageclass.go index cce61b2c06..e012275b4c 100644 --- a/kubernetes/typed/storage/v1/storageclass.go +++ b/kubernetes/typed/storage/v1/storageclass.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // StorageClassesGetter has a method to return a StorageClassInterface. @@ -79,13 +81,22 @@ func (c *storageClasses) Get(ctx context.Context, name string, options metav1.Ge } // List takes label and field selectors, and returns the list of StorageClasses that match those selectors. -func (c *storageClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.StorageClassList, err error) { - defer func() { +func (c *storageClasses) List(ctx context.Context, opts metav1.ListOptions) (*v1.StorageClassList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for storageclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for storageclasses", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for storageclasses", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for storageclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for storageclasses", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of StorageClasses that match those selectors. @@ -104,6 +115,22 @@ func (c *storageClasses) list(ctx context.Context, opts metav1.ListOptions) (res return } +// watchList establishes a watch stream with the server and returns the list of StorageClasses +func (c *storageClasses) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.StorageClassList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.StorageClassList{} + err = c.client.Get(). + Resource("storageclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested storageClasses. func (c *storageClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/storage/v1/volumeattachment.go b/kubernetes/typed/storage/v1/volumeattachment.go index c29fe44866..503093e428 100644 --- a/kubernetes/typed/storage/v1/volumeattachment.go +++ b/kubernetes/typed/storage/v1/volumeattachment.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // VolumeAttachmentsGetter has a method to return a VolumeAttachmentInterface. @@ -81,13 +83,22 @@ func (c *volumeAttachments) Get(ctx context.Context, name string, options metav1 } // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. -func (c *volumeAttachments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VolumeAttachmentList, err error) { - defer func() { +func (c *volumeAttachments) List(ctx context.Context, opts metav1.ListOptions) (*v1.VolumeAttachmentList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for volumeattachments, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for volumeattachments", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for volumeattachments", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for volumeattachments ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for volumeattachments", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. @@ -106,6 +117,22 @@ func (c *volumeAttachments) list(ctx context.Context, opts metav1.ListOptions) ( return } +// watchList establishes a watch stream with the server and returns the list of VolumeAttachments +func (c *volumeAttachments) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.VolumeAttachmentList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.VolumeAttachmentList{} + err = c.client.Get(). + Resource("volumeattachments"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested volumeAttachments. func (c *volumeAttachments) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/storage/v1alpha1/csistoragecapacity.go b/kubernetes/typed/storage/v1alpha1/csistoragecapacity.go index 2d464baa6f..b8923b0fc1 100644 --- a/kubernetes/typed/storage/v1alpha1/csistoragecapacity.go +++ b/kubernetes/typed/storage/v1alpha1/csistoragecapacity.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // CSIStorageCapacitiesGetter has a method to return a CSIStorageCapacityInterface. @@ -82,13 +84,22 @@ func (c *cSIStorageCapacities) Get(ctx context.Context, name string, options v1. } // List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. -func (c *cSIStorageCapacities) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.CSIStorageCapacityList, err error) { - defer func() { +func (c *cSIStorageCapacities) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.CSIStorageCapacityList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for csistoragecapacities, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csistoragecapacities", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for csistoragecapacities", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for csistoragecapacities ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csistoragecapacities", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. @@ -108,6 +119,23 @@ func (c *cSIStorageCapacities) list(ctx context.Context, opts v1.ListOptions) (r return } +// watchList establishes a watch stream with the server and returns the list of CSIStorageCapacities +func (c *cSIStorageCapacities) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.CSIStorageCapacityList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.CSIStorageCapacityList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("csistoragecapacities"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested cSIStorageCapacities. func (c *cSIStorageCapacities) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/storage/v1alpha1/volumeattachment.go b/kubernetes/typed/storage/v1alpha1/volumeattachment.go index 69aa9d8a27..c782f46216 100644 --- a/kubernetes/typed/storage/v1alpha1/volumeattachment.go +++ b/kubernetes/typed/storage/v1alpha1/volumeattachment.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // VolumeAttachmentsGetter has a method to return a VolumeAttachmentInterface. @@ -81,13 +83,22 @@ func (c *volumeAttachments) Get(ctx context.Context, name string, options v1.Get } // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. -func (c *volumeAttachments) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttachmentList, err error) { - defer func() { +func (c *volumeAttachments) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.VolumeAttachmentList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for volumeattachments, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for volumeattachments", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for volumeattachments", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for volumeattachments ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for volumeattachments", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. @@ -106,6 +117,22 @@ func (c *volumeAttachments) list(ctx context.Context, opts v1.ListOptions) (resu return } +// watchList establishes a watch stream with the server and returns the list of VolumeAttachments +func (c *volumeAttachments) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttachmentList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.VolumeAttachmentList{} + err = c.client.Get(). + Resource("volumeattachments"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested volumeAttachments. func (c *volumeAttachments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go b/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go index e049d94b2c..c9bf5b2ddd 100644 --- a/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go +++ b/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // VolumeAttributesClassesGetter has a method to return a VolumeAttributesClassInterface. @@ -79,13 +81,22 @@ func (c *volumeAttributesClasses) Get(ctx context.Context, name string, options } // List takes label and field selectors, and returns the list of VolumeAttributesClasses that match those selectors. -func (c *volumeAttributesClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttributesClassList, err error) { - defer func() { +func (c *volumeAttributesClasses) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.VolumeAttributesClassList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for volumeattributesclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for volumeattributesclasses", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for volumeattributesclasses", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for volumeattributesclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for volumeattributesclasses", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of VolumeAttributesClasses that match those selectors. @@ -104,6 +115,22 @@ func (c *volumeAttributesClasses) list(ctx context.Context, opts v1.ListOptions) return } +// watchList establishes a watch stream with the server and returns the list of VolumeAttributesClasses +func (c *volumeAttributesClasses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttributesClassList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.VolumeAttributesClassList{} + err = c.client.Get(). + Resource("volumeattributesclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested volumeAttributesClasses. func (c *volumeAttributesClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/storage/v1beta1/csidriver.go b/kubernetes/typed/storage/v1beta1/csidriver.go index 861a9c0512..c6205cb867 100644 --- a/kubernetes/typed/storage/v1beta1/csidriver.go +++ b/kubernetes/typed/storage/v1beta1/csidriver.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // CSIDriversGetter has a method to return a CSIDriverInterface. @@ -79,13 +81,22 @@ func (c *cSIDrivers) Get(ctx context.Context, name string, options v1.GetOptions } // List takes label and field selectors, and returns the list of CSIDrivers that match those selectors. -func (c *cSIDrivers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIDriverList, err error) { - defer func() { +func (c *cSIDrivers) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CSIDriverList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for csidrivers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csidrivers", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for csidrivers", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for csidrivers ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csidrivers", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of CSIDrivers that match those selectors. @@ -104,6 +115,22 @@ func (c *cSIDrivers) list(ctx context.Context, opts v1.ListOptions) (result *v1b return } +// watchList establishes a watch stream with the server and returns the list of CSIDrivers +func (c *cSIDrivers) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIDriverList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.CSIDriverList{} + err = c.client.Get(). + Resource("csidrivers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested cSIDrivers. func (c *cSIDrivers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/storage/v1beta1/csinode.go b/kubernetes/typed/storage/v1beta1/csinode.go index effe3d98a0..4c0fefc764 100644 --- a/kubernetes/typed/storage/v1beta1/csinode.go +++ b/kubernetes/typed/storage/v1beta1/csinode.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // CSINodesGetter has a method to return a CSINodeInterface. @@ -79,13 +81,22 @@ func (c *cSINodes) Get(ctx context.Context, name string, options v1.GetOptions) } // List takes label and field selectors, and returns the list of CSINodes that match those selectors. -func (c *cSINodes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSINodeList, err error) { - defer func() { +func (c *cSINodes) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CSINodeList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for csinodes, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csinodes", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for csinodes", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for csinodes ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csinodes", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of CSINodes that match those selectors. @@ -104,6 +115,22 @@ func (c *cSINodes) list(ctx context.Context, opts v1.ListOptions) (result *v1bet return } +// watchList establishes a watch stream with the server and returns the list of CSINodes +func (c *cSINodes) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSINodeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.CSINodeList{} + err = c.client.Get(). + Resource("csinodes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested cSINodes. func (c *cSINodes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/storage/v1beta1/csistoragecapacity.go b/kubernetes/typed/storage/v1beta1/csistoragecapacity.go index eb4e044556..a001e70ef4 100644 --- a/kubernetes/typed/storage/v1beta1/csistoragecapacity.go +++ b/kubernetes/typed/storage/v1beta1/csistoragecapacity.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // CSIStorageCapacitiesGetter has a method to return a CSIStorageCapacityInterface. @@ -82,13 +84,22 @@ func (c *cSIStorageCapacities) Get(ctx context.Context, name string, options v1. } // List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. -func (c *cSIStorageCapacities) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIStorageCapacityList, err error) { - defer func() { +func (c *cSIStorageCapacities) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CSIStorageCapacityList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for csistoragecapacities, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csistoragecapacities", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for csistoragecapacities", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for csistoragecapacities ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csistoragecapacities", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. @@ -108,6 +119,23 @@ func (c *cSIStorageCapacities) list(ctx context.Context, opts v1.ListOptions) (r return } +// watchList establishes a watch stream with the server and returns the list of CSIStorageCapacities +func (c *cSIStorageCapacities) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIStorageCapacityList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.CSIStorageCapacityList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("csistoragecapacities"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested cSIStorageCapacities. func (c *cSIStorageCapacities) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/storage/v1beta1/storageclass.go b/kubernetes/typed/storage/v1beta1/storageclass.go index b38a78db6c..4a89634827 100644 --- a/kubernetes/typed/storage/v1beta1/storageclass.go +++ b/kubernetes/typed/storage/v1beta1/storageclass.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // StorageClassesGetter has a method to return a StorageClassInterface. @@ -79,13 +81,22 @@ func (c *storageClasses) Get(ctx context.Context, name string, options v1.GetOpt } // List takes label and field selectors, and returns the list of StorageClasses that match those selectors. -func (c *storageClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StorageClassList, err error) { - defer func() { +func (c *storageClasses) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.StorageClassList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for storageclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for storageclasses", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for storageclasses", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for storageclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for storageclasses", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of StorageClasses that match those selectors. @@ -104,6 +115,22 @@ func (c *storageClasses) list(ctx context.Context, opts v1.ListOptions) (result return } +// watchList establishes a watch stream with the server and returns the list of StorageClasses +func (c *storageClasses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StorageClassList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.StorageClassList{} + err = c.client.Get(). + Resource("storageclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested storageClasses. func (c *storageClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/storage/v1beta1/volumeattachment.go b/kubernetes/typed/storage/v1beta1/volumeattachment.go index e82276772c..0492a7a163 100644 --- a/kubernetes/typed/storage/v1beta1/volumeattachment.go +++ b/kubernetes/typed/storage/v1beta1/volumeattachment.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // VolumeAttachmentsGetter has a method to return a VolumeAttachmentInterface. @@ -81,13 +83,22 @@ func (c *volumeAttachments) Get(ctx context.Context, name string, options v1.Get } // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. -func (c *volumeAttachments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeAttachmentList, err error) { - defer func() { +func (c *volumeAttachments) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VolumeAttachmentList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for volumeattachments, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for volumeattachments", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for volumeattachments", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for volumeattachments ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for volumeattachments", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. @@ -106,6 +117,22 @@ func (c *volumeAttachments) list(ctx context.Context, opts v1.ListOptions) (resu return } +// watchList establishes a watch stream with the server and returns the list of VolumeAttachments +func (c *volumeAttachments) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeAttachmentList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.VolumeAttachmentList{} + err = c.client.Get(). + Resource("volumeattachments"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested volumeAttachments. func (c *volumeAttachments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration diff --git a/kubernetes/typed/storagemigration/v1alpha1/storageversionmigration.go b/kubernetes/typed/storagemigration/v1alpha1/storageversionmigration.go index 17fe4ac2ee..5b9356f9ca 100644 --- a/kubernetes/typed/storagemigration/v1alpha1/storageversionmigration.go +++ b/kubernetes/typed/storagemigration/v1alpha1/storageversionmigration.go @@ -32,6 +32,8 @@ import ( scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" consistencydetector "k8s.io/client-go/util/consistencydetector" + watchlist "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) // StorageVersionMigrationsGetter has a method to return a StorageVersionMigrationInterface. @@ -81,13 +83,22 @@ func (c *storageVersionMigrations) Get(ctx context.Context, name string, options } // List takes label and field selectors, and returns the list of StorageVersionMigrations that match those selectors. -func (c *storageVersionMigrations) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionMigrationList, err error) { - defer func() { +func (c *storageVersionMigrations) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.StorageVersionMigrationList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for storageversionmigrations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for storageversionmigrations", c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for storageversionmigrations", c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for storageversionmigrations ended with an error, falling back to the standard LIST semantics, err = %v", err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for storageversionmigrations", c.list, opts, result) + } + return result, err } // list takes label and field selectors, and returns the list of StorageVersionMigrations that match those selectors. @@ -106,6 +117,22 @@ func (c *storageVersionMigrations) list(ctx context.Context, opts v1.ListOptions return } +// watchList establishes a watch stream with the server and returns the list of StorageVersionMigrations +func (c *storageVersionMigrations) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionMigrationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.StorageVersionMigrationList{} + err = c.client.Get(). + Resource("storageversionmigrations"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + // Watch returns a watch.Interface that watches the requested storageVersionMigrations. func (c *storageVersionMigrations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration From 6e4469285c5041cdbe52164df80f1e9ee1fa4c15 Mon Sep 17 00:00:00 2001 From: Sean Sullivan Date: Sat, 15 Jun 2024 16:09:23 -0700 Subject: [PATCH 086/159] Graduate PortForwardWebsockets to Beta Kubernetes-commit: 3ae3b4ea551443d8ef695d31bf0c51963fe35ac3 --- tools/portforward/fallback_dialer.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/portforward/fallback_dialer.go b/tools/portforward/fallback_dialer.go index 8fb74a4185..7fcc2492bf 100644 --- a/tools/portforward/fallback_dialer.go +++ b/tools/portforward/fallback_dialer.go @@ -21,21 +21,21 @@ import ( "k8s.io/klog/v2" ) -var _ httpstream.Dialer = &fallbackDialer{} +var _ httpstream.Dialer = &FallbackDialer{} -// fallbackDialer encapsulates a primary and secondary dialer, including +// FallbackDialer encapsulates a primary and secondary dialer, including // the boolean function to determine if the primary dialer failed. Implements // the httpstream.Dialer interface. -type fallbackDialer struct { +type FallbackDialer struct { primary httpstream.Dialer secondary httpstream.Dialer shouldFallback func(error) bool } -// NewFallbackDialer creates the fallbackDialer with the primary and secondary dialers, +// NewFallbackDialer creates the FallbackDialer with the primary and secondary dialers, // as well as the boolean function to determine if the primary dialer failed. func NewFallbackDialer(primary, secondary httpstream.Dialer, shouldFallback func(error) bool) httpstream.Dialer { - return &fallbackDialer{ + return &FallbackDialer{ primary: primary, secondary: secondary, shouldFallback: shouldFallback, @@ -47,7 +47,7 @@ func NewFallbackDialer(primary, secondary httpstream.Dialer, shouldFallback func // httstream.Connection and the negotiated protocol version accepted. If the initial // primary dialer fails, this function attempts the secondary dialer. Returns an error // if one occurs. -func (f *fallbackDialer) Dial(protocols ...string) (httpstream.Connection, string, error) { +func (f *FallbackDialer) Dial(protocols ...string) (httpstream.Connection, string, error) { conn, version, err := f.primary.Dial(protocols...) if err != nil && f.shouldFallback(err) { klog.V(4).Infof("fallback to secondary dialer from primary dialer err: %v", err) From d2f5fba1f82d119e09288c70ce87bccb3dc119e4 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Sun, 16 Jun 2024 13:59:32 -0700 Subject: [PATCH 087/159] Merge pull request #125528 from seans3/port-forward-beta PortForward over Websockets Graduates to Beta Kubernetes-commit: ef9965ebc66dafda37800bb04f5e284535bbba10 From 233a06528f10ca7439928a7bc87745ecd713b3fa Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Mon, 27 May 2024 10:55:47 +0200 Subject: [PATCH 088/159] Run codegen Signed-off-by: Stephen Kitt Kubernetes-commit: 55ea0a55358de787353c9c9c38280d483456475a --- .../v1/mutatingwebhookconfiguration.go | 6 ++++++ .../admissionregistration/v1/validatingadmissionpolicy.go | 6 ++++++ .../v1/validatingadmissionpolicybinding.go | 6 ++++++ .../v1/validatingwebhookconfiguration.go | 6 ++++++ .../v1alpha1/validatingadmissionpolicy.go | 6 ++++++ .../v1alpha1/validatingadmissionpolicybinding.go | 6 ++++++ .../v1beta1/mutatingwebhookconfiguration.go | 6 ++++++ .../v1beta1/validatingadmissionpolicy.go | 6 ++++++ .../v1beta1/validatingadmissionpolicybinding.go | 6 ++++++ .../v1beta1/validatingwebhookconfiguration.go | 6 ++++++ .../apiserverinternal/v1alpha1/storageversion.go | 6 ++++++ applyconfigurations/apps/v1/controllerrevision.go | 6 ++++++ applyconfigurations/apps/v1/daemonset.go | 6 ++++++ applyconfigurations/apps/v1/deployment.go | 6 ++++++ applyconfigurations/apps/v1/replicaset.go | 6 ++++++ applyconfigurations/apps/v1/statefulset.go | 6 ++++++ applyconfigurations/apps/v1beta1/controllerrevision.go | 6 ++++++ applyconfigurations/apps/v1beta1/deployment.go | 6 ++++++ applyconfigurations/apps/v1beta1/statefulset.go | 6 ++++++ applyconfigurations/apps/v1beta2/controllerrevision.go | 6 ++++++ applyconfigurations/apps/v1beta2/daemonset.go | 6 ++++++ applyconfigurations/apps/v1beta2/deployment.go | 6 ++++++ applyconfigurations/apps/v1beta2/replicaset.go | 6 ++++++ applyconfigurations/apps/v1beta2/scale.go | 6 ++++++ applyconfigurations/apps/v1beta2/statefulset.go | 6 ++++++ .../autoscaling/v1/horizontalpodautoscaler.go | 6 ++++++ applyconfigurations/autoscaling/v1/scale.go | 6 ++++++ .../autoscaling/v2/horizontalpodautoscaler.go | 6 ++++++ .../autoscaling/v2beta1/horizontalpodautoscaler.go | 6 ++++++ .../autoscaling/v2beta2/horizontalpodautoscaler.go | 6 ++++++ applyconfigurations/batch/v1/cronjob.go | 6 ++++++ applyconfigurations/batch/v1/job.go | 6 ++++++ applyconfigurations/batch/v1/jobtemplatespec.go | 6 ++++++ applyconfigurations/batch/v1beta1/cronjob.go | 6 ++++++ applyconfigurations/batch/v1beta1/jobtemplatespec.go | 6 ++++++ .../certificates/v1/certificatesigningrequest.go | 6 ++++++ .../certificates/v1alpha1/clustertrustbundle.go | 6 ++++++ .../certificates/v1beta1/certificatesigningrequest.go | 6 ++++++ applyconfigurations/coordination/v1/lease.go | 6 ++++++ applyconfigurations/coordination/v1beta1/lease.go | 6 ++++++ applyconfigurations/core/v1/componentstatus.go | 6 ++++++ applyconfigurations/core/v1/configmap.go | 6 ++++++ applyconfigurations/core/v1/endpoints.go | 6 ++++++ applyconfigurations/core/v1/event.go | 6 ++++++ applyconfigurations/core/v1/limitrange.go | 6 ++++++ applyconfigurations/core/v1/namespace.go | 6 ++++++ applyconfigurations/core/v1/node.go | 6 ++++++ applyconfigurations/core/v1/persistentvolume.go | 6 ++++++ applyconfigurations/core/v1/persistentvolumeclaim.go | 6 ++++++ .../core/v1/persistentvolumeclaimtemplate.go | 6 ++++++ applyconfigurations/core/v1/pod.go | 6 ++++++ applyconfigurations/core/v1/podtemplate.go | 6 ++++++ applyconfigurations/core/v1/podtemplatespec.go | 6 ++++++ applyconfigurations/core/v1/replicationcontroller.go | 6 ++++++ applyconfigurations/core/v1/resourcequota.go | 6 ++++++ applyconfigurations/core/v1/secret.go | 6 ++++++ applyconfigurations/core/v1/service.go | 6 ++++++ applyconfigurations/core/v1/serviceaccount.go | 6 ++++++ applyconfigurations/discovery/v1/endpointslice.go | 6 ++++++ applyconfigurations/discovery/v1beta1/endpointslice.go | 6 ++++++ applyconfigurations/events/v1/event.go | 6 ++++++ applyconfigurations/events/v1beta1/event.go | 6 ++++++ applyconfigurations/extensions/v1beta1/daemonset.go | 6 ++++++ applyconfigurations/extensions/v1beta1/deployment.go | 6 ++++++ applyconfigurations/extensions/v1beta1/ingress.go | 6 ++++++ applyconfigurations/extensions/v1beta1/networkpolicy.go | 6 ++++++ applyconfigurations/extensions/v1beta1/replicaset.go | 6 ++++++ applyconfigurations/extensions/v1beta1/scale.go | 6 ++++++ applyconfigurations/flowcontrol/v1/flowschema.go | 6 ++++++ .../flowcontrol/v1/prioritylevelconfiguration.go | 6 ++++++ applyconfigurations/flowcontrol/v1beta1/flowschema.go | 6 ++++++ .../flowcontrol/v1beta1/prioritylevelconfiguration.go | 6 ++++++ applyconfigurations/flowcontrol/v1beta2/flowschema.go | 6 ++++++ .../flowcontrol/v1beta2/prioritylevelconfiguration.go | 6 ++++++ applyconfigurations/flowcontrol/v1beta3/flowschema.go | 6 ++++++ .../flowcontrol/v1beta3/prioritylevelconfiguration.go | 6 ++++++ applyconfigurations/imagepolicy/v1alpha1/imagereview.go | 6 ++++++ applyconfigurations/meta/v1/objectmeta.go | 5 +++++ applyconfigurations/networking/v1/ingress.go | 6 ++++++ applyconfigurations/networking/v1/ingressclass.go | 6 ++++++ applyconfigurations/networking/v1/networkpolicy.go | 6 ++++++ applyconfigurations/networking/v1alpha1/ipaddress.go | 6 ++++++ applyconfigurations/networking/v1alpha1/servicecidr.go | 6 ++++++ applyconfigurations/networking/v1beta1/ingress.go | 6 ++++++ applyconfigurations/networking/v1beta1/ingressclass.go | 6 ++++++ applyconfigurations/node/v1/runtimeclass.go | 6 ++++++ applyconfigurations/node/v1alpha1/runtimeclass.go | 6 ++++++ applyconfigurations/node/v1beta1/runtimeclass.go | 6 ++++++ applyconfigurations/policy/v1/eviction.go | 6 ++++++ applyconfigurations/policy/v1/poddisruptionbudget.go | 6 ++++++ applyconfigurations/policy/v1beta1/eviction.go | 6 ++++++ applyconfigurations/policy/v1beta1/poddisruptionbudget.go | 6 ++++++ applyconfigurations/rbac/v1/clusterrole.go | 6 ++++++ applyconfigurations/rbac/v1/clusterrolebinding.go | 6 ++++++ applyconfigurations/rbac/v1/role.go | 6 ++++++ applyconfigurations/rbac/v1/rolebinding.go | 6 ++++++ applyconfigurations/rbac/v1alpha1/clusterrole.go | 6 ++++++ applyconfigurations/rbac/v1alpha1/clusterrolebinding.go | 6 ++++++ applyconfigurations/rbac/v1alpha1/role.go | 6 ++++++ applyconfigurations/rbac/v1alpha1/rolebinding.go | 6 ++++++ applyconfigurations/rbac/v1beta1/clusterrole.go | 6 ++++++ applyconfigurations/rbac/v1beta1/clusterrolebinding.go | 6 ++++++ applyconfigurations/rbac/v1beta1/role.go | 6 ++++++ applyconfigurations/rbac/v1beta1/rolebinding.go | 6 ++++++ .../resource/v1alpha2/podschedulingcontext.go | 6 ++++++ applyconfigurations/resource/v1alpha2/resourceclaim.go | 6 ++++++ .../resource/v1alpha2/resourceclaimparameters.go | 6 ++++++ .../resource/v1alpha2/resourceclaimtemplate.go | 6 ++++++ .../resource/v1alpha2/resourceclaimtemplatespec.go | 6 ++++++ applyconfigurations/resource/v1alpha2/resourceclass.go | 6 ++++++ .../resource/v1alpha2/resourceclassparameters.go | 6 ++++++ applyconfigurations/resource/v1alpha2/resourceslice.go | 6 ++++++ applyconfigurations/scheduling/v1/priorityclass.go | 6 ++++++ applyconfigurations/scheduling/v1alpha1/priorityclass.go | 6 ++++++ applyconfigurations/scheduling/v1beta1/priorityclass.go | 6 ++++++ applyconfigurations/storage/v1/csidriver.go | 6 ++++++ applyconfigurations/storage/v1/csinode.go | 6 ++++++ applyconfigurations/storage/v1/csistoragecapacity.go | 6 ++++++ applyconfigurations/storage/v1/storageclass.go | 6 ++++++ applyconfigurations/storage/v1/volumeattachment.go | 6 ++++++ applyconfigurations/storage/v1alpha1/csistoragecapacity.go | 6 ++++++ applyconfigurations/storage/v1alpha1/volumeattachment.go | 6 ++++++ .../storage/v1alpha1/volumeattributesclass.go | 6 ++++++ applyconfigurations/storage/v1beta1/csidriver.go | 6 ++++++ applyconfigurations/storage/v1beta1/csinode.go | 6 ++++++ applyconfigurations/storage/v1beta1/csistoragecapacity.go | 6 ++++++ applyconfigurations/storage/v1beta1/storageclass.go | 6 ++++++ applyconfigurations/storage/v1beta1/volumeattachment.go | 6 ++++++ .../storagemigration/v1alpha1/storageversionmigration.go | 6 ++++++ 129 files changed, 773 insertions(+) diff --git a/applyconfigurations/admissionregistration/v1/mutatingwebhookconfiguration.go b/applyconfigurations/admissionregistration/v1/mutatingwebhookconfiguration.go index 61c8f667d2..50eeae308a 100644 --- a/applyconfigurations/admissionregistration/v1/mutatingwebhookconfiguration.go +++ b/applyconfigurations/admissionregistration/v1/mutatingwebhookconfiguration.go @@ -250,3 +250,9 @@ func (b *MutatingWebhookConfigurationApplyConfiguration) WithWebhooks(values ... } return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *MutatingWebhookConfigurationApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/admissionregistration/v1/validatingadmissionpolicy.go b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicy.go index fc96a8bdc6..881da7fcde 100644 --- a/applyconfigurations/admissionregistration/v1/validatingadmissionpolicy.go +++ b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicy.go @@ -254,3 +254,9 @@ func (b *ValidatingAdmissionPolicyApplyConfiguration) WithStatus(value *Validati b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ValidatingAdmissionPolicyApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybinding.go b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybinding.go index 5bc41a0f52..8719916292 100644 --- a/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybinding.go +++ b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybinding.go @@ -245,3 +245,9 @@ func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithSpec(value *Val b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/admissionregistration/v1/validatingwebhookconfiguration.go b/applyconfigurations/admissionregistration/v1/validatingwebhookconfiguration.go index 811bfdf0b6..95b1419f6f 100644 --- a/applyconfigurations/admissionregistration/v1/validatingwebhookconfiguration.go +++ b/applyconfigurations/admissionregistration/v1/validatingwebhookconfiguration.go @@ -250,3 +250,9 @@ func (b *ValidatingWebhookConfigurationApplyConfiguration) WithWebhooks(values . } return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ValidatingWebhookConfigurationApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicy.go b/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicy.go index c860b85cf7..f8bd4dbc7e 100644 --- a/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicy.go +++ b/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicy.go @@ -254,3 +254,9 @@ func (b *ValidatingAdmissionPolicyApplyConfiguration) WithStatus(value *Validati b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ValidatingAdmissionPolicyApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go b/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go index dc08226404..2e2e3a48f6 100644 --- a/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go +++ b/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go @@ -245,3 +245,9 @@ func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithSpec(value *Val b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/applyconfigurations/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index 10dd034e25..99e2be0b81 100644 --- a/applyconfigurations/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/applyconfigurations/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -250,3 +250,9 @@ func (b *MutatingWebhookConfigurationApplyConfiguration) WithWebhooks(values ... } return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *MutatingWebhookConfigurationApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicy.go b/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicy.go index e144bc9f70..b03f78c0cb 100644 --- a/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicy.go +++ b/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicy.go @@ -254,3 +254,9 @@ func (b *ValidatingAdmissionPolicyApplyConfiguration) WithStatus(value *Validati b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ValidatingAdmissionPolicyApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybinding.go b/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybinding.go index 0dc06aedec..637d350b3b 100644 --- a/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybinding.go +++ b/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybinding.go @@ -245,3 +245,9 @@ func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) WithSpec(value *Val b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ValidatingAdmissionPolicyBindingApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/applyconfigurations/admissionregistration/v1beta1/validatingwebhookconfiguration.go index 75f1b9d716..d48b5454ee 100644 --- a/applyconfigurations/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/applyconfigurations/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -250,3 +250,9 @@ func (b *ValidatingWebhookConfigurationApplyConfiguration) WithWebhooks(values . } return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ValidatingWebhookConfigurationApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/apiserverinternal/v1alpha1/storageversion.go b/applyconfigurations/apiserverinternal/v1alpha1/storageversion.go index 6b9f178390..5727164e41 100644 --- a/applyconfigurations/apiserverinternal/v1alpha1/storageversion.go +++ b/applyconfigurations/apiserverinternal/v1alpha1/storageversion.go @@ -254,3 +254,9 @@ func (b *StorageVersionApplyConfiguration) WithStatus(value *StorageVersionStatu b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *StorageVersionApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/apps/v1/controllerrevision.go b/applyconfigurations/apps/v1/controllerrevision.go index c4e2085078..efd62b07f8 100644 --- a/applyconfigurations/apps/v1/controllerrevision.go +++ b/applyconfigurations/apps/v1/controllerrevision.go @@ -257,3 +257,9 @@ func (b *ControllerRevisionApplyConfiguration) WithRevision(value int64) *Contro b.Revision = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ControllerRevisionApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/apps/v1/daemonset.go b/applyconfigurations/apps/v1/daemonset.go index cc9fdcd5dd..89f0076ac1 100644 --- a/applyconfigurations/apps/v1/daemonset.go +++ b/applyconfigurations/apps/v1/daemonset.go @@ -256,3 +256,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/applyconfigurations/apps/v1/deployment.go b/applyconfigurations/apps/v1/deployment.go index 13edda7727..2f4d7ae3b9 100644 --- a/applyconfigurations/apps/v1/deployment.go +++ b/applyconfigurations/apps/v1/deployment.go @@ -256,3 +256,9 @@ func (b *DeploymentApplyConfiguration) WithStatus(value *DeploymentStatusApplyCo b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *DeploymentApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/apps/v1/replicaset.go b/applyconfigurations/apps/v1/replicaset.go index 4e7818e535..ed4532059e 100644 --- a/applyconfigurations/apps/v1/replicaset.go +++ b/applyconfigurations/apps/v1/replicaset.go @@ -256,3 +256,9 @@ func (b *ReplicaSetApplyConfiguration) WithStatus(value *ReplicaSetStatusApplyCo b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ReplicaSetApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/apps/v1/statefulset.go b/applyconfigurations/apps/v1/statefulset.go index 24041d99f8..5de53d102c 100644 --- a/applyconfigurations/apps/v1/statefulset.go +++ b/applyconfigurations/apps/v1/statefulset.go @@ -256,3 +256,9 @@ func (b *StatefulSetApplyConfiguration) WithStatus(value *StatefulSetStatusApply b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *StatefulSetApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/apps/v1beta1/controllerrevision.go b/applyconfigurations/apps/v1beta1/controllerrevision.go index 827c063598..1b2ea80669 100644 --- a/applyconfigurations/apps/v1beta1/controllerrevision.go +++ b/applyconfigurations/apps/v1beta1/controllerrevision.go @@ -257,3 +257,9 @@ func (b *ControllerRevisionApplyConfiguration) WithRevision(value int64) *Contro b.Revision = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ControllerRevisionApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/apps/v1beta1/deployment.go b/applyconfigurations/apps/v1beta1/deployment.go index e22f76b665..35bdabefa1 100644 --- a/applyconfigurations/apps/v1beta1/deployment.go +++ b/applyconfigurations/apps/v1beta1/deployment.go @@ -256,3 +256,9 @@ func (b *DeploymentApplyConfiguration) WithStatus(value *DeploymentStatusApplyCo b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *DeploymentApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/apps/v1beta1/statefulset.go b/applyconfigurations/apps/v1beta1/statefulset.go index ed5cfab41c..26c57cccc4 100644 --- a/applyconfigurations/apps/v1beta1/statefulset.go +++ b/applyconfigurations/apps/v1beta1/statefulset.go @@ -256,3 +256,9 @@ func (b *StatefulSetApplyConfiguration) WithStatus(value *StatefulSetStatusApply b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *StatefulSetApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/apps/v1beta2/controllerrevision.go b/applyconfigurations/apps/v1beta2/controllerrevision.go index 4abab6851c..7b236f7e04 100644 --- a/applyconfigurations/apps/v1beta2/controllerrevision.go +++ b/applyconfigurations/apps/v1beta2/controllerrevision.go @@ -257,3 +257,9 @@ func (b *ControllerRevisionApplyConfiguration) WithRevision(value int64) *Contro b.Revision = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ControllerRevisionApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/apps/v1beta2/daemonset.go b/applyconfigurations/apps/v1beta2/daemonset.go index 906a8ca46e..0969bcf65b 100644 --- a/applyconfigurations/apps/v1beta2/daemonset.go +++ b/applyconfigurations/apps/v1beta2/daemonset.go @@ -256,3 +256,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/applyconfigurations/apps/v1beta2/deployment.go b/applyconfigurations/apps/v1beta2/deployment.go index 7e39e67510..38bec8043a 100644 --- a/applyconfigurations/apps/v1beta2/deployment.go +++ b/applyconfigurations/apps/v1beta2/deployment.go @@ -256,3 +256,9 @@ func (b *DeploymentApplyConfiguration) WithStatus(value *DeploymentStatusApplyCo b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *DeploymentApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/apps/v1beta2/replicaset.go b/applyconfigurations/apps/v1beta2/replicaset.go index d9303e1b22..d9b02afaac 100644 --- a/applyconfigurations/apps/v1beta2/replicaset.go +++ b/applyconfigurations/apps/v1beta2/replicaset.go @@ -256,3 +256,9 @@ func (b *ReplicaSetApplyConfiguration) WithStatus(value *ReplicaSetStatusApplyCo b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ReplicaSetApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/apps/v1beta2/scale.go b/applyconfigurations/apps/v1beta2/scale.go index 0e89668cb3..d84db27e80 100644 --- a/applyconfigurations/apps/v1beta2/scale.go +++ b/applyconfigurations/apps/v1beta2/scale.go @@ -216,3 +216,9 @@ func (b *ScaleApplyConfiguration) WithStatus(value v1beta2.ScaleStatus) *ScaleAp b.Status = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ScaleApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/apps/v1beta2/statefulset.go b/applyconfigurations/apps/v1beta2/statefulset.go index 03d5428b4b..848dfb9751 100644 --- a/applyconfigurations/apps/v1beta2/statefulset.go +++ b/applyconfigurations/apps/v1beta2/statefulset.go @@ -256,3 +256,9 @@ func (b *StatefulSetApplyConfiguration) WithStatus(value *StatefulSetStatusApply b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *StatefulSetApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/autoscaling/v1/horizontalpodautoscaler.go b/applyconfigurations/autoscaling/v1/horizontalpodautoscaler.go index 38fa205841..fbf844e3dd 100644 --- a/applyconfigurations/autoscaling/v1/horizontalpodautoscaler.go +++ b/applyconfigurations/autoscaling/v1/horizontalpodautoscaler.go @@ -256,3 +256,9 @@ func (b *HorizontalPodAutoscalerApplyConfiguration) WithStatus(value *Horizontal b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *HorizontalPodAutoscalerApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/autoscaling/v1/scale.go b/applyconfigurations/autoscaling/v1/scale.go index f770922803..e3266be563 100644 --- a/applyconfigurations/autoscaling/v1/scale.go +++ b/applyconfigurations/autoscaling/v1/scale.go @@ -215,3 +215,9 @@ func (b *ScaleApplyConfiguration) WithStatus(value *ScaleStatusApplyConfiguratio b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ScaleApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/autoscaling/v2/horizontalpodautoscaler.go b/applyconfigurations/autoscaling/v2/horizontalpodautoscaler.go index 31061de85e..c3de7ecf8f 100644 --- a/applyconfigurations/autoscaling/v2/horizontalpodautoscaler.go +++ b/applyconfigurations/autoscaling/v2/horizontalpodautoscaler.go @@ -256,3 +256,9 @@ func (b *HorizontalPodAutoscalerApplyConfiguration) WithStatus(value *Horizontal b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *HorizontalPodAutoscalerApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscaler.go b/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscaler.go index 66b8d5f738..ce63233ded 100644 --- a/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscaler.go +++ b/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscaler.go @@ -256,3 +256,9 @@ func (b *HorizontalPodAutoscalerApplyConfiguration) WithStatus(value *Horizontal b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *HorizontalPodAutoscalerApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscaler.go b/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscaler.go index 1c750cb164..2e7a0a474b 100644 --- a/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscaler.go +++ b/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscaler.go @@ -256,3 +256,9 @@ func (b *HorizontalPodAutoscalerApplyConfiguration) WithStatus(value *Horizontal b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *HorizontalPodAutoscalerApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/batch/v1/cronjob.go b/applyconfigurations/batch/v1/cronjob.go index 5225a5a079..4162e67bc4 100644 --- a/applyconfigurations/batch/v1/cronjob.go +++ b/applyconfigurations/batch/v1/cronjob.go @@ -256,3 +256,9 @@ func (b *CronJobApplyConfiguration) WithStatus(value *CronJobStatusApplyConfigur b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *CronJobApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/batch/v1/job.go b/applyconfigurations/batch/v1/job.go index fb10ba3968..1ef2136f37 100644 --- a/applyconfigurations/batch/v1/job.go +++ b/applyconfigurations/batch/v1/job.go @@ -256,3 +256,9 @@ func (b *JobApplyConfiguration) WithStatus(value *JobStatusApplyConfiguration) * b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *JobApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/batch/v1/jobtemplatespec.go b/applyconfigurations/batch/v1/jobtemplatespec.go index b37a815680..5ed6e5a92e 100644 --- a/applyconfigurations/batch/v1/jobtemplatespec.go +++ b/applyconfigurations/batch/v1/jobtemplatespec.go @@ -186,3 +186,9 @@ func (b *JobTemplateSpecApplyConfiguration) WithSpec(value *JobSpecApplyConfigur b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *JobTemplateSpecApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/batch/v1beta1/cronjob.go b/applyconfigurations/batch/v1beta1/cronjob.go index 1d735a8407..3b20cf12cd 100644 --- a/applyconfigurations/batch/v1beta1/cronjob.go +++ b/applyconfigurations/batch/v1beta1/cronjob.go @@ -256,3 +256,9 @@ func (b *CronJobApplyConfiguration) WithStatus(value *CronJobStatusApplyConfigur b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *CronJobApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/batch/v1beta1/jobtemplatespec.go b/applyconfigurations/batch/v1beta1/jobtemplatespec.go index f925d65a7e..d3f7bc51fe 100644 --- a/applyconfigurations/batch/v1beta1/jobtemplatespec.go +++ b/applyconfigurations/batch/v1beta1/jobtemplatespec.go @@ -187,3 +187,9 @@ func (b *JobTemplateSpecApplyConfiguration) WithSpec(value *batchv1.JobSpecApply b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *JobTemplateSpecApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/certificates/v1/certificatesigningrequest.go b/applyconfigurations/certificates/v1/certificatesigningrequest.go index 3d02c0be80..7cd68f0e29 100644 --- a/applyconfigurations/certificates/v1/certificatesigningrequest.go +++ b/applyconfigurations/certificates/v1/certificatesigningrequest.go @@ -254,3 +254,9 @@ func (b *CertificateSigningRequestApplyConfiguration) WithStatus(value *Certific b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *CertificateSigningRequestApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/certificates/v1alpha1/clustertrustbundle.go b/applyconfigurations/certificates/v1alpha1/clustertrustbundle.go index 788d2a07dc..42816e5524 100644 --- a/applyconfigurations/certificates/v1alpha1/clustertrustbundle.go +++ b/applyconfigurations/certificates/v1alpha1/clustertrustbundle.go @@ -245,3 +245,9 @@ func (b *ClusterTrustBundleApplyConfiguration) WithSpec(value *ClusterTrustBundl b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ClusterTrustBundleApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/certificates/v1beta1/certificatesigningrequest.go b/applyconfigurations/certificates/v1beta1/certificatesigningrequest.go index 83a0edc18f..9913c8b1d3 100644 --- a/applyconfigurations/certificates/v1beta1/certificatesigningrequest.go +++ b/applyconfigurations/certificates/v1beta1/certificatesigningrequest.go @@ -254,3 +254,9 @@ func (b *CertificateSigningRequestApplyConfiguration) WithStatus(value *Certific b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *CertificateSigningRequestApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/coordination/v1/lease.go b/applyconfigurations/coordination/v1/lease.go index 618f12fb21..11543f09a9 100644 --- a/applyconfigurations/coordination/v1/lease.go +++ b/applyconfigurations/coordination/v1/lease.go @@ -247,3 +247,9 @@ func (b *LeaseApplyConfiguration) WithSpec(value *LeaseSpecApplyConfiguration) * b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *LeaseApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/coordination/v1beta1/lease.go b/applyconfigurations/coordination/v1beta1/lease.go index 867e0f58ba..46fd39c5f2 100644 --- a/applyconfigurations/coordination/v1beta1/lease.go +++ b/applyconfigurations/coordination/v1beta1/lease.go @@ -247,3 +247,9 @@ func (b *LeaseApplyConfiguration) WithSpec(value *LeaseSpecApplyConfiguration) * b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *LeaseApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/core/v1/componentstatus.go b/applyconfigurations/core/v1/componentstatus.go index 300e526942..e5526366c9 100644 --- a/applyconfigurations/core/v1/componentstatus.go +++ b/applyconfigurations/core/v1/componentstatus.go @@ -250,3 +250,9 @@ func (b *ComponentStatusApplyConfiguration) WithConditions(values ...*ComponentC } return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ComponentStatusApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/core/v1/configmap.go b/applyconfigurations/core/v1/configmap.go index f4cc7024d2..64e421d32e 100644 --- a/applyconfigurations/core/v1/configmap.go +++ b/applyconfigurations/core/v1/configmap.go @@ -277,3 +277,9 @@ func (b *ConfigMapApplyConfiguration) WithBinaryData(entries map[string][]byte) } return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ConfigMapApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/core/v1/endpoints.go b/applyconfigurations/core/v1/endpoints.go index b98fed0858..5185b5ac80 100644 --- a/applyconfigurations/core/v1/endpoints.go +++ b/applyconfigurations/core/v1/endpoints.go @@ -252,3 +252,9 @@ func (b *EndpointsApplyConfiguration) WithSubsets(values ...*EndpointSubsetApply } return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *EndpointsApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/core/v1/event.go b/applyconfigurations/core/v1/event.go index 60aff6b5b2..d35f0ae510 100644 --- a/applyconfigurations/core/v1/event.go +++ b/applyconfigurations/core/v1/event.go @@ -364,3 +364,9 @@ func (b *EventApplyConfiguration) WithReportingInstance(value string) *EventAppl b.ReportingInstance = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *EventApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/core/v1/limitrange.go b/applyconfigurations/core/v1/limitrange.go index eaf635c76a..70362d3e96 100644 --- a/applyconfigurations/core/v1/limitrange.go +++ b/applyconfigurations/core/v1/limitrange.go @@ -247,3 +247,9 @@ func (b *LimitRangeApplyConfiguration) WithSpec(value *LimitRangeSpecApplyConfig b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *LimitRangeApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/core/v1/namespace.go b/applyconfigurations/core/v1/namespace.go index bdc9ef167c..ca3701a081 100644 --- a/applyconfigurations/core/v1/namespace.go +++ b/applyconfigurations/core/v1/namespace.go @@ -254,3 +254,9 @@ func (b *NamespaceApplyConfiguration) WithStatus(value *NamespaceStatusApplyConf b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *NamespaceApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/core/v1/node.go b/applyconfigurations/core/v1/node.go index 047f4ac1cb..59109da0dd 100644 --- a/applyconfigurations/core/v1/node.go +++ b/applyconfigurations/core/v1/node.go @@ -254,3 +254,9 @@ func (b *NodeApplyConfiguration) WithStatus(value *NodeStatusApplyConfiguration) 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/applyconfigurations/core/v1/persistentvolume.go b/applyconfigurations/core/v1/persistentvolume.go index 2599c197e8..8cd01390b1 100644 --- a/applyconfigurations/core/v1/persistentvolume.go +++ b/applyconfigurations/core/v1/persistentvolume.go @@ -254,3 +254,9 @@ func (b *PersistentVolumeApplyConfiguration) WithStatus(value *PersistentVolumeS b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PersistentVolumeApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/core/v1/persistentvolumeclaim.go b/applyconfigurations/core/v1/persistentvolumeclaim.go index a0a0017018..b19ada16c7 100644 --- a/applyconfigurations/core/v1/persistentvolumeclaim.go +++ b/applyconfigurations/core/v1/persistentvolumeclaim.go @@ -256,3 +256,9 @@ func (b *PersistentVolumeClaimApplyConfiguration) WithStatus(value *PersistentVo b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PersistentVolumeClaimApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/core/v1/persistentvolumeclaimtemplate.go b/applyconfigurations/core/v1/persistentvolumeclaimtemplate.go index 894d04f0b4..a616c4d40c 100644 --- a/applyconfigurations/core/v1/persistentvolumeclaimtemplate.go +++ b/applyconfigurations/core/v1/persistentvolumeclaimtemplate.go @@ -186,3 +186,9 @@ func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithSpec(value *Persis b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PersistentVolumeClaimTemplateApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/core/v1/pod.go b/applyconfigurations/core/v1/pod.go index 7210bd9836..ef8b540dd2 100644 --- a/applyconfigurations/core/v1/pod.go +++ b/applyconfigurations/core/v1/pod.go @@ -256,3 +256,9 @@ func (b *PodApplyConfiguration) WithStatus(value *PodStatusApplyConfiguration) * b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PodApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/core/v1/podtemplate.go b/applyconfigurations/core/v1/podtemplate.go index 7fe51d9e1b..826f71b12d 100644 --- a/applyconfigurations/core/v1/podtemplate.go +++ b/applyconfigurations/core/v1/podtemplate.go @@ -247,3 +247,9 @@ func (b *PodTemplateApplyConfiguration) WithTemplate(value *PodTemplateSpecApply b.Template = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PodTemplateApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/core/v1/podtemplatespec.go b/applyconfigurations/core/v1/podtemplatespec.go index 82878a9ace..05e89ec66a 100644 --- a/applyconfigurations/core/v1/podtemplatespec.go +++ b/applyconfigurations/core/v1/podtemplatespec.go @@ -186,3 +186,9 @@ func (b *PodTemplateSpecApplyConfiguration) WithSpec(value *PodSpecApplyConfigur b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PodTemplateSpecApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/core/v1/replicationcontroller.go b/applyconfigurations/core/v1/replicationcontroller.go index 7cd71460a9..aa4ae9a904 100644 --- a/applyconfigurations/core/v1/replicationcontroller.go +++ b/applyconfigurations/core/v1/replicationcontroller.go @@ -256,3 +256,9 @@ func (b *ReplicationControllerApplyConfiguration) WithStatus(value *ReplicationC b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ReplicationControllerApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/core/v1/resourcequota.go b/applyconfigurations/core/v1/resourcequota.go index 6b22ebdc59..fd304166d4 100644 --- a/applyconfigurations/core/v1/resourcequota.go +++ b/applyconfigurations/core/v1/resourcequota.go @@ -256,3 +256,9 @@ func (b *ResourceQuotaApplyConfiguration) WithStatus(value *ResourceQuotaStatusA b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ResourceQuotaApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/core/v1/secret.go b/applyconfigurations/core/v1/secret.go index 3f7e1eb039..d62ca0697f 100644 --- a/applyconfigurations/core/v1/secret.go +++ b/applyconfigurations/core/v1/secret.go @@ -286,3 +286,9 @@ func (b *SecretApplyConfiguration) WithType(value corev1.SecretType) *SecretAppl b.Type = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *SecretApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/core/v1/service.go b/applyconfigurations/core/v1/service.go index 3fa1195237..541aa3d50e 100644 --- a/applyconfigurations/core/v1/service.go +++ b/applyconfigurations/core/v1/service.go @@ -256,3 +256,9 @@ func (b *ServiceApplyConfiguration) WithStatus(value *ServiceStatusApplyConfigur b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ServiceApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/core/v1/serviceaccount.go b/applyconfigurations/core/v1/serviceaccount.go index 53a8193750..a413b38c2c 100644 --- a/applyconfigurations/core/v1/serviceaccount.go +++ b/applyconfigurations/core/v1/serviceaccount.go @@ -275,3 +275,9 @@ func (b *ServiceAccountApplyConfiguration) WithAutomountServiceAccountToken(valu b.AutomountServiceAccountToken = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ServiceAccountApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/discovery/v1/endpointslice.go b/applyconfigurations/discovery/v1/endpointslice.go index 640613753d..96c10dc5b9 100644 --- a/applyconfigurations/discovery/v1/endpointslice.go +++ b/applyconfigurations/discovery/v1/endpointslice.go @@ -275,3 +275,9 @@ func (b *EndpointSliceApplyConfiguration) WithPorts(values ...*EndpointPortApply } return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *EndpointSliceApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/discovery/v1beta1/endpointslice.go b/applyconfigurations/discovery/v1beta1/endpointslice.go index 74a24773cc..75d1b8b28c 100644 --- a/applyconfigurations/discovery/v1beta1/endpointslice.go +++ b/applyconfigurations/discovery/v1beta1/endpointslice.go @@ -275,3 +275,9 @@ func (b *EndpointSliceApplyConfiguration) WithPorts(values ...*EndpointPortApply } return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *EndpointSliceApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/events/v1/event.go b/applyconfigurations/events/v1/event.go index 767e3dfc73..2c6b8addff 100644 --- a/applyconfigurations/events/v1/event.go +++ b/applyconfigurations/events/v1/event.go @@ -365,3 +365,9 @@ func (b *EventApplyConfiguration) WithDeprecatedCount(value int32) *EventApplyCo b.DeprecatedCount = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *EventApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/events/v1beta1/event.go b/applyconfigurations/events/v1beta1/event.go index cfc4a851f3..12fd53898c 100644 --- a/applyconfigurations/events/v1beta1/event.go +++ b/applyconfigurations/events/v1beta1/event.go @@ -365,3 +365,9 @@ func (b *EventApplyConfiguration) WithDeprecatedCount(value int32) *EventApplyCo b.DeprecatedCount = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *EventApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/extensions/v1beta1/daemonset.go b/applyconfigurations/extensions/v1beta1/daemonset.go index eae399d323..7efbff07fb 100644 --- a/applyconfigurations/extensions/v1beta1/daemonset.go +++ b/applyconfigurations/extensions/v1beta1/daemonset.go @@ -256,3 +256,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/applyconfigurations/extensions/v1beta1/deployment.go b/applyconfigurations/extensions/v1beta1/deployment.go index 878083f821..d16ebed903 100644 --- a/applyconfigurations/extensions/v1beta1/deployment.go +++ b/applyconfigurations/extensions/v1beta1/deployment.go @@ -256,3 +256,9 @@ func (b *DeploymentApplyConfiguration) WithStatus(value *DeploymentStatusApplyCo b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *DeploymentApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/extensions/v1beta1/ingress.go b/applyconfigurations/extensions/v1beta1/ingress.go index 46c541048d..26b42c0490 100644 --- a/applyconfigurations/extensions/v1beta1/ingress.go +++ b/applyconfigurations/extensions/v1beta1/ingress.go @@ -256,3 +256,9 @@ func (b *IngressApplyConfiguration) WithStatus(value *IngressStatusApplyConfigur b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *IngressApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/extensions/v1beta1/networkpolicy.go b/applyconfigurations/extensions/v1beta1/networkpolicy.go index 27ea5d9dde..9f5869e464 100644 --- a/applyconfigurations/extensions/v1beta1/networkpolicy.go +++ b/applyconfigurations/extensions/v1beta1/networkpolicy.go @@ -247,3 +247,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/applyconfigurations/extensions/v1beta1/replicaset.go b/applyconfigurations/extensions/v1beta1/replicaset.go index b2afc835d8..391e91031b 100644 --- a/applyconfigurations/extensions/v1beta1/replicaset.go +++ b/applyconfigurations/extensions/v1beta1/replicaset.go @@ -256,3 +256,9 @@ func (b *ReplicaSetApplyConfiguration) WithStatus(value *ReplicaSetStatusApplyCo b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ReplicaSetApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/extensions/v1beta1/scale.go b/applyconfigurations/extensions/v1beta1/scale.go index 60a1a8430c..2a2065728f 100644 --- a/applyconfigurations/extensions/v1beta1/scale.go +++ b/applyconfigurations/extensions/v1beta1/scale.go @@ -216,3 +216,9 @@ func (b *ScaleApplyConfiguration) WithStatus(value v1beta1.ScaleStatus) *ScaleAp b.Status = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ScaleApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/flowcontrol/v1/flowschema.go b/applyconfigurations/flowcontrol/v1/flowschema.go index 8809fafbae..2faaa1e330 100644 --- a/applyconfigurations/flowcontrol/v1/flowschema.go +++ b/applyconfigurations/flowcontrol/v1/flowschema.go @@ -254,3 +254,9 @@ func (b *FlowSchemaApplyConfiguration) WithStatus(value *FlowSchemaStatusApplyCo b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *FlowSchemaApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/flowcontrol/v1/prioritylevelconfiguration.go b/applyconfigurations/flowcontrol/v1/prioritylevelconfiguration.go index e8a1b97c9f..32ca469050 100644 --- a/applyconfigurations/flowcontrol/v1/prioritylevelconfiguration.go +++ b/applyconfigurations/flowcontrol/v1/prioritylevelconfiguration.go @@ -254,3 +254,9 @@ func (b *PriorityLevelConfigurationApplyConfiguration) WithStatus(value *Priorit b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PriorityLevelConfigurationApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/flowcontrol/v1beta1/flowschema.go b/applyconfigurations/flowcontrol/v1beta1/flowschema.go index f44313f54e..bacc2fc033 100644 --- a/applyconfigurations/flowcontrol/v1beta1/flowschema.go +++ b/applyconfigurations/flowcontrol/v1beta1/flowschema.go @@ -254,3 +254,9 @@ func (b *FlowSchemaApplyConfiguration) WithStatus(value *FlowSchemaStatusApplyCo b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *FlowSchemaApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfiguration.go b/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfiguration.go index 84324dbfdc..018758f0b9 100644 --- a/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfiguration.go +++ b/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfiguration.go @@ -254,3 +254,9 @@ func (b *PriorityLevelConfigurationApplyConfiguration) WithStatus(value *Priorit b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PriorityLevelConfigurationApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/flowcontrol/v1beta2/flowschema.go b/applyconfigurations/flowcontrol/v1beta2/flowschema.go index 63a5f0aa30..9b0d20ad29 100644 --- a/applyconfigurations/flowcontrol/v1beta2/flowschema.go +++ b/applyconfigurations/flowcontrol/v1beta2/flowschema.go @@ -254,3 +254,9 @@ func (b *FlowSchemaApplyConfiguration) WithStatus(value *FlowSchemaStatusApplyCo b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *FlowSchemaApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfiguration.go b/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfiguration.go index 3256b36300..7589d9ebe4 100644 --- a/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfiguration.go +++ b/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfiguration.go @@ -254,3 +254,9 @@ func (b *PriorityLevelConfigurationApplyConfiguration) WithStatus(value *Priorit b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PriorityLevelConfigurationApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/flowcontrol/v1beta3/flowschema.go b/applyconfigurations/flowcontrol/v1beta3/flowschema.go index c95635360e..0523d2140c 100644 --- a/applyconfigurations/flowcontrol/v1beta3/flowschema.go +++ b/applyconfigurations/flowcontrol/v1beta3/flowschema.go @@ -254,3 +254,9 @@ func (b *FlowSchemaApplyConfiguration) WithStatus(value *FlowSchemaStatusApplyCo b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *FlowSchemaApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfiguration.go b/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfiguration.go index 6fbbbea8fe..b21e438518 100644 --- a/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfiguration.go +++ b/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfiguration.go @@ -254,3 +254,9 @@ func (b *PriorityLevelConfigurationApplyConfiguration) WithStatus(value *Priorit b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PriorityLevelConfigurationApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/imagepolicy/v1alpha1/imagereview.go b/applyconfigurations/imagepolicy/v1alpha1/imagereview.go index a25558cc89..caff2c192e 100644 --- a/applyconfigurations/imagepolicy/v1alpha1/imagereview.go +++ b/applyconfigurations/imagepolicy/v1alpha1/imagereview.go @@ -254,3 +254,9 @@ func (b *ImageReviewApplyConfiguration) WithStatus(value *ImageReviewStatusApply b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ImageReviewApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/meta/v1/objectmeta.go b/applyconfigurations/meta/v1/objectmeta.go index 9b290e9680..1cc948f682 100644 --- a/applyconfigurations/meta/v1/objectmeta.go +++ b/applyconfigurations/meta/v1/objectmeta.go @@ -169,3 +169,8 @@ func (b *ObjectMetaApplyConfiguration) WithFinalizers(values ...string) *ObjectM } return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ObjectMetaApplyConfiguration) GetName() *string { + return b.Name +} diff --git a/applyconfigurations/networking/v1/ingress.go b/applyconfigurations/networking/v1/ingress.go index b5146902d4..b08d3e6f7b 100644 --- a/applyconfigurations/networking/v1/ingress.go +++ b/applyconfigurations/networking/v1/ingress.go @@ -256,3 +256,9 @@ func (b *IngressApplyConfiguration) WithStatus(value *IngressStatusApplyConfigur b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *IngressApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/networking/v1/ingressclass.go b/applyconfigurations/networking/v1/ingressclass.go index e33d0b2d9f..0013f8cb38 100644 --- a/applyconfigurations/networking/v1/ingressclass.go +++ b/applyconfigurations/networking/v1/ingressclass.go @@ -245,3 +245,9 @@ func (b *IngressClassApplyConfiguration) WithSpec(value *IngressClassSpecApplyCo b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *IngressClassApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/networking/v1/networkpolicy.go b/applyconfigurations/networking/v1/networkpolicy.go index 409507310b..3387ab07d1 100644 --- a/applyconfigurations/networking/v1/networkpolicy.go +++ b/applyconfigurations/networking/v1/networkpolicy.go @@ -247,3 +247,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/applyconfigurations/networking/v1alpha1/ipaddress.go b/applyconfigurations/networking/v1alpha1/ipaddress.go index da6822111d..36ccd06bcb 100644 --- a/applyconfigurations/networking/v1alpha1/ipaddress.go +++ b/applyconfigurations/networking/v1alpha1/ipaddress.go @@ -245,3 +245,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/applyconfigurations/networking/v1alpha1/servicecidr.go b/applyconfigurations/networking/v1alpha1/servicecidr.go index f6d0a91e00..e3762aaa52 100644 --- a/applyconfigurations/networking/v1alpha1/servicecidr.go +++ b/applyconfigurations/networking/v1alpha1/servicecidr.go @@ -254,3 +254,9 @@ func (b *ServiceCIDRApplyConfiguration) WithStatus(value *ServiceCIDRStatusApply b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ServiceCIDRApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/networking/v1beta1/ingress.go b/applyconfigurations/networking/v1beta1/ingress.go index 56f65c30a9..2435c8531b 100644 --- a/applyconfigurations/networking/v1beta1/ingress.go +++ b/applyconfigurations/networking/v1beta1/ingress.go @@ -256,3 +256,9 @@ func (b *IngressApplyConfiguration) WithStatus(value *IngressStatusApplyConfigur b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *IngressApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/networking/v1beta1/ingressclass.go b/applyconfigurations/networking/v1beta1/ingressclass.go index b65d4b3073..6098280d45 100644 --- a/applyconfigurations/networking/v1beta1/ingressclass.go +++ b/applyconfigurations/networking/v1beta1/ingressclass.go @@ -245,3 +245,9 @@ func (b *IngressClassApplyConfiguration) WithSpec(value *IngressClassSpecApplyCo b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *IngressClassApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/node/v1/runtimeclass.go b/applyconfigurations/node/v1/runtimeclass.go index 3c9d1fc467..0db2598fd2 100644 --- a/applyconfigurations/node/v1/runtimeclass.go +++ b/applyconfigurations/node/v1/runtimeclass.go @@ -263,3 +263,9 @@ func (b *RuntimeClassApplyConfiguration) WithScheduling(value *SchedulingApplyCo b.Scheduling = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *RuntimeClassApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/node/v1alpha1/runtimeclass.go b/applyconfigurations/node/v1alpha1/runtimeclass.go index e680e12deb..f49d1a08cc 100644 --- a/applyconfigurations/node/v1alpha1/runtimeclass.go +++ b/applyconfigurations/node/v1alpha1/runtimeclass.go @@ -245,3 +245,9 @@ func (b *RuntimeClassApplyConfiguration) WithSpec(value *RuntimeClassSpecApplyCo b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *RuntimeClassApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/node/v1beta1/runtimeclass.go b/applyconfigurations/node/v1beta1/runtimeclass.go index f5487665c3..a291b264be 100644 --- a/applyconfigurations/node/v1beta1/runtimeclass.go +++ b/applyconfigurations/node/v1beta1/runtimeclass.go @@ -263,3 +263,9 @@ func (b *RuntimeClassApplyConfiguration) WithScheduling(value *SchedulingApplyCo b.Scheduling = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *RuntimeClassApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/policy/v1/eviction.go b/applyconfigurations/policy/v1/eviction.go index 76a9533a6f..c9660c1f7f 100644 --- a/applyconfigurations/policy/v1/eviction.go +++ b/applyconfigurations/policy/v1/eviction.go @@ -247,3 +247,9 @@ func (b *EvictionApplyConfiguration) WithDeleteOptions(value *v1.DeleteOptionsAp b.DeleteOptions = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *EvictionApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/policy/v1/poddisruptionbudget.go b/applyconfigurations/policy/v1/poddisruptionbudget.go index 6b547c2695..8896c2c3d2 100644 --- a/applyconfigurations/policy/v1/poddisruptionbudget.go +++ b/applyconfigurations/policy/v1/poddisruptionbudget.go @@ -256,3 +256,9 @@ func (b *PodDisruptionBudgetApplyConfiguration) WithStatus(value *PodDisruptionB b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PodDisruptionBudgetApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/policy/v1beta1/eviction.go b/applyconfigurations/policy/v1beta1/eviction.go index d2a361d1b5..640167ccc5 100644 --- a/applyconfigurations/policy/v1beta1/eviction.go +++ b/applyconfigurations/policy/v1beta1/eviction.go @@ -247,3 +247,9 @@ func (b *EvictionApplyConfiguration) WithDeleteOptions(value *v1.DeleteOptionsAp b.DeleteOptions = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *EvictionApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/policy/v1beta1/poddisruptionbudget.go b/applyconfigurations/policy/v1beta1/poddisruptionbudget.go index cef51a279c..7372cc6b50 100644 --- a/applyconfigurations/policy/v1beta1/poddisruptionbudget.go +++ b/applyconfigurations/policy/v1beta1/poddisruptionbudget.go @@ -256,3 +256,9 @@ func (b *PodDisruptionBudgetApplyConfiguration) WithStatus(value *PodDisruptionB b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PodDisruptionBudgetApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/rbac/v1/clusterrole.go b/applyconfigurations/rbac/v1/clusterrole.go index 3a5660fe19..04535e4b23 100644 --- a/applyconfigurations/rbac/v1/clusterrole.go +++ b/applyconfigurations/rbac/v1/clusterrole.go @@ -259,3 +259,9 @@ func (b *ClusterRoleApplyConfiguration) WithAggregationRule(value *AggregationRu b.AggregationRule = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ClusterRoleApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/rbac/v1/clusterrolebinding.go b/applyconfigurations/rbac/v1/clusterrolebinding.go index 625ad72c44..81379a8555 100644 --- a/applyconfigurations/rbac/v1/clusterrolebinding.go +++ b/applyconfigurations/rbac/v1/clusterrolebinding.go @@ -259,3 +259,9 @@ func (b *ClusterRoleBindingApplyConfiguration) WithRoleRef(value *RoleRefApplyCo b.RoleRef = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ClusterRoleBindingApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/rbac/v1/role.go b/applyconfigurations/rbac/v1/role.go index 97df25fb65..3c8dd3c977 100644 --- a/applyconfigurations/rbac/v1/role.go +++ b/applyconfigurations/rbac/v1/role.go @@ -252,3 +252,9 @@ func (b *RoleApplyConfiguration) WithRules(values ...*PolicyRuleApplyConfigurati } return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *RoleApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/rbac/v1/rolebinding.go b/applyconfigurations/rbac/v1/rolebinding.go index 7270f07e49..2d9176cc81 100644 --- a/applyconfigurations/rbac/v1/rolebinding.go +++ b/applyconfigurations/rbac/v1/rolebinding.go @@ -261,3 +261,9 @@ func (b *RoleBindingApplyConfiguration) WithRoleRef(value *RoleRefApplyConfigura b.RoleRef = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *RoleBindingApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/rbac/v1alpha1/clusterrole.go b/applyconfigurations/rbac/v1alpha1/clusterrole.go index 19b1180fad..eeb954466e 100644 --- a/applyconfigurations/rbac/v1alpha1/clusterrole.go +++ b/applyconfigurations/rbac/v1alpha1/clusterrole.go @@ -259,3 +259,9 @@ func (b *ClusterRoleApplyConfiguration) WithAggregationRule(value *AggregationRu b.AggregationRule = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ClusterRoleApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/rbac/v1alpha1/clusterrolebinding.go b/applyconfigurations/rbac/v1alpha1/clusterrolebinding.go index a1723efc35..aa0b66073f 100644 --- a/applyconfigurations/rbac/v1alpha1/clusterrolebinding.go +++ b/applyconfigurations/rbac/v1alpha1/clusterrolebinding.go @@ -259,3 +259,9 @@ func (b *ClusterRoleBindingApplyConfiguration) WithRoleRef(value *RoleRefApplyCo b.RoleRef = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ClusterRoleBindingApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/rbac/v1alpha1/role.go b/applyconfigurations/rbac/v1alpha1/role.go index cd256397a2..8080a43a0d 100644 --- a/applyconfigurations/rbac/v1alpha1/role.go +++ b/applyconfigurations/rbac/v1alpha1/role.go @@ -252,3 +252,9 @@ func (b *RoleApplyConfiguration) WithRules(values ...*PolicyRuleApplyConfigurati } return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *RoleApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/rbac/v1alpha1/rolebinding.go b/applyconfigurations/rbac/v1alpha1/rolebinding.go index a0ec20d0b1..740a8f5bb2 100644 --- a/applyconfigurations/rbac/v1alpha1/rolebinding.go +++ b/applyconfigurations/rbac/v1alpha1/rolebinding.go @@ -261,3 +261,9 @@ func (b *RoleBindingApplyConfiguration) WithRoleRef(value *RoleRefApplyConfigura b.RoleRef = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *RoleBindingApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/rbac/v1beta1/clusterrole.go b/applyconfigurations/rbac/v1beta1/clusterrole.go index cf714ecc27..9a5fb58e10 100644 --- a/applyconfigurations/rbac/v1beta1/clusterrole.go +++ b/applyconfigurations/rbac/v1beta1/clusterrole.go @@ -259,3 +259,9 @@ func (b *ClusterRoleApplyConfiguration) WithAggregationRule(value *AggregationRu b.AggregationRule = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ClusterRoleApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/rbac/v1beta1/clusterrolebinding.go b/applyconfigurations/rbac/v1beta1/clusterrolebinding.go index b97cbcba2f..db14668502 100644 --- a/applyconfigurations/rbac/v1beta1/clusterrolebinding.go +++ b/applyconfigurations/rbac/v1beta1/clusterrolebinding.go @@ -259,3 +259,9 @@ func (b *ClusterRoleBindingApplyConfiguration) WithRoleRef(value *RoleRefApplyCo b.RoleRef = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ClusterRoleBindingApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/rbac/v1beta1/role.go b/applyconfigurations/rbac/v1beta1/role.go index 53a751eb34..1e322141b9 100644 --- a/applyconfigurations/rbac/v1beta1/role.go +++ b/applyconfigurations/rbac/v1beta1/role.go @@ -252,3 +252,9 @@ func (b *RoleApplyConfiguration) WithRules(values ...*PolicyRuleApplyConfigurati } return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *RoleApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/rbac/v1beta1/rolebinding.go b/applyconfigurations/rbac/v1beta1/rolebinding.go index ecccdf91b1..c5c4fb9cc4 100644 --- a/applyconfigurations/rbac/v1beta1/rolebinding.go +++ b/applyconfigurations/rbac/v1beta1/rolebinding.go @@ -261,3 +261,9 @@ func (b *RoleBindingApplyConfiguration) WithRoleRef(value *RoleRefApplyConfigura b.RoleRef = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *RoleBindingApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/resource/v1alpha2/podschedulingcontext.go b/applyconfigurations/resource/v1alpha2/podschedulingcontext.go index 1dfb6ff97b..05fcd42c76 100644 --- a/applyconfigurations/resource/v1alpha2/podschedulingcontext.go +++ b/applyconfigurations/resource/v1alpha2/podschedulingcontext.go @@ -256,3 +256,9 @@ func (b *PodSchedulingContextApplyConfiguration) WithStatus(value *PodScheduling b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PodSchedulingContextApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/resource/v1alpha2/resourceclaim.go b/applyconfigurations/resource/v1alpha2/resourceclaim.go index 6c219f837b..a076ed1101 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclaim.go +++ b/applyconfigurations/resource/v1alpha2/resourceclaim.go @@ -256,3 +256,9 @@ func (b *ResourceClaimApplyConfiguration) WithStatus(value *ResourceClaimStatusA b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ResourceClaimApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/resource/v1alpha2/resourceclaimparameters.go b/applyconfigurations/resource/v1alpha2/resourceclaimparameters.go index ea13570e33..61f8bac075 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclaimparameters.go +++ b/applyconfigurations/resource/v1alpha2/resourceclaimparameters.go @@ -270,3 +270,9 @@ func (b *ResourceClaimParametersApplyConfiguration) WithDriverRequests(values .. } return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ResourceClaimParametersApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/resource/v1alpha2/resourceclaimtemplate.go b/applyconfigurations/resource/v1alpha2/resourceclaimtemplate.go index fc2209b8f0..213b6cf01b 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclaimtemplate.go +++ b/applyconfigurations/resource/v1alpha2/resourceclaimtemplate.go @@ -247,3 +247,9 @@ func (b *ResourceClaimTemplateApplyConfiguration) WithSpec(value *ResourceClaimT b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ResourceClaimTemplateApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/resource/v1alpha2/resourceclaimtemplatespec.go b/applyconfigurations/resource/v1alpha2/resourceclaimtemplatespec.go index 2f38ea0366..90efefc203 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclaimtemplatespec.go +++ b/applyconfigurations/resource/v1alpha2/resourceclaimtemplatespec.go @@ -186,3 +186,9 @@ func (b *ResourceClaimTemplateSpecApplyConfiguration) WithSpec(value *ResourceCl b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ResourceClaimTemplateSpecApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/resource/v1alpha2/resourceclass.go b/applyconfigurations/resource/v1alpha2/resourceclass.go index 364fda9d00..7cab033c0f 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclass.go +++ b/applyconfigurations/resource/v1alpha2/resourceclass.go @@ -273,3 +273,9 @@ func (b *ResourceClassApplyConfiguration) WithStructuredParameters(value bool) * b.StructuredParameters = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ResourceClassApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/resource/v1alpha2/resourceclassparameters.go b/applyconfigurations/resource/v1alpha2/resourceclassparameters.go index 028d0d612d..2eda764343 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclassparameters.go +++ b/applyconfigurations/resource/v1alpha2/resourceclassparameters.go @@ -275,3 +275,9 @@ func (b *ResourceClassParametersApplyConfiguration) WithFilters(values ...*Resou } return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ResourceClassParametersApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/resource/v1alpha2/resourceslice.go b/applyconfigurations/resource/v1alpha2/resourceslice.go index ff737ce672..447afe2dfc 100644 --- a/applyconfigurations/resource/v1alpha2/resourceslice.go +++ b/applyconfigurations/resource/v1alpha2/resourceslice.go @@ -263,3 +263,9 @@ func (b *ResourceSliceApplyConfiguration) WithNamedResources(value *NamedResourc b.NamedResources = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ResourceSliceApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/scheduling/v1/priorityclass.go b/applyconfigurations/scheduling/v1/priorityclass.go index b57e8ba57d..62f144a4ff 100644 --- a/applyconfigurations/scheduling/v1/priorityclass.go +++ b/applyconfigurations/scheduling/v1/priorityclass.go @@ -273,3 +273,9 @@ func (b *PriorityClassApplyConfiguration) WithPreemptionPolicy(value corev1.Pree b.PreemptionPolicy = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PriorityClassApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/scheduling/v1alpha1/priorityclass.go b/applyconfigurations/scheduling/v1alpha1/priorityclass.go index 0cd09d5d1c..dbf207de93 100644 --- a/applyconfigurations/scheduling/v1alpha1/priorityclass.go +++ b/applyconfigurations/scheduling/v1alpha1/priorityclass.go @@ -273,3 +273,9 @@ func (b *PriorityClassApplyConfiguration) WithPreemptionPolicy(value corev1.Pree b.PreemptionPolicy = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PriorityClassApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/scheduling/v1beta1/priorityclass.go b/applyconfigurations/scheduling/v1beta1/priorityclass.go index 98cfb14c70..9696f44bf1 100644 --- a/applyconfigurations/scheduling/v1beta1/priorityclass.go +++ b/applyconfigurations/scheduling/v1beta1/priorityclass.go @@ -273,3 +273,9 @@ func (b *PriorityClassApplyConfiguration) WithPreemptionPolicy(value corev1.Pree b.PreemptionPolicy = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *PriorityClassApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/storage/v1/csidriver.go b/applyconfigurations/storage/v1/csidriver.go index aeead0861c..a00157a1dc 100644 --- a/applyconfigurations/storage/v1/csidriver.go +++ b/applyconfigurations/storage/v1/csidriver.go @@ -245,3 +245,9 @@ func (b *CSIDriverApplyConfiguration) WithSpec(value *CSIDriverSpecApplyConfigur b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *CSIDriverApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/storage/v1/csinode.go b/applyconfigurations/storage/v1/csinode.go index d8296e4856..22755e529d 100644 --- a/applyconfigurations/storage/v1/csinode.go +++ b/applyconfigurations/storage/v1/csinode.go @@ -245,3 +245,9 @@ func (b *CSINodeApplyConfiguration) WithSpec(value *CSINodeSpecApplyConfiguratio b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *CSINodeApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/storage/v1/csistoragecapacity.go b/applyconfigurations/storage/v1/csistoragecapacity.go index c47c6b8215..34ebcd796f 100644 --- a/applyconfigurations/storage/v1/csistoragecapacity.go +++ b/applyconfigurations/storage/v1/csistoragecapacity.go @@ -275,3 +275,9 @@ func (b *CSIStorageCapacityApplyConfiguration) WithMaximumVolumeSize(value resou b.MaximumVolumeSize = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *CSIStorageCapacityApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/storage/v1/storageclass.go b/applyconfigurations/storage/v1/storageclass.go index 98c4c22336..8c2abac2ea 100644 --- a/applyconfigurations/storage/v1/storageclass.go +++ b/applyconfigurations/storage/v1/storageclass.go @@ -314,3 +314,9 @@ func (b *StorageClassApplyConfiguration) WithAllowedTopologies(values ...*applyc } return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *StorageClassApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/storage/v1/volumeattachment.go b/applyconfigurations/storage/v1/volumeattachment.go index 4c74f09aa2..483cf595b4 100644 --- a/applyconfigurations/storage/v1/volumeattachment.go +++ b/applyconfigurations/storage/v1/volumeattachment.go @@ -254,3 +254,9 @@ func (b *VolumeAttachmentApplyConfiguration) WithStatus(value *VolumeAttachmentS b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *VolumeAttachmentApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/storage/v1alpha1/csistoragecapacity.go b/applyconfigurations/storage/v1alpha1/csistoragecapacity.go index 8b810fed10..6a28d857ac 100644 --- a/applyconfigurations/storage/v1alpha1/csistoragecapacity.go +++ b/applyconfigurations/storage/v1alpha1/csistoragecapacity.go @@ -275,3 +275,9 @@ func (b *CSIStorageCapacityApplyConfiguration) WithMaximumVolumeSize(value resou b.MaximumVolumeSize = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *CSIStorageCapacityApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/storage/v1alpha1/volumeattachment.go b/applyconfigurations/storage/v1alpha1/volumeattachment.go index bcefb5778a..770d1e166f 100644 --- a/applyconfigurations/storage/v1alpha1/volumeattachment.go +++ b/applyconfigurations/storage/v1alpha1/volumeattachment.go @@ -254,3 +254,9 @@ func (b *VolumeAttachmentApplyConfiguration) WithStatus(value *VolumeAttachmentS b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *VolumeAttachmentApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/storage/v1alpha1/volumeattributesclass.go b/applyconfigurations/storage/v1alpha1/volumeattributesclass.go index 9d4c476259..566bca3288 100644 --- a/applyconfigurations/storage/v1alpha1/volumeattributesclass.go +++ b/applyconfigurations/storage/v1alpha1/volumeattributesclass.go @@ -260,3 +260,9 @@ func (b *VolumeAttributesClassApplyConfiguration) WithParameters(entries map[str } return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *VolumeAttributesClassApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/storage/v1beta1/csidriver.go b/applyconfigurations/storage/v1beta1/csidriver.go index 4266f0b6e4..28393e8ed4 100644 --- a/applyconfigurations/storage/v1beta1/csidriver.go +++ b/applyconfigurations/storage/v1beta1/csidriver.go @@ -245,3 +245,9 @@ func (b *CSIDriverApplyConfiguration) WithSpec(value *CSIDriverSpecApplyConfigur b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *CSIDriverApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/storage/v1beta1/csinode.go b/applyconfigurations/storage/v1beta1/csinode.go index 91588fd9fb..fb9f85bea3 100644 --- a/applyconfigurations/storage/v1beta1/csinode.go +++ b/applyconfigurations/storage/v1beta1/csinode.go @@ -245,3 +245,9 @@ func (b *CSINodeApplyConfiguration) WithSpec(value *CSINodeSpecApplyConfiguratio b.Spec = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *CSINodeApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/storage/v1beta1/csistoragecapacity.go b/applyconfigurations/storage/v1beta1/csistoragecapacity.go index 2854a15da7..2e0c6f35c1 100644 --- a/applyconfigurations/storage/v1beta1/csistoragecapacity.go +++ b/applyconfigurations/storage/v1beta1/csistoragecapacity.go @@ -275,3 +275,9 @@ func (b *CSIStorageCapacityApplyConfiguration) WithMaximumVolumeSize(value resou b.MaximumVolumeSize = &value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *CSIStorageCapacityApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/storage/v1beta1/storageclass.go b/applyconfigurations/storage/v1beta1/storageclass.go index 02194f1080..1e727cc95f 100644 --- a/applyconfigurations/storage/v1beta1/storageclass.go +++ b/applyconfigurations/storage/v1beta1/storageclass.go @@ -314,3 +314,9 @@ func (b *StorageClassApplyConfiguration) WithAllowedTopologies(values ...*applyc } return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *StorageClassApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/storage/v1beta1/volumeattachment.go b/applyconfigurations/storage/v1beta1/volumeattachment.go index 9fccaf5cf9..ed44241bb4 100644 --- a/applyconfigurations/storage/v1beta1/volumeattachment.go +++ b/applyconfigurations/storage/v1beta1/volumeattachment.go @@ -254,3 +254,9 @@ func (b *VolumeAttachmentApplyConfiguration) WithStatus(value *VolumeAttachmentS b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *VolumeAttachmentApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/storagemigration/v1alpha1/storageversionmigration.go b/applyconfigurations/storagemigration/v1alpha1/storageversionmigration.go index cc57b2b126..b76769f5c5 100644 --- a/applyconfigurations/storagemigration/v1alpha1/storageversionmigration.go +++ b/applyconfigurations/storagemigration/v1alpha1/storageversionmigration.go @@ -254,3 +254,9 @@ func (b *StorageVersionMigrationApplyConfiguration) WithStatus(value *StorageVer b.Status = value return b } + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *StorageVersionMigrationApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} From 6a88f2da3876468e56e2469f550557d0331a5197 Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Mon, 27 May 2024 11:00:27 +0200 Subject: [PATCH 089/159] Run codegen Signed-off-by: Stephen Kitt Kubernetes-commit: c982ce1891eacd1bff135e9010df4fc17e3dbb23 --- .../admissionregistration/v1/auditannotation.go | 4 ++-- .../admissionregistration/v1/expressionwarning.go | 4 ++-- .../admissionregistration/v1/matchcondition.go | 4 ++-- .../admissionregistration/v1/matchresources.go | 4 ++-- .../admissionregistration/v1/mutatingwebhook.go | 4 ++-- .../admissionregistration/v1/mutatingwebhookconfiguration.go | 4 ++-- .../admissionregistration/v1/namedrulewithoperations.go | 4 ++-- applyconfigurations/admissionregistration/v1/paramkind.go | 4 ++-- applyconfigurations/admissionregistration/v1/paramref.go | 4 ++-- applyconfigurations/admissionregistration/v1/rule.go | 4 ++-- .../admissionregistration/v1/rulewithoperations.go | 4 ++-- .../admissionregistration/v1/servicereference.go | 4 ++-- applyconfigurations/admissionregistration/v1/typechecking.go | 4 ++-- .../admissionregistration/v1/validatingadmissionpolicy.go | 4 ++-- .../v1/validatingadmissionpolicybinding.go | 4 ++-- .../v1/validatingadmissionpolicybindingspec.go | 4 ++-- .../admissionregistration/v1/validatingadmissionpolicyspec.go | 4 ++-- .../v1/validatingadmissionpolicystatus.go | 4 ++-- .../admissionregistration/v1/validatingwebhook.go | 4 ++-- .../v1/validatingwebhookconfiguration.go | 4 ++-- applyconfigurations/admissionregistration/v1/validation.go | 4 ++-- applyconfigurations/admissionregistration/v1/variable.go | 4 ++-- .../admissionregistration/v1/webhookclientconfig.go | 4 ++-- .../admissionregistration/v1alpha1/auditannotation.go | 4 ++-- .../admissionregistration/v1alpha1/expressionwarning.go | 4 ++-- .../admissionregistration/v1alpha1/matchcondition.go | 4 ++-- .../admissionregistration/v1alpha1/matchresources.go | 4 ++-- .../admissionregistration/v1alpha1/namedrulewithoperations.go | 4 ++-- .../admissionregistration/v1alpha1/paramkind.go | 4 ++-- .../admissionregistration/v1alpha1/paramref.go | 4 ++-- .../admissionregistration/v1alpha1/typechecking.go | 4 ++-- .../v1alpha1/validatingadmissionpolicy.go | 4 ++-- .../v1alpha1/validatingadmissionpolicybinding.go | 4 ++-- .../v1alpha1/validatingadmissionpolicybindingspec.go | 4 ++-- .../v1alpha1/validatingadmissionpolicyspec.go | 4 ++-- .../v1alpha1/validatingadmissionpolicystatus.go | 4 ++-- .../admissionregistration/v1alpha1/validation.go | 4 ++-- .../admissionregistration/v1alpha1/variable.go | 4 ++-- .../admissionregistration/v1beta1/auditannotation.go | 4 ++-- .../admissionregistration/v1beta1/expressionwarning.go | 4 ++-- .../admissionregistration/v1beta1/matchcondition.go | 4 ++-- .../admissionregistration/v1beta1/matchresources.go | 4 ++-- .../admissionregistration/v1beta1/mutatingwebhook.go | 4 ++-- .../v1beta1/mutatingwebhookconfiguration.go | 4 ++-- .../admissionregistration/v1beta1/namedrulewithoperations.go | 4 ++-- .../admissionregistration/v1beta1/paramkind.go | 4 ++-- applyconfigurations/admissionregistration/v1beta1/paramref.go | 4 ++-- .../admissionregistration/v1beta1/servicereference.go | 4 ++-- .../admissionregistration/v1beta1/typechecking.go | 4 ++-- .../v1beta1/validatingadmissionpolicy.go | 4 ++-- .../v1beta1/validatingadmissionpolicybinding.go | 4 ++-- .../v1beta1/validatingadmissionpolicybindingspec.go | 4 ++-- .../v1beta1/validatingadmissionpolicyspec.go | 4 ++-- .../v1beta1/validatingadmissionpolicystatus.go | 4 ++-- .../admissionregistration/v1beta1/validatingwebhook.go | 4 ++-- .../v1beta1/validatingwebhookconfiguration.go | 4 ++-- .../admissionregistration/v1beta1/validation.go | 4 ++-- applyconfigurations/admissionregistration/v1beta1/variable.go | 4 ++-- .../admissionregistration/v1beta1/webhookclientconfig.go | 4 ++-- .../apiserverinternal/v1alpha1/serverstorageversion.go | 4 ++-- .../apiserverinternal/v1alpha1/storageversion.go | 4 ++-- .../apiserverinternal/v1alpha1/storageversioncondition.go | 4 ++-- .../apiserverinternal/v1alpha1/storageversionstatus.go | 4 ++-- applyconfigurations/apps/v1/controllerrevision.go | 4 ++-- applyconfigurations/apps/v1/daemonset.go | 4 ++-- applyconfigurations/apps/v1/daemonsetcondition.go | 4 ++-- applyconfigurations/apps/v1/daemonsetspec.go | 4 ++-- applyconfigurations/apps/v1/daemonsetstatus.go | 4 ++-- applyconfigurations/apps/v1/daemonsetupdatestrategy.go | 4 ++-- applyconfigurations/apps/v1/deployment.go | 4 ++-- applyconfigurations/apps/v1/deploymentcondition.go | 4 ++-- applyconfigurations/apps/v1/deploymentspec.go | 4 ++-- applyconfigurations/apps/v1/deploymentstatus.go | 4 ++-- applyconfigurations/apps/v1/deploymentstrategy.go | 4 ++-- applyconfigurations/apps/v1/replicaset.go | 4 ++-- applyconfigurations/apps/v1/replicasetcondition.go | 4 ++-- applyconfigurations/apps/v1/replicasetspec.go | 4 ++-- applyconfigurations/apps/v1/replicasetstatus.go | 4 ++-- applyconfigurations/apps/v1/rollingupdatedaemonset.go | 4 ++-- applyconfigurations/apps/v1/rollingupdatedeployment.go | 4 ++-- .../apps/v1/rollingupdatestatefulsetstrategy.go | 4 ++-- applyconfigurations/apps/v1/statefulset.go | 4 ++-- applyconfigurations/apps/v1/statefulsetcondition.go | 4 ++-- applyconfigurations/apps/v1/statefulsetordinals.go | 4 ++-- .../v1/statefulsetpersistentvolumeclaimretentionpolicy.go | 4 ++-- applyconfigurations/apps/v1/statefulsetspec.go | 4 ++-- applyconfigurations/apps/v1/statefulsetstatus.go | 4 ++-- applyconfigurations/apps/v1/statefulsetupdatestrategy.go | 4 ++-- applyconfigurations/apps/v1beta1/controllerrevision.go | 4 ++-- applyconfigurations/apps/v1beta1/deployment.go | 4 ++-- applyconfigurations/apps/v1beta1/deploymentcondition.go | 4 ++-- applyconfigurations/apps/v1beta1/deploymentspec.go | 4 ++-- applyconfigurations/apps/v1beta1/deploymentstatus.go | 4 ++-- applyconfigurations/apps/v1beta1/deploymentstrategy.go | 4 ++-- applyconfigurations/apps/v1beta1/rollbackconfig.go | 4 ++-- applyconfigurations/apps/v1beta1/rollingupdatedeployment.go | 4 ++-- .../apps/v1beta1/rollingupdatestatefulsetstrategy.go | 4 ++-- applyconfigurations/apps/v1beta1/statefulset.go | 4 ++-- applyconfigurations/apps/v1beta1/statefulsetcondition.go | 4 ++-- applyconfigurations/apps/v1beta1/statefulsetordinals.go | 4 ++-- .../statefulsetpersistentvolumeclaimretentionpolicy.go | 4 ++-- applyconfigurations/apps/v1beta1/statefulsetspec.go | 4 ++-- applyconfigurations/apps/v1beta1/statefulsetstatus.go | 4 ++-- applyconfigurations/apps/v1beta1/statefulsetupdatestrategy.go | 4 ++-- applyconfigurations/apps/v1beta2/controllerrevision.go | 4 ++-- applyconfigurations/apps/v1beta2/daemonset.go | 4 ++-- applyconfigurations/apps/v1beta2/daemonsetcondition.go | 4 ++-- applyconfigurations/apps/v1beta2/daemonsetspec.go | 4 ++-- applyconfigurations/apps/v1beta2/daemonsetstatus.go | 4 ++-- applyconfigurations/apps/v1beta2/daemonsetupdatestrategy.go | 4 ++-- applyconfigurations/apps/v1beta2/deployment.go | 4 ++-- applyconfigurations/apps/v1beta2/deploymentcondition.go | 4 ++-- applyconfigurations/apps/v1beta2/deploymentspec.go | 4 ++-- applyconfigurations/apps/v1beta2/deploymentstatus.go | 4 ++-- applyconfigurations/apps/v1beta2/deploymentstrategy.go | 4 ++-- applyconfigurations/apps/v1beta2/replicaset.go | 4 ++-- applyconfigurations/apps/v1beta2/replicasetcondition.go | 4 ++-- applyconfigurations/apps/v1beta2/replicasetspec.go | 4 ++-- applyconfigurations/apps/v1beta2/replicasetstatus.go | 4 ++-- applyconfigurations/apps/v1beta2/rollingupdatedaemonset.go | 4 ++-- applyconfigurations/apps/v1beta2/rollingupdatedeployment.go | 4 ++-- .../apps/v1beta2/rollingupdatestatefulsetstrategy.go | 4 ++-- applyconfigurations/apps/v1beta2/scale.go | 4 ++-- applyconfigurations/apps/v1beta2/statefulset.go | 4 ++-- applyconfigurations/apps/v1beta2/statefulsetcondition.go | 4 ++-- applyconfigurations/apps/v1beta2/statefulsetordinals.go | 4 ++-- .../statefulsetpersistentvolumeclaimretentionpolicy.go | 4 ++-- applyconfigurations/apps/v1beta2/statefulsetspec.go | 4 ++-- applyconfigurations/apps/v1beta2/statefulsetstatus.go | 4 ++-- applyconfigurations/apps/v1beta2/statefulsetupdatestrategy.go | 4 ++-- .../autoscaling/v1/crossversionobjectreference.go | 4 ++-- applyconfigurations/autoscaling/v1/horizontalpodautoscaler.go | 4 ++-- .../autoscaling/v1/horizontalpodautoscalerspec.go | 4 ++-- .../autoscaling/v1/horizontalpodautoscalerstatus.go | 4 ++-- applyconfigurations/autoscaling/v1/scale.go | 4 ++-- applyconfigurations/autoscaling/v1/scalespec.go | 4 ++-- applyconfigurations/autoscaling/v1/scalestatus.go | 4 ++-- .../autoscaling/v2/containerresourcemetricsource.go | 4 ++-- .../autoscaling/v2/containerresourcemetricstatus.go | 4 ++-- .../autoscaling/v2/crossversionobjectreference.go | 4 ++-- applyconfigurations/autoscaling/v2/externalmetricsource.go | 4 ++-- applyconfigurations/autoscaling/v2/externalmetricstatus.go | 4 ++-- applyconfigurations/autoscaling/v2/horizontalpodautoscaler.go | 4 ++-- .../autoscaling/v2/horizontalpodautoscalerbehavior.go | 4 ++-- .../autoscaling/v2/horizontalpodautoscalercondition.go | 4 ++-- .../autoscaling/v2/horizontalpodautoscalerspec.go | 4 ++-- .../autoscaling/v2/horizontalpodautoscalerstatus.go | 4 ++-- applyconfigurations/autoscaling/v2/hpascalingpolicy.go | 4 ++-- applyconfigurations/autoscaling/v2/hpascalingrules.go | 4 ++-- applyconfigurations/autoscaling/v2/metricidentifier.go | 4 ++-- applyconfigurations/autoscaling/v2/metricspec.go | 4 ++-- applyconfigurations/autoscaling/v2/metricstatus.go | 4 ++-- applyconfigurations/autoscaling/v2/metrictarget.go | 4 ++-- applyconfigurations/autoscaling/v2/metricvaluestatus.go | 4 ++-- applyconfigurations/autoscaling/v2/objectmetricsource.go | 4 ++-- applyconfigurations/autoscaling/v2/objectmetricstatus.go | 4 ++-- applyconfigurations/autoscaling/v2/podsmetricsource.go | 4 ++-- applyconfigurations/autoscaling/v2/podsmetricstatus.go | 4 ++-- applyconfigurations/autoscaling/v2/resourcemetricsource.go | 4 ++-- applyconfigurations/autoscaling/v2/resourcemetricstatus.go | 4 ++-- .../autoscaling/v2beta1/containerresourcemetricsource.go | 4 ++-- .../autoscaling/v2beta1/containerresourcemetricstatus.go | 4 ++-- .../autoscaling/v2beta1/crossversionobjectreference.go | 4 ++-- .../autoscaling/v2beta1/externalmetricsource.go | 4 ++-- .../autoscaling/v2beta1/externalmetricstatus.go | 4 ++-- .../autoscaling/v2beta1/horizontalpodautoscaler.go | 4 ++-- .../autoscaling/v2beta1/horizontalpodautoscalercondition.go | 4 ++-- .../autoscaling/v2beta1/horizontalpodautoscalerspec.go | 4 ++-- .../autoscaling/v2beta1/horizontalpodautoscalerstatus.go | 4 ++-- applyconfigurations/autoscaling/v2beta1/metricspec.go | 4 ++-- applyconfigurations/autoscaling/v2beta1/metricstatus.go | 4 ++-- applyconfigurations/autoscaling/v2beta1/objectmetricsource.go | 4 ++-- applyconfigurations/autoscaling/v2beta1/objectmetricstatus.go | 4 ++-- applyconfigurations/autoscaling/v2beta1/podsmetricsource.go | 4 ++-- applyconfigurations/autoscaling/v2beta1/podsmetricstatus.go | 4 ++-- .../autoscaling/v2beta1/resourcemetricsource.go | 4 ++-- .../autoscaling/v2beta1/resourcemetricstatus.go | 4 ++-- .../autoscaling/v2beta2/containerresourcemetricsource.go | 4 ++-- .../autoscaling/v2beta2/containerresourcemetricstatus.go | 4 ++-- .../autoscaling/v2beta2/crossversionobjectreference.go | 4 ++-- .../autoscaling/v2beta2/externalmetricsource.go | 4 ++-- .../autoscaling/v2beta2/externalmetricstatus.go | 4 ++-- .../autoscaling/v2beta2/horizontalpodautoscaler.go | 4 ++-- .../autoscaling/v2beta2/horizontalpodautoscalerbehavior.go | 4 ++-- .../autoscaling/v2beta2/horizontalpodautoscalercondition.go | 4 ++-- .../autoscaling/v2beta2/horizontalpodautoscalerspec.go | 4 ++-- .../autoscaling/v2beta2/horizontalpodautoscalerstatus.go | 4 ++-- applyconfigurations/autoscaling/v2beta2/hpascalingpolicy.go | 4 ++-- applyconfigurations/autoscaling/v2beta2/hpascalingrules.go | 4 ++-- applyconfigurations/autoscaling/v2beta2/metricidentifier.go | 4 ++-- applyconfigurations/autoscaling/v2beta2/metricspec.go | 4 ++-- applyconfigurations/autoscaling/v2beta2/metricstatus.go | 4 ++-- applyconfigurations/autoscaling/v2beta2/metrictarget.go | 4 ++-- applyconfigurations/autoscaling/v2beta2/metricvaluestatus.go | 4 ++-- applyconfigurations/autoscaling/v2beta2/objectmetricsource.go | 4 ++-- applyconfigurations/autoscaling/v2beta2/objectmetricstatus.go | 4 ++-- applyconfigurations/autoscaling/v2beta2/podsmetricsource.go | 4 ++-- applyconfigurations/autoscaling/v2beta2/podsmetricstatus.go | 4 ++-- .../autoscaling/v2beta2/resourcemetricsource.go | 4 ++-- .../autoscaling/v2beta2/resourcemetricstatus.go | 4 ++-- applyconfigurations/batch/v1/cronjob.go | 4 ++-- applyconfigurations/batch/v1/cronjobspec.go | 4 ++-- applyconfigurations/batch/v1/cronjobstatus.go | 4 ++-- applyconfigurations/batch/v1/job.go | 4 ++-- applyconfigurations/batch/v1/jobcondition.go | 4 ++-- applyconfigurations/batch/v1/jobspec.go | 4 ++-- applyconfigurations/batch/v1/jobstatus.go | 4 ++-- applyconfigurations/batch/v1/jobtemplatespec.go | 4 ++-- applyconfigurations/batch/v1/podfailurepolicy.go | 4 ++-- .../batch/v1/podfailurepolicyonexitcodesrequirement.go | 4 ++-- .../batch/v1/podfailurepolicyonpodconditionspattern.go | 4 ++-- applyconfigurations/batch/v1/podfailurepolicyrule.go | 4 ++-- applyconfigurations/batch/v1/successpolicy.go | 4 ++-- applyconfigurations/batch/v1/successpolicyrule.go | 4 ++-- applyconfigurations/batch/v1/uncountedterminatedpods.go | 4 ++-- applyconfigurations/batch/v1beta1/cronjob.go | 4 ++-- applyconfigurations/batch/v1beta1/cronjobspec.go | 4 ++-- applyconfigurations/batch/v1beta1/cronjobstatus.go | 4 ++-- applyconfigurations/batch/v1beta1/jobtemplatespec.go | 4 ++-- .../certificates/v1/certificatesigningrequest.go | 4 ++-- .../certificates/v1/certificatesigningrequestcondition.go | 4 ++-- .../certificates/v1/certificatesigningrequestspec.go | 4 ++-- .../certificates/v1/certificatesigningrequeststatus.go | 4 ++-- .../certificates/v1alpha1/clustertrustbundle.go | 4 ++-- .../certificates/v1alpha1/clustertrustbundlespec.go | 4 ++-- .../certificates/v1beta1/certificatesigningrequest.go | 4 ++-- .../v1beta1/certificatesigningrequestcondition.go | 4 ++-- .../certificates/v1beta1/certificatesigningrequestspec.go | 4 ++-- .../certificates/v1beta1/certificatesigningrequeststatus.go | 4 ++-- applyconfigurations/coordination/v1/lease.go | 4 ++-- applyconfigurations/coordination/v1/leasespec.go | 4 ++-- applyconfigurations/coordination/v1beta1/lease.go | 4 ++-- applyconfigurations/coordination/v1beta1/leasespec.go | 4 ++-- applyconfigurations/core/v1/affinity.go | 4 ++-- applyconfigurations/core/v1/apparmorprofile.go | 4 ++-- applyconfigurations/core/v1/attachedvolume.go | 4 ++-- .../core/v1/awselasticblockstorevolumesource.go | 4 ++-- applyconfigurations/core/v1/azurediskvolumesource.go | 4 ++-- .../core/v1/azurefilepersistentvolumesource.go | 4 ++-- applyconfigurations/core/v1/azurefilevolumesource.go | 4 ++-- applyconfigurations/core/v1/capabilities.go | 4 ++-- applyconfigurations/core/v1/cephfspersistentvolumesource.go | 4 ++-- applyconfigurations/core/v1/cephfsvolumesource.go | 4 ++-- applyconfigurations/core/v1/cinderpersistentvolumesource.go | 4 ++-- applyconfigurations/core/v1/cindervolumesource.go | 4 ++-- applyconfigurations/core/v1/claimsource.go | 4 ++-- applyconfigurations/core/v1/clientipconfig.go | 4 ++-- applyconfigurations/core/v1/clustertrustbundleprojection.go | 4 ++-- applyconfigurations/core/v1/componentcondition.go | 4 ++-- applyconfigurations/core/v1/componentstatus.go | 4 ++-- applyconfigurations/core/v1/configmap.go | 4 ++-- applyconfigurations/core/v1/configmapenvsource.go | 4 ++-- applyconfigurations/core/v1/configmapkeyselector.go | 4 ++-- applyconfigurations/core/v1/configmapnodeconfigsource.go | 4 ++-- applyconfigurations/core/v1/configmapprojection.go | 4 ++-- applyconfigurations/core/v1/configmapvolumesource.go | 4 ++-- applyconfigurations/core/v1/container.go | 4 ++-- applyconfigurations/core/v1/containerimage.go | 4 ++-- applyconfigurations/core/v1/containerport.go | 4 ++-- applyconfigurations/core/v1/containerresizepolicy.go | 4 ++-- applyconfigurations/core/v1/containerstate.go | 4 ++-- applyconfigurations/core/v1/containerstaterunning.go | 4 ++-- applyconfigurations/core/v1/containerstateterminated.go | 4 ++-- applyconfigurations/core/v1/containerstatewaiting.go | 4 ++-- applyconfigurations/core/v1/containerstatus.go | 4 ++-- applyconfigurations/core/v1/containeruser.go | 4 ++-- applyconfigurations/core/v1/csipersistentvolumesource.go | 4 ++-- applyconfigurations/core/v1/csivolumesource.go | 4 ++-- applyconfigurations/core/v1/daemonendpoint.go | 4 ++-- applyconfigurations/core/v1/downwardapiprojection.go | 4 ++-- applyconfigurations/core/v1/downwardapivolumefile.go | 4 ++-- applyconfigurations/core/v1/downwardapivolumesource.go | 4 ++-- applyconfigurations/core/v1/emptydirvolumesource.go | 4 ++-- applyconfigurations/core/v1/endpointaddress.go | 4 ++-- applyconfigurations/core/v1/endpointport.go | 4 ++-- applyconfigurations/core/v1/endpoints.go | 4 ++-- applyconfigurations/core/v1/endpointsubset.go | 4 ++-- applyconfigurations/core/v1/envfromsource.go | 4 ++-- applyconfigurations/core/v1/envvar.go | 4 ++-- applyconfigurations/core/v1/envvarsource.go | 4 ++-- applyconfigurations/core/v1/ephemeralcontainer.go | 4 ++-- applyconfigurations/core/v1/ephemeralcontainercommon.go | 4 ++-- applyconfigurations/core/v1/ephemeralvolumesource.go | 4 ++-- applyconfigurations/core/v1/event.go | 4 ++-- applyconfigurations/core/v1/eventseries.go | 4 ++-- applyconfigurations/core/v1/eventsource.go | 4 ++-- applyconfigurations/core/v1/execaction.go | 4 ++-- applyconfigurations/core/v1/fcvolumesource.go | 4 ++-- applyconfigurations/core/v1/flexpersistentvolumesource.go | 4 ++-- applyconfigurations/core/v1/flexvolumesource.go | 4 ++-- applyconfigurations/core/v1/flockervolumesource.go | 4 ++-- applyconfigurations/core/v1/gcepersistentdiskvolumesource.go | 4 ++-- applyconfigurations/core/v1/gitrepovolumesource.go | 4 ++-- .../core/v1/glusterfspersistentvolumesource.go | 4 ++-- applyconfigurations/core/v1/glusterfsvolumesource.go | 4 ++-- applyconfigurations/core/v1/grpcaction.go | 4 ++-- applyconfigurations/core/v1/hostalias.go | 4 ++-- applyconfigurations/core/v1/hostip.go | 4 ++-- applyconfigurations/core/v1/hostpathvolumesource.go | 4 ++-- applyconfigurations/core/v1/httpgetaction.go | 4 ++-- applyconfigurations/core/v1/httpheader.go | 4 ++-- applyconfigurations/core/v1/iscsipersistentvolumesource.go | 4 ++-- applyconfigurations/core/v1/iscsivolumesource.go | 4 ++-- applyconfigurations/core/v1/keytopath.go | 4 ++-- applyconfigurations/core/v1/lifecycle.go | 4 ++-- applyconfigurations/core/v1/lifecyclehandler.go | 4 ++-- applyconfigurations/core/v1/limitrange.go | 4 ++-- applyconfigurations/core/v1/limitrangeitem.go | 4 ++-- applyconfigurations/core/v1/limitrangespec.go | 4 ++-- applyconfigurations/core/v1/linuxcontaineruser.go | 4 ++-- applyconfigurations/core/v1/loadbalanceringress.go | 4 ++-- applyconfigurations/core/v1/loadbalancerstatus.go | 4 ++-- applyconfigurations/core/v1/localobjectreference.go | 4 ++-- applyconfigurations/core/v1/localvolumesource.go | 4 ++-- applyconfigurations/core/v1/modifyvolumestatus.go | 4 ++-- applyconfigurations/core/v1/namespace.go | 4 ++-- applyconfigurations/core/v1/namespacecondition.go | 4 ++-- applyconfigurations/core/v1/namespacespec.go | 4 ++-- applyconfigurations/core/v1/namespacestatus.go | 4 ++-- applyconfigurations/core/v1/nfsvolumesource.go | 4 ++-- applyconfigurations/core/v1/node.go | 4 ++-- applyconfigurations/core/v1/nodeaddress.go | 4 ++-- applyconfigurations/core/v1/nodeaffinity.go | 4 ++-- applyconfigurations/core/v1/nodecondition.go | 4 ++-- applyconfigurations/core/v1/nodeconfigsource.go | 4 ++-- applyconfigurations/core/v1/nodeconfigstatus.go | 4 ++-- applyconfigurations/core/v1/nodedaemonendpoints.go | 4 ++-- applyconfigurations/core/v1/noderuntimehandler.go | 4 ++-- applyconfigurations/core/v1/noderuntimehandlerfeatures.go | 4 ++-- applyconfigurations/core/v1/nodeselector.go | 4 ++-- applyconfigurations/core/v1/nodeselectorrequirement.go | 4 ++-- applyconfigurations/core/v1/nodeselectorterm.go | 4 ++-- applyconfigurations/core/v1/nodespec.go | 4 ++-- applyconfigurations/core/v1/nodestatus.go | 4 ++-- applyconfigurations/core/v1/nodesysteminfo.go | 4 ++-- applyconfigurations/core/v1/objectfieldselector.go | 4 ++-- applyconfigurations/core/v1/objectreference.go | 4 ++-- applyconfigurations/core/v1/persistentvolume.go | 4 ++-- applyconfigurations/core/v1/persistentvolumeclaim.go | 4 ++-- applyconfigurations/core/v1/persistentvolumeclaimcondition.go | 4 ++-- applyconfigurations/core/v1/persistentvolumeclaimspec.go | 4 ++-- applyconfigurations/core/v1/persistentvolumeclaimstatus.go | 4 ++-- applyconfigurations/core/v1/persistentvolumeclaimtemplate.go | 4 ++-- .../core/v1/persistentvolumeclaimvolumesource.go | 4 ++-- applyconfigurations/core/v1/persistentvolumesource.go | 4 ++-- applyconfigurations/core/v1/persistentvolumespec.go | 4 ++-- applyconfigurations/core/v1/persistentvolumestatus.go | 4 ++-- .../core/v1/photonpersistentdiskvolumesource.go | 4 ++-- applyconfigurations/core/v1/pod.go | 4 ++-- applyconfigurations/core/v1/podaffinity.go | 4 ++-- applyconfigurations/core/v1/podaffinityterm.go | 4 ++-- applyconfigurations/core/v1/podantiaffinity.go | 4 ++-- applyconfigurations/core/v1/podcondition.go | 4 ++-- applyconfigurations/core/v1/poddnsconfig.go | 4 ++-- applyconfigurations/core/v1/poddnsconfigoption.go | 4 ++-- applyconfigurations/core/v1/podip.go | 4 ++-- applyconfigurations/core/v1/podos.go | 4 ++-- applyconfigurations/core/v1/podreadinessgate.go | 4 ++-- applyconfigurations/core/v1/podresourceclaim.go | 4 ++-- applyconfigurations/core/v1/podresourceclaimstatus.go | 4 ++-- applyconfigurations/core/v1/podschedulinggate.go | 4 ++-- applyconfigurations/core/v1/podsecuritycontext.go | 4 ++-- applyconfigurations/core/v1/podspec.go | 4 ++-- applyconfigurations/core/v1/podstatus.go | 4 ++-- applyconfigurations/core/v1/podtemplate.go | 4 ++-- applyconfigurations/core/v1/podtemplatespec.go | 4 ++-- applyconfigurations/core/v1/portstatus.go | 4 ++-- applyconfigurations/core/v1/portworxvolumesource.go | 4 ++-- applyconfigurations/core/v1/preferredschedulingterm.go | 4 ++-- applyconfigurations/core/v1/probe.go | 4 ++-- applyconfigurations/core/v1/probehandler.go | 4 ++-- applyconfigurations/core/v1/projectedvolumesource.go | 4 ++-- applyconfigurations/core/v1/quobytevolumesource.go | 4 ++-- applyconfigurations/core/v1/rbdpersistentvolumesource.go | 4 ++-- applyconfigurations/core/v1/rbdvolumesource.go | 4 ++-- applyconfigurations/core/v1/replicationcontroller.go | 4 ++-- applyconfigurations/core/v1/replicationcontrollercondition.go | 4 ++-- applyconfigurations/core/v1/replicationcontrollerspec.go | 4 ++-- applyconfigurations/core/v1/replicationcontrollerstatus.go | 4 ++-- applyconfigurations/core/v1/resourceclaim.go | 4 ++-- applyconfigurations/core/v1/resourcefieldselector.go | 4 ++-- applyconfigurations/core/v1/resourcequota.go | 4 ++-- applyconfigurations/core/v1/resourcequotaspec.go | 4 ++-- applyconfigurations/core/v1/resourcequotastatus.go | 4 ++-- applyconfigurations/core/v1/resourcerequirements.go | 4 ++-- applyconfigurations/core/v1/scaleiopersistentvolumesource.go | 4 ++-- applyconfigurations/core/v1/scaleiovolumesource.go | 4 ++-- .../core/v1/scopedresourceselectorrequirement.go | 4 ++-- applyconfigurations/core/v1/scopeselector.go | 4 ++-- applyconfigurations/core/v1/seccompprofile.go | 4 ++-- applyconfigurations/core/v1/secret.go | 4 ++-- applyconfigurations/core/v1/secretenvsource.go | 4 ++-- applyconfigurations/core/v1/secretkeyselector.go | 4 ++-- applyconfigurations/core/v1/secretprojection.go | 4 ++-- applyconfigurations/core/v1/secretreference.go | 4 ++-- applyconfigurations/core/v1/secretvolumesource.go | 4 ++-- applyconfigurations/core/v1/securitycontext.go | 4 ++-- applyconfigurations/core/v1/selinuxoptions.go | 4 ++-- applyconfigurations/core/v1/service.go | 4 ++-- applyconfigurations/core/v1/serviceaccount.go | 4 ++-- applyconfigurations/core/v1/serviceaccounttokenprojection.go | 4 ++-- applyconfigurations/core/v1/serviceport.go | 4 ++-- applyconfigurations/core/v1/servicespec.go | 4 ++-- applyconfigurations/core/v1/servicestatus.go | 4 ++-- applyconfigurations/core/v1/sessionaffinityconfig.go | 4 ++-- applyconfigurations/core/v1/sleepaction.go | 4 ++-- .../core/v1/storageospersistentvolumesource.go | 4 ++-- applyconfigurations/core/v1/storageosvolumesource.go | 4 ++-- applyconfigurations/core/v1/sysctl.go | 4 ++-- applyconfigurations/core/v1/taint.go | 4 ++-- applyconfigurations/core/v1/tcpsocketaction.go | 4 ++-- applyconfigurations/core/v1/toleration.go | 4 ++-- .../core/v1/topologyselectorlabelrequirement.go | 4 ++-- applyconfigurations/core/v1/topologyselectorterm.go | 4 ++-- applyconfigurations/core/v1/topologyspreadconstraint.go | 4 ++-- applyconfigurations/core/v1/typedlocalobjectreference.go | 4 ++-- applyconfigurations/core/v1/typedobjectreference.go | 4 ++-- applyconfigurations/core/v1/volume.go | 4 ++-- applyconfigurations/core/v1/volumedevice.go | 4 ++-- applyconfigurations/core/v1/volumemount.go | 4 ++-- applyconfigurations/core/v1/volumemountstatus.go | 4 ++-- applyconfigurations/core/v1/volumenodeaffinity.go | 4 ++-- applyconfigurations/core/v1/volumeprojection.go | 4 ++-- applyconfigurations/core/v1/volumeresourcerequirements.go | 4 ++-- applyconfigurations/core/v1/volumesource.go | 4 ++-- applyconfigurations/core/v1/vspherevirtualdiskvolumesource.go | 4 ++-- applyconfigurations/core/v1/weightedpodaffinityterm.go | 4 ++-- applyconfigurations/core/v1/windowssecuritycontextoptions.go | 4 ++-- applyconfigurations/discovery/v1/endpoint.go | 4 ++-- applyconfigurations/discovery/v1/endpointconditions.go | 4 ++-- applyconfigurations/discovery/v1/endpointhints.go | 4 ++-- applyconfigurations/discovery/v1/endpointport.go | 4 ++-- applyconfigurations/discovery/v1/endpointslice.go | 4 ++-- applyconfigurations/discovery/v1/forzone.go | 4 ++-- applyconfigurations/discovery/v1beta1/endpoint.go | 4 ++-- applyconfigurations/discovery/v1beta1/endpointconditions.go | 4 ++-- applyconfigurations/discovery/v1beta1/endpointhints.go | 4 ++-- applyconfigurations/discovery/v1beta1/endpointport.go | 4 ++-- applyconfigurations/discovery/v1beta1/endpointslice.go | 4 ++-- applyconfigurations/discovery/v1beta1/forzone.go | 4 ++-- applyconfigurations/events/v1/event.go | 4 ++-- applyconfigurations/events/v1/eventseries.go | 4 ++-- applyconfigurations/events/v1beta1/event.go | 4 ++-- applyconfigurations/events/v1beta1/eventseries.go | 4 ++-- applyconfigurations/extensions/v1beta1/daemonset.go | 4 ++-- applyconfigurations/extensions/v1beta1/daemonsetcondition.go | 4 ++-- applyconfigurations/extensions/v1beta1/daemonsetspec.go | 4 ++-- applyconfigurations/extensions/v1beta1/daemonsetstatus.go | 4 ++-- .../extensions/v1beta1/daemonsetupdatestrategy.go | 4 ++-- applyconfigurations/extensions/v1beta1/deployment.go | 4 ++-- applyconfigurations/extensions/v1beta1/deploymentcondition.go | 4 ++-- applyconfigurations/extensions/v1beta1/deploymentspec.go | 4 ++-- applyconfigurations/extensions/v1beta1/deploymentstatus.go | 4 ++-- applyconfigurations/extensions/v1beta1/deploymentstrategy.go | 4 ++-- applyconfigurations/extensions/v1beta1/httpingresspath.go | 4 ++-- .../extensions/v1beta1/httpingressrulevalue.go | 4 ++-- applyconfigurations/extensions/v1beta1/ingress.go | 4 ++-- applyconfigurations/extensions/v1beta1/ingressbackend.go | 4 ++-- .../extensions/v1beta1/ingressloadbalanceringress.go | 4 ++-- .../extensions/v1beta1/ingressloadbalancerstatus.go | 4 ++-- applyconfigurations/extensions/v1beta1/ingressportstatus.go | 4 ++-- applyconfigurations/extensions/v1beta1/ingressrule.go | 4 ++-- applyconfigurations/extensions/v1beta1/ingressrulevalue.go | 4 ++-- applyconfigurations/extensions/v1beta1/ingressspec.go | 4 ++-- applyconfigurations/extensions/v1beta1/ingressstatus.go | 4 ++-- applyconfigurations/extensions/v1beta1/ingresstls.go | 4 ++-- applyconfigurations/extensions/v1beta1/ipblock.go | 4 ++-- applyconfigurations/extensions/v1beta1/networkpolicy.go | 4 ++-- .../extensions/v1beta1/networkpolicyegressrule.go | 4 ++-- .../extensions/v1beta1/networkpolicyingressrule.go | 4 ++-- applyconfigurations/extensions/v1beta1/networkpolicypeer.go | 4 ++-- applyconfigurations/extensions/v1beta1/networkpolicyport.go | 4 ++-- applyconfigurations/extensions/v1beta1/networkpolicyspec.go | 4 ++-- applyconfigurations/extensions/v1beta1/replicaset.go | 4 ++-- applyconfigurations/extensions/v1beta1/replicasetcondition.go | 4 ++-- applyconfigurations/extensions/v1beta1/replicasetspec.go | 4 ++-- applyconfigurations/extensions/v1beta1/replicasetstatus.go | 4 ++-- applyconfigurations/extensions/v1beta1/rollbackconfig.go | 4 ++-- .../extensions/v1beta1/rollingupdatedaemonset.go | 4 ++-- .../extensions/v1beta1/rollingupdatedeployment.go | 4 ++-- applyconfigurations/extensions/v1beta1/scale.go | 4 ++-- .../flowcontrol/v1/exemptprioritylevelconfiguration.go | 4 ++-- applyconfigurations/flowcontrol/v1/flowdistinguishermethod.go | 4 ++-- applyconfigurations/flowcontrol/v1/flowschema.go | 4 ++-- applyconfigurations/flowcontrol/v1/flowschemacondition.go | 4 ++-- applyconfigurations/flowcontrol/v1/flowschemaspec.go | 4 ++-- applyconfigurations/flowcontrol/v1/flowschemastatus.go | 4 ++-- applyconfigurations/flowcontrol/v1/groupsubject.go | 4 ++-- .../flowcontrol/v1/limitedprioritylevelconfiguration.go | 4 ++-- applyconfigurations/flowcontrol/v1/limitresponse.go | 4 ++-- applyconfigurations/flowcontrol/v1/nonresourcepolicyrule.go | 4 ++-- applyconfigurations/flowcontrol/v1/policyruleswithsubjects.go | 4 ++-- .../flowcontrol/v1/prioritylevelconfiguration.go | 4 ++-- .../flowcontrol/v1/prioritylevelconfigurationcondition.go | 4 ++-- .../flowcontrol/v1/prioritylevelconfigurationreference.go | 4 ++-- .../flowcontrol/v1/prioritylevelconfigurationspec.go | 4 ++-- .../flowcontrol/v1/prioritylevelconfigurationstatus.go | 4 ++-- applyconfigurations/flowcontrol/v1/queuingconfiguration.go | 4 ++-- applyconfigurations/flowcontrol/v1/resourcepolicyrule.go | 4 ++-- applyconfigurations/flowcontrol/v1/serviceaccountsubject.go | 4 ++-- applyconfigurations/flowcontrol/v1/subject.go | 4 ++-- applyconfigurations/flowcontrol/v1/usersubject.go | 4 ++-- .../flowcontrol/v1beta1/exemptprioritylevelconfiguration.go | 4 ++-- .../flowcontrol/v1beta1/flowdistinguishermethod.go | 4 ++-- applyconfigurations/flowcontrol/v1beta1/flowschema.go | 4 ++-- .../flowcontrol/v1beta1/flowschemacondition.go | 4 ++-- applyconfigurations/flowcontrol/v1beta1/flowschemaspec.go | 4 ++-- applyconfigurations/flowcontrol/v1beta1/flowschemastatus.go | 4 ++-- applyconfigurations/flowcontrol/v1beta1/groupsubject.go | 4 ++-- .../flowcontrol/v1beta1/limitedprioritylevelconfiguration.go | 4 ++-- applyconfigurations/flowcontrol/v1beta1/limitresponse.go | 4 ++-- .../flowcontrol/v1beta1/nonresourcepolicyrule.go | 4 ++-- .../flowcontrol/v1beta1/policyruleswithsubjects.go | 4 ++-- .../flowcontrol/v1beta1/prioritylevelconfiguration.go | 4 ++-- .../v1beta1/prioritylevelconfigurationcondition.go | 4 ++-- .../v1beta1/prioritylevelconfigurationreference.go | 4 ++-- .../flowcontrol/v1beta1/prioritylevelconfigurationspec.go | 4 ++-- .../flowcontrol/v1beta1/prioritylevelconfigurationstatus.go | 4 ++-- .../flowcontrol/v1beta1/queuingconfiguration.go | 4 ++-- applyconfigurations/flowcontrol/v1beta1/resourcepolicyrule.go | 4 ++-- .../flowcontrol/v1beta1/serviceaccountsubject.go | 4 ++-- applyconfigurations/flowcontrol/v1beta1/subject.go | 4 ++-- applyconfigurations/flowcontrol/v1beta1/usersubject.go | 4 ++-- .../flowcontrol/v1beta2/exemptprioritylevelconfiguration.go | 4 ++-- .../flowcontrol/v1beta2/flowdistinguishermethod.go | 4 ++-- applyconfigurations/flowcontrol/v1beta2/flowschema.go | 4 ++-- .../flowcontrol/v1beta2/flowschemacondition.go | 4 ++-- applyconfigurations/flowcontrol/v1beta2/flowschemaspec.go | 4 ++-- applyconfigurations/flowcontrol/v1beta2/flowschemastatus.go | 4 ++-- applyconfigurations/flowcontrol/v1beta2/groupsubject.go | 4 ++-- .../flowcontrol/v1beta2/limitedprioritylevelconfiguration.go | 4 ++-- applyconfigurations/flowcontrol/v1beta2/limitresponse.go | 4 ++-- .../flowcontrol/v1beta2/nonresourcepolicyrule.go | 4 ++-- .../flowcontrol/v1beta2/policyruleswithsubjects.go | 4 ++-- .../flowcontrol/v1beta2/prioritylevelconfiguration.go | 4 ++-- .../v1beta2/prioritylevelconfigurationcondition.go | 4 ++-- .../v1beta2/prioritylevelconfigurationreference.go | 4 ++-- .../flowcontrol/v1beta2/prioritylevelconfigurationspec.go | 4 ++-- .../flowcontrol/v1beta2/prioritylevelconfigurationstatus.go | 4 ++-- .../flowcontrol/v1beta2/queuingconfiguration.go | 4 ++-- applyconfigurations/flowcontrol/v1beta2/resourcepolicyrule.go | 4 ++-- .../flowcontrol/v1beta2/serviceaccountsubject.go | 4 ++-- applyconfigurations/flowcontrol/v1beta2/subject.go | 4 ++-- applyconfigurations/flowcontrol/v1beta2/usersubject.go | 4 ++-- .../flowcontrol/v1beta3/exemptprioritylevelconfiguration.go | 4 ++-- .../flowcontrol/v1beta3/flowdistinguishermethod.go | 4 ++-- applyconfigurations/flowcontrol/v1beta3/flowschema.go | 4 ++-- .../flowcontrol/v1beta3/flowschemacondition.go | 4 ++-- applyconfigurations/flowcontrol/v1beta3/flowschemaspec.go | 4 ++-- applyconfigurations/flowcontrol/v1beta3/flowschemastatus.go | 4 ++-- applyconfigurations/flowcontrol/v1beta3/groupsubject.go | 4 ++-- .../flowcontrol/v1beta3/limitedprioritylevelconfiguration.go | 4 ++-- applyconfigurations/flowcontrol/v1beta3/limitresponse.go | 4 ++-- .../flowcontrol/v1beta3/nonresourcepolicyrule.go | 4 ++-- .../flowcontrol/v1beta3/policyruleswithsubjects.go | 4 ++-- .../flowcontrol/v1beta3/prioritylevelconfiguration.go | 4 ++-- .../v1beta3/prioritylevelconfigurationcondition.go | 4 ++-- .../v1beta3/prioritylevelconfigurationreference.go | 4 ++-- .../flowcontrol/v1beta3/prioritylevelconfigurationspec.go | 4 ++-- .../flowcontrol/v1beta3/prioritylevelconfigurationstatus.go | 4 ++-- .../flowcontrol/v1beta3/queuingconfiguration.go | 4 ++-- applyconfigurations/flowcontrol/v1beta3/resourcepolicyrule.go | 4 ++-- .../flowcontrol/v1beta3/serviceaccountsubject.go | 4 ++-- applyconfigurations/flowcontrol/v1beta3/subject.go | 4 ++-- applyconfigurations/flowcontrol/v1beta3/usersubject.go | 4 ++-- applyconfigurations/imagepolicy/v1alpha1/imagereview.go | 4 ++-- .../imagepolicy/v1alpha1/imagereviewcontainerspec.go | 4 ++-- applyconfigurations/imagepolicy/v1alpha1/imagereviewspec.go | 4 ++-- applyconfigurations/imagepolicy/v1alpha1/imagereviewstatus.go | 4 ++-- applyconfigurations/meta/v1/condition.go | 4 ++-- applyconfigurations/meta/v1/deleteoptions.go | 4 ++-- applyconfigurations/meta/v1/labelselector.go | 4 ++-- applyconfigurations/meta/v1/labelselectorrequirement.go | 4 ++-- applyconfigurations/meta/v1/managedfieldsentry.go | 4 ++-- applyconfigurations/meta/v1/objectmeta.go | 4 ++-- applyconfigurations/meta/v1/ownerreference.go | 4 ++-- applyconfigurations/meta/v1/preconditions.go | 4 ++-- applyconfigurations/meta/v1/typemeta.go | 4 ++-- applyconfigurations/networking/v1/httpingresspath.go | 4 ++-- applyconfigurations/networking/v1/httpingressrulevalue.go | 4 ++-- applyconfigurations/networking/v1/ingress.go | 4 ++-- applyconfigurations/networking/v1/ingressbackend.go | 4 ++-- applyconfigurations/networking/v1/ingressclass.go | 4 ++-- .../networking/v1/ingressclassparametersreference.go | 4 ++-- applyconfigurations/networking/v1/ingressclassspec.go | 4 ++-- .../networking/v1/ingressloadbalanceringress.go | 4 ++-- .../networking/v1/ingressloadbalancerstatus.go | 4 ++-- applyconfigurations/networking/v1/ingressportstatus.go | 4 ++-- applyconfigurations/networking/v1/ingressrule.go | 4 ++-- applyconfigurations/networking/v1/ingressrulevalue.go | 4 ++-- applyconfigurations/networking/v1/ingressservicebackend.go | 4 ++-- applyconfigurations/networking/v1/ingressspec.go | 4 ++-- applyconfigurations/networking/v1/ingressstatus.go | 4 ++-- applyconfigurations/networking/v1/ingresstls.go | 4 ++-- applyconfigurations/networking/v1/ipblock.go | 4 ++-- applyconfigurations/networking/v1/networkpolicy.go | 4 ++-- applyconfigurations/networking/v1/networkpolicyegressrule.go | 4 ++-- applyconfigurations/networking/v1/networkpolicyingressrule.go | 4 ++-- applyconfigurations/networking/v1/networkpolicypeer.go | 4 ++-- applyconfigurations/networking/v1/networkpolicyport.go | 4 ++-- applyconfigurations/networking/v1/networkpolicyspec.go | 4 ++-- applyconfigurations/networking/v1/servicebackendport.go | 4 ++-- applyconfigurations/networking/v1alpha1/ipaddress.go | 4 ++-- applyconfigurations/networking/v1alpha1/ipaddressspec.go | 4 ++-- applyconfigurations/networking/v1alpha1/parentreference.go | 4 ++-- applyconfigurations/networking/v1alpha1/servicecidr.go | 4 ++-- applyconfigurations/networking/v1alpha1/servicecidrspec.go | 4 ++-- applyconfigurations/networking/v1alpha1/servicecidrstatus.go | 4 ++-- applyconfigurations/networking/v1beta1/httpingresspath.go | 4 ++-- .../networking/v1beta1/httpingressrulevalue.go | 4 ++-- applyconfigurations/networking/v1beta1/ingress.go | 4 ++-- applyconfigurations/networking/v1beta1/ingressbackend.go | 4 ++-- applyconfigurations/networking/v1beta1/ingressclass.go | 4 ++-- .../networking/v1beta1/ingressclassparametersreference.go | 4 ++-- applyconfigurations/networking/v1beta1/ingressclassspec.go | 4 ++-- .../networking/v1beta1/ingressloadbalanceringress.go | 4 ++-- .../networking/v1beta1/ingressloadbalancerstatus.go | 4 ++-- applyconfigurations/networking/v1beta1/ingressportstatus.go | 4 ++-- applyconfigurations/networking/v1beta1/ingressrule.go | 4 ++-- applyconfigurations/networking/v1beta1/ingressrulevalue.go | 4 ++-- applyconfigurations/networking/v1beta1/ingressspec.go | 4 ++-- applyconfigurations/networking/v1beta1/ingressstatus.go | 4 ++-- applyconfigurations/networking/v1beta1/ingresstls.go | 4 ++-- applyconfigurations/node/v1/overhead.go | 4 ++-- applyconfigurations/node/v1/runtimeclass.go | 4 ++-- applyconfigurations/node/v1/scheduling.go | 4 ++-- applyconfigurations/node/v1alpha1/overhead.go | 4 ++-- applyconfigurations/node/v1alpha1/runtimeclass.go | 4 ++-- applyconfigurations/node/v1alpha1/runtimeclassspec.go | 4 ++-- applyconfigurations/node/v1alpha1/scheduling.go | 4 ++-- applyconfigurations/node/v1beta1/overhead.go | 4 ++-- applyconfigurations/node/v1beta1/runtimeclass.go | 4 ++-- applyconfigurations/node/v1beta1/scheduling.go | 4 ++-- applyconfigurations/policy/v1/eviction.go | 4 ++-- applyconfigurations/policy/v1/poddisruptionbudget.go | 4 ++-- applyconfigurations/policy/v1/poddisruptionbudgetspec.go | 4 ++-- applyconfigurations/policy/v1/poddisruptionbudgetstatus.go | 4 ++-- applyconfigurations/policy/v1beta1/eviction.go | 4 ++-- applyconfigurations/policy/v1beta1/poddisruptionbudget.go | 4 ++-- applyconfigurations/policy/v1beta1/poddisruptionbudgetspec.go | 4 ++-- .../policy/v1beta1/poddisruptionbudgetstatus.go | 4 ++-- applyconfigurations/rbac/v1/aggregationrule.go | 4 ++-- applyconfigurations/rbac/v1/clusterrole.go | 4 ++-- applyconfigurations/rbac/v1/clusterrolebinding.go | 4 ++-- applyconfigurations/rbac/v1/policyrule.go | 4 ++-- applyconfigurations/rbac/v1/role.go | 4 ++-- applyconfigurations/rbac/v1/rolebinding.go | 4 ++-- applyconfigurations/rbac/v1/roleref.go | 4 ++-- applyconfigurations/rbac/v1/subject.go | 4 ++-- applyconfigurations/rbac/v1alpha1/aggregationrule.go | 4 ++-- applyconfigurations/rbac/v1alpha1/clusterrole.go | 4 ++-- applyconfigurations/rbac/v1alpha1/clusterrolebinding.go | 4 ++-- applyconfigurations/rbac/v1alpha1/policyrule.go | 4 ++-- applyconfigurations/rbac/v1alpha1/role.go | 4 ++-- applyconfigurations/rbac/v1alpha1/rolebinding.go | 4 ++-- applyconfigurations/rbac/v1alpha1/roleref.go | 4 ++-- applyconfigurations/rbac/v1alpha1/subject.go | 4 ++-- applyconfigurations/rbac/v1beta1/aggregationrule.go | 4 ++-- applyconfigurations/rbac/v1beta1/clusterrole.go | 4 ++-- applyconfigurations/rbac/v1beta1/clusterrolebinding.go | 4 ++-- applyconfigurations/rbac/v1beta1/policyrule.go | 4 ++-- applyconfigurations/rbac/v1beta1/role.go | 4 ++-- applyconfigurations/rbac/v1beta1/rolebinding.go | 4 ++-- applyconfigurations/rbac/v1beta1/roleref.go | 4 ++-- applyconfigurations/rbac/v1beta1/subject.go | 4 ++-- applyconfigurations/resource/v1alpha2/allocationresult.go | 4 ++-- .../resource/v1alpha2/allocationresultmodel.go | 4 ++-- .../resource/v1alpha2/driverallocationresult.go | 4 ++-- applyconfigurations/resource/v1alpha2/driverrequests.go | 4 ++-- .../resource/v1alpha2/namedresourcesallocationresult.go | 4 ++-- .../resource/v1alpha2/namedresourcesattribute.go | 4 ++-- .../resource/v1alpha2/namedresourcesattributevalue.go | 4 ++-- applyconfigurations/resource/v1alpha2/namedresourcesfilter.go | 4 ++-- .../resource/v1alpha2/namedresourcesinstance.go | 4 ++-- .../resource/v1alpha2/namedresourcesintslice.go | 4 ++-- .../resource/v1alpha2/namedresourcesrequest.go | 4 ++-- .../resource/v1alpha2/namedresourcesresources.go | 4 ++-- .../resource/v1alpha2/namedresourcesstringslice.go | 4 ++-- applyconfigurations/resource/v1alpha2/podschedulingcontext.go | 4 ++-- .../resource/v1alpha2/podschedulingcontextspec.go | 4 ++-- .../resource/v1alpha2/podschedulingcontextstatus.go | 4 ++-- applyconfigurations/resource/v1alpha2/resourceclaim.go | 4 ++-- .../resource/v1alpha2/resourceclaimconsumerreference.go | 4 ++-- .../resource/v1alpha2/resourceclaimparameters.go | 4 ++-- .../resource/v1alpha2/resourceclaimparametersreference.go | 4 ++-- .../resource/v1alpha2/resourceclaimschedulingstatus.go | 4 ++-- applyconfigurations/resource/v1alpha2/resourceclaimspec.go | 4 ++-- applyconfigurations/resource/v1alpha2/resourceclaimstatus.go | 4 ++-- .../resource/v1alpha2/resourceclaimtemplate.go | 4 ++-- .../resource/v1alpha2/resourceclaimtemplatespec.go | 4 ++-- applyconfigurations/resource/v1alpha2/resourceclass.go | 4 ++-- .../resource/v1alpha2/resourceclassparameters.go | 4 ++-- .../resource/v1alpha2/resourceclassparametersreference.go | 4 ++-- applyconfigurations/resource/v1alpha2/resourcefilter.go | 4 ++-- applyconfigurations/resource/v1alpha2/resourcefiltermodel.go | 4 ++-- applyconfigurations/resource/v1alpha2/resourcehandle.go | 4 ++-- applyconfigurations/resource/v1alpha2/resourcemodel.go | 4 ++-- applyconfigurations/resource/v1alpha2/resourcerequest.go | 4 ++-- applyconfigurations/resource/v1alpha2/resourcerequestmodel.go | 4 ++-- applyconfigurations/resource/v1alpha2/resourceslice.go | 4 ++-- .../resource/v1alpha2/structuredresourcehandle.go | 4 ++-- applyconfigurations/resource/v1alpha2/vendorparameters.go | 4 ++-- applyconfigurations/scheduling/v1/priorityclass.go | 4 ++-- applyconfigurations/scheduling/v1alpha1/priorityclass.go | 4 ++-- applyconfigurations/scheduling/v1beta1/priorityclass.go | 4 ++-- applyconfigurations/storage/v1/csidriver.go | 4 ++-- applyconfigurations/storage/v1/csidriverspec.go | 4 ++-- applyconfigurations/storage/v1/csinode.go | 4 ++-- applyconfigurations/storage/v1/csinodedriver.go | 4 ++-- applyconfigurations/storage/v1/csinodespec.go | 4 ++-- applyconfigurations/storage/v1/csistoragecapacity.go | 4 ++-- applyconfigurations/storage/v1/storageclass.go | 4 ++-- applyconfigurations/storage/v1/tokenrequest.go | 4 ++-- applyconfigurations/storage/v1/volumeattachment.go | 4 ++-- applyconfigurations/storage/v1/volumeattachmentsource.go | 4 ++-- applyconfigurations/storage/v1/volumeattachmentspec.go | 4 ++-- applyconfigurations/storage/v1/volumeattachmentstatus.go | 4 ++-- applyconfigurations/storage/v1/volumeerror.go | 4 ++-- applyconfigurations/storage/v1/volumenoderesources.go | 4 ++-- applyconfigurations/storage/v1alpha1/csistoragecapacity.go | 4 ++-- applyconfigurations/storage/v1alpha1/volumeattachment.go | 4 ++-- .../storage/v1alpha1/volumeattachmentsource.go | 4 ++-- applyconfigurations/storage/v1alpha1/volumeattachmentspec.go | 4 ++-- .../storage/v1alpha1/volumeattachmentstatus.go | 4 ++-- applyconfigurations/storage/v1alpha1/volumeattributesclass.go | 4 ++-- applyconfigurations/storage/v1alpha1/volumeerror.go | 4 ++-- applyconfigurations/storage/v1beta1/csidriver.go | 4 ++-- applyconfigurations/storage/v1beta1/csidriverspec.go | 4 ++-- applyconfigurations/storage/v1beta1/csinode.go | 4 ++-- applyconfigurations/storage/v1beta1/csinodedriver.go | 4 ++-- applyconfigurations/storage/v1beta1/csinodespec.go | 4 ++-- applyconfigurations/storage/v1beta1/csistoragecapacity.go | 4 ++-- applyconfigurations/storage/v1beta1/storageclass.go | 4 ++-- applyconfigurations/storage/v1beta1/tokenrequest.go | 4 ++-- applyconfigurations/storage/v1beta1/volumeattachment.go | 4 ++-- applyconfigurations/storage/v1beta1/volumeattachmentsource.go | 4 ++-- applyconfigurations/storage/v1beta1/volumeattachmentspec.go | 4 ++-- applyconfigurations/storage/v1beta1/volumeattachmentstatus.go | 4 ++-- applyconfigurations/storage/v1beta1/volumeerror.go | 4 ++-- applyconfigurations/storage/v1beta1/volumenoderesources.go | 4 ++-- .../storagemigration/v1alpha1/groupversionresource.go | 4 ++-- .../storagemigration/v1alpha1/migrationcondition.go | 4 ++-- .../storagemigration/v1alpha1/storageversionmigration.go | 4 ++-- .../storagemigration/v1alpha1/storageversionmigrationspec.go | 4 ++-- .../v1alpha1/storageversionmigrationstatus.go | 4 ++-- 745 files changed, 1490 insertions(+), 1490 deletions(-) diff --git a/applyconfigurations/admissionregistration/v1/auditannotation.go b/applyconfigurations/admissionregistration/v1/auditannotation.go index 64422c1df4..0d50d44ac2 100644 --- a/applyconfigurations/admissionregistration/v1/auditannotation.go +++ b/applyconfigurations/admissionregistration/v1/auditannotation.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// AuditAnnotationApplyConfiguration represents an declarative configuration of the AuditAnnotation type for use +// AuditAnnotationApplyConfiguration represents a declarative configuration of the AuditAnnotation type for use // with apply. type AuditAnnotationApplyConfiguration struct { Key *string `json:"key,omitempty"` ValueExpression *string `json:"valueExpression,omitempty"` } -// AuditAnnotationApplyConfiguration constructs an declarative configuration of the AuditAnnotation type for use with +// AuditAnnotationApplyConfiguration constructs a declarative configuration of the AuditAnnotation type for use with // apply. func AuditAnnotation() *AuditAnnotationApplyConfiguration { return &AuditAnnotationApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1/expressionwarning.go b/applyconfigurations/admissionregistration/v1/expressionwarning.go index 38b7475cc4..1f890bcfcb 100644 --- a/applyconfigurations/admissionregistration/v1/expressionwarning.go +++ b/applyconfigurations/admissionregistration/v1/expressionwarning.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// ExpressionWarningApplyConfiguration represents an declarative configuration of the ExpressionWarning type for use +// ExpressionWarningApplyConfiguration represents a declarative configuration of the ExpressionWarning type for use // with apply. type ExpressionWarningApplyConfiguration struct { FieldRef *string `json:"fieldRef,omitempty"` Warning *string `json:"warning,omitempty"` } -// ExpressionWarningApplyConfiguration constructs an declarative configuration of the ExpressionWarning type for use with +// ExpressionWarningApplyConfiguration constructs a declarative configuration of the ExpressionWarning type for use with // apply. func ExpressionWarning() *ExpressionWarningApplyConfiguration { return &ExpressionWarningApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1/matchcondition.go b/applyconfigurations/admissionregistration/v1/matchcondition.go index ea1dc377b9..d8a816f1e2 100644 --- a/applyconfigurations/admissionregistration/v1/matchcondition.go +++ b/applyconfigurations/admissionregistration/v1/matchcondition.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// MatchConditionApplyConfiguration represents an declarative configuration of the MatchCondition type for use +// MatchConditionApplyConfiguration represents a declarative configuration of the MatchCondition type for use // with apply. type MatchConditionApplyConfiguration struct { Name *string `json:"name,omitempty"` Expression *string `json:"expression,omitempty"` } -// MatchConditionApplyConfiguration constructs an declarative configuration of the MatchCondition type for use with +// MatchConditionApplyConfiguration constructs a declarative configuration of the MatchCondition type for use with // apply. func MatchCondition() *MatchConditionApplyConfiguration { return &MatchConditionApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1/matchresources.go b/applyconfigurations/admissionregistration/v1/matchresources.go index d8e9828947..e8e371d7dd 100644 --- a/applyconfigurations/admissionregistration/v1/matchresources.go +++ b/applyconfigurations/admissionregistration/v1/matchresources.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// MatchResourcesApplyConfiguration represents an declarative configuration of the MatchResources type for use +// MatchResourcesApplyConfiguration represents a declarative configuration of the MatchResources type for use // with apply. type MatchResourcesApplyConfiguration struct { NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` @@ -33,7 +33,7 @@ type MatchResourcesApplyConfiguration struct { MatchPolicy *apiadmissionregistrationv1.MatchPolicyType `json:"matchPolicy,omitempty"` } -// MatchResourcesApplyConfiguration constructs an declarative configuration of the MatchResources type for use with +// MatchResourcesApplyConfiguration constructs a declarative configuration of the MatchResources type for use with // apply. func MatchResources() *MatchResourcesApplyConfiguration { return &MatchResourcesApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1/mutatingwebhook.go b/applyconfigurations/admissionregistration/v1/mutatingwebhook.go index faff51a041..cd8096f902 100644 --- a/applyconfigurations/admissionregistration/v1/mutatingwebhook.go +++ b/applyconfigurations/admissionregistration/v1/mutatingwebhook.go @@ -23,7 +23,7 @@ import ( metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// MutatingWebhookApplyConfiguration represents an declarative configuration of the MutatingWebhook type for use +// MutatingWebhookApplyConfiguration represents a declarative configuration of the MutatingWebhook type for use // with apply. type MutatingWebhookApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -40,7 +40,7 @@ type MutatingWebhookApplyConfiguration struct { MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"` } -// MutatingWebhookApplyConfiguration constructs an declarative configuration of the MutatingWebhook type for use with +// MutatingWebhookApplyConfiguration constructs a declarative configuration of the MutatingWebhook type for use with // apply. func MutatingWebhook() *MutatingWebhookApplyConfiguration { return &MutatingWebhookApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1/mutatingwebhookconfiguration.go b/applyconfigurations/admissionregistration/v1/mutatingwebhookconfiguration.go index 50eeae308a..58b71d6d58 100644 --- a/applyconfigurations/admissionregistration/v1/mutatingwebhookconfiguration.go +++ b/applyconfigurations/admissionregistration/v1/mutatingwebhookconfiguration.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// MutatingWebhookConfigurationApplyConfiguration represents an declarative configuration of the MutatingWebhookConfiguration type for use +// MutatingWebhookConfigurationApplyConfiguration represents a declarative configuration of the MutatingWebhookConfiguration type for use // with apply. type MutatingWebhookConfigurationApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type MutatingWebhookConfigurationApplyConfiguration struct { Webhooks []MutatingWebhookApplyConfiguration `json:"webhooks,omitempty"` } -// MutatingWebhookConfiguration constructs an declarative configuration of the MutatingWebhookConfiguration type for use with +// MutatingWebhookConfiguration constructs a declarative configuration of the MutatingWebhookConfiguration type for use with // apply. func MutatingWebhookConfiguration(name string) *MutatingWebhookConfigurationApplyConfiguration { b := &MutatingWebhookConfigurationApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1/namedrulewithoperations.go b/applyconfigurations/admissionregistration/v1/namedrulewithoperations.go index be8d5206cb..eda3bf635a 100644 --- a/applyconfigurations/admissionregistration/v1/namedrulewithoperations.go +++ b/applyconfigurations/admissionregistration/v1/namedrulewithoperations.go @@ -22,14 +22,14 @@ import ( admissionregistrationv1 "k8s.io/api/admissionregistration/v1" ) -// NamedRuleWithOperationsApplyConfiguration represents an declarative configuration of the NamedRuleWithOperations type for use +// NamedRuleWithOperationsApplyConfiguration represents a declarative configuration of the NamedRuleWithOperations type for use // with apply. type NamedRuleWithOperationsApplyConfiguration struct { ResourceNames []string `json:"resourceNames,omitempty"` RuleWithOperationsApplyConfiguration `json:",inline"` } -// NamedRuleWithOperationsApplyConfiguration constructs an declarative configuration of the NamedRuleWithOperations type for use with +// NamedRuleWithOperationsApplyConfiguration constructs a declarative configuration of the NamedRuleWithOperations type for use with // apply. func NamedRuleWithOperations() *NamedRuleWithOperationsApplyConfiguration { return &NamedRuleWithOperationsApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1/paramkind.go b/applyconfigurations/admissionregistration/v1/paramkind.go index b77a30cf91..07577929ab 100644 --- a/applyconfigurations/admissionregistration/v1/paramkind.go +++ b/applyconfigurations/admissionregistration/v1/paramkind.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// ParamKindApplyConfiguration represents an declarative configuration of the ParamKind type for use +// ParamKindApplyConfiguration represents a declarative configuration of the ParamKind type for use // with apply. type ParamKindApplyConfiguration struct { APIVersion *string `json:"apiVersion,omitempty"` Kind *string `json:"kind,omitempty"` } -// ParamKindApplyConfiguration constructs an declarative configuration of the ParamKind type for use with +// ParamKindApplyConfiguration constructs a declarative configuration of the ParamKind type for use with // apply. func ParamKind() *ParamKindApplyConfiguration { return &ParamKindApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1/paramref.go b/applyconfigurations/admissionregistration/v1/paramref.go index b52becda5e..73cda9b04d 100644 --- a/applyconfigurations/admissionregistration/v1/paramref.go +++ b/applyconfigurations/admissionregistration/v1/paramref.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ParamRefApplyConfiguration represents an declarative configuration of the ParamRef type for use +// ParamRefApplyConfiguration represents a declarative configuration of the ParamRef type for use // with apply. type ParamRefApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -32,7 +32,7 @@ type ParamRefApplyConfiguration struct { ParameterNotFoundAction *admissionregistrationv1.ParameterNotFoundActionType `json:"parameterNotFoundAction,omitempty"` } -// ParamRefApplyConfiguration constructs an declarative configuration of the ParamRef type for use with +// ParamRefApplyConfiguration constructs a declarative configuration of the ParamRef type for use with // apply. func ParamRef() *ParamRefApplyConfiguration { return &ParamRefApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1/rule.go b/applyconfigurations/admissionregistration/v1/rule.go index 41d4179df4..36a93643c1 100644 --- a/applyconfigurations/admissionregistration/v1/rule.go +++ b/applyconfigurations/admissionregistration/v1/rule.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/admissionregistration/v1" ) -// 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 { APIGroups []string `json:"apiGroups,omitempty"` @@ -31,7 +31,7 @@ type RuleApplyConfiguration struct { Scope *v1.ScopeType `json:"scope,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/applyconfigurations/admissionregistration/v1/rulewithoperations.go b/applyconfigurations/admissionregistration/v1/rulewithoperations.go index 59bbb8fe3d..92bddd502a 100644 --- a/applyconfigurations/admissionregistration/v1/rulewithoperations.go +++ b/applyconfigurations/admissionregistration/v1/rulewithoperations.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/admissionregistration/v1" ) -// RuleWithOperationsApplyConfiguration represents an declarative configuration of the RuleWithOperations type for use +// RuleWithOperationsApplyConfiguration represents a declarative configuration of the RuleWithOperations type for use // with apply. type RuleWithOperationsApplyConfiguration struct { Operations []v1.OperationType `json:"operations,omitempty"` RuleApplyConfiguration `json:",inline"` } -// RuleWithOperationsApplyConfiguration constructs an declarative configuration of the RuleWithOperations type for use with +// RuleWithOperationsApplyConfiguration constructs a declarative configuration of the RuleWithOperations type for use with // apply. func RuleWithOperations() *RuleWithOperationsApplyConfiguration { return &RuleWithOperationsApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1/servicereference.go b/applyconfigurations/admissionregistration/v1/servicereference.go index 2cd55d9ea2..239780664d 100644 --- a/applyconfigurations/admissionregistration/v1/servicereference.go +++ b/applyconfigurations/admissionregistration/v1/servicereference.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// ServiceReferenceApplyConfiguration represents an declarative configuration of the ServiceReference type for use +// ServiceReferenceApplyConfiguration represents a declarative configuration of the ServiceReference type for use // with apply. type ServiceReferenceApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` @@ -27,7 +27,7 @@ type ServiceReferenceApplyConfiguration struct { Port *int32 `json:"port,omitempty"` } -// ServiceReferenceApplyConfiguration constructs an declarative configuration of the ServiceReference type for use with +// ServiceReferenceApplyConfiguration constructs a declarative configuration of the ServiceReference type for use with // apply. func ServiceReference() *ServiceReferenceApplyConfiguration { return &ServiceReferenceApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1/typechecking.go b/applyconfigurations/admissionregistration/v1/typechecking.go index 8621ce71ec..723d10ecf5 100644 --- a/applyconfigurations/admissionregistration/v1/typechecking.go +++ b/applyconfigurations/admissionregistration/v1/typechecking.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// TypeCheckingApplyConfiguration represents an declarative configuration of the TypeChecking type for use +// TypeCheckingApplyConfiguration represents a declarative configuration of the TypeChecking type for use // with apply. type TypeCheckingApplyConfiguration struct { ExpressionWarnings []ExpressionWarningApplyConfiguration `json:"expressionWarnings,omitempty"` } -// TypeCheckingApplyConfiguration constructs an declarative configuration of the TypeChecking type for use with +// TypeCheckingApplyConfiguration constructs a declarative configuration of the TypeChecking type for use with // apply. func TypeChecking() *TypeCheckingApplyConfiguration { return &TypeCheckingApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1/validatingadmissionpolicy.go b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicy.go index 881da7fcde..841209cae1 100644 --- a/applyconfigurations/admissionregistration/v1/validatingadmissionpolicy.go +++ b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicy.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ValidatingAdmissionPolicyApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicy type for use +// ValidatingAdmissionPolicyApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicy type for use // with apply. type ValidatingAdmissionPolicyApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type ValidatingAdmissionPolicyApplyConfiguration struct { Status *ValidatingAdmissionPolicyStatusApplyConfiguration `json:"status,omitempty"` } -// ValidatingAdmissionPolicy constructs an declarative configuration of the ValidatingAdmissionPolicy type for use with +// ValidatingAdmissionPolicy constructs a declarative configuration of the ValidatingAdmissionPolicy type for use with // apply. func ValidatingAdmissionPolicy(name string) *ValidatingAdmissionPolicyApplyConfiguration { b := &ValidatingAdmissionPolicyApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybinding.go b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybinding.go index 8719916292..1acad056f3 100644 --- a/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybinding.go +++ b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybinding.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ValidatingAdmissionPolicyBindingApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicyBinding type for use +// ValidatingAdmissionPolicyBindingApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyBinding type for use // with apply. type ValidatingAdmissionPolicyBindingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type ValidatingAdmissionPolicyBindingApplyConfiguration struct { Spec *ValidatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"` } -// ValidatingAdmissionPolicyBinding constructs an declarative configuration of the ValidatingAdmissionPolicyBinding type for use with +// ValidatingAdmissionPolicyBinding constructs a declarative configuration of the ValidatingAdmissionPolicyBinding type for use with // apply. func ValidatingAdmissionPolicyBinding(name string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b := &ValidatingAdmissionPolicyBindingApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybindingspec.go b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybindingspec.go index da6ecbe371..eb426af42a 100644 --- a/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybindingspec.go +++ b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicybindingspec.go @@ -22,7 +22,7 @@ import ( admissionregistrationv1 "k8s.io/api/admissionregistration/v1" ) -// ValidatingAdmissionPolicyBindingSpecApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use +// ValidatingAdmissionPolicyBindingSpecApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use // with apply. type ValidatingAdmissionPolicyBindingSpecApplyConfiguration struct { PolicyName *string `json:"policyName,omitempty"` @@ -31,7 +31,7 @@ type ValidatingAdmissionPolicyBindingSpecApplyConfiguration struct { ValidationActions []admissionregistrationv1.ValidationAction `json:"validationActions,omitempty"` } -// ValidatingAdmissionPolicyBindingSpecApplyConfiguration constructs an declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use with +// ValidatingAdmissionPolicyBindingSpecApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use with // apply. func ValidatingAdmissionPolicyBindingSpec() *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { return &ValidatingAdmissionPolicyBindingSpecApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1/validatingadmissionpolicyspec.go b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicyspec.go index eb930b9b1c..1635b30a61 100644 --- a/applyconfigurations/admissionregistration/v1/validatingadmissionpolicyspec.go +++ b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicyspec.go @@ -22,7 +22,7 @@ import ( admissionregistrationv1 "k8s.io/api/admissionregistration/v1" ) -// ValidatingAdmissionPolicySpecApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicySpec type for use +// ValidatingAdmissionPolicySpecApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicySpec type for use // with apply. type ValidatingAdmissionPolicySpecApplyConfiguration struct { ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"` @@ -34,7 +34,7 @@ type ValidatingAdmissionPolicySpecApplyConfiguration struct { Variables []VariableApplyConfiguration `json:"variables,omitempty"` } -// ValidatingAdmissionPolicySpecApplyConfiguration constructs an declarative configuration of the ValidatingAdmissionPolicySpec type for use with +// ValidatingAdmissionPolicySpecApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicySpec type for use with // apply. func ValidatingAdmissionPolicySpec() *ValidatingAdmissionPolicySpecApplyConfiguration { return &ValidatingAdmissionPolicySpecApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1/validatingadmissionpolicystatus.go b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicystatus.go index 25cd67f08d..e6f4e84591 100644 --- a/applyconfigurations/admissionregistration/v1/validatingadmissionpolicystatus.go +++ b/applyconfigurations/admissionregistration/v1/validatingadmissionpolicystatus.go @@ -22,7 +22,7 @@ import ( metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ValidatingAdmissionPolicyStatusApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicyStatus type for use +// ValidatingAdmissionPolicyStatusApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyStatus type for use // with apply. type ValidatingAdmissionPolicyStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` @@ -30,7 +30,7 @@ type ValidatingAdmissionPolicyStatusApplyConfiguration struct { Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` } -// ValidatingAdmissionPolicyStatusApplyConfiguration constructs an declarative configuration of the ValidatingAdmissionPolicyStatus type for use with +// ValidatingAdmissionPolicyStatusApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicyStatus type for use with // apply. func ValidatingAdmissionPolicyStatus() *ValidatingAdmissionPolicyStatusApplyConfiguration { return &ValidatingAdmissionPolicyStatusApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1/validatingwebhook.go b/applyconfigurations/admissionregistration/v1/validatingwebhook.go index 613856bac7..a2c705eb5c 100644 --- a/applyconfigurations/admissionregistration/v1/validatingwebhook.go +++ b/applyconfigurations/admissionregistration/v1/validatingwebhook.go @@ -23,7 +23,7 @@ import ( metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ValidatingWebhookApplyConfiguration represents an declarative configuration of the ValidatingWebhook type for use +// ValidatingWebhookApplyConfiguration represents a declarative configuration of the ValidatingWebhook type for use // with apply. type ValidatingWebhookApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -39,7 +39,7 @@ type ValidatingWebhookApplyConfiguration struct { MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"` } -// ValidatingWebhookApplyConfiguration constructs an declarative configuration of the ValidatingWebhook type for use with +// ValidatingWebhookApplyConfiguration constructs a declarative configuration of the ValidatingWebhook type for use with // apply. func ValidatingWebhook() *ValidatingWebhookApplyConfiguration { return &ValidatingWebhookApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1/validatingwebhookconfiguration.go b/applyconfigurations/admissionregistration/v1/validatingwebhookconfiguration.go index 95b1419f6f..0d1a6c81ae 100644 --- a/applyconfigurations/admissionregistration/v1/validatingwebhookconfiguration.go +++ b/applyconfigurations/admissionregistration/v1/validatingwebhookconfiguration.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ValidatingWebhookConfigurationApplyConfiguration represents an declarative configuration of the ValidatingWebhookConfiguration type for use +// ValidatingWebhookConfigurationApplyConfiguration represents a declarative configuration of the ValidatingWebhookConfiguration type for use // with apply. type ValidatingWebhookConfigurationApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type ValidatingWebhookConfigurationApplyConfiguration struct { Webhooks []ValidatingWebhookApplyConfiguration `json:"webhooks,omitempty"` } -// ValidatingWebhookConfiguration constructs an declarative configuration of the ValidatingWebhookConfiguration type for use with +// ValidatingWebhookConfiguration constructs a declarative configuration of the ValidatingWebhookConfiguration type for use with // apply. func ValidatingWebhookConfiguration(name string) *ValidatingWebhookConfigurationApplyConfiguration { b := &ValidatingWebhookConfigurationApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1/validation.go b/applyconfigurations/admissionregistration/v1/validation.go index ac29d14362..2a828b6b4f 100644 --- a/applyconfigurations/admissionregistration/v1/validation.go +++ b/applyconfigurations/admissionregistration/v1/validation.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// ValidationApplyConfiguration represents an declarative configuration of the Validation type for use +// ValidationApplyConfiguration represents a declarative configuration of the Validation type for use // with apply. type ValidationApplyConfiguration struct { Expression *string `json:"expression,omitempty"` @@ -31,7 +31,7 @@ type ValidationApplyConfiguration struct { MessageExpression *string `json:"messageExpression,omitempty"` } -// ValidationApplyConfiguration constructs an declarative configuration of the Validation type for use with +// ValidationApplyConfiguration constructs a declarative configuration of the Validation type for use with // apply. func Validation() *ValidationApplyConfiguration { return &ValidationApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1/variable.go b/applyconfigurations/admissionregistration/v1/variable.go index d55f29a38b..9dd20afa72 100644 --- a/applyconfigurations/admissionregistration/v1/variable.go +++ b/applyconfigurations/admissionregistration/v1/variable.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// VariableApplyConfiguration represents an declarative configuration of the Variable type for use +// VariableApplyConfiguration represents a declarative configuration of the Variable type for use // with apply. type VariableApplyConfiguration struct { Name *string `json:"name,omitempty"` Expression *string `json:"expression,omitempty"` } -// VariableApplyConfiguration constructs an declarative configuration of the Variable type for use with +// VariableApplyConfiguration constructs a declarative configuration of the Variable type for use with // apply. func Variable() *VariableApplyConfiguration { return &VariableApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1/webhookclientconfig.go b/applyconfigurations/admissionregistration/v1/webhookclientconfig.go index aa358ae205..77f2227b95 100644 --- a/applyconfigurations/admissionregistration/v1/webhookclientconfig.go +++ b/applyconfigurations/admissionregistration/v1/webhookclientconfig.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// WebhookClientConfigApplyConfiguration represents an declarative configuration of the WebhookClientConfig type for use +// WebhookClientConfigApplyConfiguration represents a declarative configuration of the WebhookClientConfig type for use // with apply. type WebhookClientConfigApplyConfiguration struct { URL *string `json:"url,omitempty"` @@ -26,7 +26,7 @@ type WebhookClientConfigApplyConfiguration struct { CABundle []byte `json:"caBundle,omitempty"` } -// WebhookClientConfigApplyConfiguration constructs an declarative configuration of the WebhookClientConfig type for use with +// WebhookClientConfigApplyConfiguration constructs a declarative configuration of the WebhookClientConfig type for use with // apply. func WebhookClientConfig() *WebhookClientConfigApplyConfiguration { return &WebhookClientConfigApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1alpha1/auditannotation.go b/applyconfigurations/admissionregistration/v1alpha1/auditannotation.go index 023695139d..958a537406 100644 --- a/applyconfigurations/admissionregistration/v1alpha1/auditannotation.go +++ b/applyconfigurations/admissionregistration/v1alpha1/auditannotation.go @@ -18,14 +18,14 @@ limitations under the License. package v1alpha1 -// AuditAnnotationApplyConfiguration represents an declarative configuration of the AuditAnnotation type for use +// AuditAnnotationApplyConfiguration represents a declarative configuration of the AuditAnnotation type for use // with apply. type AuditAnnotationApplyConfiguration struct { Key *string `json:"key,omitempty"` ValueExpression *string `json:"valueExpression,omitempty"` } -// AuditAnnotationApplyConfiguration constructs an declarative configuration of the AuditAnnotation type for use with +// AuditAnnotationApplyConfiguration constructs a declarative configuration of the AuditAnnotation type for use with // apply. func AuditAnnotation() *AuditAnnotationApplyConfiguration { return &AuditAnnotationApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1alpha1/expressionwarning.go b/applyconfigurations/admissionregistration/v1alpha1/expressionwarning.go index f8b511f512..f36c2f0f5c 100644 --- a/applyconfigurations/admissionregistration/v1alpha1/expressionwarning.go +++ b/applyconfigurations/admissionregistration/v1alpha1/expressionwarning.go @@ -18,14 +18,14 @@ limitations under the License. package v1alpha1 -// ExpressionWarningApplyConfiguration represents an declarative configuration of the ExpressionWarning type for use +// ExpressionWarningApplyConfiguration represents a declarative configuration of the ExpressionWarning type for use // with apply. type ExpressionWarningApplyConfiguration struct { FieldRef *string `json:"fieldRef,omitempty"` Warning *string `json:"warning,omitempty"` } -// ExpressionWarningApplyConfiguration constructs an declarative configuration of the ExpressionWarning type for use with +// ExpressionWarningApplyConfiguration constructs a declarative configuration of the ExpressionWarning type for use with // apply. func ExpressionWarning() *ExpressionWarningApplyConfiguration { return &ExpressionWarningApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1alpha1/matchcondition.go b/applyconfigurations/admissionregistration/v1alpha1/matchcondition.go index 186c750f96..7f983dcb22 100644 --- a/applyconfigurations/admissionregistration/v1alpha1/matchcondition.go +++ b/applyconfigurations/admissionregistration/v1alpha1/matchcondition.go @@ -18,14 +18,14 @@ limitations under the License. package v1alpha1 -// MatchConditionApplyConfiguration represents an declarative configuration of the MatchCondition type for use +// MatchConditionApplyConfiguration represents a declarative configuration of the MatchCondition type for use // with apply. type MatchConditionApplyConfiguration struct { Name *string `json:"name,omitempty"` Expression *string `json:"expression,omitempty"` } -// MatchConditionApplyConfiguration constructs an declarative configuration of the MatchCondition type for use with +// MatchConditionApplyConfiguration constructs a declarative configuration of the MatchCondition type for use with // apply. func MatchCondition() *MatchConditionApplyConfiguration { return &MatchConditionApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1alpha1/matchresources.go b/applyconfigurations/admissionregistration/v1alpha1/matchresources.go index a6710ac7ed..e443535b6a 100644 --- a/applyconfigurations/admissionregistration/v1alpha1/matchresources.go +++ b/applyconfigurations/admissionregistration/v1alpha1/matchresources.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// MatchResourcesApplyConfiguration represents an declarative configuration of the MatchResources type for use +// MatchResourcesApplyConfiguration represents a declarative configuration of the MatchResources type for use // with apply. type MatchResourcesApplyConfiguration struct { NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` @@ -33,7 +33,7 @@ type MatchResourcesApplyConfiguration struct { MatchPolicy *admissionregistrationv1alpha1.MatchPolicyType `json:"matchPolicy,omitempty"` } -// MatchResourcesApplyConfiguration constructs an declarative configuration of the MatchResources type for use with +// MatchResourcesApplyConfiguration constructs a declarative configuration of the MatchResources type for use with // apply. func MatchResources() *MatchResourcesApplyConfiguration { return &MatchResourcesApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1alpha1/namedrulewithoperations.go b/applyconfigurations/admissionregistration/v1alpha1/namedrulewithoperations.go index bb2a7ba890..5e6744fd74 100644 --- a/applyconfigurations/admissionregistration/v1alpha1/namedrulewithoperations.go +++ b/applyconfigurations/admissionregistration/v1alpha1/namedrulewithoperations.go @@ -23,14 +23,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" ) -// NamedRuleWithOperationsApplyConfiguration represents an declarative configuration of the NamedRuleWithOperations type for use +// NamedRuleWithOperationsApplyConfiguration represents a declarative configuration of the NamedRuleWithOperations type for use // with apply. type NamedRuleWithOperationsApplyConfiguration struct { ResourceNames []string `json:"resourceNames,omitempty"` v1.RuleWithOperationsApplyConfiguration `json:",inline"` } -// NamedRuleWithOperationsApplyConfiguration constructs an declarative configuration of the NamedRuleWithOperations type for use with +// NamedRuleWithOperationsApplyConfiguration constructs a declarative configuration of the NamedRuleWithOperations type for use with // apply. func NamedRuleWithOperations() *NamedRuleWithOperationsApplyConfiguration { return &NamedRuleWithOperationsApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1alpha1/paramkind.go b/applyconfigurations/admissionregistration/v1alpha1/paramkind.go index 350993cea0..daf17fb249 100644 --- a/applyconfigurations/admissionregistration/v1alpha1/paramkind.go +++ b/applyconfigurations/admissionregistration/v1alpha1/paramkind.go @@ -18,14 +18,14 @@ limitations under the License. package v1alpha1 -// ParamKindApplyConfiguration represents an declarative configuration of the ParamKind type for use +// ParamKindApplyConfiguration represents a declarative configuration of the ParamKind type for use // with apply. type ParamKindApplyConfiguration struct { APIVersion *string `json:"apiVersion,omitempty"` Kind *string `json:"kind,omitempty"` } -// ParamKindApplyConfiguration constructs an declarative configuration of the ParamKind type for use with +// ParamKindApplyConfiguration constructs a declarative configuration of the ParamKind type for use with // apply. func ParamKind() *ParamKindApplyConfiguration { return &ParamKindApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1alpha1/paramref.go b/applyconfigurations/admissionregistration/v1alpha1/paramref.go index 0951cae8a9..c4fff1d475 100644 --- a/applyconfigurations/admissionregistration/v1alpha1/paramref.go +++ b/applyconfigurations/admissionregistration/v1alpha1/paramref.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ParamRefApplyConfiguration represents an declarative configuration of the ParamRef type for use +// ParamRefApplyConfiguration represents a declarative configuration of the ParamRef type for use // with apply. type ParamRefApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -32,7 +32,7 @@ type ParamRefApplyConfiguration struct { ParameterNotFoundAction *v1alpha1.ParameterNotFoundActionType `json:"parameterNotFoundAction,omitempty"` } -// ParamRefApplyConfiguration constructs an declarative configuration of the ParamRef type for use with +// ParamRefApplyConfiguration constructs a declarative configuration of the ParamRef type for use with // apply. func ParamRef() *ParamRefApplyConfiguration { return &ParamRefApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1alpha1/typechecking.go b/applyconfigurations/admissionregistration/v1alpha1/typechecking.go index 42a9170710..d1a7fff50e 100644 --- a/applyconfigurations/admissionregistration/v1alpha1/typechecking.go +++ b/applyconfigurations/admissionregistration/v1alpha1/typechecking.go @@ -18,13 +18,13 @@ limitations under the License. package v1alpha1 -// TypeCheckingApplyConfiguration represents an declarative configuration of the TypeChecking type for use +// TypeCheckingApplyConfiguration represents a declarative configuration of the TypeChecking type for use // with apply. type TypeCheckingApplyConfiguration struct { ExpressionWarnings []ExpressionWarningApplyConfiguration `json:"expressionWarnings,omitempty"` } -// TypeCheckingApplyConfiguration constructs an declarative configuration of the TypeChecking type for use with +// TypeCheckingApplyConfiguration constructs a declarative configuration of the TypeChecking type for use with // apply. func TypeChecking() *TypeCheckingApplyConfiguration { return &TypeCheckingApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicy.go b/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicy.go index f8bd4dbc7e..fe60eb5f25 100644 --- a/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicy.go +++ b/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicy.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ValidatingAdmissionPolicyApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicy type for use +// ValidatingAdmissionPolicyApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicy type for use // with apply. type ValidatingAdmissionPolicyApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type ValidatingAdmissionPolicyApplyConfiguration struct { Status *ValidatingAdmissionPolicyStatusApplyConfiguration `json:"status,omitempty"` } -// ValidatingAdmissionPolicy constructs an declarative configuration of the ValidatingAdmissionPolicy type for use with +// ValidatingAdmissionPolicy constructs a declarative configuration of the ValidatingAdmissionPolicy type for use with // apply. func ValidatingAdmissionPolicy(name string) *ValidatingAdmissionPolicyApplyConfiguration { b := &ValidatingAdmissionPolicyApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go b/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go index 2e2e3a48f6..0c11ee5945 100644 --- a/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go +++ b/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ValidatingAdmissionPolicyBindingApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicyBinding type for use +// ValidatingAdmissionPolicyBindingApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyBinding type for use // with apply. type ValidatingAdmissionPolicyBindingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type ValidatingAdmissionPolicyBindingApplyConfiguration struct { Spec *ValidatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"` } -// ValidatingAdmissionPolicyBinding constructs an declarative configuration of the ValidatingAdmissionPolicyBinding type for use with +// ValidatingAdmissionPolicyBinding constructs a declarative configuration of the ValidatingAdmissionPolicyBinding type for use with // apply. func ValidatingAdmissionPolicyBinding(name string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b := &ValidatingAdmissionPolicyBindingApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicybindingspec.go b/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicybindingspec.go index c9a4ff7ab4..0f8e4e4357 100644 --- a/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicybindingspec.go +++ b/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicybindingspec.go @@ -22,7 +22,7 @@ import ( admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1" ) -// ValidatingAdmissionPolicyBindingSpecApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use +// ValidatingAdmissionPolicyBindingSpecApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use // with apply. type ValidatingAdmissionPolicyBindingSpecApplyConfiguration struct { PolicyName *string `json:"policyName,omitempty"` @@ -31,7 +31,7 @@ type ValidatingAdmissionPolicyBindingSpecApplyConfiguration struct { ValidationActions []admissionregistrationv1alpha1.ValidationAction `json:"validationActions,omitempty"` } -// ValidatingAdmissionPolicyBindingSpecApplyConfiguration constructs an declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use with +// ValidatingAdmissionPolicyBindingSpecApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use with // apply. func ValidatingAdmissionPolicyBindingSpec() *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { return &ValidatingAdmissionPolicyBindingSpecApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicyspec.go b/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicyspec.go index 7ee320e428..d5d3529949 100644 --- a/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicyspec.go +++ b/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicyspec.go @@ -22,7 +22,7 @@ import ( admissionregistrationv1alpha1 "k8s.io/api/admissionregistration/v1alpha1" ) -// ValidatingAdmissionPolicySpecApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicySpec type for use +// ValidatingAdmissionPolicySpecApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicySpec type for use // with apply. type ValidatingAdmissionPolicySpecApplyConfiguration struct { ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"` @@ -34,7 +34,7 @@ type ValidatingAdmissionPolicySpecApplyConfiguration struct { Variables []VariableApplyConfiguration `json:"variables,omitempty"` } -// ValidatingAdmissionPolicySpecApplyConfiguration constructs an declarative configuration of the ValidatingAdmissionPolicySpec type for use with +// ValidatingAdmissionPolicySpecApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicySpec type for use with // apply. func ValidatingAdmissionPolicySpec() *ValidatingAdmissionPolicySpecApplyConfiguration { return &ValidatingAdmissionPolicySpecApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicystatus.go b/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicystatus.go index 821184c8a8..2fec5ba477 100644 --- a/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicystatus.go +++ b/applyconfigurations/admissionregistration/v1alpha1/validatingadmissionpolicystatus.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ValidatingAdmissionPolicyStatusApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicyStatus type for use +// ValidatingAdmissionPolicyStatusApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyStatus type for use // with apply. type ValidatingAdmissionPolicyStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` @@ -30,7 +30,7 @@ type ValidatingAdmissionPolicyStatusApplyConfiguration struct { Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` } -// ValidatingAdmissionPolicyStatusApplyConfiguration constructs an declarative configuration of the ValidatingAdmissionPolicyStatus type for use with +// ValidatingAdmissionPolicyStatusApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicyStatus type for use with // apply. func ValidatingAdmissionPolicyStatus() *ValidatingAdmissionPolicyStatusApplyConfiguration { return &ValidatingAdmissionPolicyStatusApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1alpha1/validation.go b/applyconfigurations/admissionregistration/v1alpha1/validation.go index 9a5fc8475a..5f73043734 100644 --- a/applyconfigurations/admissionregistration/v1alpha1/validation.go +++ b/applyconfigurations/admissionregistration/v1alpha1/validation.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// ValidationApplyConfiguration represents an declarative configuration of the Validation type for use +// ValidationApplyConfiguration represents a declarative configuration of the Validation type for use // with apply. type ValidationApplyConfiguration struct { Expression *string `json:"expression,omitempty"` @@ -31,7 +31,7 @@ type ValidationApplyConfiguration struct { MessageExpression *string `json:"messageExpression,omitempty"` } -// ValidationApplyConfiguration constructs an declarative configuration of the Validation type for use with +// ValidationApplyConfiguration constructs a declarative configuration of the Validation type for use with // apply. func Validation() *ValidationApplyConfiguration { return &ValidationApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1alpha1/variable.go b/applyconfigurations/admissionregistration/v1alpha1/variable.go index 2c70a8cfb5..0459dae655 100644 --- a/applyconfigurations/admissionregistration/v1alpha1/variable.go +++ b/applyconfigurations/admissionregistration/v1alpha1/variable.go @@ -18,14 +18,14 @@ limitations under the License. package v1alpha1 -// VariableApplyConfiguration represents an declarative configuration of the Variable type for use +// VariableApplyConfiguration represents a declarative configuration of the Variable type for use // with apply. type VariableApplyConfiguration struct { Name *string `json:"name,omitempty"` Expression *string `json:"expression,omitempty"` } -// VariableApplyConfiguration constructs an declarative configuration of the Variable type for use with +// VariableApplyConfiguration constructs a declarative configuration of the Variable type for use with // apply. func Variable() *VariableApplyConfiguration { return &VariableApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1beta1/auditannotation.go b/applyconfigurations/admissionregistration/v1beta1/auditannotation.go index e92fba0ddb..8718db9447 100644 --- a/applyconfigurations/admissionregistration/v1beta1/auditannotation.go +++ b/applyconfigurations/admissionregistration/v1beta1/auditannotation.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta1 -// AuditAnnotationApplyConfiguration represents an declarative configuration of the AuditAnnotation type for use +// AuditAnnotationApplyConfiguration represents a declarative configuration of the AuditAnnotation type for use // with apply. type AuditAnnotationApplyConfiguration struct { Key *string `json:"key,omitempty"` ValueExpression *string `json:"valueExpression,omitempty"` } -// AuditAnnotationApplyConfiguration constructs an declarative configuration of the AuditAnnotation type for use with +// AuditAnnotationApplyConfiguration constructs a declarative configuration of the AuditAnnotation type for use with // apply. func AuditAnnotation() *AuditAnnotationApplyConfiguration { return &AuditAnnotationApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1beta1/expressionwarning.go b/applyconfigurations/admissionregistration/v1beta1/expressionwarning.go index 059c1b94ba..66cfc8cdc7 100644 --- a/applyconfigurations/admissionregistration/v1beta1/expressionwarning.go +++ b/applyconfigurations/admissionregistration/v1beta1/expressionwarning.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta1 -// ExpressionWarningApplyConfiguration represents an declarative configuration of the ExpressionWarning type for use +// ExpressionWarningApplyConfiguration represents a declarative configuration of the ExpressionWarning type for use // with apply. type ExpressionWarningApplyConfiguration struct { FieldRef *string `json:"fieldRef,omitempty"` Warning *string `json:"warning,omitempty"` } -// ExpressionWarningApplyConfiguration constructs an declarative configuration of the ExpressionWarning type for use with +// ExpressionWarningApplyConfiguration constructs a declarative configuration of the ExpressionWarning type for use with // apply. func ExpressionWarning() *ExpressionWarningApplyConfiguration { return &ExpressionWarningApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1beta1/matchcondition.go b/applyconfigurations/admissionregistration/v1beta1/matchcondition.go index d099b6b6ea..63db7fc801 100644 --- a/applyconfigurations/admissionregistration/v1beta1/matchcondition.go +++ b/applyconfigurations/admissionregistration/v1beta1/matchcondition.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta1 -// MatchConditionApplyConfiguration represents an declarative configuration of the MatchCondition type for use +// MatchConditionApplyConfiguration represents a declarative configuration of the MatchCondition type for use // with apply. type MatchConditionApplyConfiguration struct { Name *string `json:"name,omitempty"` Expression *string `json:"expression,omitempty"` } -// MatchConditionApplyConfiguration constructs an declarative configuration of the MatchCondition type for use with +// MatchConditionApplyConfiguration constructs a declarative configuration of the MatchCondition type for use with // apply. func MatchCondition() *MatchConditionApplyConfiguration { return &MatchConditionApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1beta1/matchresources.go b/applyconfigurations/admissionregistration/v1beta1/matchresources.go index 25d4139db6..4005e55a33 100644 --- a/applyconfigurations/admissionregistration/v1beta1/matchresources.go +++ b/applyconfigurations/admissionregistration/v1beta1/matchresources.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// MatchResourcesApplyConfiguration represents an declarative configuration of the MatchResources type for use +// MatchResourcesApplyConfiguration represents a declarative configuration of the MatchResources type for use // with apply. type MatchResourcesApplyConfiguration struct { NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` @@ -33,7 +33,7 @@ type MatchResourcesApplyConfiguration struct { MatchPolicy *admissionregistrationv1beta1.MatchPolicyType `json:"matchPolicy,omitempty"` } -// MatchResourcesApplyConfiguration constructs an declarative configuration of the MatchResources type for use with +// MatchResourcesApplyConfiguration constructs a declarative configuration of the MatchResources type for use with // apply. func MatchResources() *MatchResourcesApplyConfiguration { return &MatchResourcesApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1beta1/mutatingwebhook.go b/applyconfigurations/admissionregistration/v1beta1/mutatingwebhook.go index 54845341f4..b2ab76aefd 100644 --- a/applyconfigurations/admissionregistration/v1beta1/mutatingwebhook.go +++ b/applyconfigurations/admissionregistration/v1beta1/mutatingwebhook.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// MutatingWebhookApplyConfiguration represents an declarative configuration of the MutatingWebhook type for use +// MutatingWebhookApplyConfiguration represents a declarative configuration of the MutatingWebhook type for use // with apply. type MutatingWebhookApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -41,7 +41,7 @@ type MutatingWebhookApplyConfiguration struct { MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"` } -// MutatingWebhookApplyConfiguration constructs an declarative configuration of the MutatingWebhook type for use with +// MutatingWebhookApplyConfiguration constructs a declarative configuration of the MutatingWebhook type for use with // apply. func MutatingWebhook() *MutatingWebhookApplyConfiguration { return &MutatingWebhookApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/applyconfigurations/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index 99e2be0b81..51bb823896 100644 --- a/applyconfigurations/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/applyconfigurations/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// MutatingWebhookConfigurationApplyConfiguration represents an declarative configuration of the MutatingWebhookConfiguration type for use +// MutatingWebhookConfigurationApplyConfiguration represents a declarative configuration of the MutatingWebhookConfiguration type for use // with apply. type MutatingWebhookConfigurationApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type MutatingWebhookConfigurationApplyConfiguration struct { Webhooks []MutatingWebhookApplyConfiguration `json:"webhooks,omitempty"` } -// MutatingWebhookConfiguration constructs an declarative configuration of the MutatingWebhookConfiguration type for use with +// MutatingWebhookConfiguration constructs a declarative configuration of the MutatingWebhookConfiguration type for use with // apply. func MutatingWebhookConfiguration(name string) *MutatingWebhookConfigurationApplyConfiguration { b := &MutatingWebhookConfigurationApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1beta1/namedrulewithoperations.go b/applyconfigurations/admissionregistration/v1beta1/namedrulewithoperations.go index fa346c4a57..5de70c7ad3 100644 --- a/applyconfigurations/admissionregistration/v1beta1/namedrulewithoperations.go +++ b/applyconfigurations/admissionregistration/v1beta1/namedrulewithoperations.go @@ -23,14 +23,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" ) -// NamedRuleWithOperationsApplyConfiguration represents an declarative configuration of the NamedRuleWithOperations type for use +// NamedRuleWithOperationsApplyConfiguration represents a declarative configuration of the NamedRuleWithOperations type for use // with apply. type NamedRuleWithOperationsApplyConfiguration struct { ResourceNames []string `json:"resourceNames,omitempty"` v1.RuleWithOperationsApplyConfiguration `json:",inline"` } -// NamedRuleWithOperationsApplyConfiguration constructs an declarative configuration of the NamedRuleWithOperations type for use with +// NamedRuleWithOperationsApplyConfiguration constructs a declarative configuration of the NamedRuleWithOperations type for use with // apply. func NamedRuleWithOperations() *NamedRuleWithOperationsApplyConfiguration { return &NamedRuleWithOperationsApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1beta1/paramkind.go b/applyconfigurations/admissionregistration/v1beta1/paramkind.go index 6050e60251..3983125281 100644 --- a/applyconfigurations/admissionregistration/v1beta1/paramkind.go +++ b/applyconfigurations/admissionregistration/v1beta1/paramkind.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta1 -// ParamKindApplyConfiguration represents an declarative configuration of the ParamKind type for use +// ParamKindApplyConfiguration represents a declarative configuration of the ParamKind type for use // with apply. type ParamKindApplyConfiguration struct { APIVersion *string `json:"apiVersion,omitempty"` Kind *string `json:"kind,omitempty"` } -// ParamKindApplyConfiguration constructs an declarative configuration of the ParamKind type for use with +// ParamKindApplyConfiguration constructs a declarative configuration of the ParamKind type for use with // apply. func ParamKind() *ParamKindApplyConfiguration { return &ParamKindApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1beta1/paramref.go b/applyconfigurations/admissionregistration/v1beta1/paramref.go index 2be98dbc52..0a94ae0673 100644 --- a/applyconfigurations/admissionregistration/v1beta1/paramref.go +++ b/applyconfigurations/admissionregistration/v1beta1/paramref.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ParamRefApplyConfiguration represents an declarative configuration of the ParamRef type for use +// ParamRefApplyConfiguration represents a declarative configuration of the ParamRef type for use // with apply. type ParamRefApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -32,7 +32,7 @@ type ParamRefApplyConfiguration struct { ParameterNotFoundAction *v1beta1.ParameterNotFoundActionType `json:"parameterNotFoundAction,omitempty"` } -// ParamRefApplyConfiguration constructs an declarative configuration of the ParamRef type for use with +// ParamRefApplyConfiguration constructs a declarative configuration of the ParamRef type for use with // apply. func ParamRef() *ParamRefApplyConfiguration { return &ParamRefApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1beta1/servicereference.go b/applyconfigurations/admissionregistration/v1beta1/servicereference.go index c21b574908..70cc6b5b27 100644 --- a/applyconfigurations/admissionregistration/v1beta1/servicereference.go +++ b/applyconfigurations/admissionregistration/v1beta1/servicereference.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// ServiceReferenceApplyConfiguration represents an declarative configuration of the ServiceReference type for use +// ServiceReferenceApplyConfiguration represents a declarative configuration of the ServiceReference type for use // with apply. type ServiceReferenceApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` @@ -27,7 +27,7 @@ type ServiceReferenceApplyConfiguration struct { Port *int32 `json:"port,omitempty"` } -// ServiceReferenceApplyConfiguration constructs an declarative configuration of the ServiceReference type for use with +// ServiceReferenceApplyConfiguration constructs a declarative configuration of the ServiceReference type for use with // apply. func ServiceReference() *ServiceReferenceApplyConfiguration { return &ServiceReferenceApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1beta1/typechecking.go b/applyconfigurations/admissionregistration/v1beta1/typechecking.go index 07baf334cd..cea6e11dee 100644 --- a/applyconfigurations/admissionregistration/v1beta1/typechecking.go +++ b/applyconfigurations/admissionregistration/v1beta1/typechecking.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta1 -// TypeCheckingApplyConfiguration represents an declarative configuration of the TypeChecking type for use +// TypeCheckingApplyConfiguration represents a declarative configuration of the TypeChecking type for use // with apply. type TypeCheckingApplyConfiguration struct { ExpressionWarnings []ExpressionWarningApplyConfiguration `json:"expressionWarnings,omitempty"` } -// TypeCheckingApplyConfiguration constructs an declarative configuration of the TypeChecking type for use with +// TypeCheckingApplyConfiguration constructs a declarative configuration of the TypeChecking type for use with // apply. func TypeChecking() *TypeCheckingApplyConfiguration { return &TypeCheckingApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicy.go b/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicy.go index b03f78c0cb..c29ee56cbe 100644 --- a/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicy.go +++ b/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicy.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ValidatingAdmissionPolicyApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicy type for use +// ValidatingAdmissionPolicyApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicy type for use // with apply. type ValidatingAdmissionPolicyApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type ValidatingAdmissionPolicyApplyConfiguration struct { Status *ValidatingAdmissionPolicyStatusApplyConfiguration `json:"status,omitempty"` } -// ValidatingAdmissionPolicy constructs an declarative configuration of the ValidatingAdmissionPolicy type for use with +// ValidatingAdmissionPolicy constructs a declarative configuration of the ValidatingAdmissionPolicy type for use with // apply. func ValidatingAdmissionPolicy(name string) *ValidatingAdmissionPolicyApplyConfiguration { b := &ValidatingAdmissionPolicyApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybinding.go b/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybinding.go index 637d350b3b..4347c4810c 100644 --- a/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybinding.go +++ b/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybinding.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ValidatingAdmissionPolicyBindingApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicyBinding type for use +// ValidatingAdmissionPolicyBindingApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyBinding type for use // with apply. type ValidatingAdmissionPolicyBindingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type ValidatingAdmissionPolicyBindingApplyConfiguration struct { Spec *ValidatingAdmissionPolicyBindingSpecApplyConfiguration `json:"spec,omitempty"` } -// ValidatingAdmissionPolicyBinding constructs an declarative configuration of the ValidatingAdmissionPolicyBinding type for use with +// ValidatingAdmissionPolicyBinding constructs a declarative configuration of the ValidatingAdmissionPolicyBinding type for use with // apply. func ValidatingAdmissionPolicyBinding(name string) *ValidatingAdmissionPolicyBindingApplyConfiguration { b := &ValidatingAdmissionPolicyBindingApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybindingspec.go b/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybindingspec.go index d20a78efff..bddc3a40c7 100644 --- a/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybindingspec.go +++ b/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicybindingspec.go @@ -22,7 +22,7 @@ import ( admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" ) -// ValidatingAdmissionPolicyBindingSpecApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use +// ValidatingAdmissionPolicyBindingSpecApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use // with apply. type ValidatingAdmissionPolicyBindingSpecApplyConfiguration struct { PolicyName *string `json:"policyName,omitempty"` @@ -31,7 +31,7 @@ type ValidatingAdmissionPolicyBindingSpecApplyConfiguration struct { ValidationActions []admissionregistrationv1beta1.ValidationAction `json:"validationActions,omitempty"` } -// ValidatingAdmissionPolicyBindingSpecApplyConfiguration constructs an declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use with +// ValidatingAdmissionPolicyBindingSpecApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicyBindingSpec type for use with // apply. func ValidatingAdmissionPolicyBindingSpec() *ValidatingAdmissionPolicyBindingSpecApplyConfiguration { return &ValidatingAdmissionPolicyBindingSpecApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicyspec.go b/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicyspec.go index c6e9389103..8b235337d7 100644 --- a/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicyspec.go +++ b/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicyspec.go @@ -22,7 +22,7 @@ import ( admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" ) -// ValidatingAdmissionPolicySpecApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicySpec type for use +// ValidatingAdmissionPolicySpecApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicySpec type for use // with apply. type ValidatingAdmissionPolicySpecApplyConfiguration struct { ParamKind *ParamKindApplyConfiguration `json:"paramKind,omitempty"` @@ -34,7 +34,7 @@ type ValidatingAdmissionPolicySpecApplyConfiguration struct { Variables []VariableApplyConfiguration `json:"variables,omitempty"` } -// ValidatingAdmissionPolicySpecApplyConfiguration constructs an declarative configuration of the ValidatingAdmissionPolicySpec type for use with +// ValidatingAdmissionPolicySpecApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicySpec type for use with // apply. func ValidatingAdmissionPolicySpec() *ValidatingAdmissionPolicySpecApplyConfiguration { return &ValidatingAdmissionPolicySpecApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicystatus.go b/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicystatus.go index e3e6d417ed..4612af0cff 100644 --- a/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicystatus.go +++ b/applyconfigurations/admissionregistration/v1beta1/validatingadmissionpolicystatus.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ValidatingAdmissionPolicyStatusApplyConfiguration represents an declarative configuration of the ValidatingAdmissionPolicyStatus type for use +// ValidatingAdmissionPolicyStatusApplyConfiguration represents a declarative configuration of the ValidatingAdmissionPolicyStatus type for use // with apply. type ValidatingAdmissionPolicyStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` @@ -30,7 +30,7 @@ type ValidatingAdmissionPolicyStatusApplyConfiguration struct { Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` } -// ValidatingAdmissionPolicyStatusApplyConfiguration constructs an declarative configuration of the ValidatingAdmissionPolicyStatus type for use with +// ValidatingAdmissionPolicyStatusApplyConfiguration constructs a declarative configuration of the ValidatingAdmissionPolicyStatus type for use with // apply. func ValidatingAdmissionPolicyStatus() *ValidatingAdmissionPolicyStatusApplyConfiguration { return &ValidatingAdmissionPolicyStatusApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1beta1/validatingwebhook.go b/applyconfigurations/admissionregistration/v1beta1/validatingwebhook.go index 8c5c341bad..1e107d68f7 100644 --- a/applyconfigurations/admissionregistration/v1beta1/validatingwebhook.go +++ b/applyconfigurations/admissionregistration/v1beta1/validatingwebhook.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ValidatingWebhookApplyConfiguration represents an declarative configuration of the ValidatingWebhook type for use +// ValidatingWebhookApplyConfiguration represents a declarative configuration of the ValidatingWebhook type for use // with apply. type ValidatingWebhookApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -40,7 +40,7 @@ type ValidatingWebhookApplyConfiguration struct { MatchConditions []MatchConditionApplyConfiguration `json:"matchConditions,omitempty"` } -// ValidatingWebhookApplyConfiguration constructs an declarative configuration of the ValidatingWebhook type for use with +// ValidatingWebhookApplyConfiguration constructs a declarative configuration of the ValidatingWebhook type for use with // apply. func ValidatingWebhook() *ValidatingWebhookApplyConfiguration { return &ValidatingWebhookApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/applyconfigurations/admissionregistration/v1beta1/validatingwebhookconfiguration.go index d48b5454ee..c3535c180c 100644 --- a/applyconfigurations/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/applyconfigurations/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ValidatingWebhookConfigurationApplyConfiguration represents an declarative configuration of the ValidatingWebhookConfiguration type for use +// ValidatingWebhookConfigurationApplyConfiguration represents a declarative configuration of the ValidatingWebhookConfiguration type for use // with apply. type ValidatingWebhookConfigurationApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type ValidatingWebhookConfigurationApplyConfiguration struct { Webhooks []ValidatingWebhookApplyConfiguration `json:"webhooks,omitempty"` } -// ValidatingWebhookConfiguration constructs an declarative configuration of the ValidatingWebhookConfiguration type for use with +// ValidatingWebhookConfiguration constructs a declarative configuration of the ValidatingWebhookConfiguration type for use with // apply. func ValidatingWebhookConfiguration(name string) *ValidatingWebhookConfigurationApplyConfiguration { b := &ValidatingWebhookConfigurationApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1beta1/validation.go b/applyconfigurations/admissionregistration/v1beta1/validation.go index ed9ff1ac0c..019e8e7aa9 100644 --- a/applyconfigurations/admissionregistration/v1beta1/validation.go +++ b/applyconfigurations/admissionregistration/v1beta1/validation.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// ValidationApplyConfiguration represents an declarative configuration of the Validation type for use +// ValidationApplyConfiguration represents a declarative configuration of the Validation type for use // with apply. type ValidationApplyConfiguration struct { Expression *string `json:"expression,omitempty"` @@ -31,7 +31,7 @@ type ValidationApplyConfiguration struct { MessageExpression *string `json:"messageExpression,omitempty"` } -// ValidationApplyConfiguration constructs an declarative configuration of the Validation type for use with +// ValidationApplyConfiguration constructs a declarative configuration of the Validation type for use with // apply. func Validation() *ValidationApplyConfiguration { return &ValidationApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1beta1/variable.go b/applyconfigurations/admissionregistration/v1beta1/variable.go index 0fc294c65d..0ece197db2 100644 --- a/applyconfigurations/admissionregistration/v1beta1/variable.go +++ b/applyconfigurations/admissionregistration/v1beta1/variable.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta1 -// VariableApplyConfiguration represents an declarative configuration of the Variable type for use +// VariableApplyConfiguration represents a declarative configuration of the Variable type for use // with apply. type VariableApplyConfiguration struct { Name *string `json:"name,omitempty"` Expression *string `json:"expression,omitempty"` } -// VariableApplyConfiguration constructs an declarative configuration of the Variable type for use with +// VariableApplyConfiguration constructs a declarative configuration of the Variable type for use with // apply. func Variable() *VariableApplyConfiguration { return &VariableApplyConfiguration{} diff --git a/applyconfigurations/admissionregistration/v1beta1/webhookclientconfig.go b/applyconfigurations/admissionregistration/v1beta1/webhookclientconfig.go index 490f9d5f3f..76ff71b4ae 100644 --- a/applyconfigurations/admissionregistration/v1beta1/webhookclientconfig.go +++ b/applyconfigurations/admissionregistration/v1beta1/webhookclientconfig.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// WebhookClientConfigApplyConfiguration represents an declarative configuration of the WebhookClientConfig type for use +// WebhookClientConfigApplyConfiguration represents a declarative configuration of the WebhookClientConfig type for use // with apply. type WebhookClientConfigApplyConfiguration struct { URL *string `json:"url,omitempty"` @@ -26,7 +26,7 @@ type WebhookClientConfigApplyConfiguration struct { CABundle []byte `json:"caBundle,omitempty"` } -// WebhookClientConfigApplyConfiguration constructs an declarative configuration of the WebhookClientConfig type for use with +// WebhookClientConfigApplyConfiguration constructs a declarative configuration of the WebhookClientConfig type for use with // apply. func WebhookClientConfig() *WebhookClientConfigApplyConfiguration { return &WebhookClientConfigApplyConfiguration{} diff --git a/applyconfigurations/apiserverinternal/v1alpha1/serverstorageversion.go b/applyconfigurations/apiserverinternal/v1alpha1/serverstorageversion.go index 81c56330bb..8394298b93 100644 --- a/applyconfigurations/apiserverinternal/v1alpha1/serverstorageversion.go +++ b/applyconfigurations/apiserverinternal/v1alpha1/serverstorageversion.go @@ -18,7 +18,7 @@ limitations under the License. package v1alpha1 -// ServerStorageVersionApplyConfiguration represents an declarative configuration of the ServerStorageVersion type for use +// ServerStorageVersionApplyConfiguration represents a declarative configuration of the ServerStorageVersion type for use // with apply. type ServerStorageVersionApplyConfiguration struct { APIServerID *string `json:"apiServerID,omitempty"` @@ -27,7 +27,7 @@ type ServerStorageVersionApplyConfiguration struct { ServedVersions []string `json:"servedVersions,omitempty"` } -// ServerStorageVersionApplyConfiguration constructs an declarative configuration of the ServerStorageVersion type for use with +// ServerStorageVersionApplyConfiguration constructs a declarative configuration of the ServerStorageVersion type for use with // apply. func ServerStorageVersion() *ServerStorageVersionApplyConfiguration { return &ServerStorageVersionApplyConfiguration{} diff --git a/applyconfigurations/apiserverinternal/v1alpha1/storageversion.go b/applyconfigurations/apiserverinternal/v1alpha1/storageversion.go index 5727164e41..d734328b06 100644 --- a/applyconfigurations/apiserverinternal/v1alpha1/storageversion.go +++ b/applyconfigurations/apiserverinternal/v1alpha1/storageversion.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// StorageVersionApplyConfiguration represents an declarative configuration of the StorageVersion type for use +// StorageVersionApplyConfiguration represents a declarative configuration of the StorageVersion type for use // with apply. type StorageVersionApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type StorageVersionApplyConfiguration struct { Status *StorageVersionStatusApplyConfiguration `json:"status,omitempty"` } -// StorageVersion constructs an declarative configuration of the StorageVersion type for use with +// StorageVersion constructs a declarative configuration of the StorageVersion type for use with // apply. func StorageVersion(name string) *StorageVersionApplyConfiguration { b := &StorageVersionApplyConfiguration{} diff --git a/applyconfigurations/apiserverinternal/v1alpha1/storageversioncondition.go b/applyconfigurations/apiserverinternal/v1alpha1/storageversioncondition.go index 75b6256478..68d894d0c7 100644 --- a/applyconfigurations/apiserverinternal/v1alpha1/storageversioncondition.go +++ b/applyconfigurations/apiserverinternal/v1alpha1/storageversioncondition.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// StorageVersionConditionApplyConfiguration represents an declarative configuration of the StorageVersionCondition type for use +// StorageVersionConditionApplyConfiguration represents a declarative configuration of the StorageVersionCondition type for use // with apply. type StorageVersionConditionApplyConfiguration struct { Type *v1alpha1.StorageVersionConditionType `json:"type,omitempty"` @@ -34,7 +34,7 @@ type StorageVersionConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// StorageVersionConditionApplyConfiguration constructs an declarative configuration of the StorageVersionCondition type for use with +// StorageVersionConditionApplyConfiguration constructs a declarative configuration of the StorageVersionCondition type for use with // apply. func StorageVersionCondition() *StorageVersionConditionApplyConfiguration { return &StorageVersionConditionApplyConfiguration{} diff --git a/applyconfigurations/apiserverinternal/v1alpha1/storageversionstatus.go b/applyconfigurations/apiserverinternal/v1alpha1/storageversionstatus.go index 43b0bf71b1..2e25d67524 100644 --- a/applyconfigurations/apiserverinternal/v1alpha1/storageversionstatus.go +++ b/applyconfigurations/apiserverinternal/v1alpha1/storageversionstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v1alpha1 -// StorageVersionStatusApplyConfiguration represents an declarative configuration of the StorageVersionStatus type for use +// StorageVersionStatusApplyConfiguration represents a declarative configuration of the StorageVersionStatus type for use // with apply. type StorageVersionStatusApplyConfiguration struct { StorageVersions []ServerStorageVersionApplyConfiguration `json:"storageVersions,omitempty"` @@ -26,7 +26,7 @@ type StorageVersionStatusApplyConfiguration struct { Conditions []StorageVersionConditionApplyConfiguration `json:"conditions,omitempty"` } -// StorageVersionStatusApplyConfiguration constructs an declarative configuration of the StorageVersionStatus type for use with +// StorageVersionStatusApplyConfiguration constructs a declarative configuration of the StorageVersionStatus type for use with // apply. func StorageVersionStatus() *StorageVersionStatusApplyConfiguration { return &StorageVersionStatusApplyConfiguration{} diff --git a/applyconfigurations/apps/v1/controllerrevision.go b/applyconfigurations/apps/v1/controllerrevision.go index efd62b07f8..25b6450591 100644 --- a/applyconfigurations/apps/v1/controllerrevision.go +++ b/applyconfigurations/apps/v1/controllerrevision.go @@ -28,7 +28,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ControllerRevisionApplyConfiguration represents an declarative configuration of the ControllerRevision type for use +// ControllerRevisionApplyConfiguration represents a declarative configuration of the ControllerRevision type for use // with apply. type ControllerRevisionApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +37,7 @@ type ControllerRevisionApplyConfiguration struct { Revision *int64 `json:"revision,omitempty"` } -// ControllerRevision constructs an declarative configuration of the ControllerRevision type for use with +// ControllerRevision constructs a declarative configuration of the ControllerRevision type for use with // apply. func ControllerRevision(name, namespace string) *ControllerRevisionApplyConfiguration { b := &ControllerRevisionApplyConfiguration{} diff --git a/applyconfigurations/apps/v1/daemonset.go b/applyconfigurations/apps/v1/daemonset.go index 89f0076ac1..a157856514 100644 --- a/applyconfigurations/apps/v1/daemonset.go +++ b/applyconfigurations/apps/v1/daemonset.go @@ -27,7 +27,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"` @@ -36,7 +36,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{} diff --git a/applyconfigurations/apps/v1/daemonsetcondition.go b/applyconfigurations/apps/v1/daemonsetcondition.go index 283ae10a29..de91745b83 100644 --- a/applyconfigurations/apps/v1/daemonsetcondition.go +++ b/applyconfigurations/apps/v1/daemonsetcondition.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// DaemonSetConditionApplyConfiguration represents an declarative configuration of the DaemonSetCondition type for use +// DaemonSetConditionApplyConfiguration represents a declarative configuration of the DaemonSetCondition type for use // with apply. type DaemonSetConditionApplyConfiguration struct { Type *v1.DaemonSetConditionType `json:"type,omitempty"` @@ -34,7 +34,7 @@ type DaemonSetConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// DaemonSetConditionApplyConfiguration constructs an declarative configuration of the DaemonSetCondition type for use with +// DaemonSetConditionApplyConfiguration constructs a declarative configuration of the DaemonSetCondition type for use with // apply. func DaemonSetCondition() *DaemonSetConditionApplyConfiguration { return &DaemonSetConditionApplyConfiguration{} diff --git a/applyconfigurations/apps/v1/daemonsetspec.go b/applyconfigurations/apps/v1/daemonsetspec.go index 5e808874b7..99dc5abae8 100644 --- a/applyconfigurations/apps/v1/daemonsetspec.go +++ b/applyconfigurations/apps/v1/daemonsetspec.go @@ -23,7 +23,7 @@ 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:"selector,omitempty"` @@ -33,7 +33,7 @@ type DaemonSetSpecApplyConfiguration struct { RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,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/applyconfigurations/apps/v1/daemonsetstatus.go b/applyconfigurations/apps/v1/daemonsetstatus.go index d1c4462aa9..a40dc16512 100644 --- a/applyconfigurations/apps/v1/daemonsetstatus.go +++ b/applyconfigurations/apps/v1/daemonsetstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// 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 { CurrentNumberScheduled *int32 `json:"currentNumberScheduled,omitempty"` @@ -33,7 +33,7 @@ type DaemonSetStatusApplyConfiguration struct { Conditions []DaemonSetConditionApplyConfiguration `json:"conditions,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/applyconfigurations/apps/v1/daemonsetupdatestrategy.go b/applyconfigurations/apps/v1/daemonsetupdatestrategy.go index f1ba18226f..15af4e66be 100644 --- a/applyconfigurations/apps/v1/daemonsetupdatestrategy.go +++ b/applyconfigurations/apps/v1/daemonsetupdatestrategy.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/apps/v1" ) -// DaemonSetUpdateStrategyApplyConfiguration represents an declarative configuration of the DaemonSetUpdateStrategy type for use +// DaemonSetUpdateStrategyApplyConfiguration represents a declarative configuration of the DaemonSetUpdateStrategy type for use // with apply. type DaemonSetUpdateStrategyApplyConfiguration struct { Type *v1.DaemonSetUpdateStrategyType `json:"type,omitempty"` RollingUpdate *RollingUpdateDaemonSetApplyConfiguration `json:"rollingUpdate,omitempty"` } -// DaemonSetUpdateStrategyApplyConfiguration constructs an declarative configuration of the DaemonSetUpdateStrategy type for use with +// DaemonSetUpdateStrategyApplyConfiguration constructs a declarative configuration of the DaemonSetUpdateStrategy type for use with // apply. func DaemonSetUpdateStrategy() *DaemonSetUpdateStrategyApplyConfiguration { return &DaemonSetUpdateStrategyApplyConfiguration{} diff --git a/applyconfigurations/apps/v1/deployment.go b/applyconfigurations/apps/v1/deployment.go index 2f4d7ae3b9..52b7a21b71 100644 --- a/applyconfigurations/apps/v1/deployment.go +++ b/applyconfigurations/apps/v1/deployment.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// DeploymentApplyConfiguration represents an declarative configuration of the Deployment type for use +// DeploymentApplyConfiguration represents a declarative configuration of the Deployment type for use // with apply. type DeploymentApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type DeploymentApplyConfiguration struct { Status *DeploymentStatusApplyConfiguration `json:"status,omitempty"` } -// Deployment constructs an declarative configuration of the Deployment type for use with +// Deployment constructs a declarative configuration of the Deployment type for use with // apply. func Deployment(name, namespace string) *DeploymentApplyConfiguration { b := &DeploymentApplyConfiguration{} diff --git a/applyconfigurations/apps/v1/deploymentcondition.go b/applyconfigurations/apps/v1/deploymentcondition.go index 7747044136..84df752bc1 100644 --- a/applyconfigurations/apps/v1/deploymentcondition.go +++ b/applyconfigurations/apps/v1/deploymentcondition.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// DeploymentConditionApplyConfiguration represents an declarative configuration of the DeploymentCondition type for use +// DeploymentConditionApplyConfiguration represents a declarative configuration of the DeploymentCondition type for use // with apply. type DeploymentConditionApplyConfiguration struct { Type *v1.DeploymentConditionType `json:"type,omitempty"` @@ -35,7 +35,7 @@ type DeploymentConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// DeploymentConditionApplyConfiguration constructs an declarative configuration of the DeploymentCondition type for use with +// DeploymentConditionApplyConfiguration constructs a declarative configuration of the DeploymentCondition type for use with // apply. func DeploymentCondition() *DeploymentConditionApplyConfiguration { return &DeploymentConditionApplyConfiguration{} diff --git a/applyconfigurations/apps/v1/deploymentspec.go b/applyconfigurations/apps/v1/deploymentspec.go index 812253dae8..063f1c2765 100644 --- a/applyconfigurations/apps/v1/deploymentspec.go +++ b/applyconfigurations/apps/v1/deploymentspec.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// DeploymentSpecApplyConfiguration represents an declarative configuration of the DeploymentSpec type for use +// DeploymentSpecApplyConfiguration represents a declarative configuration of the DeploymentSpec type for use // with apply. type DeploymentSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` @@ -36,7 +36,7 @@ type DeploymentSpecApplyConfiguration struct { ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"` } -// DeploymentSpecApplyConfiguration constructs an declarative configuration of the DeploymentSpec type for use with +// DeploymentSpecApplyConfiguration constructs a declarative configuration of the DeploymentSpec type for use with // apply. func DeploymentSpec() *DeploymentSpecApplyConfiguration { return &DeploymentSpecApplyConfiguration{} diff --git a/applyconfigurations/apps/v1/deploymentstatus.go b/applyconfigurations/apps/v1/deploymentstatus.go index 7b48b42557..747813ade8 100644 --- a/applyconfigurations/apps/v1/deploymentstatus.go +++ b/applyconfigurations/apps/v1/deploymentstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// DeploymentStatusApplyConfiguration represents an declarative configuration of the DeploymentStatus type for use +// DeploymentStatusApplyConfiguration represents a declarative configuration of the DeploymentStatus type for use // with apply. type DeploymentStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` @@ -31,7 +31,7 @@ type DeploymentStatusApplyConfiguration struct { CollisionCount *int32 `json:"collisionCount,omitempty"` } -// DeploymentStatusApplyConfiguration constructs an declarative configuration of the DeploymentStatus type for use with +// DeploymentStatusApplyConfiguration constructs a declarative configuration of the DeploymentStatus type for use with // apply. func DeploymentStatus() *DeploymentStatusApplyConfiguration { return &DeploymentStatusApplyConfiguration{} diff --git a/applyconfigurations/apps/v1/deploymentstrategy.go b/applyconfigurations/apps/v1/deploymentstrategy.go index e9571edab1..dc4b97c55a 100644 --- a/applyconfigurations/apps/v1/deploymentstrategy.go +++ b/applyconfigurations/apps/v1/deploymentstrategy.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/apps/v1" ) -// DeploymentStrategyApplyConfiguration represents an declarative configuration of the DeploymentStrategy type for use +// DeploymentStrategyApplyConfiguration represents a declarative configuration of the DeploymentStrategy type for use // with apply. type DeploymentStrategyApplyConfiguration struct { Type *v1.DeploymentStrategyType `json:"type,omitempty"` RollingUpdate *RollingUpdateDeploymentApplyConfiguration `json:"rollingUpdate,omitempty"` } -// DeploymentStrategyApplyConfiguration constructs an declarative configuration of the DeploymentStrategy type for use with +// DeploymentStrategyApplyConfiguration constructs a declarative configuration of the DeploymentStrategy type for use with // apply. func DeploymentStrategy() *DeploymentStrategyApplyConfiguration { return &DeploymentStrategyApplyConfiguration{} diff --git a/applyconfigurations/apps/v1/replicaset.go b/applyconfigurations/apps/v1/replicaset.go index ed4532059e..35ca4e4dff 100644 --- a/applyconfigurations/apps/v1/replicaset.go +++ b/applyconfigurations/apps/v1/replicaset.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ReplicaSetApplyConfiguration represents an declarative configuration of the ReplicaSet type for use +// ReplicaSetApplyConfiguration represents a declarative configuration of the ReplicaSet type for use // with apply. type ReplicaSetApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type ReplicaSetApplyConfiguration struct { Status *ReplicaSetStatusApplyConfiguration `json:"status,omitempty"` } -// ReplicaSet constructs an declarative configuration of the ReplicaSet type for use with +// ReplicaSet constructs a declarative configuration of the ReplicaSet type for use with // apply. func ReplicaSet(name, namespace string) *ReplicaSetApplyConfiguration { b := &ReplicaSetApplyConfiguration{} diff --git a/applyconfigurations/apps/v1/replicasetcondition.go b/applyconfigurations/apps/v1/replicasetcondition.go index 19b0355d15..32da80842c 100644 --- a/applyconfigurations/apps/v1/replicasetcondition.go +++ b/applyconfigurations/apps/v1/replicasetcondition.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// ReplicaSetConditionApplyConfiguration represents an declarative configuration of the ReplicaSetCondition type for use +// ReplicaSetConditionApplyConfiguration represents a declarative configuration of the ReplicaSetCondition type for use // with apply. type ReplicaSetConditionApplyConfiguration struct { Type *v1.ReplicaSetConditionType `json:"type,omitempty"` @@ -34,7 +34,7 @@ type ReplicaSetConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// ReplicaSetConditionApplyConfiguration constructs an declarative configuration of the ReplicaSetCondition type for use with +// ReplicaSetConditionApplyConfiguration constructs a declarative configuration of the ReplicaSetCondition type for use with // apply. func ReplicaSetCondition() *ReplicaSetConditionApplyConfiguration { return &ReplicaSetConditionApplyConfiguration{} diff --git a/applyconfigurations/apps/v1/replicasetspec.go b/applyconfigurations/apps/v1/replicasetspec.go index ca32865835..0390584867 100644 --- a/applyconfigurations/apps/v1/replicasetspec.go +++ b/applyconfigurations/apps/v1/replicasetspec.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ReplicaSetSpecApplyConfiguration represents an declarative configuration of the ReplicaSetSpec type for use +// ReplicaSetSpecApplyConfiguration represents a declarative configuration of the ReplicaSetSpec type for use // with apply. type ReplicaSetSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` @@ -32,7 +32,7 @@ type ReplicaSetSpecApplyConfiguration struct { Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` } -// ReplicaSetSpecApplyConfiguration constructs an declarative configuration of the ReplicaSetSpec type for use with +// ReplicaSetSpecApplyConfiguration constructs a declarative configuration of the ReplicaSetSpec type for use with // apply. func ReplicaSetSpec() *ReplicaSetSpecApplyConfiguration { return &ReplicaSetSpecApplyConfiguration{} diff --git a/applyconfigurations/apps/v1/replicasetstatus.go b/applyconfigurations/apps/v1/replicasetstatus.go index 12f41490f9..a1408ae25e 100644 --- a/applyconfigurations/apps/v1/replicasetstatus.go +++ b/applyconfigurations/apps/v1/replicasetstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// ReplicaSetStatusApplyConfiguration represents an declarative configuration of the ReplicaSetStatus type for use +// ReplicaSetStatusApplyConfiguration represents a declarative configuration of the ReplicaSetStatus type for use // with apply. type ReplicaSetStatusApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` @@ -29,7 +29,7 @@ type ReplicaSetStatusApplyConfiguration struct { Conditions []ReplicaSetConditionApplyConfiguration `json:"conditions,omitempty"` } -// ReplicaSetStatusApplyConfiguration constructs an declarative configuration of the ReplicaSetStatus type for use with +// ReplicaSetStatusApplyConfiguration constructs a declarative configuration of the ReplicaSetStatus type for use with // apply. func ReplicaSetStatus() *ReplicaSetStatusApplyConfiguration { return &ReplicaSetStatusApplyConfiguration{} diff --git a/applyconfigurations/apps/v1/rollingupdatedaemonset.go b/applyconfigurations/apps/v1/rollingupdatedaemonset.go index ebe8e86d1f..e898f5081c 100644 --- a/applyconfigurations/apps/v1/rollingupdatedaemonset.go +++ b/applyconfigurations/apps/v1/rollingupdatedaemonset.go @@ -22,14 +22,14 @@ import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) -// RollingUpdateDaemonSetApplyConfiguration represents an declarative configuration of the RollingUpdateDaemonSet type for use +// RollingUpdateDaemonSetApplyConfiguration represents a declarative configuration of the RollingUpdateDaemonSet type for use // with apply. type RollingUpdateDaemonSetApplyConfiguration struct { MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` } -// RollingUpdateDaemonSetApplyConfiguration constructs an declarative configuration of the RollingUpdateDaemonSet type for use with +// RollingUpdateDaemonSetApplyConfiguration constructs a declarative configuration of the RollingUpdateDaemonSet type for use with // apply. func RollingUpdateDaemonSet() *RollingUpdateDaemonSetApplyConfiguration { return &RollingUpdateDaemonSetApplyConfiguration{} diff --git a/applyconfigurations/apps/v1/rollingupdatedeployment.go b/applyconfigurations/apps/v1/rollingupdatedeployment.go index ca9daaf249..2bc2937241 100644 --- a/applyconfigurations/apps/v1/rollingupdatedeployment.go +++ b/applyconfigurations/apps/v1/rollingupdatedeployment.go @@ -22,14 +22,14 @@ import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) -// RollingUpdateDeploymentApplyConfiguration represents an declarative configuration of the RollingUpdateDeployment type for use +// RollingUpdateDeploymentApplyConfiguration represents a declarative configuration of the RollingUpdateDeployment type for use // with apply. type RollingUpdateDeploymentApplyConfiguration struct { MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` } -// RollingUpdateDeploymentApplyConfiguration constructs an declarative configuration of the RollingUpdateDeployment type for use with +// RollingUpdateDeploymentApplyConfiguration constructs a declarative configuration of the RollingUpdateDeployment type for use with // apply. func RollingUpdateDeployment() *RollingUpdateDeploymentApplyConfiguration { return &RollingUpdateDeploymentApplyConfiguration{} diff --git a/applyconfigurations/apps/v1/rollingupdatestatefulsetstrategy.go b/applyconfigurations/apps/v1/rollingupdatestatefulsetstrategy.go index c1b5dea855..dd0de81a6c 100644 --- a/applyconfigurations/apps/v1/rollingupdatestatefulsetstrategy.go +++ b/applyconfigurations/apps/v1/rollingupdatestatefulsetstrategy.go @@ -22,14 +22,14 @@ import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) -// RollingUpdateStatefulSetStrategyApplyConfiguration represents an declarative configuration of the RollingUpdateStatefulSetStrategy type for use +// RollingUpdateStatefulSetStrategyApplyConfiguration represents a declarative configuration of the RollingUpdateStatefulSetStrategy type for use // with apply. type RollingUpdateStatefulSetStrategyApplyConfiguration struct { Partition *int32 `json:"partition,omitempty"` MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` } -// RollingUpdateStatefulSetStrategyApplyConfiguration constructs an declarative configuration of the RollingUpdateStatefulSetStrategy type for use with +// RollingUpdateStatefulSetStrategyApplyConfiguration constructs a declarative configuration of the RollingUpdateStatefulSetStrategy type for use with // apply. func RollingUpdateStatefulSetStrategy() *RollingUpdateStatefulSetStrategyApplyConfiguration { return &RollingUpdateStatefulSetStrategyApplyConfiguration{} diff --git a/applyconfigurations/apps/v1/statefulset.go b/applyconfigurations/apps/v1/statefulset.go index 5de53d102c..6f2b340dab 100644 --- a/applyconfigurations/apps/v1/statefulset.go +++ b/applyconfigurations/apps/v1/statefulset.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// StatefulSetApplyConfiguration represents an declarative configuration of the StatefulSet type for use +// StatefulSetApplyConfiguration represents a declarative configuration of the StatefulSet type for use // with apply. type StatefulSetApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type StatefulSetApplyConfiguration struct { Status *StatefulSetStatusApplyConfiguration `json:"status,omitempty"` } -// StatefulSet constructs an declarative configuration of the StatefulSet type for use with +// StatefulSet constructs a declarative configuration of the StatefulSet type for use with // apply. func StatefulSet(name, namespace string) *StatefulSetApplyConfiguration { b := &StatefulSetApplyConfiguration{} diff --git a/applyconfigurations/apps/v1/statefulsetcondition.go b/applyconfigurations/apps/v1/statefulsetcondition.go index f9d47850d6..c62a5e854c 100644 --- a/applyconfigurations/apps/v1/statefulsetcondition.go +++ b/applyconfigurations/apps/v1/statefulsetcondition.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// StatefulSetConditionApplyConfiguration represents an declarative configuration of the StatefulSetCondition type for use +// StatefulSetConditionApplyConfiguration represents a declarative configuration of the StatefulSetCondition type for use // with apply. type StatefulSetConditionApplyConfiguration struct { Type *v1.StatefulSetConditionType `json:"type,omitempty"` @@ -34,7 +34,7 @@ type StatefulSetConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// StatefulSetConditionApplyConfiguration constructs an declarative configuration of the StatefulSetCondition type for use with +// StatefulSetConditionApplyConfiguration constructs a declarative configuration of the StatefulSetCondition type for use with // apply. func StatefulSetCondition() *StatefulSetConditionApplyConfiguration { return &StatefulSetConditionApplyConfiguration{} diff --git a/applyconfigurations/apps/v1/statefulsetordinals.go b/applyconfigurations/apps/v1/statefulsetordinals.go index 9778f1c4a0..86f39e16c1 100644 --- a/applyconfigurations/apps/v1/statefulsetordinals.go +++ b/applyconfigurations/apps/v1/statefulsetordinals.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// StatefulSetOrdinalsApplyConfiguration represents an declarative configuration of the StatefulSetOrdinals type for use +// StatefulSetOrdinalsApplyConfiguration represents a declarative configuration of the StatefulSetOrdinals type for use // with apply. type StatefulSetOrdinalsApplyConfiguration struct { Start *int32 `json:"start,omitempty"` } -// StatefulSetOrdinalsApplyConfiguration constructs an declarative configuration of the StatefulSetOrdinals type for use with +// StatefulSetOrdinalsApplyConfiguration constructs a declarative configuration of the StatefulSetOrdinals type for use with // apply. func StatefulSetOrdinals() *StatefulSetOrdinalsApplyConfiguration { return &StatefulSetOrdinalsApplyConfiguration{} diff --git a/applyconfigurations/apps/v1/statefulsetpersistentvolumeclaimretentionpolicy.go b/applyconfigurations/apps/v1/statefulsetpersistentvolumeclaimretentionpolicy.go index ba01d5d3c1..cd65fd4364 100644 --- a/applyconfigurations/apps/v1/statefulsetpersistentvolumeclaimretentionpolicy.go +++ b/applyconfigurations/apps/v1/statefulsetpersistentvolumeclaimretentionpolicy.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/apps/v1" ) -// StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration represents an declarative configuration of the StatefulSetPersistentVolumeClaimRetentionPolicy type for use +// StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration represents a declarative configuration of the StatefulSetPersistentVolumeClaimRetentionPolicy type for use // with apply. type StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration struct { WhenDeleted *v1.PersistentVolumeClaimRetentionPolicyType `json:"whenDeleted,omitempty"` WhenScaled *v1.PersistentVolumeClaimRetentionPolicyType `json:"whenScaled,omitempty"` } -// StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration constructs an declarative configuration of the StatefulSetPersistentVolumeClaimRetentionPolicy type for use with +// StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration constructs a declarative configuration of the StatefulSetPersistentVolumeClaimRetentionPolicy type for use with // apply. func StatefulSetPersistentVolumeClaimRetentionPolicy() *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration { return &StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration{} diff --git a/applyconfigurations/apps/v1/statefulsetspec.go b/applyconfigurations/apps/v1/statefulsetspec.go index 81afdca596..1848a963cc 100644 --- a/applyconfigurations/apps/v1/statefulsetspec.go +++ b/applyconfigurations/apps/v1/statefulsetspec.go @@ -24,7 +24,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// StatefulSetSpecApplyConfiguration represents an declarative configuration of the StatefulSetSpec type for use +// StatefulSetSpecApplyConfiguration represents a declarative configuration of the StatefulSetSpec type for use // with apply. type StatefulSetSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` @@ -40,7 +40,7 @@ type StatefulSetSpecApplyConfiguration struct { Ordinals *StatefulSetOrdinalsApplyConfiguration `json:"ordinals,omitempty"` } -// StatefulSetSpecApplyConfiguration constructs an declarative configuration of the StatefulSetSpec type for use with +// StatefulSetSpecApplyConfiguration constructs a declarative configuration of the StatefulSetSpec type for use with // apply. func StatefulSetSpec() *StatefulSetSpecApplyConfiguration { return &StatefulSetSpecApplyConfiguration{} diff --git a/applyconfigurations/apps/v1/statefulsetstatus.go b/applyconfigurations/apps/v1/statefulsetstatus.go index d88881b656..637a1c649d 100644 --- a/applyconfigurations/apps/v1/statefulsetstatus.go +++ b/applyconfigurations/apps/v1/statefulsetstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// StatefulSetStatusApplyConfiguration represents an declarative configuration of the StatefulSetStatus type for use +// StatefulSetStatusApplyConfiguration represents a declarative configuration of the StatefulSetStatus type for use // with apply. type StatefulSetStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` @@ -33,7 +33,7 @@ type StatefulSetStatusApplyConfiguration struct { AvailableReplicas *int32 `json:"availableReplicas,omitempty"` } -// StatefulSetStatusApplyConfiguration constructs an declarative configuration of the StatefulSetStatus type for use with +// StatefulSetStatusApplyConfiguration constructs a declarative configuration of the StatefulSetStatus type for use with // apply. func StatefulSetStatus() *StatefulSetStatusApplyConfiguration { return &StatefulSetStatusApplyConfiguration{} diff --git a/applyconfigurations/apps/v1/statefulsetupdatestrategy.go b/applyconfigurations/apps/v1/statefulsetupdatestrategy.go index 5268a1e065..b59e107355 100644 --- a/applyconfigurations/apps/v1/statefulsetupdatestrategy.go +++ b/applyconfigurations/apps/v1/statefulsetupdatestrategy.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/apps/v1" ) -// StatefulSetUpdateStrategyApplyConfiguration represents an declarative configuration of the StatefulSetUpdateStrategy type for use +// StatefulSetUpdateStrategyApplyConfiguration represents a declarative configuration of the StatefulSetUpdateStrategy type for use // with apply. type StatefulSetUpdateStrategyApplyConfiguration struct { Type *v1.StatefulSetUpdateStrategyType `json:"type,omitempty"` RollingUpdate *RollingUpdateStatefulSetStrategyApplyConfiguration `json:"rollingUpdate,omitempty"` } -// StatefulSetUpdateStrategyApplyConfiguration constructs an declarative configuration of the StatefulSetUpdateStrategy type for use with +// StatefulSetUpdateStrategyApplyConfiguration constructs a declarative configuration of the StatefulSetUpdateStrategy type for use with // apply. func StatefulSetUpdateStrategy() *StatefulSetUpdateStrategyApplyConfiguration { return &StatefulSetUpdateStrategyApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta1/controllerrevision.go b/applyconfigurations/apps/v1beta1/controllerrevision.go index 1b2ea80669..606de58a1e 100644 --- a/applyconfigurations/apps/v1beta1/controllerrevision.go +++ b/applyconfigurations/apps/v1beta1/controllerrevision.go @@ -28,7 +28,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ControllerRevisionApplyConfiguration represents an declarative configuration of the ControllerRevision type for use +// ControllerRevisionApplyConfiguration represents a declarative configuration of the ControllerRevision type for use // with apply. type ControllerRevisionApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +37,7 @@ type ControllerRevisionApplyConfiguration struct { Revision *int64 `json:"revision,omitempty"` } -// ControllerRevision constructs an declarative configuration of the ControllerRevision type for use with +// ControllerRevision constructs a declarative configuration of the ControllerRevision type for use with // apply. func ControllerRevision(name, namespace string) *ControllerRevisionApplyConfiguration { b := &ControllerRevisionApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta1/deployment.go b/applyconfigurations/apps/v1beta1/deployment.go index 35bdabefa1..145aaed70d 100644 --- a/applyconfigurations/apps/v1beta1/deployment.go +++ b/applyconfigurations/apps/v1beta1/deployment.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// DeploymentApplyConfiguration represents an declarative configuration of the Deployment type for use +// DeploymentApplyConfiguration represents a declarative configuration of the Deployment type for use // with apply. type DeploymentApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type DeploymentApplyConfiguration struct { Status *DeploymentStatusApplyConfiguration `json:"status,omitempty"` } -// Deployment constructs an declarative configuration of the Deployment type for use with +// Deployment constructs a declarative configuration of the Deployment type for use with // apply. func Deployment(name, namespace string) *DeploymentApplyConfiguration { b := &DeploymentApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta1/deploymentcondition.go b/applyconfigurations/apps/v1beta1/deploymentcondition.go index 9da8ce0899..504dddd94e 100644 --- a/applyconfigurations/apps/v1beta1/deploymentcondition.go +++ b/applyconfigurations/apps/v1beta1/deploymentcondition.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// DeploymentConditionApplyConfiguration represents an declarative configuration of the DeploymentCondition type for use +// DeploymentConditionApplyConfiguration represents a declarative configuration of the DeploymentCondition type for use // with apply. type DeploymentConditionApplyConfiguration struct { Type *v1beta1.DeploymentConditionType `json:"type,omitempty"` @@ -35,7 +35,7 @@ type DeploymentConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// DeploymentConditionApplyConfiguration constructs an declarative configuration of the DeploymentCondition type for use with +// DeploymentConditionApplyConfiguration constructs a declarative configuration of the DeploymentCondition type for use with // apply. func DeploymentCondition() *DeploymentConditionApplyConfiguration { return &DeploymentConditionApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta1/deploymentspec.go b/applyconfigurations/apps/v1beta1/deploymentspec.go index 5e18476bdc..5531c756f9 100644 --- a/applyconfigurations/apps/v1beta1/deploymentspec.go +++ b/applyconfigurations/apps/v1beta1/deploymentspec.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// DeploymentSpecApplyConfiguration represents an declarative configuration of the DeploymentSpec type for use +// DeploymentSpecApplyConfiguration represents a declarative configuration of the DeploymentSpec type for use // with apply. type DeploymentSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` @@ -37,7 +37,7 @@ type DeploymentSpecApplyConfiguration struct { ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"` } -// DeploymentSpecApplyConfiguration constructs an declarative configuration of the DeploymentSpec type for use with +// DeploymentSpecApplyConfiguration constructs a declarative configuration of the DeploymentSpec type for use with // apply. func DeploymentSpec() *DeploymentSpecApplyConfiguration { return &DeploymentSpecApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta1/deploymentstatus.go b/applyconfigurations/apps/v1beta1/deploymentstatus.go index f8d1cf5d25..adc023a34d 100644 --- a/applyconfigurations/apps/v1beta1/deploymentstatus.go +++ b/applyconfigurations/apps/v1beta1/deploymentstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// DeploymentStatusApplyConfiguration represents an declarative configuration of the DeploymentStatus type for use +// DeploymentStatusApplyConfiguration represents a declarative configuration of the DeploymentStatus type for use // with apply. type DeploymentStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` @@ -31,7 +31,7 @@ type DeploymentStatusApplyConfiguration struct { CollisionCount *int32 `json:"collisionCount,omitempty"` } -// DeploymentStatusApplyConfiguration constructs an declarative configuration of the DeploymentStatus type for use with +// DeploymentStatusApplyConfiguration constructs a declarative configuration of the DeploymentStatus type for use with // apply. func DeploymentStatus() *DeploymentStatusApplyConfiguration { return &DeploymentStatusApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta1/deploymentstrategy.go b/applyconfigurations/apps/v1beta1/deploymentstrategy.go index 7279318a88..2c322b4ace 100644 --- a/applyconfigurations/apps/v1beta1/deploymentstrategy.go +++ b/applyconfigurations/apps/v1beta1/deploymentstrategy.go @@ -22,14 +22,14 @@ import ( v1beta1 "k8s.io/api/apps/v1beta1" ) -// DeploymentStrategyApplyConfiguration represents an declarative configuration of the DeploymentStrategy type for use +// DeploymentStrategyApplyConfiguration represents a declarative configuration of the DeploymentStrategy type for use // with apply. type DeploymentStrategyApplyConfiguration struct { Type *v1beta1.DeploymentStrategyType `json:"type,omitempty"` RollingUpdate *RollingUpdateDeploymentApplyConfiguration `json:"rollingUpdate,omitempty"` } -// DeploymentStrategyApplyConfiguration constructs an declarative configuration of the DeploymentStrategy type for use with +// DeploymentStrategyApplyConfiguration constructs a declarative configuration of the DeploymentStrategy type for use with // apply. func DeploymentStrategy() *DeploymentStrategyApplyConfiguration { return &DeploymentStrategyApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta1/rollbackconfig.go b/applyconfigurations/apps/v1beta1/rollbackconfig.go index 131e57a39d..775f82eef8 100644 --- a/applyconfigurations/apps/v1beta1/rollbackconfig.go +++ b/applyconfigurations/apps/v1beta1/rollbackconfig.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta1 -// RollbackConfigApplyConfiguration represents an declarative configuration of the RollbackConfig type for use +// RollbackConfigApplyConfiguration represents a declarative configuration of the RollbackConfig type for use // with apply. type RollbackConfigApplyConfiguration struct { Revision *int64 `json:"revision,omitempty"` } -// RollbackConfigApplyConfiguration constructs an declarative configuration of the RollbackConfig type for use with +// RollbackConfigApplyConfiguration constructs a declarative configuration of the RollbackConfig type for use with // apply. func RollbackConfig() *RollbackConfigApplyConfiguration { return &RollbackConfigApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta1/rollingupdatedeployment.go b/applyconfigurations/apps/v1beta1/rollingupdatedeployment.go index dde5f064b0..244701a5e0 100644 --- a/applyconfigurations/apps/v1beta1/rollingupdatedeployment.go +++ b/applyconfigurations/apps/v1beta1/rollingupdatedeployment.go @@ -22,14 +22,14 @@ import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) -// RollingUpdateDeploymentApplyConfiguration represents an declarative configuration of the RollingUpdateDeployment type for use +// RollingUpdateDeploymentApplyConfiguration represents a declarative configuration of the RollingUpdateDeployment type for use // with apply. type RollingUpdateDeploymentApplyConfiguration struct { MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` } -// RollingUpdateDeploymentApplyConfiguration constructs an declarative configuration of the RollingUpdateDeployment type for use with +// RollingUpdateDeploymentApplyConfiguration constructs a declarative configuration of the RollingUpdateDeployment type for use with // apply. func RollingUpdateDeployment() *RollingUpdateDeploymentApplyConfiguration { return &RollingUpdateDeploymentApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta1/rollingupdatestatefulsetstrategy.go b/applyconfigurations/apps/v1beta1/rollingupdatestatefulsetstrategy.go index 8989a08d2c..94c2971343 100644 --- a/applyconfigurations/apps/v1beta1/rollingupdatestatefulsetstrategy.go +++ b/applyconfigurations/apps/v1beta1/rollingupdatestatefulsetstrategy.go @@ -22,14 +22,14 @@ import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) -// RollingUpdateStatefulSetStrategyApplyConfiguration represents an declarative configuration of the RollingUpdateStatefulSetStrategy type for use +// RollingUpdateStatefulSetStrategyApplyConfiguration represents a declarative configuration of the RollingUpdateStatefulSetStrategy type for use // with apply. type RollingUpdateStatefulSetStrategyApplyConfiguration struct { Partition *int32 `json:"partition,omitempty"` MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` } -// RollingUpdateStatefulSetStrategyApplyConfiguration constructs an declarative configuration of the RollingUpdateStatefulSetStrategy type for use with +// RollingUpdateStatefulSetStrategyApplyConfiguration constructs a declarative configuration of the RollingUpdateStatefulSetStrategy type for use with // apply. func RollingUpdateStatefulSetStrategy() *RollingUpdateStatefulSetStrategyApplyConfiguration { return &RollingUpdateStatefulSetStrategyApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta1/statefulset.go b/applyconfigurations/apps/v1beta1/statefulset.go index 26c57cccc4..2705938862 100644 --- a/applyconfigurations/apps/v1beta1/statefulset.go +++ b/applyconfigurations/apps/v1beta1/statefulset.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// StatefulSetApplyConfiguration represents an declarative configuration of the StatefulSet type for use +// StatefulSetApplyConfiguration represents a declarative configuration of the StatefulSet type for use // with apply. type StatefulSetApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type StatefulSetApplyConfiguration struct { Status *StatefulSetStatusApplyConfiguration `json:"status,omitempty"` } -// StatefulSet constructs an declarative configuration of the StatefulSet type for use with +// StatefulSet constructs a declarative configuration of the StatefulSet type for use with // apply. func StatefulSet(name, namespace string) *StatefulSetApplyConfiguration { b := &StatefulSetApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta1/statefulsetcondition.go b/applyconfigurations/apps/v1beta1/statefulsetcondition.go index 97e994ab71..8a17391cd2 100644 --- a/applyconfigurations/apps/v1beta1/statefulsetcondition.go +++ b/applyconfigurations/apps/v1beta1/statefulsetcondition.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// StatefulSetConditionApplyConfiguration represents an declarative configuration of the StatefulSetCondition type for use +// StatefulSetConditionApplyConfiguration represents a declarative configuration of the StatefulSetCondition type for use // with apply. type StatefulSetConditionApplyConfiguration struct { Type *v1beta1.StatefulSetConditionType `json:"type,omitempty"` @@ -34,7 +34,7 @@ type StatefulSetConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// StatefulSetConditionApplyConfiguration constructs an declarative configuration of the StatefulSetCondition type for use with +// StatefulSetConditionApplyConfiguration constructs a declarative configuration of the StatefulSetCondition type for use with // apply. func StatefulSetCondition() *StatefulSetConditionApplyConfiguration { return &StatefulSetConditionApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta1/statefulsetordinals.go b/applyconfigurations/apps/v1beta1/statefulsetordinals.go index 8f349a2d27..2e3049e5e2 100644 --- a/applyconfigurations/apps/v1beta1/statefulsetordinals.go +++ b/applyconfigurations/apps/v1beta1/statefulsetordinals.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta1 -// StatefulSetOrdinalsApplyConfiguration represents an declarative configuration of the StatefulSetOrdinals type for use +// StatefulSetOrdinalsApplyConfiguration represents a declarative configuration of the StatefulSetOrdinals type for use // with apply. type StatefulSetOrdinalsApplyConfiguration struct { Start *int32 `json:"start,omitempty"` } -// StatefulSetOrdinalsApplyConfiguration constructs an declarative configuration of the StatefulSetOrdinals type for use with +// StatefulSetOrdinalsApplyConfiguration constructs a declarative configuration of the StatefulSetOrdinals type for use with // apply. func StatefulSetOrdinals() *StatefulSetOrdinalsApplyConfiguration { return &StatefulSetOrdinalsApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta1/statefulsetpersistentvolumeclaimretentionpolicy.go b/applyconfigurations/apps/v1beta1/statefulsetpersistentvolumeclaimretentionpolicy.go index 0048724c04..69a8ee0f0b 100644 --- a/applyconfigurations/apps/v1beta1/statefulsetpersistentvolumeclaimretentionpolicy.go +++ b/applyconfigurations/apps/v1beta1/statefulsetpersistentvolumeclaimretentionpolicy.go @@ -22,14 +22,14 @@ import ( v1beta1 "k8s.io/api/apps/v1beta1" ) -// StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration represents an declarative configuration of the StatefulSetPersistentVolumeClaimRetentionPolicy type for use +// StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration represents a declarative configuration of the StatefulSetPersistentVolumeClaimRetentionPolicy type for use // with apply. type StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration struct { WhenDeleted *v1beta1.PersistentVolumeClaimRetentionPolicyType `json:"whenDeleted,omitempty"` WhenScaled *v1beta1.PersistentVolumeClaimRetentionPolicyType `json:"whenScaled,omitempty"` } -// StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration constructs an declarative configuration of the StatefulSetPersistentVolumeClaimRetentionPolicy type for use with +// StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration constructs a declarative configuration of the StatefulSetPersistentVolumeClaimRetentionPolicy type for use with // apply. func StatefulSetPersistentVolumeClaimRetentionPolicy() *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration { return &StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta1/statefulsetspec.go b/applyconfigurations/apps/v1beta1/statefulsetspec.go index 1eb1ba7b03..ac325d717e 100644 --- a/applyconfigurations/apps/v1beta1/statefulsetspec.go +++ b/applyconfigurations/apps/v1beta1/statefulsetspec.go @@ -24,7 +24,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// StatefulSetSpecApplyConfiguration represents an declarative configuration of the StatefulSetSpec type for use +// StatefulSetSpecApplyConfiguration represents a declarative configuration of the StatefulSetSpec type for use // with apply. type StatefulSetSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` @@ -40,7 +40,7 @@ type StatefulSetSpecApplyConfiguration struct { Ordinals *StatefulSetOrdinalsApplyConfiguration `json:"ordinals,omitempty"` } -// StatefulSetSpecApplyConfiguration constructs an declarative configuration of the StatefulSetSpec type for use with +// StatefulSetSpecApplyConfiguration constructs a declarative configuration of the StatefulSetSpec type for use with // apply. func StatefulSetSpec() *StatefulSetSpecApplyConfiguration { return &StatefulSetSpecApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta1/statefulsetstatus.go b/applyconfigurations/apps/v1beta1/statefulsetstatus.go index f31066b6ff..27ae7540fd 100644 --- a/applyconfigurations/apps/v1beta1/statefulsetstatus.go +++ b/applyconfigurations/apps/v1beta1/statefulsetstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// StatefulSetStatusApplyConfiguration represents an declarative configuration of the StatefulSetStatus type for use +// StatefulSetStatusApplyConfiguration represents a declarative configuration of the StatefulSetStatus type for use // with apply. type StatefulSetStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` @@ -33,7 +33,7 @@ type StatefulSetStatusApplyConfiguration struct { AvailableReplicas *int32 `json:"availableReplicas,omitempty"` } -// StatefulSetStatusApplyConfiguration constructs an declarative configuration of the StatefulSetStatus type for use with +// StatefulSetStatusApplyConfiguration constructs a declarative configuration of the StatefulSetStatus type for use with // apply. func StatefulSetStatus() *StatefulSetStatusApplyConfiguration { return &StatefulSetStatusApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta1/statefulsetupdatestrategy.go b/applyconfigurations/apps/v1beta1/statefulsetupdatestrategy.go index 895c1e7f8a..7714ebbb72 100644 --- a/applyconfigurations/apps/v1beta1/statefulsetupdatestrategy.go +++ b/applyconfigurations/apps/v1beta1/statefulsetupdatestrategy.go @@ -22,14 +22,14 @@ import ( v1beta1 "k8s.io/api/apps/v1beta1" ) -// StatefulSetUpdateStrategyApplyConfiguration represents an declarative configuration of the StatefulSetUpdateStrategy type for use +// StatefulSetUpdateStrategyApplyConfiguration represents a declarative configuration of the StatefulSetUpdateStrategy type for use // with apply. type StatefulSetUpdateStrategyApplyConfiguration struct { Type *v1beta1.StatefulSetUpdateStrategyType `json:"type,omitempty"` RollingUpdate *RollingUpdateStatefulSetStrategyApplyConfiguration `json:"rollingUpdate,omitempty"` } -// StatefulSetUpdateStrategyApplyConfiguration constructs an declarative configuration of the StatefulSetUpdateStrategy type for use with +// StatefulSetUpdateStrategyApplyConfiguration constructs a declarative configuration of the StatefulSetUpdateStrategy type for use with // apply. func StatefulSetUpdateStrategy() *StatefulSetUpdateStrategyApplyConfiguration { return &StatefulSetUpdateStrategyApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/controllerrevision.go b/applyconfigurations/apps/v1beta2/controllerrevision.go index 7b236f7e04..5f75a45510 100644 --- a/applyconfigurations/apps/v1beta2/controllerrevision.go +++ b/applyconfigurations/apps/v1beta2/controllerrevision.go @@ -28,7 +28,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ControllerRevisionApplyConfiguration represents an declarative configuration of the ControllerRevision type for use +// ControllerRevisionApplyConfiguration represents a declarative configuration of the ControllerRevision type for use // with apply. type ControllerRevisionApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +37,7 @@ type ControllerRevisionApplyConfiguration struct { Revision *int64 `json:"revision,omitempty"` } -// ControllerRevision constructs an declarative configuration of the ControllerRevision type for use with +// ControllerRevision constructs a declarative configuration of the ControllerRevision type for use with // apply. func ControllerRevision(name, namespace string) *ControllerRevisionApplyConfiguration { b := &ControllerRevisionApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/daemonset.go b/applyconfigurations/apps/v1beta2/daemonset.go index 0969bcf65b..9ffda6182e 100644 --- a/applyconfigurations/apps/v1beta2/daemonset.go +++ b/applyconfigurations/apps/v1beta2/daemonset.go @@ -27,7 +27,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"` @@ -36,7 +36,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{} diff --git a/applyconfigurations/apps/v1beta2/daemonsetcondition.go b/applyconfigurations/apps/v1beta2/daemonsetcondition.go index 55dc1f4877..8315050f0f 100644 --- a/applyconfigurations/apps/v1beta2/daemonsetcondition.go +++ b/applyconfigurations/apps/v1beta2/daemonsetcondition.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// DaemonSetConditionApplyConfiguration represents an declarative configuration of the DaemonSetCondition type for use +// DaemonSetConditionApplyConfiguration represents a declarative configuration of the DaemonSetCondition type for use // with apply. type DaemonSetConditionApplyConfiguration struct { Type *v1beta2.DaemonSetConditionType `json:"type,omitempty"` @@ -34,7 +34,7 @@ type DaemonSetConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// DaemonSetConditionApplyConfiguration constructs an declarative configuration of the DaemonSetCondition type for use with +// DaemonSetConditionApplyConfiguration constructs a declarative configuration of the DaemonSetCondition type for use with // apply. func DaemonSetCondition() *DaemonSetConditionApplyConfiguration { return &DaemonSetConditionApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/daemonsetspec.go b/applyconfigurations/apps/v1beta2/daemonsetspec.go index 48137819af..74d8bf51c6 100644 --- a/applyconfigurations/apps/v1beta2/daemonsetspec.go +++ b/applyconfigurations/apps/v1beta2/daemonsetspec.go @@ -23,7 +23,7 @@ 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:"selector,omitempty"` @@ -33,7 +33,7 @@ type DaemonSetSpecApplyConfiguration struct { RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,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/applyconfigurations/apps/v1beta2/daemonsetstatus.go b/applyconfigurations/apps/v1beta2/daemonsetstatus.go index 29cda7a90e..6b0fda8953 100644 --- a/applyconfigurations/apps/v1beta2/daemonsetstatus.go +++ b/applyconfigurations/apps/v1beta2/daemonsetstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta2 -// 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 { CurrentNumberScheduled *int32 `json:"currentNumberScheduled,omitempty"` @@ -33,7 +33,7 @@ type DaemonSetStatusApplyConfiguration struct { Conditions []DaemonSetConditionApplyConfiguration `json:"conditions,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/applyconfigurations/apps/v1beta2/daemonsetupdatestrategy.go b/applyconfigurations/apps/v1beta2/daemonsetupdatestrategy.go index 07fc07fc6a..7d66f1da43 100644 --- a/applyconfigurations/apps/v1beta2/daemonsetupdatestrategy.go +++ b/applyconfigurations/apps/v1beta2/daemonsetupdatestrategy.go @@ -22,14 +22,14 @@ import ( v1beta2 "k8s.io/api/apps/v1beta2" ) -// DaemonSetUpdateStrategyApplyConfiguration represents an declarative configuration of the DaemonSetUpdateStrategy type for use +// DaemonSetUpdateStrategyApplyConfiguration represents a declarative configuration of the DaemonSetUpdateStrategy type for use // with apply. type DaemonSetUpdateStrategyApplyConfiguration struct { Type *v1beta2.DaemonSetUpdateStrategyType `json:"type,omitempty"` RollingUpdate *RollingUpdateDaemonSetApplyConfiguration `json:"rollingUpdate,omitempty"` } -// DaemonSetUpdateStrategyApplyConfiguration constructs an declarative configuration of the DaemonSetUpdateStrategy type for use with +// DaemonSetUpdateStrategyApplyConfiguration constructs a declarative configuration of the DaemonSetUpdateStrategy type for use with // apply. func DaemonSetUpdateStrategy() *DaemonSetUpdateStrategyApplyConfiguration { return &DaemonSetUpdateStrategyApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/deployment.go b/applyconfigurations/apps/v1beta2/deployment.go index 38bec8043a..485da788af 100644 --- a/applyconfigurations/apps/v1beta2/deployment.go +++ b/applyconfigurations/apps/v1beta2/deployment.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// DeploymentApplyConfiguration represents an declarative configuration of the Deployment type for use +// DeploymentApplyConfiguration represents a declarative configuration of the Deployment type for use // with apply. type DeploymentApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type DeploymentApplyConfiguration struct { Status *DeploymentStatusApplyConfiguration `json:"status,omitempty"` } -// Deployment constructs an declarative configuration of the Deployment type for use with +// Deployment constructs a declarative configuration of the Deployment type for use with // apply. func Deployment(name, namespace string) *DeploymentApplyConfiguration { b := &DeploymentApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/deploymentcondition.go b/applyconfigurations/apps/v1beta2/deploymentcondition.go index 852a2c6832..1924278741 100644 --- a/applyconfigurations/apps/v1beta2/deploymentcondition.go +++ b/applyconfigurations/apps/v1beta2/deploymentcondition.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// DeploymentConditionApplyConfiguration represents an declarative configuration of the DeploymentCondition type for use +// DeploymentConditionApplyConfiguration represents a declarative configuration of the DeploymentCondition type for use // with apply. type DeploymentConditionApplyConfiguration struct { Type *v1beta2.DeploymentConditionType `json:"type,omitempty"` @@ -35,7 +35,7 @@ type DeploymentConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// DeploymentConditionApplyConfiguration constructs an declarative configuration of the DeploymentCondition type for use with +// DeploymentConditionApplyConfiguration constructs a declarative configuration of the DeploymentCondition type for use with // apply. func DeploymentCondition() *DeploymentConditionApplyConfiguration { return &DeploymentConditionApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/deploymentspec.go b/applyconfigurations/apps/v1beta2/deploymentspec.go index 6898941ace..1b55130c6b 100644 --- a/applyconfigurations/apps/v1beta2/deploymentspec.go +++ b/applyconfigurations/apps/v1beta2/deploymentspec.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// DeploymentSpecApplyConfiguration represents an declarative configuration of the DeploymentSpec type for use +// DeploymentSpecApplyConfiguration represents a declarative configuration of the DeploymentSpec type for use // with apply. type DeploymentSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` @@ -36,7 +36,7 @@ type DeploymentSpecApplyConfiguration struct { ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"` } -// DeploymentSpecApplyConfiguration constructs an declarative configuration of the DeploymentSpec type for use with +// DeploymentSpecApplyConfiguration constructs a declarative configuration of the DeploymentSpec type for use with // apply. func DeploymentSpec() *DeploymentSpecApplyConfiguration { return &DeploymentSpecApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/deploymentstatus.go b/applyconfigurations/apps/v1beta2/deploymentstatus.go index fe99ca9917..5fa9122332 100644 --- a/applyconfigurations/apps/v1beta2/deploymentstatus.go +++ b/applyconfigurations/apps/v1beta2/deploymentstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta2 -// DeploymentStatusApplyConfiguration represents an declarative configuration of the DeploymentStatus type for use +// DeploymentStatusApplyConfiguration represents a declarative configuration of the DeploymentStatus type for use // with apply. type DeploymentStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` @@ -31,7 +31,7 @@ type DeploymentStatusApplyConfiguration struct { CollisionCount *int32 `json:"collisionCount,omitempty"` } -// DeploymentStatusApplyConfiguration constructs an declarative configuration of the DeploymentStatus type for use with +// DeploymentStatusApplyConfiguration constructs a declarative configuration of the DeploymentStatus type for use with // apply. func DeploymentStatus() *DeploymentStatusApplyConfiguration { return &DeploymentStatusApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/deploymentstrategy.go b/applyconfigurations/apps/v1beta2/deploymentstrategy.go index 8714e153e4..c769436ee0 100644 --- a/applyconfigurations/apps/v1beta2/deploymentstrategy.go +++ b/applyconfigurations/apps/v1beta2/deploymentstrategy.go @@ -22,14 +22,14 @@ import ( v1beta2 "k8s.io/api/apps/v1beta2" ) -// DeploymentStrategyApplyConfiguration represents an declarative configuration of the DeploymentStrategy type for use +// DeploymentStrategyApplyConfiguration represents a declarative configuration of the DeploymentStrategy type for use // with apply. type DeploymentStrategyApplyConfiguration struct { Type *v1beta2.DeploymentStrategyType `json:"type,omitempty"` RollingUpdate *RollingUpdateDeploymentApplyConfiguration `json:"rollingUpdate,omitempty"` } -// DeploymentStrategyApplyConfiguration constructs an declarative configuration of the DeploymentStrategy type for use with +// DeploymentStrategyApplyConfiguration constructs a declarative configuration of the DeploymentStrategy type for use with // apply. func DeploymentStrategy() *DeploymentStrategyApplyConfiguration { return &DeploymentStrategyApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/replicaset.go b/applyconfigurations/apps/v1beta2/replicaset.go index d9b02afaac..d8608aa51c 100644 --- a/applyconfigurations/apps/v1beta2/replicaset.go +++ b/applyconfigurations/apps/v1beta2/replicaset.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ReplicaSetApplyConfiguration represents an declarative configuration of the ReplicaSet type for use +// ReplicaSetApplyConfiguration represents a declarative configuration of the ReplicaSet type for use // with apply. type ReplicaSetApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type ReplicaSetApplyConfiguration struct { Status *ReplicaSetStatusApplyConfiguration `json:"status,omitempty"` } -// ReplicaSet constructs an declarative configuration of the ReplicaSet type for use with +// ReplicaSet constructs a declarative configuration of the ReplicaSet type for use with // apply. func ReplicaSet(name, namespace string) *ReplicaSetApplyConfiguration { b := &ReplicaSetApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/replicasetcondition.go b/applyconfigurations/apps/v1beta2/replicasetcondition.go index 47776bfa2e..beec546f7c 100644 --- a/applyconfigurations/apps/v1beta2/replicasetcondition.go +++ b/applyconfigurations/apps/v1beta2/replicasetcondition.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// ReplicaSetConditionApplyConfiguration represents an declarative configuration of the ReplicaSetCondition type for use +// ReplicaSetConditionApplyConfiguration represents a declarative configuration of the ReplicaSetCondition type for use // with apply. type ReplicaSetConditionApplyConfiguration struct { Type *v1beta2.ReplicaSetConditionType `json:"type,omitempty"` @@ -34,7 +34,7 @@ type ReplicaSetConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// ReplicaSetConditionApplyConfiguration constructs an declarative configuration of the ReplicaSetCondition type for use with +// ReplicaSetConditionApplyConfiguration constructs a declarative configuration of the ReplicaSetCondition type for use with // apply. func ReplicaSetCondition() *ReplicaSetConditionApplyConfiguration { return &ReplicaSetConditionApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/replicasetspec.go b/applyconfigurations/apps/v1beta2/replicasetspec.go index 14d548169e..1d77b9e0fd 100644 --- a/applyconfigurations/apps/v1beta2/replicasetspec.go +++ b/applyconfigurations/apps/v1beta2/replicasetspec.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ReplicaSetSpecApplyConfiguration represents an declarative configuration of the ReplicaSetSpec type for use +// ReplicaSetSpecApplyConfiguration represents a declarative configuration of the ReplicaSetSpec type for use // with apply. type ReplicaSetSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` @@ -32,7 +32,7 @@ type ReplicaSetSpecApplyConfiguration struct { Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` } -// ReplicaSetSpecApplyConfiguration constructs an declarative configuration of the ReplicaSetSpec type for use with +// ReplicaSetSpecApplyConfiguration constructs a declarative configuration of the ReplicaSetSpec type for use with // apply. func ReplicaSetSpec() *ReplicaSetSpecApplyConfiguration { return &ReplicaSetSpecApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/replicasetstatus.go b/applyconfigurations/apps/v1beta2/replicasetstatus.go index 7c1b8fb29d..d3c92e274d 100644 --- a/applyconfigurations/apps/v1beta2/replicasetstatus.go +++ b/applyconfigurations/apps/v1beta2/replicasetstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta2 -// ReplicaSetStatusApplyConfiguration represents an declarative configuration of the ReplicaSetStatus type for use +// ReplicaSetStatusApplyConfiguration represents a declarative configuration of the ReplicaSetStatus type for use // with apply. type ReplicaSetStatusApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` @@ -29,7 +29,7 @@ type ReplicaSetStatusApplyConfiguration struct { Conditions []ReplicaSetConditionApplyConfiguration `json:"conditions,omitempty"` } -// ReplicaSetStatusApplyConfiguration constructs an declarative configuration of the ReplicaSetStatus type for use with +// ReplicaSetStatusApplyConfiguration constructs a declarative configuration of the ReplicaSetStatus type for use with // apply. func ReplicaSetStatus() *ReplicaSetStatusApplyConfiguration { return &ReplicaSetStatusApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/rollingupdatedaemonset.go b/applyconfigurations/apps/v1beta2/rollingupdatedaemonset.go index b586b678d4..ad6021d37a 100644 --- a/applyconfigurations/apps/v1beta2/rollingupdatedaemonset.go +++ b/applyconfigurations/apps/v1beta2/rollingupdatedaemonset.go @@ -22,14 +22,14 @@ import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) -// RollingUpdateDaemonSetApplyConfiguration represents an declarative configuration of the RollingUpdateDaemonSet type for use +// RollingUpdateDaemonSetApplyConfiguration represents a declarative configuration of the RollingUpdateDaemonSet type for use // with apply. type RollingUpdateDaemonSetApplyConfiguration struct { MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` } -// RollingUpdateDaemonSetApplyConfiguration constructs an declarative configuration of the RollingUpdateDaemonSet type for use with +// RollingUpdateDaemonSetApplyConfiguration constructs a declarative configuration of the RollingUpdateDaemonSet type for use with // apply. func RollingUpdateDaemonSet() *RollingUpdateDaemonSetApplyConfiguration { return &RollingUpdateDaemonSetApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/rollingupdatedeployment.go b/applyconfigurations/apps/v1beta2/rollingupdatedeployment.go index 78ef210081..b0cc3a4ee4 100644 --- a/applyconfigurations/apps/v1beta2/rollingupdatedeployment.go +++ b/applyconfigurations/apps/v1beta2/rollingupdatedeployment.go @@ -22,14 +22,14 @@ import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) -// RollingUpdateDeploymentApplyConfiguration represents an declarative configuration of the RollingUpdateDeployment type for use +// RollingUpdateDeploymentApplyConfiguration represents a declarative configuration of the RollingUpdateDeployment type for use // with apply. type RollingUpdateDeploymentApplyConfiguration struct { MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` } -// RollingUpdateDeploymentApplyConfiguration constructs an declarative configuration of the RollingUpdateDeployment type for use with +// RollingUpdateDeploymentApplyConfiguration constructs a declarative configuration of the RollingUpdateDeployment type for use with // apply. func RollingUpdateDeployment() *RollingUpdateDeploymentApplyConfiguration { return &RollingUpdateDeploymentApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/rollingupdatestatefulsetstrategy.go b/applyconfigurations/apps/v1beta2/rollingupdatestatefulsetstrategy.go index 4a12e51c0a..0046c264bb 100644 --- a/applyconfigurations/apps/v1beta2/rollingupdatestatefulsetstrategy.go +++ b/applyconfigurations/apps/v1beta2/rollingupdatestatefulsetstrategy.go @@ -22,14 +22,14 @@ import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) -// RollingUpdateStatefulSetStrategyApplyConfiguration represents an declarative configuration of the RollingUpdateStatefulSetStrategy type for use +// RollingUpdateStatefulSetStrategyApplyConfiguration represents a declarative configuration of the RollingUpdateStatefulSetStrategy type for use // with apply. type RollingUpdateStatefulSetStrategyApplyConfiguration struct { Partition *int32 `json:"partition,omitempty"` MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` } -// RollingUpdateStatefulSetStrategyApplyConfiguration constructs an declarative configuration of the RollingUpdateStatefulSetStrategy type for use with +// RollingUpdateStatefulSetStrategyApplyConfiguration constructs a declarative configuration of the RollingUpdateStatefulSetStrategy type for use with // apply. func RollingUpdateStatefulSetStrategy() *RollingUpdateStatefulSetStrategyApplyConfiguration { return &RollingUpdateStatefulSetStrategyApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/scale.go b/applyconfigurations/apps/v1beta2/scale.go index d84db27e80..126ab2d8bd 100644 --- a/applyconfigurations/apps/v1beta2/scale.go +++ b/applyconfigurations/apps/v1beta2/scale.go @@ -25,7 +25,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ScaleApplyConfiguration represents an declarative configuration of the Scale type for use +// ScaleApplyConfiguration represents a declarative configuration of the Scale type for use // with apply. type ScaleApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -34,7 +34,7 @@ type ScaleApplyConfiguration struct { Status *v1beta2.ScaleStatus `json:"status,omitempty"` } -// ScaleApplyConfiguration constructs an declarative configuration of the Scale type for use with +// ScaleApplyConfiguration constructs a declarative configuration of the Scale type for use with // apply. func Scale() *ScaleApplyConfiguration { b := &ScaleApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/statefulset.go b/applyconfigurations/apps/v1beta2/statefulset.go index 848dfb9751..3d2b5d1917 100644 --- a/applyconfigurations/apps/v1beta2/statefulset.go +++ b/applyconfigurations/apps/v1beta2/statefulset.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// StatefulSetApplyConfiguration represents an declarative configuration of the StatefulSet type for use +// StatefulSetApplyConfiguration represents a declarative configuration of the StatefulSet type for use // with apply. type StatefulSetApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type StatefulSetApplyConfiguration struct { Status *StatefulSetStatusApplyConfiguration `json:"status,omitempty"` } -// StatefulSet constructs an declarative configuration of the StatefulSet type for use with +// StatefulSet constructs a declarative configuration of the StatefulSet type for use with // apply. func StatefulSet(name, namespace string) *StatefulSetApplyConfiguration { b := &StatefulSetApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/statefulsetcondition.go b/applyconfigurations/apps/v1beta2/statefulsetcondition.go index c33e68b5e2..aa45db686e 100644 --- a/applyconfigurations/apps/v1beta2/statefulsetcondition.go +++ b/applyconfigurations/apps/v1beta2/statefulsetcondition.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// StatefulSetConditionApplyConfiguration represents an declarative configuration of the StatefulSetCondition type for use +// StatefulSetConditionApplyConfiguration represents a declarative configuration of the StatefulSetCondition type for use // with apply. type StatefulSetConditionApplyConfiguration struct { Type *v1beta2.StatefulSetConditionType `json:"type,omitempty"` @@ -34,7 +34,7 @@ type StatefulSetConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// StatefulSetConditionApplyConfiguration constructs an declarative configuration of the StatefulSetCondition type for use with +// StatefulSetConditionApplyConfiguration constructs a declarative configuration of the StatefulSetCondition type for use with // apply. func StatefulSetCondition() *StatefulSetConditionApplyConfiguration { return &StatefulSetConditionApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/statefulsetordinals.go b/applyconfigurations/apps/v1beta2/statefulsetordinals.go index c586da775c..a899243a5a 100644 --- a/applyconfigurations/apps/v1beta2/statefulsetordinals.go +++ b/applyconfigurations/apps/v1beta2/statefulsetordinals.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta2 -// StatefulSetOrdinalsApplyConfiguration represents an declarative configuration of the StatefulSetOrdinals type for use +// StatefulSetOrdinalsApplyConfiguration represents a declarative configuration of the StatefulSetOrdinals type for use // with apply. type StatefulSetOrdinalsApplyConfiguration struct { Start *int32 `json:"start,omitempty"` } -// StatefulSetOrdinalsApplyConfiguration constructs an declarative configuration of the StatefulSetOrdinals type for use with +// StatefulSetOrdinalsApplyConfiguration constructs a declarative configuration of the StatefulSetOrdinals type for use with // apply. func StatefulSetOrdinals() *StatefulSetOrdinalsApplyConfiguration { return &StatefulSetOrdinalsApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/statefulsetpersistentvolumeclaimretentionpolicy.go b/applyconfigurations/apps/v1beta2/statefulsetpersistentvolumeclaimretentionpolicy.go index aee27803d3..318e5f4642 100644 --- a/applyconfigurations/apps/v1beta2/statefulsetpersistentvolumeclaimretentionpolicy.go +++ b/applyconfigurations/apps/v1beta2/statefulsetpersistentvolumeclaimretentionpolicy.go @@ -22,14 +22,14 @@ import ( v1beta2 "k8s.io/api/apps/v1beta2" ) -// StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration represents an declarative configuration of the StatefulSetPersistentVolumeClaimRetentionPolicy type for use +// StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration represents a declarative configuration of the StatefulSetPersistentVolumeClaimRetentionPolicy type for use // with apply. type StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration struct { WhenDeleted *v1beta2.PersistentVolumeClaimRetentionPolicyType `json:"whenDeleted,omitempty"` WhenScaled *v1beta2.PersistentVolumeClaimRetentionPolicyType `json:"whenScaled,omitempty"` } -// StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration constructs an declarative configuration of the StatefulSetPersistentVolumeClaimRetentionPolicy type for use with +// StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration constructs a declarative configuration of the StatefulSetPersistentVolumeClaimRetentionPolicy type for use with // apply. func StatefulSetPersistentVolumeClaimRetentionPolicy() *StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration { return &StatefulSetPersistentVolumeClaimRetentionPolicyApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/statefulsetspec.go b/applyconfigurations/apps/v1beta2/statefulsetspec.go index b6165fbd9a..bebf80c896 100644 --- a/applyconfigurations/apps/v1beta2/statefulsetspec.go +++ b/applyconfigurations/apps/v1beta2/statefulsetspec.go @@ -24,7 +24,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// StatefulSetSpecApplyConfiguration represents an declarative configuration of the StatefulSetSpec type for use +// StatefulSetSpecApplyConfiguration represents a declarative configuration of the StatefulSetSpec type for use // with apply. type StatefulSetSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` @@ -40,7 +40,7 @@ type StatefulSetSpecApplyConfiguration struct { Ordinals *StatefulSetOrdinalsApplyConfiguration `json:"ordinals,omitempty"` } -// StatefulSetSpecApplyConfiguration constructs an declarative configuration of the StatefulSetSpec type for use with +// StatefulSetSpecApplyConfiguration constructs a declarative configuration of the StatefulSetSpec type for use with // apply. func StatefulSetSpec() *StatefulSetSpecApplyConfiguration { return &StatefulSetSpecApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/statefulsetstatus.go b/applyconfigurations/apps/v1beta2/statefulsetstatus.go index 63835904c1..a647cd7d26 100644 --- a/applyconfigurations/apps/v1beta2/statefulsetstatus.go +++ b/applyconfigurations/apps/v1beta2/statefulsetstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta2 -// StatefulSetStatusApplyConfiguration represents an declarative configuration of the StatefulSetStatus type for use +// StatefulSetStatusApplyConfiguration represents a declarative configuration of the StatefulSetStatus type for use // with apply. type StatefulSetStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` @@ -33,7 +33,7 @@ type StatefulSetStatusApplyConfiguration struct { AvailableReplicas *int32 `json:"availableReplicas,omitempty"` } -// StatefulSetStatusApplyConfiguration constructs an declarative configuration of the StatefulSetStatus type for use with +// StatefulSetStatusApplyConfiguration constructs a declarative configuration of the StatefulSetStatus type for use with // apply. func StatefulSetStatus() *StatefulSetStatusApplyConfiguration { return &StatefulSetStatusApplyConfiguration{} diff --git a/applyconfigurations/apps/v1beta2/statefulsetupdatestrategy.go b/applyconfigurations/apps/v1beta2/statefulsetupdatestrategy.go index 03c2914917..81d4ba1df3 100644 --- a/applyconfigurations/apps/v1beta2/statefulsetupdatestrategy.go +++ b/applyconfigurations/apps/v1beta2/statefulsetupdatestrategy.go @@ -22,14 +22,14 @@ import ( v1beta2 "k8s.io/api/apps/v1beta2" ) -// StatefulSetUpdateStrategyApplyConfiguration represents an declarative configuration of the StatefulSetUpdateStrategy type for use +// StatefulSetUpdateStrategyApplyConfiguration represents a declarative configuration of the StatefulSetUpdateStrategy type for use // with apply. type StatefulSetUpdateStrategyApplyConfiguration struct { Type *v1beta2.StatefulSetUpdateStrategyType `json:"type,omitempty"` RollingUpdate *RollingUpdateStatefulSetStrategyApplyConfiguration `json:"rollingUpdate,omitempty"` } -// StatefulSetUpdateStrategyApplyConfiguration constructs an declarative configuration of the StatefulSetUpdateStrategy type for use with +// StatefulSetUpdateStrategyApplyConfiguration constructs a declarative configuration of the StatefulSetUpdateStrategy type for use with // apply. func StatefulSetUpdateStrategy() *StatefulSetUpdateStrategyApplyConfiguration { return &StatefulSetUpdateStrategyApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v1/crossversionobjectreference.go b/applyconfigurations/autoscaling/v1/crossversionobjectreference.go index 0eac22692c..51ec665012 100644 --- a/applyconfigurations/autoscaling/v1/crossversionobjectreference.go +++ b/applyconfigurations/autoscaling/v1/crossversionobjectreference.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// CrossVersionObjectReferenceApplyConfiguration represents an declarative configuration of the CrossVersionObjectReference type for use +// CrossVersionObjectReferenceApplyConfiguration represents a declarative configuration of the CrossVersionObjectReference type for use // with apply. type CrossVersionObjectReferenceApplyConfiguration struct { Kind *string `json:"kind,omitempty"` @@ -26,7 +26,7 @@ type CrossVersionObjectReferenceApplyConfiguration struct { APIVersion *string `json:"apiVersion,omitempty"` } -// CrossVersionObjectReferenceApplyConfiguration constructs an declarative configuration of the CrossVersionObjectReference type for use with +// CrossVersionObjectReferenceApplyConfiguration constructs a declarative configuration of the CrossVersionObjectReference type for use with // apply. func CrossVersionObjectReference() *CrossVersionObjectReferenceApplyConfiguration { return &CrossVersionObjectReferenceApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v1/horizontalpodautoscaler.go b/applyconfigurations/autoscaling/v1/horizontalpodautoscaler.go index fbf844e3dd..8150635ee6 100644 --- a/applyconfigurations/autoscaling/v1/horizontalpodautoscaler.go +++ b/applyconfigurations/autoscaling/v1/horizontalpodautoscaler.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// HorizontalPodAutoscalerApplyConfiguration represents an declarative configuration of the HorizontalPodAutoscaler type for use +// HorizontalPodAutoscalerApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscaler type for use // with apply. type HorizontalPodAutoscalerApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type HorizontalPodAutoscalerApplyConfiguration struct { Status *HorizontalPodAutoscalerStatusApplyConfiguration `json:"status,omitempty"` } -// HorizontalPodAutoscaler constructs an declarative configuration of the HorizontalPodAutoscaler type for use with +// HorizontalPodAutoscaler constructs a declarative configuration of the HorizontalPodAutoscaler type for use with // apply. func HorizontalPodAutoscaler(name, namespace string) *HorizontalPodAutoscalerApplyConfiguration { b := &HorizontalPodAutoscalerApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v1/horizontalpodautoscalerspec.go b/applyconfigurations/autoscaling/v1/horizontalpodautoscalerspec.go index 561ac60d35..0ca2f84ea9 100644 --- a/applyconfigurations/autoscaling/v1/horizontalpodautoscalerspec.go +++ b/applyconfigurations/autoscaling/v1/horizontalpodautoscalerspec.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// HorizontalPodAutoscalerSpecApplyConfiguration represents an declarative configuration of the HorizontalPodAutoscalerSpec type for use +// HorizontalPodAutoscalerSpecApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerSpec type for use // with apply. type HorizontalPodAutoscalerSpecApplyConfiguration struct { ScaleTargetRef *CrossVersionObjectReferenceApplyConfiguration `json:"scaleTargetRef,omitempty"` @@ -27,7 +27,7 @@ type HorizontalPodAutoscalerSpecApplyConfiguration struct { TargetCPUUtilizationPercentage *int32 `json:"targetCPUUtilizationPercentage,omitempty"` } -// HorizontalPodAutoscalerSpecApplyConfiguration constructs an declarative configuration of the HorizontalPodAutoscalerSpec type for use with +// HorizontalPodAutoscalerSpecApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerSpec type for use with // apply. func HorizontalPodAutoscalerSpec() *HorizontalPodAutoscalerSpecApplyConfiguration { return &HorizontalPodAutoscalerSpecApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v1/horizontalpodautoscalerstatus.go b/applyconfigurations/autoscaling/v1/horizontalpodautoscalerstatus.go index abc2e05aa7..fcb231c3be 100644 --- a/applyconfigurations/autoscaling/v1/horizontalpodautoscalerstatus.go +++ b/applyconfigurations/autoscaling/v1/horizontalpodautoscalerstatus.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// HorizontalPodAutoscalerStatusApplyConfiguration represents an declarative configuration of the HorizontalPodAutoscalerStatus type for use +// HorizontalPodAutoscalerStatusApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerStatus type for use // with apply. type HorizontalPodAutoscalerStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` @@ -32,7 +32,7 @@ type HorizontalPodAutoscalerStatusApplyConfiguration struct { CurrentCPUUtilizationPercentage *int32 `json:"currentCPUUtilizationPercentage,omitempty"` } -// HorizontalPodAutoscalerStatusApplyConfiguration constructs an declarative configuration of the HorizontalPodAutoscalerStatus type for use with +// HorizontalPodAutoscalerStatusApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerStatus type for use with // apply. func HorizontalPodAutoscalerStatus() *HorizontalPodAutoscalerStatusApplyConfiguration { return &HorizontalPodAutoscalerStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v1/scale.go b/applyconfigurations/autoscaling/v1/scale.go index e3266be563..40f3db8c5a 100644 --- a/applyconfigurations/autoscaling/v1/scale.go +++ b/applyconfigurations/autoscaling/v1/scale.go @@ -24,7 +24,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ScaleApplyConfiguration represents an declarative configuration of the Scale type for use +// ScaleApplyConfiguration represents a declarative configuration of the Scale type for use // with apply. type ScaleApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -33,7 +33,7 @@ type ScaleApplyConfiguration struct { Status *ScaleStatusApplyConfiguration `json:"status,omitempty"` } -// ScaleApplyConfiguration constructs an declarative configuration of the Scale type for use with +// ScaleApplyConfiguration constructs a declarative configuration of the Scale type for use with // apply. func Scale() *ScaleApplyConfiguration { b := &ScaleApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v1/scalespec.go b/applyconfigurations/autoscaling/v1/scalespec.go index 2339a8fef2..025004ba5f 100644 --- a/applyconfigurations/autoscaling/v1/scalespec.go +++ b/applyconfigurations/autoscaling/v1/scalespec.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// ScaleSpecApplyConfiguration represents an declarative configuration of the ScaleSpec type for use +// ScaleSpecApplyConfiguration represents a declarative configuration of the ScaleSpec type for use // with apply. type ScaleSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` } -// ScaleSpecApplyConfiguration constructs an declarative configuration of the ScaleSpec type for use with +// ScaleSpecApplyConfiguration constructs a declarative configuration of the ScaleSpec type for use with // apply. func ScaleSpec() *ScaleSpecApplyConfiguration { return &ScaleSpecApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v1/scalestatus.go b/applyconfigurations/autoscaling/v1/scalestatus.go index 81c8d1b30a..51f96d2357 100644 --- a/applyconfigurations/autoscaling/v1/scalestatus.go +++ b/applyconfigurations/autoscaling/v1/scalestatus.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// ScaleStatusApplyConfiguration represents an declarative configuration of the ScaleStatus type for use +// ScaleStatusApplyConfiguration represents a declarative configuration of the ScaleStatus type for use // with apply. type ScaleStatusApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` Selector *string `json:"selector,omitempty"` } -// ScaleStatusApplyConfiguration constructs an declarative configuration of the ScaleStatus type for use with +// ScaleStatusApplyConfiguration constructs a declarative configuration of the ScaleStatus type for use with // apply. func ScaleStatus() *ScaleStatusApplyConfiguration { return &ScaleStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/containerresourcemetricsource.go b/applyconfigurations/autoscaling/v2/containerresourcemetricsource.go index 15ef216d1b..b6e071e848 100644 --- a/applyconfigurations/autoscaling/v2/containerresourcemetricsource.go +++ b/applyconfigurations/autoscaling/v2/containerresourcemetricsource.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// ContainerResourceMetricSourceApplyConfiguration represents an declarative configuration of the ContainerResourceMetricSource type for use +// ContainerResourceMetricSourceApplyConfiguration represents a declarative configuration of the ContainerResourceMetricSource type for use // with apply. type ContainerResourceMetricSourceApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` @@ -30,7 +30,7 @@ type ContainerResourceMetricSourceApplyConfiguration struct { Container *string `json:"container,omitempty"` } -// ContainerResourceMetricSourceApplyConfiguration constructs an declarative configuration of the ContainerResourceMetricSource type for use with +// ContainerResourceMetricSourceApplyConfiguration constructs a declarative configuration of the ContainerResourceMetricSource type for use with // apply. func ContainerResourceMetricSource() *ContainerResourceMetricSourceApplyConfiguration { return &ContainerResourceMetricSourceApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/containerresourcemetricstatus.go b/applyconfigurations/autoscaling/v2/containerresourcemetricstatus.go index 34213bca3f..46bd2bac20 100644 --- a/applyconfigurations/autoscaling/v2/containerresourcemetricstatus.go +++ b/applyconfigurations/autoscaling/v2/containerresourcemetricstatus.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// ContainerResourceMetricStatusApplyConfiguration represents an declarative configuration of the ContainerResourceMetricStatus type for use +// ContainerResourceMetricStatusApplyConfiguration represents a declarative configuration of the ContainerResourceMetricStatus type for use // with apply. type ContainerResourceMetricStatusApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` @@ -30,7 +30,7 @@ type ContainerResourceMetricStatusApplyConfiguration struct { Container *string `json:"container,omitempty"` } -// ContainerResourceMetricStatusApplyConfiguration constructs an declarative configuration of the ContainerResourceMetricStatus type for use with +// ContainerResourceMetricStatusApplyConfiguration constructs a declarative configuration of the ContainerResourceMetricStatus type for use with // apply. func ContainerResourceMetricStatus() *ContainerResourceMetricStatusApplyConfiguration { return &ContainerResourceMetricStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/crossversionobjectreference.go b/applyconfigurations/autoscaling/v2/crossversionobjectreference.go index 19045706dc..645f098577 100644 --- a/applyconfigurations/autoscaling/v2/crossversionobjectreference.go +++ b/applyconfigurations/autoscaling/v2/crossversionobjectreference.go @@ -18,7 +18,7 @@ limitations under the License. package v2 -// CrossVersionObjectReferenceApplyConfiguration represents an declarative configuration of the CrossVersionObjectReference type for use +// CrossVersionObjectReferenceApplyConfiguration represents a declarative configuration of the CrossVersionObjectReference type for use // with apply. type CrossVersionObjectReferenceApplyConfiguration struct { Kind *string `json:"kind,omitempty"` @@ -26,7 +26,7 @@ type CrossVersionObjectReferenceApplyConfiguration struct { APIVersion *string `json:"apiVersion,omitempty"` } -// CrossVersionObjectReferenceApplyConfiguration constructs an declarative configuration of the CrossVersionObjectReference type for use with +// CrossVersionObjectReferenceApplyConfiguration constructs a declarative configuration of the CrossVersionObjectReference type for use with // apply. func CrossVersionObjectReference() *CrossVersionObjectReferenceApplyConfiguration { return &CrossVersionObjectReferenceApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/externalmetricsource.go b/applyconfigurations/autoscaling/v2/externalmetricsource.go index 11a8eff263..a9c45b31a0 100644 --- a/applyconfigurations/autoscaling/v2/externalmetricsource.go +++ b/applyconfigurations/autoscaling/v2/externalmetricsource.go @@ -18,14 +18,14 @@ limitations under the License. package v2 -// ExternalMetricSourceApplyConfiguration represents an declarative configuration of the ExternalMetricSource type for use +// ExternalMetricSourceApplyConfiguration represents a declarative configuration of the ExternalMetricSource type for use // with apply. type ExternalMetricSourceApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` Target *MetricTargetApplyConfiguration `json:"target,omitempty"` } -// ExternalMetricSourceApplyConfiguration constructs an declarative configuration of the ExternalMetricSource type for use with +// ExternalMetricSourceApplyConfiguration constructs a declarative configuration of the ExternalMetricSource type for use with // apply. func ExternalMetricSource() *ExternalMetricSourceApplyConfiguration { return &ExternalMetricSourceApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/externalmetricstatus.go b/applyconfigurations/autoscaling/v2/externalmetricstatus.go index 3b1a0329b8..4280086f5e 100644 --- a/applyconfigurations/autoscaling/v2/externalmetricstatus.go +++ b/applyconfigurations/autoscaling/v2/externalmetricstatus.go @@ -18,14 +18,14 @@ limitations under the License. package v2 -// ExternalMetricStatusApplyConfiguration represents an declarative configuration of the ExternalMetricStatus type for use +// ExternalMetricStatusApplyConfiguration represents a declarative configuration of the ExternalMetricStatus type for use // with apply. type ExternalMetricStatusApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` Current *MetricValueStatusApplyConfiguration `json:"current,omitempty"` } -// ExternalMetricStatusApplyConfiguration constructs an declarative configuration of the ExternalMetricStatus type for use with +// ExternalMetricStatusApplyConfiguration constructs a declarative configuration of the ExternalMetricStatus type for use with // apply. func ExternalMetricStatus() *ExternalMetricStatusApplyConfiguration { return &ExternalMetricStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/horizontalpodautoscaler.go b/applyconfigurations/autoscaling/v2/horizontalpodautoscaler.go index c3de7ecf8f..e26b530c18 100644 --- a/applyconfigurations/autoscaling/v2/horizontalpodautoscaler.go +++ b/applyconfigurations/autoscaling/v2/horizontalpodautoscaler.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// HorizontalPodAutoscalerApplyConfiguration represents an declarative configuration of the HorizontalPodAutoscaler type for use +// HorizontalPodAutoscalerApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscaler type for use // with apply. type HorizontalPodAutoscalerApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type HorizontalPodAutoscalerApplyConfiguration struct { Status *HorizontalPodAutoscalerStatusApplyConfiguration `json:"status,omitempty"` } -// HorizontalPodAutoscaler constructs an declarative configuration of the HorizontalPodAutoscaler type for use with +// HorizontalPodAutoscaler constructs a declarative configuration of the HorizontalPodAutoscaler type for use with // apply. func HorizontalPodAutoscaler(name, namespace string) *HorizontalPodAutoscalerApplyConfiguration { b := &HorizontalPodAutoscalerApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/horizontalpodautoscalerbehavior.go b/applyconfigurations/autoscaling/v2/horizontalpodautoscalerbehavior.go index e6fdabd7c8..05750cc21d 100644 --- a/applyconfigurations/autoscaling/v2/horizontalpodautoscalerbehavior.go +++ b/applyconfigurations/autoscaling/v2/horizontalpodautoscalerbehavior.go @@ -18,14 +18,14 @@ limitations under the License. package v2 -// HorizontalPodAutoscalerBehaviorApplyConfiguration represents an declarative configuration of the HorizontalPodAutoscalerBehavior type for use +// HorizontalPodAutoscalerBehaviorApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerBehavior type for use // with apply. type HorizontalPodAutoscalerBehaviorApplyConfiguration struct { ScaleUp *HPAScalingRulesApplyConfiguration `json:"scaleUp,omitempty"` ScaleDown *HPAScalingRulesApplyConfiguration `json:"scaleDown,omitempty"` } -// HorizontalPodAutoscalerBehaviorApplyConfiguration constructs an declarative configuration of the HorizontalPodAutoscalerBehavior type for use with +// HorizontalPodAutoscalerBehaviorApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerBehavior type for use with // apply. func HorizontalPodAutoscalerBehavior() *HorizontalPodAutoscalerBehaviorApplyConfiguration { return &HorizontalPodAutoscalerBehaviorApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/horizontalpodautoscalercondition.go b/applyconfigurations/autoscaling/v2/horizontalpodautoscalercondition.go index c020eccd3d..844c6dc862 100644 --- a/applyconfigurations/autoscaling/v2/horizontalpodautoscalercondition.go +++ b/applyconfigurations/autoscaling/v2/horizontalpodautoscalercondition.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// HorizontalPodAutoscalerConditionApplyConfiguration represents an declarative configuration of the HorizontalPodAutoscalerCondition type for use +// HorizontalPodAutoscalerConditionApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerCondition type for use // with apply. type HorizontalPodAutoscalerConditionApplyConfiguration struct { Type *v2.HorizontalPodAutoscalerConditionType `json:"type,omitempty"` @@ -34,7 +34,7 @@ type HorizontalPodAutoscalerConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// HorizontalPodAutoscalerConditionApplyConfiguration constructs an declarative configuration of the HorizontalPodAutoscalerCondition type for use with +// HorizontalPodAutoscalerConditionApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerCondition type for use with // apply. func HorizontalPodAutoscalerCondition() *HorizontalPodAutoscalerConditionApplyConfiguration { return &HorizontalPodAutoscalerConditionApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/horizontalpodautoscalerspec.go b/applyconfigurations/autoscaling/v2/horizontalpodautoscalerspec.go index c36bc3f225..e34ababc58 100644 --- a/applyconfigurations/autoscaling/v2/horizontalpodautoscalerspec.go +++ b/applyconfigurations/autoscaling/v2/horizontalpodautoscalerspec.go @@ -18,7 +18,7 @@ limitations under the License. package v2 -// HorizontalPodAutoscalerSpecApplyConfiguration represents an declarative configuration of the HorizontalPodAutoscalerSpec type for use +// HorizontalPodAutoscalerSpecApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerSpec type for use // with apply. type HorizontalPodAutoscalerSpecApplyConfiguration struct { ScaleTargetRef *CrossVersionObjectReferenceApplyConfiguration `json:"scaleTargetRef,omitempty"` @@ -28,7 +28,7 @@ type HorizontalPodAutoscalerSpecApplyConfiguration struct { Behavior *HorizontalPodAutoscalerBehaviorApplyConfiguration `json:"behavior,omitempty"` } -// HorizontalPodAutoscalerSpecApplyConfiguration constructs an declarative configuration of the HorizontalPodAutoscalerSpec type for use with +// HorizontalPodAutoscalerSpecApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerSpec type for use with // apply. func HorizontalPodAutoscalerSpec() *HorizontalPodAutoscalerSpecApplyConfiguration { return &HorizontalPodAutoscalerSpecApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/horizontalpodautoscalerstatus.go b/applyconfigurations/autoscaling/v2/horizontalpodautoscalerstatus.go index d4d551df85..f1a2c3f4e9 100644 --- a/applyconfigurations/autoscaling/v2/horizontalpodautoscalerstatus.go +++ b/applyconfigurations/autoscaling/v2/horizontalpodautoscalerstatus.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// HorizontalPodAutoscalerStatusApplyConfiguration represents an declarative configuration of the HorizontalPodAutoscalerStatus type for use +// HorizontalPodAutoscalerStatusApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerStatus type for use // with apply. type HorizontalPodAutoscalerStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` @@ -33,7 +33,7 @@ type HorizontalPodAutoscalerStatusApplyConfiguration struct { Conditions []HorizontalPodAutoscalerConditionApplyConfiguration `json:"conditions,omitempty"` } -// HorizontalPodAutoscalerStatusApplyConfiguration constructs an declarative configuration of the HorizontalPodAutoscalerStatus type for use with +// HorizontalPodAutoscalerStatusApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerStatus type for use with // apply. func HorizontalPodAutoscalerStatus() *HorizontalPodAutoscalerStatusApplyConfiguration { return &HorizontalPodAutoscalerStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/hpascalingpolicy.go b/applyconfigurations/autoscaling/v2/hpascalingpolicy.go index 139f0fb5c7..b8b735747b 100644 --- a/applyconfigurations/autoscaling/v2/hpascalingpolicy.go +++ b/applyconfigurations/autoscaling/v2/hpascalingpolicy.go @@ -22,7 +22,7 @@ import ( v2 "k8s.io/api/autoscaling/v2" ) -// HPAScalingPolicyApplyConfiguration represents an declarative configuration of the HPAScalingPolicy type for use +// HPAScalingPolicyApplyConfiguration represents a declarative configuration of the HPAScalingPolicy type for use // with apply. type HPAScalingPolicyApplyConfiguration struct { Type *v2.HPAScalingPolicyType `json:"type,omitempty"` @@ -30,7 +30,7 @@ type HPAScalingPolicyApplyConfiguration struct { PeriodSeconds *int32 `json:"periodSeconds,omitempty"` } -// HPAScalingPolicyApplyConfiguration constructs an declarative configuration of the HPAScalingPolicy type for use with +// HPAScalingPolicyApplyConfiguration constructs a declarative configuration of the HPAScalingPolicy type for use with // apply. func HPAScalingPolicy() *HPAScalingPolicyApplyConfiguration { return &HPAScalingPolicyApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/hpascalingrules.go b/applyconfigurations/autoscaling/v2/hpascalingrules.go index e768076aa4..c7020f77bd 100644 --- a/applyconfigurations/autoscaling/v2/hpascalingrules.go +++ b/applyconfigurations/autoscaling/v2/hpascalingrules.go @@ -22,7 +22,7 @@ import ( v2 "k8s.io/api/autoscaling/v2" ) -// HPAScalingRulesApplyConfiguration represents an declarative configuration of the HPAScalingRules type for use +// HPAScalingRulesApplyConfiguration represents a declarative configuration of the HPAScalingRules type for use // with apply. type HPAScalingRulesApplyConfiguration struct { StabilizationWindowSeconds *int32 `json:"stabilizationWindowSeconds,omitempty"` @@ -30,7 +30,7 @@ type HPAScalingRulesApplyConfiguration struct { Policies []HPAScalingPolicyApplyConfiguration `json:"policies,omitempty"` } -// HPAScalingRulesApplyConfiguration constructs an declarative configuration of the HPAScalingRules type for use with +// HPAScalingRulesApplyConfiguration constructs a declarative configuration of the HPAScalingRules type for use with // apply. func HPAScalingRules() *HPAScalingRulesApplyConfiguration { return &HPAScalingRulesApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/metricidentifier.go b/applyconfigurations/autoscaling/v2/metricidentifier.go index 312ad3ddd6..2f99f7d0b4 100644 --- a/applyconfigurations/autoscaling/v2/metricidentifier.go +++ b/applyconfigurations/autoscaling/v2/metricidentifier.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// MetricIdentifierApplyConfiguration represents an declarative configuration of the MetricIdentifier type for use +// MetricIdentifierApplyConfiguration represents a declarative configuration of the MetricIdentifier type for use // with apply. type MetricIdentifierApplyConfiguration struct { Name *string `json:"name,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` } -// MetricIdentifierApplyConfiguration constructs an declarative configuration of the MetricIdentifier type for use with +// MetricIdentifierApplyConfiguration constructs a declarative configuration of the MetricIdentifier type for use with // apply. func MetricIdentifier() *MetricIdentifierApplyConfiguration { return &MetricIdentifierApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/metricspec.go b/applyconfigurations/autoscaling/v2/metricspec.go index 094ead6c16..89e6b5c68b 100644 --- a/applyconfigurations/autoscaling/v2/metricspec.go +++ b/applyconfigurations/autoscaling/v2/metricspec.go @@ -22,7 +22,7 @@ import ( v2 "k8s.io/api/autoscaling/v2" ) -// MetricSpecApplyConfiguration represents an declarative configuration of the MetricSpec type for use +// MetricSpecApplyConfiguration represents a declarative configuration of the MetricSpec type for use // with apply. type MetricSpecApplyConfiguration struct { Type *v2.MetricSourceType `json:"type,omitempty"` @@ -33,7 +33,7 @@ type MetricSpecApplyConfiguration struct { External *ExternalMetricSourceApplyConfiguration `json:"external,omitempty"` } -// MetricSpecApplyConfiguration constructs an declarative configuration of the MetricSpec type for use with +// MetricSpecApplyConfiguration constructs a declarative configuration of the MetricSpec type for use with // apply. func MetricSpec() *MetricSpecApplyConfiguration { return &MetricSpecApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/metricstatus.go b/applyconfigurations/autoscaling/v2/metricstatus.go index c65ad446f0..86ae3348b6 100644 --- a/applyconfigurations/autoscaling/v2/metricstatus.go +++ b/applyconfigurations/autoscaling/v2/metricstatus.go @@ -22,7 +22,7 @@ import ( v2 "k8s.io/api/autoscaling/v2" ) -// MetricStatusApplyConfiguration represents an declarative configuration of the MetricStatus type for use +// MetricStatusApplyConfiguration represents a declarative configuration of the MetricStatus type for use // with apply. type MetricStatusApplyConfiguration struct { Type *v2.MetricSourceType `json:"type,omitempty"` @@ -33,7 +33,7 @@ type MetricStatusApplyConfiguration struct { External *ExternalMetricStatusApplyConfiguration `json:"external,omitempty"` } -// MetricStatusApplyConfiguration constructs an declarative configuration of the MetricStatus type for use with +// MetricStatusApplyConfiguration constructs a declarative configuration of the MetricStatus type for use with // apply. func MetricStatus() *MetricStatusApplyConfiguration { return &MetricStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/metrictarget.go b/applyconfigurations/autoscaling/v2/metrictarget.go index f301e4d2be..bf68a1c346 100644 --- a/applyconfigurations/autoscaling/v2/metrictarget.go +++ b/applyconfigurations/autoscaling/v2/metrictarget.go @@ -23,7 +23,7 @@ import ( resource "k8s.io/apimachinery/pkg/api/resource" ) -// MetricTargetApplyConfiguration represents an declarative configuration of the MetricTarget type for use +// MetricTargetApplyConfiguration represents a declarative configuration of the MetricTarget type for use // with apply. type MetricTargetApplyConfiguration struct { Type *v2.MetricTargetType `json:"type,omitempty"` @@ -32,7 +32,7 @@ type MetricTargetApplyConfiguration struct { AverageUtilization *int32 `json:"averageUtilization,omitempty"` } -// MetricTargetApplyConfiguration constructs an declarative configuration of the MetricTarget type for use with +// MetricTargetApplyConfiguration constructs a declarative configuration of the MetricTarget type for use with // apply. func MetricTarget() *MetricTargetApplyConfiguration { return &MetricTargetApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/metricvaluestatus.go b/applyconfigurations/autoscaling/v2/metricvaluestatus.go index e8474b1890..59732548b8 100644 --- a/applyconfigurations/autoscaling/v2/metricvaluestatus.go +++ b/applyconfigurations/autoscaling/v2/metricvaluestatus.go @@ -22,7 +22,7 @@ import ( resource "k8s.io/apimachinery/pkg/api/resource" ) -// MetricValueStatusApplyConfiguration represents an declarative configuration of the MetricValueStatus type for use +// MetricValueStatusApplyConfiguration represents a declarative configuration of the MetricValueStatus type for use // with apply. type MetricValueStatusApplyConfiguration struct { Value *resource.Quantity `json:"value,omitempty"` @@ -30,7 +30,7 @@ type MetricValueStatusApplyConfiguration struct { AverageUtilization *int32 `json:"averageUtilization,omitempty"` } -// MetricValueStatusApplyConfiguration constructs an declarative configuration of the MetricValueStatus type for use with +// MetricValueStatusApplyConfiguration constructs a declarative configuration of the MetricValueStatus type for use with // apply. func MetricValueStatus() *MetricValueStatusApplyConfiguration { return &MetricValueStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/objectmetricsource.go b/applyconfigurations/autoscaling/v2/objectmetricsource.go index a9482565e0..2391fa5c22 100644 --- a/applyconfigurations/autoscaling/v2/objectmetricsource.go +++ b/applyconfigurations/autoscaling/v2/objectmetricsource.go @@ -18,7 +18,7 @@ limitations under the License. package v2 -// ObjectMetricSourceApplyConfiguration represents an declarative configuration of the ObjectMetricSource type for use +// ObjectMetricSourceApplyConfiguration represents a declarative configuration of the ObjectMetricSource type for use // with apply. type ObjectMetricSourceApplyConfiguration struct { DescribedObject *CrossVersionObjectReferenceApplyConfiguration `json:"describedObject,omitempty"` @@ -26,7 +26,7 @@ type ObjectMetricSourceApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` } -// ObjectMetricSourceApplyConfiguration constructs an declarative configuration of the ObjectMetricSource type for use with +// ObjectMetricSourceApplyConfiguration constructs a declarative configuration of the ObjectMetricSource type for use with // apply. func ObjectMetricSource() *ObjectMetricSourceApplyConfiguration { return &ObjectMetricSourceApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/objectmetricstatus.go b/applyconfigurations/autoscaling/v2/objectmetricstatus.go index 70ba43bedd..9ffd0c180d 100644 --- a/applyconfigurations/autoscaling/v2/objectmetricstatus.go +++ b/applyconfigurations/autoscaling/v2/objectmetricstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v2 -// ObjectMetricStatusApplyConfiguration represents an declarative configuration of the ObjectMetricStatus type for use +// ObjectMetricStatusApplyConfiguration represents a declarative configuration of the ObjectMetricStatus type for use // with apply. type ObjectMetricStatusApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` @@ -26,7 +26,7 @@ type ObjectMetricStatusApplyConfiguration struct { DescribedObject *CrossVersionObjectReferenceApplyConfiguration `json:"describedObject,omitempty"` } -// ObjectMetricStatusApplyConfiguration constructs an declarative configuration of the ObjectMetricStatus type for use with +// ObjectMetricStatusApplyConfiguration constructs a declarative configuration of the ObjectMetricStatus type for use with // apply. func ObjectMetricStatus() *ObjectMetricStatusApplyConfiguration { return &ObjectMetricStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/podsmetricsource.go b/applyconfigurations/autoscaling/v2/podsmetricsource.go index 0a7a5c2595..28a35a2ae1 100644 --- a/applyconfigurations/autoscaling/v2/podsmetricsource.go +++ b/applyconfigurations/autoscaling/v2/podsmetricsource.go @@ -18,14 +18,14 @@ limitations under the License. package v2 -// PodsMetricSourceApplyConfiguration represents an declarative configuration of the PodsMetricSource type for use +// PodsMetricSourceApplyConfiguration represents a declarative configuration of the PodsMetricSource type for use // with apply. type PodsMetricSourceApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` Target *MetricTargetApplyConfiguration `json:"target,omitempty"` } -// PodsMetricSourceApplyConfiguration constructs an declarative configuration of the PodsMetricSource type for use with +// PodsMetricSourceApplyConfiguration constructs a declarative configuration of the PodsMetricSource type for use with // apply. func PodsMetricSource() *PodsMetricSourceApplyConfiguration { return &PodsMetricSourceApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/podsmetricstatus.go b/applyconfigurations/autoscaling/v2/podsmetricstatus.go index 865fcc33e3..4614282ce1 100644 --- a/applyconfigurations/autoscaling/v2/podsmetricstatus.go +++ b/applyconfigurations/autoscaling/v2/podsmetricstatus.go @@ -18,14 +18,14 @@ limitations under the License. package v2 -// PodsMetricStatusApplyConfiguration represents an declarative configuration of the PodsMetricStatus type for use +// PodsMetricStatusApplyConfiguration represents a declarative configuration of the PodsMetricStatus type for use // with apply. type PodsMetricStatusApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` Current *MetricValueStatusApplyConfiguration `json:"current,omitempty"` } -// PodsMetricStatusApplyConfiguration constructs an declarative configuration of the PodsMetricStatus type for use with +// PodsMetricStatusApplyConfiguration constructs a declarative configuration of the PodsMetricStatus type for use with // apply. func PodsMetricStatus() *PodsMetricStatusApplyConfiguration { return &PodsMetricStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/resourcemetricsource.go b/applyconfigurations/autoscaling/v2/resourcemetricsource.go index 25a065fef6..ffc9042b9f 100644 --- a/applyconfigurations/autoscaling/v2/resourcemetricsource.go +++ b/applyconfigurations/autoscaling/v2/resourcemetricsource.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// ResourceMetricSourceApplyConfiguration represents an declarative configuration of the ResourceMetricSource type for use +// ResourceMetricSourceApplyConfiguration represents a declarative configuration of the ResourceMetricSource type for use // with apply. type ResourceMetricSourceApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` Target *MetricTargetApplyConfiguration `json:"target,omitempty"` } -// ResourceMetricSourceApplyConfiguration constructs an declarative configuration of the ResourceMetricSource type for use with +// ResourceMetricSourceApplyConfiguration constructs a declarative configuration of the ResourceMetricSource type for use with // apply. func ResourceMetricSource() *ResourceMetricSourceApplyConfiguration { return &ResourceMetricSourceApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2/resourcemetricstatus.go b/applyconfigurations/autoscaling/v2/resourcemetricstatus.go index fb5625afab..0fdbfcb555 100644 --- a/applyconfigurations/autoscaling/v2/resourcemetricstatus.go +++ b/applyconfigurations/autoscaling/v2/resourcemetricstatus.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// ResourceMetricStatusApplyConfiguration represents an declarative configuration of the ResourceMetricStatus type for use +// ResourceMetricStatusApplyConfiguration represents a declarative configuration of the ResourceMetricStatus type for use // with apply. type ResourceMetricStatusApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` Current *MetricValueStatusApplyConfiguration `json:"current,omitempty"` } -// ResourceMetricStatusApplyConfiguration constructs an declarative configuration of the ResourceMetricStatus type for use with +// ResourceMetricStatusApplyConfiguration constructs a declarative configuration of the ResourceMetricStatus type for use with // apply. func ResourceMetricStatus() *ResourceMetricStatusApplyConfiguration { return &ResourceMetricStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta1/containerresourcemetricsource.go b/applyconfigurations/autoscaling/v2beta1/containerresourcemetricsource.go index 2594e8e072..f41c5af10f 100644 --- a/applyconfigurations/autoscaling/v2beta1/containerresourcemetricsource.go +++ b/applyconfigurations/autoscaling/v2beta1/containerresourcemetricsource.go @@ -23,7 +23,7 @@ import ( resource "k8s.io/apimachinery/pkg/api/resource" ) -// ContainerResourceMetricSourceApplyConfiguration represents an declarative configuration of the ContainerResourceMetricSource type for use +// ContainerResourceMetricSourceApplyConfiguration represents a declarative configuration of the ContainerResourceMetricSource type for use // with apply. type ContainerResourceMetricSourceApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` @@ -32,7 +32,7 @@ type ContainerResourceMetricSourceApplyConfiguration struct { Container *string `json:"container,omitempty"` } -// ContainerResourceMetricSourceApplyConfiguration constructs an declarative configuration of the ContainerResourceMetricSource type for use with +// ContainerResourceMetricSourceApplyConfiguration constructs a declarative configuration of the ContainerResourceMetricSource type for use with // apply. func ContainerResourceMetricSource() *ContainerResourceMetricSourceApplyConfiguration { return &ContainerResourceMetricSourceApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta1/containerresourcemetricstatus.go b/applyconfigurations/autoscaling/v2beta1/containerresourcemetricstatus.go index ae897237c4..4cd56eea37 100644 --- a/applyconfigurations/autoscaling/v2beta1/containerresourcemetricstatus.go +++ b/applyconfigurations/autoscaling/v2beta1/containerresourcemetricstatus.go @@ -23,7 +23,7 @@ import ( resource "k8s.io/apimachinery/pkg/api/resource" ) -// ContainerResourceMetricStatusApplyConfiguration represents an declarative configuration of the ContainerResourceMetricStatus type for use +// ContainerResourceMetricStatusApplyConfiguration represents a declarative configuration of the ContainerResourceMetricStatus type for use // with apply. type ContainerResourceMetricStatusApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` @@ -32,7 +32,7 @@ type ContainerResourceMetricStatusApplyConfiguration struct { Container *string `json:"container,omitempty"` } -// ContainerResourceMetricStatusApplyConfiguration constructs an declarative configuration of the ContainerResourceMetricStatus type for use with +// ContainerResourceMetricStatusApplyConfiguration constructs a declarative configuration of the ContainerResourceMetricStatus type for use with // apply. func ContainerResourceMetricStatus() *ContainerResourceMetricStatusApplyConfiguration { return &ContainerResourceMetricStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta1/crossversionobjectreference.go b/applyconfigurations/autoscaling/v2beta1/crossversionobjectreference.go index fe3d15e866..f03261612e 100644 --- a/applyconfigurations/autoscaling/v2beta1/crossversionobjectreference.go +++ b/applyconfigurations/autoscaling/v2beta1/crossversionobjectreference.go @@ -18,7 +18,7 @@ limitations under the License. package v2beta1 -// CrossVersionObjectReferenceApplyConfiguration represents an declarative configuration of the CrossVersionObjectReference type for use +// CrossVersionObjectReferenceApplyConfiguration represents a declarative configuration of the CrossVersionObjectReference type for use // with apply. type CrossVersionObjectReferenceApplyConfiguration struct { Kind *string `json:"kind,omitempty"` @@ -26,7 +26,7 @@ type CrossVersionObjectReferenceApplyConfiguration struct { APIVersion *string `json:"apiVersion,omitempty"` } -// CrossVersionObjectReferenceApplyConfiguration constructs an declarative configuration of the CrossVersionObjectReference type for use with +// CrossVersionObjectReferenceApplyConfiguration constructs a declarative configuration of the CrossVersionObjectReference type for use with // apply. func CrossVersionObjectReference() *CrossVersionObjectReferenceApplyConfiguration { return &CrossVersionObjectReferenceApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta1/externalmetricsource.go b/applyconfigurations/autoscaling/v2beta1/externalmetricsource.go index c118e6ca1e..8dce4529dd 100644 --- a/applyconfigurations/autoscaling/v2beta1/externalmetricsource.go +++ b/applyconfigurations/autoscaling/v2beta1/externalmetricsource.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ExternalMetricSourceApplyConfiguration represents an declarative configuration of the ExternalMetricSource type for use +// ExternalMetricSourceApplyConfiguration represents a declarative configuration of the ExternalMetricSource type for use // with apply. type ExternalMetricSourceApplyConfiguration struct { MetricName *string `json:"metricName,omitempty"` @@ -32,7 +32,7 @@ type ExternalMetricSourceApplyConfiguration struct { TargetAverageValue *resource.Quantity `json:"targetAverageValue,omitempty"` } -// ExternalMetricSourceApplyConfiguration constructs an declarative configuration of the ExternalMetricSource type for use with +// ExternalMetricSourceApplyConfiguration constructs a declarative configuration of the ExternalMetricSource type for use with // apply. func ExternalMetricSource() *ExternalMetricSourceApplyConfiguration { return &ExternalMetricSourceApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta1/externalmetricstatus.go b/applyconfigurations/autoscaling/v2beta1/externalmetricstatus.go index ab771214e2..4034d7e55c 100644 --- a/applyconfigurations/autoscaling/v2beta1/externalmetricstatus.go +++ b/applyconfigurations/autoscaling/v2beta1/externalmetricstatus.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ExternalMetricStatusApplyConfiguration represents an declarative configuration of the ExternalMetricStatus type for use +// ExternalMetricStatusApplyConfiguration represents a declarative configuration of the ExternalMetricStatus type for use // with apply. type ExternalMetricStatusApplyConfiguration struct { MetricName *string `json:"metricName,omitempty"` @@ -32,7 +32,7 @@ type ExternalMetricStatusApplyConfiguration struct { CurrentAverageValue *resource.Quantity `json:"currentAverageValue,omitempty"` } -// ExternalMetricStatusApplyConfiguration constructs an declarative configuration of the ExternalMetricStatus type for use with +// ExternalMetricStatusApplyConfiguration constructs a declarative configuration of the ExternalMetricStatus type for use with // apply. func ExternalMetricStatus() *ExternalMetricStatusApplyConfiguration { return &ExternalMetricStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscaler.go b/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscaler.go index ce63233ded..93e37eaffa 100644 --- a/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscaler.go +++ b/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscaler.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// HorizontalPodAutoscalerApplyConfiguration represents an declarative configuration of the HorizontalPodAutoscaler type for use +// HorizontalPodAutoscalerApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscaler type for use // with apply. type HorizontalPodAutoscalerApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type HorizontalPodAutoscalerApplyConfiguration struct { Status *HorizontalPodAutoscalerStatusApplyConfiguration `json:"status,omitempty"` } -// HorizontalPodAutoscaler constructs an declarative configuration of the HorizontalPodAutoscaler type for use with +// HorizontalPodAutoscaler constructs a declarative configuration of the HorizontalPodAutoscaler type for use with // apply. func HorizontalPodAutoscaler(name, namespace string) *HorizontalPodAutoscalerApplyConfiguration { b := &HorizontalPodAutoscalerApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscalercondition.go b/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscalercondition.go index de3e6ea5cd..8bb82298d1 100644 --- a/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscalercondition.go +++ b/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscalercondition.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// HorizontalPodAutoscalerConditionApplyConfiguration represents an declarative configuration of the HorizontalPodAutoscalerCondition type for use +// HorizontalPodAutoscalerConditionApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerCondition type for use // with apply. type HorizontalPodAutoscalerConditionApplyConfiguration struct { Type *v2beta1.HorizontalPodAutoscalerConditionType `json:"type,omitempty"` @@ -34,7 +34,7 @@ type HorizontalPodAutoscalerConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// HorizontalPodAutoscalerConditionApplyConfiguration constructs an declarative configuration of the HorizontalPodAutoscalerCondition type for use with +// HorizontalPodAutoscalerConditionApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerCondition type for use with // apply. func HorizontalPodAutoscalerCondition() *HorizontalPodAutoscalerConditionApplyConfiguration { return &HorizontalPodAutoscalerConditionApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscalerspec.go b/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscalerspec.go index 761d94a850..6f111ceafd 100644 --- a/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscalerspec.go +++ b/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscalerspec.go @@ -18,7 +18,7 @@ limitations under the License. package v2beta1 -// HorizontalPodAutoscalerSpecApplyConfiguration represents an declarative configuration of the HorizontalPodAutoscalerSpec type for use +// HorizontalPodAutoscalerSpecApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerSpec type for use // with apply. type HorizontalPodAutoscalerSpecApplyConfiguration struct { ScaleTargetRef *CrossVersionObjectReferenceApplyConfiguration `json:"scaleTargetRef,omitempty"` @@ -27,7 +27,7 @@ type HorizontalPodAutoscalerSpecApplyConfiguration struct { Metrics []MetricSpecApplyConfiguration `json:"metrics,omitempty"` } -// HorizontalPodAutoscalerSpecApplyConfiguration constructs an declarative configuration of the HorizontalPodAutoscalerSpec type for use with +// HorizontalPodAutoscalerSpecApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerSpec type for use with // apply. func HorizontalPodAutoscalerSpec() *HorizontalPodAutoscalerSpecApplyConfiguration { return &HorizontalPodAutoscalerSpecApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscalerstatus.go b/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscalerstatus.go index 95ec5be43b..391b577258 100644 --- a/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscalerstatus.go +++ b/applyconfigurations/autoscaling/v2beta1/horizontalpodautoscalerstatus.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// HorizontalPodAutoscalerStatusApplyConfiguration represents an declarative configuration of the HorizontalPodAutoscalerStatus type for use +// HorizontalPodAutoscalerStatusApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerStatus type for use // with apply. type HorizontalPodAutoscalerStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` @@ -33,7 +33,7 @@ type HorizontalPodAutoscalerStatusApplyConfiguration struct { Conditions []HorizontalPodAutoscalerConditionApplyConfiguration `json:"conditions,omitempty"` } -// HorizontalPodAutoscalerStatusApplyConfiguration constructs an declarative configuration of the HorizontalPodAutoscalerStatus type for use with +// HorizontalPodAutoscalerStatusApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerStatus type for use with // apply. func HorizontalPodAutoscalerStatus() *HorizontalPodAutoscalerStatusApplyConfiguration { return &HorizontalPodAutoscalerStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta1/metricspec.go b/applyconfigurations/autoscaling/v2beta1/metricspec.go index 70beec84e0..961e2c5b48 100644 --- a/applyconfigurations/autoscaling/v2beta1/metricspec.go +++ b/applyconfigurations/autoscaling/v2beta1/metricspec.go @@ -22,7 +22,7 @@ import ( v2beta1 "k8s.io/api/autoscaling/v2beta1" ) -// MetricSpecApplyConfiguration represents an declarative configuration of the MetricSpec type for use +// MetricSpecApplyConfiguration represents a declarative configuration of the MetricSpec type for use // with apply. type MetricSpecApplyConfiguration struct { Type *v2beta1.MetricSourceType `json:"type,omitempty"` @@ -33,7 +33,7 @@ type MetricSpecApplyConfiguration struct { External *ExternalMetricSourceApplyConfiguration `json:"external,omitempty"` } -// MetricSpecApplyConfiguration constructs an declarative configuration of the MetricSpec type for use with +// MetricSpecApplyConfiguration constructs a declarative configuration of the MetricSpec type for use with // apply. func MetricSpec() *MetricSpecApplyConfiguration { return &MetricSpecApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta1/metricstatus.go b/applyconfigurations/autoscaling/v2beta1/metricstatus.go index b03ea2f9e4..587b5a1f88 100644 --- a/applyconfigurations/autoscaling/v2beta1/metricstatus.go +++ b/applyconfigurations/autoscaling/v2beta1/metricstatus.go @@ -22,7 +22,7 @@ import ( v2beta1 "k8s.io/api/autoscaling/v2beta1" ) -// MetricStatusApplyConfiguration represents an declarative configuration of the MetricStatus type for use +// MetricStatusApplyConfiguration represents a declarative configuration of the MetricStatus type for use // with apply. type MetricStatusApplyConfiguration struct { Type *v2beta1.MetricSourceType `json:"type,omitempty"` @@ -33,7 +33,7 @@ type MetricStatusApplyConfiguration struct { External *ExternalMetricStatusApplyConfiguration `json:"external,omitempty"` } -// MetricStatusApplyConfiguration constructs an declarative configuration of the MetricStatus type for use with +// MetricStatusApplyConfiguration constructs a declarative configuration of the MetricStatus type for use with // apply. func MetricStatus() *MetricStatusApplyConfiguration { return &MetricStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta1/objectmetricsource.go b/applyconfigurations/autoscaling/v2beta1/objectmetricsource.go index 07d467972e..a9e2eead4d 100644 --- a/applyconfigurations/autoscaling/v2beta1/objectmetricsource.go +++ b/applyconfigurations/autoscaling/v2beta1/objectmetricsource.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ObjectMetricSourceApplyConfiguration represents an declarative configuration of the ObjectMetricSource type for use +// ObjectMetricSourceApplyConfiguration represents a declarative configuration of the ObjectMetricSource type for use // with apply. type ObjectMetricSourceApplyConfiguration struct { Target *CrossVersionObjectReferenceApplyConfiguration `json:"target,omitempty"` @@ -33,7 +33,7 @@ type ObjectMetricSourceApplyConfiguration struct { AverageValue *resource.Quantity `json:"averageValue,omitempty"` } -// ObjectMetricSourceApplyConfiguration constructs an declarative configuration of the ObjectMetricSource type for use with +// ObjectMetricSourceApplyConfiguration constructs a declarative configuration of the ObjectMetricSource type for use with // apply. func ObjectMetricSource() *ObjectMetricSourceApplyConfiguration { return &ObjectMetricSourceApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta1/objectmetricstatus.go b/applyconfigurations/autoscaling/v2beta1/objectmetricstatus.go index b5e0d3e3d2..4d3be8df6c 100644 --- a/applyconfigurations/autoscaling/v2beta1/objectmetricstatus.go +++ b/applyconfigurations/autoscaling/v2beta1/objectmetricstatus.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ObjectMetricStatusApplyConfiguration represents an declarative configuration of the ObjectMetricStatus type for use +// ObjectMetricStatusApplyConfiguration represents a declarative configuration of the ObjectMetricStatus type for use // with apply. type ObjectMetricStatusApplyConfiguration struct { Target *CrossVersionObjectReferenceApplyConfiguration `json:"target,omitempty"` @@ -33,7 +33,7 @@ type ObjectMetricStatusApplyConfiguration struct { AverageValue *resource.Quantity `json:"averageValue,omitempty"` } -// ObjectMetricStatusApplyConfiguration constructs an declarative configuration of the ObjectMetricStatus type for use with +// ObjectMetricStatusApplyConfiguration constructs a declarative configuration of the ObjectMetricStatus type for use with // apply. func ObjectMetricStatus() *ObjectMetricStatusApplyConfiguration { return &ObjectMetricStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta1/podsmetricsource.go b/applyconfigurations/autoscaling/v2beta1/podsmetricsource.go index a4122b8989..cfcd752e24 100644 --- a/applyconfigurations/autoscaling/v2beta1/podsmetricsource.go +++ b/applyconfigurations/autoscaling/v2beta1/podsmetricsource.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PodsMetricSourceApplyConfiguration represents an declarative configuration of the PodsMetricSource type for use +// PodsMetricSourceApplyConfiguration represents a declarative configuration of the PodsMetricSource type for use // with apply. type PodsMetricSourceApplyConfiguration struct { MetricName *string `json:"metricName,omitempty"` @@ -31,7 +31,7 @@ type PodsMetricSourceApplyConfiguration struct { Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` } -// PodsMetricSourceApplyConfiguration constructs an declarative configuration of the PodsMetricSource type for use with +// PodsMetricSourceApplyConfiguration constructs a declarative configuration of the PodsMetricSource type for use with // apply. func PodsMetricSource() *PodsMetricSourceApplyConfiguration { return &PodsMetricSourceApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta1/podsmetricstatus.go b/applyconfigurations/autoscaling/v2beta1/podsmetricstatus.go index d6172011b7..f7a7777fd4 100644 --- a/applyconfigurations/autoscaling/v2beta1/podsmetricstatus.go +++ b/applyconfigurations/autoscaling/v2beta1/podsmetricstatus.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PodsMetricStatusApplyConfiguration represents an declarative configuration of the PodsMetricStatus type for use +// PodsMetricStatusApplyConfiguration represents a declarative configuration of the PodsMetricStatus type for use // with apply. type PodsMetricStatusApplyConfiguration struct { MetricName *string `json:"metricName,omitempty"` @@ -31,7 +31,7 @@ type PodsMetricStatusApplyConfiguration struct { Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` } -// PodsMetricStatusApplyConfiguration constructs an declarative configuration of the PodsMetricStatus type for use with +// PodsMetricStatusApplyConfiguration constructs a declarative configuration of the PodsMetricStatus type for use with // apply. func PodsMetricStatus() *PodsMetricStatusApplyConfiguration { return &PodsMetricStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta1/resourcemetricsource.go b/applyconfigurations/autoscaling/v2beta1/resourcemetricsource.go index 804f3f4926..ad97d83c3c 100644 --- a/applyconfigurations/autoscaling/v2beta1/resourcemetricsource.go +++ b/applyconfigurations/autoscaling/v2beta1/resourcemetricsource.go @@ -23,7 +23,7 @@ import ( resource "k8s.io/apimachinery/pkg/api/resource" ) -// ResourceMetricSourceApplyConfiguration represents an declarative configuration of the ResourceMetricSource type for use +// ResourceMetricSourceApplyConfiguration represents a declarative configuration of the ResourceMetricSource type for use // with apply. type ResourceMetricSourceApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` @@ -31,7 +31,7 @@ type ResourceMetricSourceApplyConfiguration struct { TargetAverageValue *resource.Quantity `json:"targetAverageValue,omitempty"` } -// ResourceMetricSourceApplyConfiguration constructs an declarative configuration of the ResourceMetricSource type for use with +// ResourceMetricSourceApplyConfiguration constructs a declarative configuration of the ResourceMetricSource type for use with // apply. func ResourceMetricSource() *ResourceMetricSourceApplyConfiguration { return &ResourceMetricSourceApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta1/resourcemetricstatus.go b/applyconfigurations/autoscaling/v2beta1/resourcemetricstatus.go index 5fdc29c132..78fbeaad06 100644 --- a/applyconfigurations/autoscaling/v2beta1/resourcemetricstatus.go +++ b/applyconfigurations/autoscaling/v2beta1/resourcemetricstatus.go @@ -23,7 +23,7 @@ import ( resource "k8s.io/apimachinery/pkg/api/resource" ) -// ResourceMetricStatusApplyConfiguration represents an declarative configuration of the ResourceMetricStatus type for use +// ResourceMetricStatusApplyConfiguration represents a declarative configuration of the ResourceMetricStatus type for use // with apply. type ResourceMetricStatusApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` @@ -31,7 +31,7 @@ type ResourceMetricStatusApplyConfiguration struct { CurrentAverageValue *resource.Quantity `json:"currentAverageValue,omitempty"` } -// ResourceMetricStatusApplyConfiguration constructs an declarative configuration of the ResourceMetricStatus type for use with +// ResourceMetricStatusApplyConfiguration constructs a declarative configuration of the ResourceMetricStatus type for use with // apply. func ResourceMetricStatus() *ResourceMetricStatusApplyConfiguration { return &ResourceMetricStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/containerresourcemetricsource.go b/applyconfigurations/autoscaling/v2beta2/containerresourcemetricsource.go index aa334744ea..1050165ea3 100644 --- a/applyconfigurations/autoscaling/v2beta2/containerresourcemetricsource.go +++ b/applyconfigurations/autoscaling/v2beta2/containerresourcemetricsource.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// ContainerResourceMetricSourceApplyConfiguration represents an declarative configuration of the ContainerResourceMetricSource type for use +// ContainerResourceMetricSourceApplyConfiguration represents a declarative configuration of the ContainerResourceMetricSource type for use // with apply. type ContainerResourceMetricSourceApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` @@ -30,7 +30,7 @@ type ContainerResourceMetricSourceApplyConfiguration struct { Container *string `json:"container,omitempty"` } -// ContainerResourceMetricSourceApplyConfiguration constructs an declarative configuration of the ContainerResourceMetricSource type for use with +// ContainerResourceMetricSourceApplyConfiguration constructs a declarative configuration of the ContainerResourceMetricSource type for use with // apply. func ContainerResourceMetricSource() *ContainerResourceMetricSourceApplyConfiguration { return &ContainerResourceMetricSourceApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/containerresourcemetricstatus.go b/applyconfigurations/autoscaling/v2beta2/containerresourcemetricstatus.go index bf0822a066..708f68bc6b 100644 --- a/applyconfigurations/autoscaling/v2beta2/containerresourcemetricstatus.go +++ b/applyconfigurations/autoscaling/v2beta2/containerresourcemetricstatus.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// ContainerResourceMetricStatusApplyConfiguration represents an declarative configuration of the ContainerResourceMetricStatus type for use +// ContainerResourceMetricStatusApplyConfiguration represents a declarative configuration of the ContainerResourceMetricStatus type for use // with apply. type ContainerResourceMetricStatusApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` @@ -30,7 +30,7 @@ type ContainerResourceMetricStatusApplyConfiguration struct { Container *string `json:"container,omitempty"` } -// ContainerResourceMetricStatusApplyConfiguration constructs an declarative configuration of the ContainerResourceMetricStatus type for use with +// ContainerResourceMetricStatusApplyConfiguration constructs a declarative configuration of the ContainerResourceMetricStatus type for use with // apply. func ContainerResourceMetricStatus() *ContainerResourceMetricStatusApplyConfiguration { return &ContainerResourceMetricStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/crossversionobjectreference.go b/applyconfigurations/autoscaling/v2beta2/crossversionobjectreference.go index 2903629bc8..c281084b16 100644 --- a/applyconfigurations/autoscaling/v2beta2/crossversionobjectreference.go +++ b/applyconfigurations/autoscaling/v2beta2/crossversionobjectreference.go @@ -18,7 +18,7 @@ limitations under the License. package v2beta2 -// CrossVersionObjectReferenceApplyConfiguration represents an declarative configuration of the CrossVersionObjectReference type for use +// CrossVersionObjectReferenceApplyConfiguration represents a declarative configuration of the CrossVersionObjectReference type for use // with apply. type CrossVersionObjectReferenceApplyConfiguration struct { Kind *string `json:"kind,omitempty"` @@ -26,7 +26,7 @@ type CrossVersionObjectReferenceApplyConfiguration struct { APIVersion *string `json:"apiVersion,omitempty"` } -// CrossVersionObjectReferenceApplyConfiguration constructs an declarative configuration of the CrossVersionObjectReference type for use with +// CrossVersionObjectReferenceApplyConfiguration constructs a declarative configuration of the CrossVersionObjectReference type for use with // apply. func CrossVersionObjectReference() *CrossVersionObjectReferenceApplyConfiguration { return &CrossVersionObjectReferenceApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/externalmetricsource.go b/applyconfigurations/autoscaling/v2beta2/externalmetricsource.go index 80053a6b33..d34ca11494 100644 --- a/applyconfigurations/autoscaling/v2beta2/externalmetricsource.go +++ b/applyconfigurations/autoscaling/v2beta2/externalmetricsource.go @@ -18,14 +18,14 @@ limitations under the License. package v2beta2 -// ExternalMetricSourceApplyConfiguration represents an declarative configuration of the ExternalMetricSource type for use +// ExternalMetricSourceApplyConfiguration represents a declarative configuration of the ExternalMetricSource type for use // with apply. type ExternalMetricSourceApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` Target *MetricTargetApplyConfiguration `json:"target,omitempty"` } -// ExternalMetricSourceApplyConfiguration constructs an declarative configuration of the ExternalMetricSource type for use with +// ExternalMetricSourceApplyConfiguration constructs a declarative configuration of the ExternalMetricSource type for use with // apply. func ExternalMetricSource() *ExternalMetricSourceApplyConfiguration { return &ExternalMetricSourceApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/externalmetricstatus.go b/applyconfigurations/autoscaling/v2beta2/externalmetricstatus.go index 71ac35adbc..be29e607fa 100644 --- a/applyconfigurations/autoscaling/v2beta2/externalmetricstatus.go +++ b/applyconfigurations/autoscaling/v2beta2/externalmetricstatus.go @@ -18,14 +18,14 @@ limitations under the License. package v2beta2 -// ExternalMetricStatusApplyConfiguration represents an declarative configuration of the ExternalMetricStatus type for use +// ExternalMetricStatusApplyConfiguration represents a declarative configuration of the ExternalMetricStatus type for use // with apply. type ExternalMetricStatusApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` Current *MetricValueStatusApplyConfiguration `json:"current,omitempty"` } -// ExternalMetricStatusApplyConfiguration constructs an declarative configuration of the ExternalMetricStatus type for use with +// ExternalMetricStatusApplyConfiguration constructs a declarative configuration of the ExternalMetricStatus type for use with // apply. func ExternalMetricStatus() *ExternalMetricStatusApplyConfiguration { return &ExternalMetricStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscaler.go b/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscaler.go index 2e7a0a474b..ce666f0f3e 100644 --- a/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscaler.go +++ b/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscaler.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// HorizontalPodAutoscalerApplyConfiguration represents an declarative configuration of the HorizontalPodAutoscaler type for use +// HorizontalPodAutoscalerApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscaler type for use // with apply. type HorizontalPodAutoscalerApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type HorizontalPodAutoscalerApplyConfiguration struct { Status *HorizontalPodAutoscalerStatusApplyConfiguration `json:"status,omitempty"` } -// HorizontalPodAutoscaler constructs an declarative configuration of the HorizontalPodAutoscaler type for use with +// HorizontalPodAutoscaler constructs a declarative configuration of the HorizontalPodAutoscaler type for use with // apply. func HorizontalPodAutoscaler(name, namespace string) *HorizontalPodAutoscalerApplyConfiguration { b := &HorizontalPodAutoscalerApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscalerbehavior.go b/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscalerbehavior.go index ec41bfadea..e9b1a9fb9e 100644 --- a/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscalerbehavior.go +++ b/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscalerbehavior.go @@ -18,14 +18,14 @@ limitations under the License. package v2beta2 -// HorizontalPodAutoscalerBehaviorApplyConfiguration represents an declarative configuration of the HorizontalPodAutoscalerBehavior type for use +// HorizontalPodAutoscalerBehaviorApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerBehavior type for use // with apply. type HorizontalPodAutoscalerBehaviorApplyConfiguration struct { ScaleUp *HPAScalingRulesApplyConfiguration `json:"scaleUp,omitempty"` ScaleDown *HPAScalingRulesApplyConfiguration `json:"scaleDown,omitempty"` } -// HorizontalPodAutoscalerBehaviorApplyConfiguration constructs an declarative configuration of the HorizontalPodAutoscalerBehavior type for use with +// HorizontalPodAutoscalerBehaviorApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerBehavior type for use with // apply. func HorizontalPodAutoscalerBehavior() *HorizontalPodAutoscalerBehaviorApplyConfiguration { return &HorizontalPodAutoscalerBehaviorApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscalercondition.go b/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscalercondition.go index 0f0cae75d3..a73e7ebaa8 100644 --- a/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscalercondition.go +++ b/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscalercondition.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// HorizontalPodAutoscalerConditionApplyConfiguration represents an declarative configuration of the HorizontalPodAutoscalerCondition type for use +// HorizontalPodAutoscalerConditionApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerCondition type for use // with apply. type HorizontalPodAutoscalerConditionApplyConfiguration struct { Type *v2beta2.HorizontalPodAutoscalerConditionType `json:"type,omitempty"` @@ -34,7 +34,7 @@ type HorizontalPodAutoscalerConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// HorizontalPodAutoscalerConditionApplyConfiguration constructs an declarative configuration of the HorizontalPodAutoscalerCondition type for use with +// HorizontalPodAutoscalerConditionApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerCondition type for use with // apply. func HorizontalPodAutoscalerCondition() *HorizontalPodAutoscalerConditionApplyConfiguration { return &HorizontalPodAutoscalerConditionApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscalerspec.go b/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscalerspec.go index c60adee581..9629e4bd59 100644 --- a/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscalerspec.go +++ b/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscalerspec.go @@ -18,7 +18,7 @@ limitations under the License. package v2beta2 -// HorizontalPodAutoscalerSpecApplyConfiguration represents an declarative configuration of the HorizontalPodAutoscalerSpec type for use +// HorizontalPodAutoscalerSpecApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerSpec type for use // with apply. type HorizontalPodAutoscalerSpecApplyConfiguration struct { ScaleTargetRef *CrossVersionObjectReferenceApplyConfiguration `json:"scaleTargetRef,omitempty"` @@ -28,7 +28,7 @@ type HorizontalPodAutoscalerSpecApplyConfiguration struct { Behavior *HorizontalPodAutoscalerBehaviorApplyConfiguration `json:"behavior,omitempty"` } -// HorizontalPodAutoscalerSpecApplyConfiguration constructs an declarative configuration of the HorizontalPodAutoscalerSpec type for use with +// HorizontalPodAutoscalerSpecApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerSpec type for use with // apply. func HorizontalPodAutoscalerSpec() *HorizontalPodAutoscalerSpecApplyConfiguration { return &HorizontalPodAutoscalerSpecApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscalerstatus.go b/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscalerstatus.go index 881a874e51..1eee645050 100644 --- a/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscalerstatus.go +++ b/applyconfigurations/autoscaling/v2beta2/horizontalpodautoscalerstatus.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// HorizontalPodAutoscalerStatusApplyConfiguration represents an declarative configuration of the HorizontalPodAutoscalerStatus type for use +// HorizontalPodAutoscalerStatusApplyConfiguration represents a declarative configuration of the HorizontalPodAutoscalerStatus type for use // with apply. type HorizontalPodAutoscalerStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` @@ -33,7 +33,7 @@ type HorizontalPodAutoscalerStatusApplyConfiguration struct { Conditions []HorizontalPodAutoscalerConditionApplyConfiguration `json:"conditions,omitempty"` } -// HorizontalPodAutoscalerStatusApplyConfiguration constructs an declarative configuration of the HorizontalPodAutoscalerStatus type for use with +// HorizontalPodAutoscalerStatusApplyConfiguration constructs a declarative configuration of the HorizontalPodAutoscalerStatus type for use with // apply. func HorizontalPodAutoscalerStatus() *HorizontalPodAutoscalerStatusApplyConfiguration { return &HorizontalPodAutoscalerStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/hpascalingpolicy.go b/applyconfigurations/autoscaling/v2beta2/hpascalingpolicy.go index 2a535891af..b799f99e0d 100644 --- a/applyconfigurations/autoscaling/v2beta2/hpascalingpolicy.go +++ b/applyconfigurations/autoscaling/v2beta2/hpascalingpolicy.go @@ -22,7 +22,7 @@ import ( v2beta2 "k8s.io/api/autoscaling/v2beta2" ) -// HPAScalingPolicyApplyConfiguration represents an declarative configuration of the HPAScalingPolicy type for use +// HPAScalingPolicyApplyConfiguration represents a declarative configuration of the HPAScalingPolicy type for use // with apply. type HPAScalingPolicyApplyConfiguration struct { Type *v2beta2.HPAScalingPolicyType `json:"type,omitempty"` @@ -30,7 +30,7 @@ type HPAScalingPolicyApplyConfiguration struct { PeriodSeconds *int32 `json:"periodSeconds,omitempty"` } -// HPAScalingPolicyApplyConfiguration constructs an declarative configuration of the HPAScalingPolicy type for use with +// HPAScalingPolicyApplyConfiguration constructs a declarative configuration of the HPAScalingPolicy type for use with // apply. func HPAScalingPolicy() *HPAScalingPolicyApplyConfiguration { return &HPAScalingPolicyApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/hpascalingrules.go b/applyconfigurations/autoscaling/v2beta2/hpascalingrules.go index 57c917b894..f7e8d9ae3e 100644 --- a/applyconfigurations/autoscaling/v2beta2/hpascalingrules.go +++ b/applyconfigurations/autoscaling/v2beta2/hpascalingrules.go @@ -22,7 +22,7 @@ import ( v2beta2 "k8s.io/api/autoscaling/v2beta2" ) -// HPAScalingRulesApplyConfiguration represents an declarative configuration of the HPAScalingRules type for use +// HPAScalingRulesApplyConfiguration represents a declarative configuration of the HPAScalingRules type for use // with apply. type HPAScalingRulesApplyConfiguration struct { StabilizationWindowSeconds *int32 `json:"stabilizationWindowSeconds,omitempty"` @@ -30,7 +30,7 @@ type HPAScalingRulesApplyConfiguration struct { Policies []HPAScalingPolicyApplyConfiguration `json:"policies,omitempty"` } -// HPAScalingRulesApplyConfiguration constructs an declarative configuration of the HPAScalingRules type for use with +// HPAScalingRulesApplyConfiguration constructs a declarative configuration of the HPAScalingRules type for use with // apply. func HPAScalingRules() *HPAScalingRulesApplyConfiguration { return &HPAScalingRulesApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/metricidentifier.go b/applyconfigurations/autoscaling/v2beta2/metricidentifier.go index 70cbd4e815..e8b2abb0e6 100644 --- a/applyconfigurations/autoscaling/v2beta2/metricidentifier.go +++ b/applyconfigurations/autoscaling/v2beta2/metricidentifier.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// MetricIdentifierApplyConfiguration represents an declarative configuration of the MetricIdentifier type for use +// MetricIdentifierApplyConfiguration represents a declarative configuration of the MetricIdentifier type for use // with apply. type MetricIdentifierApplyConfiguration struct { Name *string `json:"name,omitempty"` Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` } -// MetricIdentifierApplyConfiguration constructs an declarative configuration of the MetricIdentifier type for use with +// MetricIdentifierApplyConfiguration constructs a declarative configuration of the MetricIdentifier type for use with // apply. func MetricIdentifier() *MetricIdentifierApplyConfiguration { return &MetricIdentifierApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/metricspec.go b/applyconfigurations/autoscaling/v2beta2/metricspec.go index 1e7ee1419d..3ec7108618 100644 --- a/applyconfigurations/autoscaling/v2beta2/metricspec.go +++ b/applyconfigurations/autoscaling/v2beta2/metricspec.go @@ -22,7 +22,7 @@ import ( v2beta2 "k8s.io/api/autoscaling/v2beta2" ) -// MetricSpecApplyConfiguration represents an declarative configuration of the MetricSpec type for use +// MetricSpecApplyConfiguration represents a declarative configuration of the MetricSpec type for use // with apply. type MetricSpecApplyConfiguration struct { Type *v2beta2.MetricSourceType `json:"type,omitempty"` @@ -33,7 +33,7 @@ type MetricSpecApplyConfiguration struct { External *ExternalMetricSourceApplyConfiguration `json:"external,omitempty"` } -// MetricSpecApplyConfiguration constructs an declarative configuration of the MetricSpec type for use with +// MetricSpecApplyConfiguration constructs a declarative configuration of the MetricSpec type for use with // apply. func MetricSpec() *MetricSpecApplyConfiguration { return &MetricSpecApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/metricstatus.go b/applyconfigurations/autoscaling/v2beta2/metricstatus.go index 353ec6d943..40d32795bc 100644 --- a/applyconfigurations/autoscaling/v2beta2/metricstatus.go +++ b/applyconfigurations/autoscaling/v2beta2/metricstatus.go @@ -22,7 +22,7 @@ import ( v2beta2 "k8s.io/api/autoscaling/v2beta2" ) -// MetricStatusApplyConfiguration represents an declarative configuration of the MetricStatus type for use +// MetricStatusApplyConfiguration represents a declarative configuration of the MetricStatus type for use // with apply. type MetricStatusApplyConfiguration struct { Type *v2beta2.MetricSourceType `json:"type,omitempty"` @@ -33,7 +33,7 @@ type MetricStatusApplyConfiguration struct { External *ExternalMetricStatusApplyConfiguration `json:"external,omitempty"` } -// MetricStatusApplyConfiguration constructs an declarative configuration of the MetricStatus type for use with +// MetricStatusApplyConfiguration constructs a declarative configuration of the MetricStatus type for use with // apply. func MetricStatus() *MetricStatusApplyConfiguration { return &MetricStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/metrictarget.go b/applyconfigurations/autoscaling/v2beta2/metrictarget.go index fbf006a5a6..aeec3102ee 100644 --- a/applyconfigurations/autoscaling/v2beta2/metrictarget.go +++ b/applyconfigurations/autoscaling/v2beta2/metrictarget.go @@ -23,7 +23,7 @@ import ( resource "k8s.io/apimachinery/pkg/api/resource" ) -// MetricTargetApplyConfiguration represents an declarative configuration of the MetricTarget type for use +// MetricTargetApplyConfiguration represents a declarative configuration of the MetricTarget type for use // with apply. type MetricTargetApplyConfiguration struct { Type *v2beta2.MetricTargetType `json:"type,omitempty"` @@ -32,7 +32,7 @@ type MetricTargetApplyConfiguration struct { AverageUtilization *int32 `json:"averageUtilization,omitempty"` } -// MetricTargetApplyConfiguration constructs an declarative configuration of the MetricTarget type for use with +// MetricTargetApplyConfiguration constructs a declarative configuration of the MetricTarget type for use with // apply. func MetricTarget() *MetricTargetApplyConfiguration { return &MetricTargetApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/metricvaluestatus.go b/applyconfigurations/autoscaling/v2beta2/metricvaluestatus.go index 5796a0b4c1..cc409fc283 100644 --- a/applyconfigurations/autoscaling/v2beta2/metricvaluestatus.go +++ b/applyconfigurations/autoscaling/v2beta2/metricvaluestatus.go @@ -22,7 +22,7 @@ import ( resource "k8s.io/apimachinery/pkg/api/resource" ) -// MetricValueStatusApplyConfiguration represents an declarative configuration of the MetricValueStatus type for use +// MetricValueStatusApplyConfiguration represents a declarative configuration of the MetricValueStatus type for use // with apply. type MetricValueStatusApplyConfiguration struct { Value *resource.Quantity `json:"value,omitempty"` @@ -30,7 +30,7 @@ type MetricValueStatusApplyConfiguration struct { AverageUtilization *int32 `json:"averageUtilization,omitempty"` } -// MetricValueStatusApplyConfiguration constructs an declarative configuration of the MetricValueStatus type for use with +// MetricValueStatusApplyConfiguration constructs a declarative configuration of the MetricValueStatus type for use with // apply. func MetricValueStatus() *MetricValueStatusApplyConfiguration { return &MetricValueStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/objectmetricsource.go b/applyconfigurations/autoscaling/v2beta2/objectmetricsource.go index eed31dab61..17b492fa06 100644 --- a/applyconfigurations/autoscaling/v2beta2/objectmetricsource.go +++ b/applyconfigurations/autoscaling/v2beta2/objectmetricsource.go @@ -18,7 +18,7 @@ limitations under the License. package v2beta2 -// ObjectMetricSourceApplyConfiguration represents an declarative configuration of the ObjectMetricSource type for use +// ObjectMetricSourceApplyConfiguration represents a declarative configuration of the ObjectMetricSource type for use // with apply. type ObjectMetricSourceApplyConfiguration struct { DescribedObject *CrossVersionObjectReferenceApplyConfiguration `json:"describedObject,omitempty"` @@ -26,7 +26,7 @@ type ObjectMetricSourceApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` } -// ObjectMetricSourceApplyConfiguration constructs an declarative configuration of the ObjectMetricSource type for use with +// ObjectMetricSourceApplyConfiguration constructs a declarative configuration of the ObjectMetricSource type for use with // apply. func ObjectMetricSource() *ObjectMetricSourceApplyConfiguration { return &ObjectMetricSourceApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/objectmetricstatus.go b/applyconfigurations/autoscaling/v2beta2/objectmetricstatus.go index 175e2120d6..e87417f2e7 100644 --- a/applyconfigurations/autoscaling/v2beta2/objectmetricstatus.go +++ b/applyconfigurations/autoscaling/v2beta2/objectmetricstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v2beta2 -// ObjectMetricStatusApplyConfiguration represents an declarative configuration of the ObjectMetricStatus type for use +// ObjectMetricStatusApplyConfiguration represents a declarative configuration of the ObjectMetricStatus type for use // with apply. type ObjectMetricStatusApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` @@ -26,7 +26,7 @@ type ObjectMetricStatusApplyConfiguration struct { DescribedObject *CrossVersionObjectReferenceApplyConfiguration `json:"describedObject,omitempty"` } -// ObjectMetricStatusApplyConfiguration constructs an declarative configuration of the ObjectMetricStatus type for use with +// ObjectMetricStatusApplyConfiguration constructs a declarative configuration of the ObjectMetricStatus type for use with // apply. func ObjectMetricStatus() *ObjectMetricStatusApplyConfiguration { return &ObjectMetricStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/podsmetricsource.go b/applyconfigurations/autoscaling/v2beta2/podsmetricsource.go index 0365880950..6ecbb18071 100644 --- a/applyconfigurations/autoscaling/v2beta2/podsmetricsource.go +++ b/applyconfigurations/autoscaling/v2beta2/podsmetricsource.go @@ -18,14 +18,14 @@ limitations under the License. package v2beta2 -// PodsMetricSourceApplyConfiguration represents an declarative configuration of the PodsMetricSource type for use +// PodsMetricSourceApplyConfiguration represents a declarative configuration of the PodsMetricSource type for use // with apply. type PodsMetricSourceApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` Target *MetricTargetApplyConfiguration `json:"target,omitempty"` } -// PodsMetricSourceApplyConfiguration constructs an declarative configuration of the PodsMetricSource type for use with +// PodsMetricSourceApplyConfiguration constructs a declarative configuration of the PodsMetricSource type for use with // apply. func PodsMetricSource() *PodsMetricSourceApplyConfiguration { return &PodsMetricSourceApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/podsmetricstatus.go b/applyconfigurations/autoscaling/v2beta2/podsmetricstatus.go index e6f98be8c4..cd10297261 100644 --- a/applyconfigurations/autoscaling/v2beta2/podsmetricstatus.go +++ b/applyconfigurations/autoscaling/v2beta2/podsmetricstatus.go @@ -18,14 +18,14 @@ limitations under the License. package v2beta2 -// PodsMetricStatusApplyConfiguration represents an declarative configuration of the PodsMetricStatus type for use +// PodsMetricStatusApplyConfiguration represents a declarative configuration of the PodsMetricStatus type for use // with apply. type PodsMetricStatusApplyConfiguration struct { Metric *MetricIdentifierApplyConfiguration `json:"metric,omitempty"` Current *MetricValueStatusApplyConfiguration `json:"current,omitempty"` } -// PodsMetricStatusApplyConfiguration constructs an declarative configuration of the PodsMetricStatus type for use with +// PodsMetricStatusApplyConfiguration constructs a declarative configuration of the PodsMetricStatus type for use with // apply. func PodsMetricStatus() *PodsMetricStatusApplyConfiguration { return &PodsMetricStatusApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/resourcemetricsource.go b/applyconfigurations/autoscaling/v2beta2/resourcemetricsource.go index cc8118d5e3..c482d75f4b 100644 --- a/applyconfigurations/autoscaling/v2beta2/resourcemetricsource.go +++ b/applyconfigurations/autoscaling/v2beta2/resourcemetricsource.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// ResourceMetricSourceApplyConfiguration represents an declarative configuration of the ResourceMetricSource type for use +// ResourceMetricSourceApplyConfiguration represents a declarative configuration of the ResourceMetricSource type for use // with apply. type ResourceMetricSourceApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` Target *MetricTargetApplyConfiguration `json:"target,omitempty"` } -// ResourceMetricSourceApplyConfiguration constructs an declarative configuration of the ResourceMetricSource type for use with +// ResourceMetricSourceApplyConfiguration constructs a declarative configuration of the ResourceMetricSource type for use with // apply. func ResourceMetricSource() *ResourceMetricSourceApplyConfiguration { return &ResourceMetricSourceApplyConfiguration{} diff --git a/applyconfigurations/autoscaling/v2beta2/resourcemetricstatus.go b/applyconfigurations/autoscaling/v2beta2/resourcemetricstatus.go index 0ab56be0f7..eb13e90b7d 100644 --- a/applyconfigurations/autoscaling/v2beta2/resourcemetricstatus.go +++ b/applyconfigurations/autoscaling/v2beta2/resourcemetricstatus.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// ResourceMetricStatusApplyConfiguration represents an declarative configuration of the ResourceMetricStatus type for use +// ResourceMetricStatusApplyConfiguration represents a declarative configuration of the ResourceMetricStatus type for use // with apply. type ResourceMetricStatusApplyConfiguration struct { Name *v1.ResourceName `json:"name,omitempty"` Current *MetricValueStatusApplyConfiguration `json:"current,omitempty"` } -// ResourceMetricStatusApplyConfiguration constructs an declarative configuration of the ResourceMetricStatus type for use with +// ResourceMetricStatusApplyConfiguration constructs a declarative configuration of the ResourceMetricStatus type for use with // apply. func ResourceMetricStatus() *ResourceMetricStatusApplyConfiguration { return &ResourceMetricStatusApplyConfiguration{} diff --git a/applyconfigurations/batch/v1/cronjob.go b/applyconfigurations/batch/v1/cronjob.go index 4162e67bc4..8b26816e58 100644 --- a/applyconfigurations/batch/v1/cronjob.go +++ b/applyconfigurations/batch/v1/cronjob.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// CronJobApplyConfiguration represents an declarative configuration of the CronJob type for use +// CronJobApplyConfiguration represents a declarative configuration of the CronJob type for use // with apply. type CronJobApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type CronJobApplyConfiguration struct { Status *CronJobStatusApplyConfiguration `json:"status,omitempty"` } -// CronJob constructs an declarative configuration of the CronJob type for use with +// CronJob constructs a declarative configuration of the CronJob type for use with // apply. func CronJob(name, namespace string) *CronJobApplyConfiguration { b := &CronJobApplyConfiguration{} diff --git a/applyconfigurations/batch/v1/cronjobspec.go b/applyconfigurations/batch/v1/cronjobspec.go index 22a34dcb61..62f9b5298b 100644 --- a/applyconfigurations/batch/v1/cronjobspec.go +++ b/applyconfigurations/batch/v1/cronjobspec.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/batch/v1" ) -// CronJobSpecApplyConfiguration represents an declarative configuration of the CronJobSpec type for use +// CronJobSpecApplyConfiguration represents a declarative configuration of the CronJobSpec type for use // with apply. type CronJobSpecApplyConfiguration struct { Schedule *string `json:"schedule,omitempty"` @@ -35,7 +35,7 @@ type CronJobSpecApplyConfiguration struct { FailedJobsHistoryLimit *int32 `json:"failedJobsHistoryLimit,omitempty"` } -// CronJobSpecApplyConfiguration constructs an declarative configuration of the CronJobSpec type for use with +// CronJobSpecApplyConfiguration constructs a declarative configuration of the CronJobSpec type for use with // apply. func CronJobSpec() *CronJobSpecApplyConfiguration { return &CronJobSpecApplyConfiguration{} diff --git a/applyconfigurations/batch/v1/cronjobstatus.go b/applyconfigurations/batch/v1/cronjobstatus.go index b7cc2bdfb5..095dfe017f 100644 --- a/applyconfigurations/batch/v1/cronjobstatus.go +++ b/applyconfigurations/batch/v1/cronjobstatus.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" ) -// CronJobStatusApplyConfiguration represents an declarative configuration of the CronJobStatus type for use +// CronJobStatusApplyConfiguration represents a declarative configuration of the CronJobStatus type for use // with apply. type CronJobStatusApplyConfiguration struct { Active []v1.ObjectReferenceApplyConfiguration `json:"active,omitempty"` @@ -31,7 +31,7 @@ type CronJobStatusApplyConfiguration struct { LastSuccessfulTime *metav1.Time `json:"lastSuccessfulTime,omitempty"` } -// CronJobStatusApplyConfiguration constructs an declarative configuration of the CronJobStatus type for use with +// CronJobStatusApplyConfiguration constructs a declarative configuration of the CronJobStatus type for use with // apply. func CronJobStatus() *CronJobStatusApplyConfiguration { return &CronJobStatusApplyConfiguration{} diff --git a/applyconfigurations/batch/v1/job.go b/applyconfigurations/batch/v1/job.go index 1ef2136f37..1333e91844 100644 --- a/applyconfigurations/batch/v1/job.go +++ b/applyconfigurations/batch/v1/job.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// JobApplyConfiguration represents an declarative configuration of the Job type for use +// JobApplyConfiguration represents a declarative configuration of the Job type for use // with apply. type JobApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type JobApplyConfiguration struct { Status *JobStatusApplyConfiguration `json:"status,omitempty"` } -// Job constructs an declarative configuration of the Job type for use with +// Job constructs a declarative configuration of the Job type for use with // apply. func Job(name, namespace string) *JobApplyConfiguration { b := &JobApplyConfiguration{} diff --git a/applyconfigurations/batch/v1/jobcondition.go b/applyconfigurations/batch/v1/jobcondition.go index 388ca7a1c0..4f15bc6045 100644 --- a/applyconfigurations/batch/v1/jobcondition.go +++ b/applyconfigurations/batch/v1/jobcondition.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// JobConditionApplyConfiguration represents an declarative configuration of the JobCondition type for use +// JobConditionApplyConfiguration represents a declarative configuration of the JobCondition type for use // with apply. type JobConditionApplyConfiguration struct { Type *v1.JobConditionType `json:"type,omitempty"` @@ -35,7 +35,7 @@ type JobConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// JobConditionApplyConfiguration constructs an declarative configuration of the JobCondition type for use with +// JobConditionApplyConfiguration constructs a declarative configuration of the JobCondition type for use with // apply. func JobCondition() *JobConditionApplyConfiguration { return &JobConditionApplyConfiguration{} diff --git a/applyconfigurations/batch/v1/jobspec.go b/applyconfigurations/batch/v1/jobspec.go index bbcff71c86..2104fe113d 100644 --- a/applyconfigurations/batch/v1/jobspec.go +++ b/applyconfigurations/batch/v1/jobspec.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// JobSpecApplyConfiguration represents an declarative configuration of the JobSpec type for use +// JobSpecApplyConfiguration represents a declarative configuration of the JobSpec type for use // with apply. type JobSpecApplyConfiguration struct { Parallelism *int32 `json:"parallelism,omitempty"` @@ -45,7 +45,7 @@ type JobSpecApplyConfiguration struct { ManagedBy *string `json:"managedBy,omitempty"` } -// JobSpecApplyConfiguration constructs an declarative configuration of the JobSpec type for use with +// JobSpecApplyConfiguration constructs a declarative configuration of the JobSpec type for use with // apply. func JobSpec() *JobSpecApplyConfiguration { return &JobSpecApplyConfiguration{} diff --git a/applyconfigurations/batch/v1/jobstatus.go b/applyconfigurations/batch/v1/jobstatus.go index e8e472f8f7..071a0153f5 100644 --- a/applyconfigurations/batch/v1/jobstatus.go +++ b/applyconfigurations/batch/v1/jobstatus.go @@ -22,7 +22,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// JobStatusApplyConfiguration represents an declarative configuration of the JobStatus type for use +// JobStatusApplyConfiguration represents a declarative configuration of the JobStatus type for use // with apply. type JobStatusApplyConfiguration struct { Conditions []JobConditionApplyConfiguration `json:"conditions,omitempty"` @@ -38,7 +38,7 @@ type JobStatusApplyConfiguration struct { Ready *int32 `json:"ready,omitempty"` } -// JobStatusApplyConfiguration constructs an declarative configuration of the JobStatus type for use with +// JobStatusApplyConfiguration constructs a declarative configuration of the JobStatus type for use with // apply. func JobStatus() *JobStatusApplyConfiguration { return &JobStatusApplyConfiguration{} diff --git a/applyconfigurations/batch/v1/jobtemplatespec.go b/applyconfigurations/batch/v1/jobtemplatespec.go index 5ed6e5a92e..901c4228e0 100644 --- a/applyconfigurations/batch/v1/jobtemplatespec.go +++ b/applyconfigurations/batch/v1/jobtemplatespec.go @@ -24,14 +24,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// JobTemplateSpecApplyConfiguration represents an declarative configuration of the JobTemplateSpec type for use +// JobTemplateSpecApplyConfiguration represents a declarative configuration of the JobTemplateSpec type for use // with apply. type JobTemplateSpecApplyConfiguration struct { *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *JobSpecApplyConfiguration `json:"spec,omitempty"` } -// JobTemplateSpecApplyConfiguration constructs an declarative configuration of the JobTemplateSpec type for use with +// JobTemplateSpecApplyConfiguration constructs a declarative configuration of the JobTemplateSpec type for use with // apply. func JobTemplateSpec() *JobTemplateSpecApplyConfiguration { return &JobTemplateSpecApplyConfiguration{} diff --git a/applyconfigurations/batch/v1/podfailurepolicy.go b/applyconfigurations/batch/v1/podfailurepolicy.go index 6da98386c9..05a68b3c94 100644 --- a/applyconfigurations/batch/v1/podfailurepolicy.go +++ b/applyconfigurations/batch/v1/podfailurepolicy.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// PodFailurePolicyApplyConfiguration represents an declarative configuration of the PodFailurePolicy type for use +// PodFailurePolicyApplyConfiguration represents a declarative configuration of the PodFailurePolicy type for use // with apply. type PodFailurePolicyApplyConfiguration struct { Rules []PodFailurePolicyRuleApplyConfiguration `json:"rules,omitempty"` } -// PodFailurePolicyApplyConfiguration constructs an declarative configuration of the PodFailurePolicy type for use with +// PodFailurePolicyApplyConfiguration constructs a declarative configuration of the PodFailurePolicy type for use with // apply. func PodFailurePolicy() *PodFailurePolicyApplyConfiguration { return &PodFailurePolicyApplyConfiguration{} diff --git a/applyconfigurations/batch/v1/podfailurepolicyonexitcodesrequirement.go b/applyconfigurations/batch/v1/podfailurepolicyonexitcodesrequirement.go index 65f6251810..cd32296ca0 100644 --- a/applyconfigurations/batch/v1/podfailurepolicyonexitcodesrequirement.go +++ b/applyconfigurations/batch/v1/podfailurepolicyonexitcodesrequirement.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/batch/v1" ) -// PodFailurePolicyOnExitCodesRequirementApplyConfiguration represents an declarative configuration of the PodFailurePolicyOnExitCodesRequirement type for use +// PodFailurePolicyOnExitCodesRequirementApplyConfiguration represents a declarative configuration of the PodFailurePolicyOnExitCodesRequirement type for use // with apply. type PodFailurePolicyOnExitCodesRequirementApplyConfiguration struct { ContainerName *string `json:"containerName,omitempty"` @@ -30,7 +30,7 @@ type PodFailurePolicyOnExitCodesRequirementApplyConfiguration struct { Values []int32 `json:"values,omitempty"` } -// PodFailurePolicyOnExitCodesRequirementApplyConfiguration constructs an declarative configuration of the PodFailurePolicyOnExitCodesRequirement type for use with +// PodFailurePolicyOnExitCodesRequirementApplyConfiguration constructs a declarative configuration of the PodFailurePolicyOnExitCodesRequirement type for use with // apply. func PodFailurePolicyOnExitCodesRequirement() *PodFailurePolicyOnExitCodesRequirementApplyConfiguration { return &PodFailurePolicyOnExitCodesRequirementApplyConfiguration{} diff --git a/applyconfigurations/batch/v1/podfailurepolicyonpodconditionspattern.go b/applyconfigurations/batch/v1/podfailurepolicyonpodconditionspattern.go index da1556ff8b..07af4fb0e7 100644 --- a/applyconfigurations/batch/v1/podfailurepolicyonpodconditionspattern.go +++ b/applyconfigurations/batch/v1/podfailurepolicyonpodconditionspattern.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// PodFailurePolicyOnPodConditionsPatternApplyConfiguration represents an declarative configuration of the PodFailurePolicyOnPodConditionsPattern type for use +// PodFailurePolicyOnPodConditionsPatternApplyConfiguration represents a declarative configuration of the PodFailurePolicyOnPodConditionsPattern type for use // with apply. type PodFailurePolicyOnPodConditionsPatternApplyConfiguration struct { Type *v1.PodConditionType `json:"type,omitempty"` Status *v1.ConditionStatus `json:"status,omitempty"` } -// PodFailurePolicyOnPodConditionsPatternApplyConfiguration constructs an declarative configuration of the PodFailurePolicyOnPodConditionsPattern type for use with +// PodFailurePolicyOnPodConditionsPatternApplyConfiguration constructs a declarative configuration of the PodFailurePolicyOnPodConditionsPattern type for use with // apply. func PodFailurePolicyOnPodConditionsPattern() *PodFailurePolicyOnPodConditionsPatternApplyConfiguration { return &PodFailurePolicyOnPodConditionsPatternApplyConfiguration{} diff --git a/applyconfigurations/batch/v1/podfailurepolicyrule.go b/applyconfigurations/batch/v1/podfailurepolicyrule.go index d435243531..b004921d38 100644 --- a/applyconfigurations/batch/v1/podfailurepolicyrule.go +++ b/applyconfigurations/batch/v1/podfailurepolicyrule.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/batch/v1" ) -// PodFailurePolicyRuleApplyConfiguration represents an declarative configuration of the PodFailurePolicyRule type for use +// PodFailurePolicyRuleApplyConfiguration represents a declarative configuration of the PodFailurePolicyRule type for use // with apply. type PodFailurePolicyRuleApplyConfiguration struct { Action *v1.PodFailurePolicyAction `json:"action,omitempty"` @@ -30,7 +30,7 @@ type PodFailurePolicyRuleApplyConfiguration struct { OnPodConditions []PodFailurePolicyOnPodConditionsPatternApplyConfiguration `json:"onPodConditions,omitempty"` } -// PodFailurePolicyRuleApplyConfiguration constructs an declarative configuration of the PodFailurePolicyRule type for use with +// PodFailurePolicyRuleApplyConfiguration constructs a declarative configuration of the PodFailurePolicyRule type for use with // apply. func PodFailurePolicyRule() *PodFailurePolicyRuleApplyConfiguration { return &PodFailurePolicyRuleApplyConfiguration{} diff --git a/applyconfigurations/batch/v1/successpolicy.go b/applyconfigurations/batch/v1/successpolicy.go index 327aa1f5a4..a3f4f39e2e 100644 --- a/applyconfigurations/batch/v1/successpolicy.go +++ b/applyconfigurations/batch/v1/successpolicy.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// SuccessPolicyApplyConfiguration represents an declarative configuration of the SuccessPolicy type for use +// SuccessPolicyApplyConfiguration represents a declarative configuration of the SuccessPolicy type for use // with apply. type SuccessPolicyApplyConfiguration struct { Rules []SuccessPolicyRuleApplyConfiguration `json:"rules,omitempty"` } -// SuccessPolicyApplyConfiguration constructs an declarative configuration of the SuccessPolicy type for use with +// SuccessPolicyApplyConfiguration constructs a declarative configuration of the SuccessPolicy type for use with // apply. func SuccessPolicy() *SuccessPolicyApplyConfiguration { return &SuccessPolicyApplyConfiguration{} diff --git a/applyconfigurations/batch/v1/successpolicyrule.go b/applyconfigurations/batch/v1/successpolicyrule.go index 4c862e6821..2b5e3d91fe 100644 --- a/applyconfigurations/batch/v1/successpolicyrule.go +++ b/applyconfigurations/batch/v1/successpolicyrule.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// SuccessPolicyRuleApplyConfiguration represents an declarative configuration of the SuccessPolicyRule type for use +// SuccessPolicyRuleApplyConfiguration represents a declarative configuration of the SuccessPolicyRule type for use // with apply. type SuccessPolicyRuleApplyConfiguration struct { SucceededIndexes *string `json:"succeededIndexes,omitempty"` SucceededCount *int32 `json:"succeededCount,omitempty"` } -// SuccessPolicyRuleApplyConfiguration constructs an declarative configuration of the SuccessPolicyRule type for use with +// SuccessPolicyRuleApplyConfiguration constructs a declarative configuration of the SuccessPolicyRule type for use with // apply. func SuccessPolicyRule() *SuccessPolicyRuleApplyConfiguration { return &SuccessPolicyRuleApplyConfiguration{} diff --git a/applyconfigurations/batch/v1/uncountedterminatedpods.go b/applyconfigurations/batch/v1/uncountedterminatedpods.go index 1409303fff..ff6b57b86c 100644 --- a/applyconfigurations/batch/v1/uncountedterminatedpods.go +++ b/applyconfigurations/batch/v1/uncountedterminatedpods.go @@ -22,14 +22,14 @@ import ( types "k8s.io/apimachinery/pkg/types" ) -// UncountedTerminatedPodsApplyConfiguration represents an declarative configuration of the UncountedTerminatedPods type for use +// UncountedTerminatedPodsApplyConfiguration represents a declarative configuration of the UncountedTerminatedPods type for use // with apply. type UncountedTerminatedPodsApplyConfiguration struct { Succeeded []types.UID `json:"succeeded,omitempty"` Failed []types.UID `json:"failed,omitempty"` } -// UncountedTerminatedPodsApplyConfiguration constructs an declarative configuration of the UncountedTerminatedPods type for use with +// UncountedTerminatedPodsApplyConfiguration constructs a declarative configuration of the UncountedTerminatedPods type for use with // apply. func UncountedTerminatedPods() *UncountedTerminatedPodsApplyConfiguration { return &UncountedTerminatedPodsApplyConfiguration{} diff --git a/applyconfigurations/batch/v1beta1/cronjob.go b/applyconfigurations/batch/v1beta1/cronjob.go index 3b20cf12cd..765ed5e651 100644 --- a/applyconfigurations/batch/v1beta1/cronjob.go +++ b/applyconfigurations/batch/v1beta1/cronjob.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// CronJobApplyConfiguration represents an declarative configuration of the CronJob type for use +// CronJobApplyConfiguration represents a declarative configuration of the CronJob type for use // with apply. type CronJobApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type CronJobApplyConfiguration struct { Status *CronJobStatusApplyConfiguration `json:"status,omitempty"` } -// CronJob constructs an declarative configuration of the CronJob type for use with +// CronJob constructs a declarative configuration of the CronJob type for use with // apply. func CronJob(name, namespace string) *CronJobApplyConfiguration { b := &CronJobApplyConfiguration{} diff --git a/applyconfigurations/batch/v1beta1/cronjobspec.go b/applyconfigurations/batch/v1beta1/cronjobspec.go index 68c0777de0..21043690da 100644 --- a/applyconfigurations/batch/v1beta1/cronjobspec.go +++ b/applyconfigurations/batch/v1beta1/cronjobspec.go @@ -22,7 +22,7 @@ import ( v1beta1 "k8s.io/api/batch/v1beta1" ) -// CronJobSpecApplyConfiguration represents an declarative configuration of the CronJobSpec type for use +// CronJobSpecApplyConfiguration represents a declarative configuration of the CronJobSpec type for use // with apply. type CronJobSpecApplyConfiguration struct { Schedule *string `json:"schedule,omitempty"` @@ -35,7 +35,7 @@ type CronJobSpecApplyConfiguration struct { FailedJobsHistoryLimit *int32 `json:"failedJobsHistoryLimit,omitempty"` } -// CronJobSpecApplyConfiguration constructs an declarative configuration of the CronJobSpec type for use with +// CronJobSpecApplyConfiguration constructs a declarative configuration of the CronJobSpec type for use with // apply. func CronJobSpec() *CronJobSpecApplyConfiguration { return &CronJobSpecApplyConfiguration{} diff --git a/applyconfigurations/batch/v1beta1/cronjobstatus.go b/applyconfigurations/batch/v1beta1/cronjobstatus.go index 8dca14f663..335f9e0dce 100644 --- a/applyconfigurations/batch/v1beta1/cronjobstatus.go +++ b/applyconfigurations/batch/v1beta1/cronjobstatus.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" ) -// CronJobStatusApplyConfiguration represents an declarative configuration of the CronJobStatus type for use +// CronJobStatusApplyConfiguration represents a declarative configuration of the CronJobStatus type for use // with apply. type CronJobStatusApplyConfiguration struct { Active []v1.ObjectReferenceApplyConfiguration `json:"active,omitempty"` @@ -31,7 +31,7 @@ type CronJobStatusApplyConfiguration struct { LastSuccessfulTime *metav1.Time `json:"lastSuccessfulTime,omitempty"` } -// CronJobStatusApplyConfiguration constructs an declarative configuration of the CronJobStatus type for use with +// CronJobStatusApplyConfiguration constructs a declarative configuration of the CronJobStatus type for use with // apply. func CronJobStatus() *CronJobStatusApplyConfiguration { return &CronJobStatusApplyConfiguration{} diff --git a/applyconfigurations/batch/v1beta1/jobtemplatespec.go b/applyconfigurations/batch/v1beta1/jobtemplatespec.go index d3f7bc51fe..5fd2485c69 100644 --- a/applyconfigurations/batch/v1beta1/jobtemplatespec.go +++ b/applyconfigurations/batch/v1beta1/jobtemplatespec.go @@ -25,14 +25,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// JobTemplateSpecApplyConfiguration represents an declarative configuration of the JobTemplateSpec type for use +// JobTemplateSpecApplyConfiguration represents a declarative configuration of the JobTemplateSpec type for use // with apply. type JobTemplateSpecApplyConfiguration struct { *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *batchv1.JobSpecApplyConfiguration `json:"spec,omitempty"` } -// JobTemplateSpecApplyConfiguration constructs an declarative configuration of the JobTemplateSpec type for use with +// JobTemplateSpecApplyConfiguration constructs a declarative configuration of the JobTemplateSpec type for use with // apply. func JobTemplateSpec() *JobTemplateSpecApplyConfiguration { return &JobTemplateSpecApplyConfiguration{} diff --git a/applyconfigurations/certificates/v1/certificatesigningrequest.go b/applyconfigurations/certificates/v1/certificatesigningrequest.go index 7cd68f0e29..e30bb62427 100644 --- a/applyconfigurations/certificates/v1/certificatesigningrequest.go +++ b/applyconfigurations/certificates/v1/certificatesigningrequest.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// CertificateSigningRequestApplyConfiguration represents an declarative configuration of the CertificateSigningRequest type for use +// CertificateSigningRequestApplyConfiguration represents a declarative configuration of the CertificateSigningRequest type for use // with apply. type CertificateSigningRequestApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type CertificateSigningRequestApplyConfiguration struct { Status *CertificateSigningRequestStatusApplyConfiguration `json:"status,omitempty"` } -// CertificateSigningRequest constructs an declarative configuration of the CertificateSigningRequest type for use with +// CertificateSigningRequest constructs a declarative configuration of the CertificateSigningRequest type for use with // apply. func CertificateSigningRequest(name string) *CertificateSigningRequestApplyConfiguration { b := &CertificateSigningRequestApplyConfiguration{} diff --git a/applyconfigurations/certificates/v1/certificatesigningrequestcondition.go b/applyconfigurations/certificates/v1/certificatesigningrequestcondition.go index 13d69cfcef..7a4bfce011 100644 --- a/applyconfigurations/certificates/v1/certificatesigningrequestcondition.go +++ b/applyconfigurations/certificates/v1/certificatesigningrequestcondition.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// CertificateSigningRequestConditionApplyConfiguration represents an declarative configuration of the CertificateSigningRequestCondition type for use +// CertificateSigningRequestConditionApplyConfiguration represents a declarative configuration of the CertificateSigningRequestCondition type for use // with apply. type CertificateSigningRequestConditionApplyConfiguration struct { Type *v1.RequestConditionType `json:"type,omitempty"` @@ -35,7 +35,7 @@ type CertificateSigningRequestConditionApplyConfiguration struct { LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` } -// CertificateSigningRequestConditionApplyConfiguration constructs an declarative configuration of the CertificateSigningRequestCondition type for use with +// CertificateSigningRequestConditionApplyConfiguration constructs a declarative configuration of the CertificateSigningRequestCondition type for use with // apply. func CertificateSigningRequestCondition() *CertificateSigningRequestConditionApplyConfiguration { return &CertificateSigningRequestConditionApplyConfiguration{} diff --git a/applyconfigurations/certificates/v1/certificatesigningrequestspec.go b/applyconfigurations/certificates/v1/certificatesigningrequestspec.go index 81ca214a9d..9c4a85693a 100644 --- a/applyconfigurations/certificates/v1/certificatesigningrequestspec.go +++ b/applyconfigurations/certificates/v1/certificatesigningrequestspec.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/certificates/v1" ) -// CertificateSigningRequestSpecApplyConfiguration represents an declarative configuration of the CertificateSigningRequestSpec type for use +// CertificateSigningRequestSpecApplyConfiguration represents a declarative configuration of the CertificateSigningRequestSpec type for use // with apply. type CertificateSigningRequestSpecApplyConfiguration struct { Request []byte `json:"request,omitempty"` @@ -35,7 +35,7 @@ type CertificateSigningRequestSpecApplyConfiguration struct { Extra map[string]v1.ExtraValue `json:"extra,omitempty"` } -// CertificateSigningRequestSpecApplyConfiguration constructs an declarative configuration of the CertificateSigningRequestSpec type for use with +// CertificateSigningRequestSpecApplyConfiguration constructs a declarative configuration of the CertificateSigningRequestSpec type for use with // apply. func CertificateSigningRequestSpec() *CertificateSigningRequestSpecApplyConfiguration { return &CertificateSigningRequestSpecApplyConfiguration{} diff --git a/applyconfigurations/certificates/v1/certificatesigningrequeststatus.go b/applyconfigurations/certificates/v1/certificatesigningrequeststatus.go index 59d5930331..897f6d1e98 100644 --- a/applyconfigurations/certificates/v1/certificatesigningrequeststatus.go +++ b/applyconfigurations/certificates/v1/certificatesigningrequeststatus.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// CertificateSigningRequestStatusApplyConfiguration represents an declarative configuration of the CertificateSigningRequestStatus type for use +// CertificateSigningRequestStatusApplyConfiguration represents a declarative configuration of the CertificateSigningRequestStatus type for use // with apply. type CertificateSigningRequestStatusApplyConfiguration struct { Conditions []CertificateSigningRequestConditionApplyConfiguration `json:"conditions,omitempty"` Certificate []byte `json:"certificate,omitempty"` } -// CertificateSigningRequestStatusApplyConfiguration constructs an declarative configuration of the CertificateSigningRequestStatus type for use with +// CertificateSigningRequestStatusApplyConfiguration constructs a declarative configuration of the CertificateSigningRequestStatus type for use with // apply. func CertificateSigningRequestStatus() *CertificateSigningRequestStatusApplyConfiguration { return &CertificateSigningRequestStatusApplyConfiguration{} diff --git a/applyconfigurations/certificates/v1alpha1/clustertrustbundle.go b/applyconfigurations/certificates/v1alpha1/clustertrustbundle.go index 42816e5524..9cd10bc56a 100644 --- a/applyconfigurations/certificates/v1alpha1/clustertrustbundle.go +++ b/applyconfigurations/certificates/v1alpha1/clustertrustbundle.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ClusterTrustBundleApplyConfiguration represents an declarative configuration of the ClusterTrustBundle type for use +// ClusterTrustBundleApplyConfiguration represents a declarative configuration of the ClusterTrustBundle type for use // with apply. type ClusterTrustBundleApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type ClusterTrustBundleApplyConfiguration struct { Spec *ClusterTrustBundleSpecApplyConfiguration `json:"spec,omitempty"` } -// ClusterTrustBundle constructs an declarative configuration of the ClusterTrustBundle type for use with +// ClusterTrustBundle constructs a declarative configuration of the ClusterTrustBundle type for use with // apply. func ClusterTrustBundle(name string) *ClusterTrustBundleApplyConfiguration { b := &ClusterTrustBundleApplyConfiguration{} diff --git a/applyconfigurations/certificates/v1alpha1/clustertrustbundlespec.go b/applyconfigurations/certificates/v1alpha1/clustertrustbundlespec.go index d1aea1d6dc..7bb36f7084 100644 --- a/applyconfigurations/certificates/v1alpha1/clustertrustbundlespec.go +++ b/applyconfigurations/certificates/v1alpha1/clustertrustbundlespec.go @@ -18,14 +18,14 @@ limitations under the License. package v1alpha1 -// ClusterTrustBundleSpecApplyConfiguration represents an declarative configuration of the ClusterTrustBundleSpec type for use +// ClusterTrustBundleSpecApplyConfiguration represents a declarative configuration of the ClusterTrustBundleSpec type for use // with apply. type ClusterTrustBundleSpecApplyConfiguration struct { SignerName *string `json:"signerName,omitempty"` TrustBundle *string `json:"trustBundle,omitempty"` } -// ClusterTrustBundleSpecApplyConfiguration constructs an declarative configuration of the ClusterTrustBundleSpec type for use with +// ClusterTrustBundleSpecApplyConfiguration constructs a declarative configuration of the ClusterTrustBundleSpec type for use with // apply. func ClusterTrustBundleSpec() *ClusterTrustBundleSpecApplyConfiguration { return &ClusterTrustBundleSpecApplyConfiguration{} diff --git a/applyconfigurations/certificates/v1beta1/certificatesigningrequest.go b/applyconfigurations/certificates/v1beta1/certificatesigningrequest.go index 9913c8b1d3..d6e08824a4 100644 --- a/applyconfigurations/certificates/v1beta1/certificatesigningrequest.go +++ b/applyconfigurations/certificates/v1beta1/certificatesigningrequest.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// CertificateSigningRequestApplyConfiguration represents an declarative configuration of the CertificateSigningRequest type for use +// CertificateSigningRequestApplyConfiguration represents a declarative configuration of the CertificateSigningRequest type for use // with apply. type CertificateSigningRequestApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type CertificateSigningRequestApplyConfiguration struct { Status *CertificateSigningRequestStatusApplyConfiguration `json:"status,omitempty"` } -// CertificateSigningRequest constructs an declarative configuration of the CertificateSigningRequest type for use with +// CertificateSigningRequest constructs a declarative configuration of the CertificateSigningRequest type for use with // apply. func CertificateSigningRequest(name string) *CertificateSigningRequestApplyConfiguration { b := &CertificateSigningRequestApplyConfiguration{} diff --git a/applyconfigurations/certificates/v1beta1/certificatesigningrequestcondition.go b/applyconfigurations/certificates/v1beta1/certificatesigningrequestcondition.go index 2c32a3272c..6e3692d1c2 100644 --- a/applyconfigurations/certificates/v1beta1/certificatesigningrequestcondition.go +++ b/applyconfigurations/certificates/v1beta1/certificatesigningrequestcondition.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// CertificateSigningRequestConditionApplyConfiguration represents an declarative configuration of the CertificateSigningRequestCondition type for use +// CertificateSigningRequestConditionApplyConfiguration represents a declarative configuration of the CertificateSigningRequestCondition type for use // with apply. type CertificateSigningRequestConditionApplyConfiguration struct { Type *v1beta1.RequestConditionType `json:"type,omitempty"` @@ -35,7 +35,7 @@ type CertificateSigningRequestConditionApplyConfiguration struct { LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` } -// CertificateSigningRequestConditionApplyConfiguration constructs an declarative configuration of the CertificateSigningRequestCondition type for use with +// CertificateSigningRequestConditionApplyConfiguration constructs a declarative configuration of the CertificateSigningRequestCondition type for use with // apply. func CertificateSigningRequestCondition() *CertificateSigningRequestConditionApplyConfiguration { return &CertificateSigningRequestConditionApplyConfiguration{} diff --git a/applyconfigurations/certificates/v1beta1/certificatesigningrequestspec.go b/applyconfigurations/certificates/v1beta1/certificatesigningrequestspec.go index 9554b1f400..9284eca3a4 100644 --- a/applyconfigurations/certificates/v1beta1/certificatesigningrequestspec.go +++ b/applyconfigurations/certificates/v1beta1/certificatesigningrequestspec.go @@ -22,7 +22,7 @@ import ( v1beta1 "k8s.io/api/certificates/v1beta1" ) -// CertificateSigningRequestSpecApplyConfiguration represents an declarative configuration of the CertificateSigningRequestSpec type for use +// CertificateSigningRequestSpecApplyConfiguration represents a declarative configuration of the CertificateSigningRequestSpec type for use // with apply. type CertificateSigningRequestSpecApplyConfiguration struct { Request []byte `json:"request,omitempty"` @@ -35,7 +35,7 @@ type CertificateSigningRequestSpecApplyConfiguration struct { Extra map[string]v1beta1.ExtraValue `json:"extra,omitempty"` } -// CertificateSigningRequestSpecApplyConfiguration constructs an declarative configuration of the CertificateSigningRequestSpec type for use with +// CertificateSigningRequestSpecApplyConfiguration constructs a declarative configuration of the CertificateSigningRequestSpec type for use with // apply. func CertificateSigningRequestSpec() *CertificateSigningRequestSpecApplyConfiguration { return &CertificateSigningRequestSpecApplyConfiguration{} diff --git a/applyconfigurations/certificates/v1beta1/certificatesigningrequeststatus.go b/applyconfigurations/certificates/v1beta1/certificatesigningrequeststatus.go index 9d8c5d4585..f82e8aed3b 100644 --- a/applyconfigurations/certificates/v1beta1/certificatesigningrequeststatus.go +++ b/applyconfigurations/certificates/v1beta1/certificatesigningrequeststatus.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta1 -// CertificateSigningRequestStatusApplyConfiguration represents an declarative configuration of the CertificateSigningRequestStatus type for use +// CertificateSigningRequestStatusApplyConfiguration represents a declarative configuration of the CertificateSigningRequestStatus type for use // with apply. type CertificateSigningRequestStatusApplyConfiguration struct { Conditions []CertificateSigningRequestConditionApplyConfiguration `json:"conditions,omitempty"` Certificate []byte `json:"certificate,omitempty"` } -// CertificateSigningRequestStatusApplyConfiguration constructs an declarative configuration of the CertificateSigningRequestStatus type for use with +// CertificateSigningRequestStatusApplyConfiguration constructs a declarative configuration of the CertificateSigningRequestStatus type for use with // apply. func CertificateSigningRequestStatus() *CertificateSigningRequestStatusApplyConfiguration { return &CertificateSigningRequestStatusApplyConfiguration{} diff --git a/applyconfigurations/coordination/v1/lease.go b/applyconfigurations/coordination/v1/lease.go index 11543f09a9..ffd84583f4 100644 --- a/applyconfigurations/coordination/v1/lease.go +++ b/applyconfigurations/coordination/v1/lease.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// LeaseApplyConfiguration represents an declarative configuration of the Lease type for use +// LeaseApplyConfiguration represents a declarative configuration of the Lease type for use // with apply. type LeaseApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type LeaseApplyConfiguration struct { Spec *LeaseSpecApplyConfiguration `json:"spec,omitempty"` } -// Lease constructs an declarative configuration of the Lease type for use with +// Lease constructs a declarative configuration of the Lease type for use with // apply. func Lease(name, namespace string) *LeaseApplyConfiguration { b := &LeaseApplyConfiguration{} diff --git a/applyconfigurations/coordination/v1/leasespec.go b/applyconfigurations/coordination/v1/leasespec.go index a5f6a6ebba..3eea890b28 100644 --- a/applyconfigurations/coordination/v1/leasespec.go +++ b/applyconfigurations/coordination/v1/leasespec.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// LeaseSpecApplyConfiguration represents an declarative configuration of the LeaseSpec type for use +// LeaseSpecApplyConfiguration represents a declarative configuration of the LeaseSpec type for use // with apply. type LeaseSpecApplyConfiguration struct { HolderIdentity *string `json:"holderIdentity,omitempty"` @@ -32,7 +32,7 @@ type LeaseSpecApplyConfiguration struct { LeaseTransitions *int32 `json:"leaseTransitions,omitempty"` } -// LeaseSpecApplyConfiguration constructs an declarative configuration of the LeaseSpec type for use with +// LeaseSpecApplyConfiguration constructs a declarative configuration of the LeaseSpec type for use with // apply. func LeaseSpec() *LeaseSpecApplyConfiguration { return &LeaseSpecApplyConfiguration{} diff --git a/applyconfigurations/coordination/v1beta1/lease.go b/applyconfigurations/coordination/v1beta1/lease.go index 46fd39c5f2..9aa0703e8e 100644 --- a/applyconfigurations/coordination/v1beta1/lease.go +++ b/applyconfigurations/coordination/v1beta1/lease.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// LeaseApplyConfiguration represents an declarative configuration of the Lease type for use +// LeaseApplyConfiguration represents a declarative configuration of the Lease type for use // with apply. type LeaseApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type LeaseApplyConfiguration struct { Spec *LeaseSpecApplyConfiguration `json:"spec,omitempty"` } -// Lease constructs an declarative configuration of the Lease type for use with +// Lease constructs a declarative configuration of the Lease type for use with // apply. func Lease(name, namespace string) *LeaseApplyConfiguration { b := &LeaseApplyConfiguration{} diff --git a/applyconfigurations/coordination/v1beta1/leasespec.go b/applyconfigurations/coordination/v1beta1/leasespec.go index 865eb76455..9a0a9ab2f9 100644 --- a/applyconfigurations/coordination/v1beta1/leasespec.go +++ b/applyconfigurations/coordination/v1beta1/leasespec.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// LeaseSpecApplyConfiguration represents an declarative configuration of the LeaseSpec type for use +// LeaseSpecApplyConfiguration represents a declarative configuration of the LeaseSpec type for use // with apply. type LeaseSpecApplyConfiguration struct { HolderIdentity *string `json:"holderIdentity,omitempty"` @@ -32,7 +32,7 @@ type LeaseSpecApplyConfiguration struct { LeaseTransitions *int32 `json:"leaseTransitions,omitempty"` } -// LeaseSpecApplyConfiguration constructs an declarative configuration of the LeaseSpec type for use with +// LeaseSpecApplyConfiguration constructs a declarative configuration of the LeaseSpec type for use with // apply. func LeaseSpec() *LeaseSpecApplyConfiguration { return &LeaseSpecApplyConfiguration{} diff --git a/applyconfigurations/core/v1/affinity.go b/applyconfigurations/core/v1/affinity.go index df6d1c64e5..45484f140d 100644 --- a/applyconfigurations/core/v1/affinity.go +++ b/applyconfigurations/core/v1/affinity.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// 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"` @@ -26,7 +26,7 @@ type AffinityApplyConfiguration struct { PodAntiAffinity *PodAntiAffinityApplyConfiguration `json:"podAntiAffinity,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/applyconfigurations/core/v1/apparmorprofile.go b/applyconfigurations/core/v1/apparmorprofile.go index 7f3c22afa1..1d698fd610 100644 --- a/applyconfigurations/core/v1/apparmorprofile.go +++ b/applyconfigurations/core/v1/apparmorprofile.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// AppArmorProfileApplyConfiguration represents an declarative configuration of the AppArmorProfile type for use +// AppArmorProfileApplyConfiguration represents a declarative configuration of the AppArmorProfile type for use // with apply. type AppArmorProfileApplyConfiguration struct { Type *v1.AppArmorProfileType `json:"type,omitempty"` LocalhostProfile *string `json:"localhostProfile,omitempty"` } -// AppArmorProfileApplyConfiguration constructs an declarative configuration of the AppArmorProfile type for use with +// AppArmorProfileApplyConfiguration constructs a declarative configuration of the AppArmorProfile type for use with // apply. func AppArmorProfile() *AppArmorProfileApplyConfiguration { return &AppArmorProfileApplyConfiguration{} diff --git a/applyconfigurations/core/v1/attachedvolume.go b/applyconfigurations/core/v1/attachedvolume.go index 970bf24c45..e4c2fff3f6 100644 --- a/applyconfigurations/core/v1/attachedvolume.go +++ b/applyconfigurations/core/v1/attachedvolume.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// AttachedVolumeApplyConfiguration represents an declarative configuration of the AttachedVolume type for use +// AttachedVolumeApplyConfiguration represents a declarative configuration of the AttachedVolume type for use // with apply. type AttachedVolumeApplyConfiguration struct { Name *v1.UniqueVolumeName `json:"name,omitempty"` DevicePath *string `json:"devicePath,omitempty"` } -// AttachedVolumeApplyConfiguration constructs an declarative configuration of the AttachedVolume type for use with +// AttachedVolumeApplyConfiguration constructs a declarative configuration of the AttachedVolume type for use with // apply. func AttachedVolume() *AttachedVolumeApplyConfiguration { return &AttachedVolumeApplyConfiguration{} diff --git a/applyconfigurations/core/v1/awselasticblockstorevolumesource.go b/applyconfigurations/core/v1/awselasticblockstorevolumesource.go index 6ff335e9d6..d08786965e 100644 --- a/applyconfigurations/core/v1/awselasticblockstorevolumesource.go +++ b/applyconfigurations/core/v1/awselasticblockstorevolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// AWSElasticBlockStoreVolumeSourceApplyConfiguration represents an declarative configuration of the AWSElasticBlockStoreVolumeSource type for use +// AWSElasticBlockStoreVolumeSourceApplyConfiguration represents a declarative configuration of the AWSElasticBlockStoreVolumeSource type for use // with apply. type AWSElasticBlockStoreVolumeSourceApplyConfiguration struct { VolumeID *string `json:"volumeID,omitempty"` @@ -27,7 +27,7 @@ type AWSElasticBlockStoreVolumeSourceApplyConfiguration struct { ReadOnly *bool `json:"readOnly,omitempty"` } -// AWSElasticBlockStoreVolumeSourceApplyConfiguration constructs an declarative configuration of the AWSElasticBlockStoreVolumeSource type for use with +// AWSElasticBlockStoreVolumeSourceApplyConfiguration constructs a declarative configuration of the AWSElasticBlockStoreVolumeSource type for use with // apply. func AWSElasticBlockStoreVolumeSource() *AWSElasticBlockStoreVolumeSourceApplyConfiguration { return &AWSElasticBlockStoreVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/azurediskvolumesource.go b/applyconfigurations/core/v1/azurediskvolumesource.go index b2774735ae..40ad5ac78f 100644 --- a/applyconfigurations/core/v1/azurediskvolumesource.go +++ b/applyconfigurations/core/v1/azurediskvolumesource.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// AzureDiskVolumeSourceApplyConfiguration represents an declarative configuration of the AzureDiskVolumeSource type for use +// AzureDiskVolumeSourceApplyConfiguration represents a declarative configuration of the AzureDiskVolumeSource type for use // with apply. type AzureDiskVolumeSourceApplyConfiguration struct { DiskName *string `json:"diskName,omitempty"` @@ -33,7 +33,7 @@ type AzureDiskVolumeSourceApplyConfiguration struct { Kind *v1.AzureDataDiskKind `json:"kind,omitempty"` } -// AzureDiskVolumeSourceApplyConfiguration constructs an declarative configuration of the AzureDiskVolumeSource type for use with +// AzureDiskVolumeSourceApplyConfiguration constructs a declarative configuration of the AzureDiskVolumeSource type for use with // apply. func AzureDiskVolumeSource() *AzureDiskVolumeSourceApplyConfiguration { return &AzureDiskVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/azurefilepersistentvolumesource.go b/applyconfigurations/core/v1/azurefilepersistentvolumesource.go index f173938334..70a6b17be8 100644 --- a/applyconfigurations/core/v1/azurefilepersistentvolumesource.go +++ b/applyconfigurations/core/v1/azurefilepersistentvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// AzureFilePersistentVolumeSourceApplyConfiguration represents an declarative configuration of the AzureFilePersistentVolumeSource type for use +// AzureFilePersistentVolumeSourceApplyConfiguration represents a declarative configuration of the AzureFilePersistentVolumeSource type for use // with apply. type AzureFilePersistentVolumeSourceApplyConfiguration struct { SecretName *string `json:"secretName,omitempty"` @@ -27,7 +27,7 @@ type AzureFilePersistentVolumeSourceApplyConfiguration struct { SecretNamespace *string `json:"secretNamespace,omitempty"` } -// AzureFilePersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the AzureFilePersistentVolumeSource type for use with +// AzureFilePersistentVolumeSourceApplyConfiguration constructs a declarative configuration of the AzureFilePersistentVolumeSource type for use with // apply. func AzureFilePersistentVolumeSource() *AzureFilePersistentVolumeSourceApplyConfiguration { return &AzureFilePersistentVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/azurefilevolumesource.go b/applyconfigurations/core/v1/azurefilevolumesource.go index a7f7f33d88..ff0c867919 100644 --- a/applyconfigurations/core/v1/azurefilevolumesource.go +++ b/applyconfigurations/core/v1/azurefilevolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// AzureFileVolumeSourceApplyConfiguration represents an declarative configuration of the AzureFileVolumeSource type for use +// AzureFileVolumeSourceApplyConfiguration represents a declarative configuration of the AzureFileVolumeSource type for use // with apply. type AzureFileVolumeSourceApplyConfiguration struct { SecretName *string `json:"secretName,omitempty"` @@ -26,7 +26,7 @@ type AzureFileVolumeSourceApplyConfiguration struct { ReadOnly *bool `json:"readOnly,omitempty"` } -// AzureFileVolumeSourceApplyConfiguration constructs an declarative configuration of the AzureFileVolumeSource type for use with +// AzureFileVolumeSourceApplyConfiguration constructs a declarative configuration of the AzureFileVolumeSource type for use with // apply. func AzureFileVolumeSource() *AzureFileVolumeSourceApplyConfiguration { return &AzureFileVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/capabilities.go b/applyconfigurations/core/v1/capabilities.go index c3d176c4d8..1c463aef50 100644 --- a/applyconfigurations/core/v1/capabilities.go +++ b/applyconfigurations/core/v1/capabilities.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// CapabilitiesApplyConfiguration represents an declarative configuration of the Capabilities type for use +// CapabilitiesApplyConfiguration represents a declarative configuration of the Capabilities type for use // with apply. type CapabilitiesApplyConfiguration struct { Add []v1.Capability `json:"add,omitempty"` Drop []v1.Capability `json:"drop,omitempty"` } -// CapabilitiesApplyConfiguration constructs an declarative configuration of the Capabilities type for use with +// CapabilitiesApplyConfiguration constructs a declarative configuration of the Capabilities type for use with // apply. func Capabilities() *CapabilitiesApplyConfiguration { return &CapabilitiesApplyConfiguration{} diff --git a/applyconfigurations/core/v1/cephfspersistentvolumesource.go b/applyconfigurations/core/v1/cephfspersistentvolumesource.go index a41936fe3d..f3ee2d03e9 100644 --- a/applyconfigurations/core/v1/cephfspersistentvolumesource.go +++ b/applyconfigurations/core/v1/cephfspersistentvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// CephFSPersistentVolumeSourceApplyConfiguration represents an declarative configuration of the CephFSPersistentVolumeSource type for use +// CephFSPersistentVolumeSourceApplyConfiguration represents a declarative configuration of the CephFSPersistentVolumeSource type for use // with apply. type CephFSPersistentVolumeSourceApplyConfiguration struct { Monitors []string `json:"monitors,omitempty"` @@ -29,7 +29,7 @@ type CephFSPersistentVolumeSourceApplyConfiguration struct { ReadOnly *bool `json:"readOnly,omitempty"` } -// CephFSPersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the CephFSPersistentVolumeSource type for use with +// CephFSPersistentVolumeSourceApplyConfiguration constructs a declarative configuration of the CephFSPersistentVolumeSource type for use with // apply. func CephFSPersistentVolumeSource() *CephFSPersistentVolumeSourceApplyConfiguration { return &CephFSPersistentVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/cephfsvolumesource.go b/applyconfigurations/core/v1/cephfsvolumesource.go index 0ea070ba5d..77d53d6eb0 100644 --- a/applyconfigurations/core/v1/cephfsvolumesource.go +++ b/applyconfigurations/core/v1/cephfsvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// CephFSVolumeSourceApplyConfiguration represents an declarative configuration of the CephFSVolumeSource type for use +// CephFSVolumeSourceApplyConfiguration represents a declarative configuration of the CephFSVolumeSource type for use // with apply. type CephFSVolumeSourceApplyConfiguration struct { Monitors []string `json:"monitors,omitempty"` @@ -29,7 +29,7 @@ type CephFSVolumeSourceApplyConfiguration struct { ReadOnly *bool `json:"readOnly,omitempty"` } -// CephFSVolumeSourceApplyConfiguration constructs an declarative configuration of the CephFSVolumeSource type for use with +// CephFSVolumeSourceApplyConfiguration constructs a declarative configuration of the CephFSVolumeSource type for use with // apply. func CephFSVolumeSource() *CephFSVolumeSourceApplyConfiguration { return &CephFSVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/cinderpersistentvolumesource.go b/applyconfigurations/core/v1/cinderpersistentvolumesource.go index 7754cf92f7..b265734882 100644 --- a/applyconfigurations/core/v1/cinderpersistentvolumesource.go +++ b/applyconfigurations/core/v1/cinderpersistentvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// CinderPersistentVolumeSourceApplyConfiguration represents an declarative configuration of the CinderPersistentVolumeSource type for use +// CinderPersistentVolumeSourceApplyConfiguration represents a declarative configuration of the CinderPersistentVolumeSource type for use // with apply. type CinderPersistentVolumeSourceApplyConfiguration struct { VolumeID *string `json:"volumeID,omitempty"` @@ -27,7 +27,7 @@ type CinderPersistentVolumeSourceApplyConfiguration struct { SecretRef *SecretReferenceApplyConfiguration `json:"secretRef,omitempty"` } -// CinderPersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the CinderPersistentVolumeSource type for use with +// CinderPersistentVolumeSourceApplyConfiguration constructs a declarative configuration of the CinderPersistentVolumeSource type for use with // apply. func CinderPersistentVolumeSource() *CinderPersistentVolumeSourceApplyConfiguration { return &CinderPersistentVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/cindervolumesource.go b/applyconfigurations/core/v1/cindervolumesource.go index 51271e279d..131cbf219c 100644 --- a/applyconfigurations/core/v1/cindervolumesource.go +++ b/applyconfigurations/core/v1/cindervolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// CinderVolumeSourceApplyConfiguration represents an declarative configuration of the CinderVolumeSource type for use +// CinderVolumeSourceApplyConfiguration represents a declarative configuration of the CinderVolumeSource type for use // with apply. type CinderVolumeSourceApplyConfiguration struct { VolumeID *string `json:"volumeID,omitempty"` @@ -27,7 +27,7 @@ type CinderVolumeSourceApplyConfiguration struct { SecretRef *LocalObjectReferenceApplyConfiguration `json:"secretRef,omitempty"` } -// CinderVolumeSourceApplyConfiguration constructs an declarative configuration of the CinderVolumeSource type for use with +// CinderVolumeSourceApplyConfiguration constructs a declarative configuration of the CinderVolumeSource type for use with // apply. func CinderVolumeSource() *CinderVolumeSourceApplyConfiguration { return &CinderVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/claimsource.go b/applyconfigurations/core/v1/claimsource.go index 2153570fc0..fcd4e664ee 100644 --- a/applyconfigurations/core/v1/claimsource.go +++ b/applyconfigurations/core/v1/claimsource.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// ClaimSourceApplyConfiguration represents an declarative configuration of the ClaimSource type for use +// ClaimSourceApplyConfiguration represents a declarative configuration of the ClaimSource type for use // with apply. type ClaimSourceApplyConfiguration struct { ResourceClaimName *string `json:"resourceClaimName,omitempty"` ResourceClaimTemplateName *string `json:"resourceClaimTemplateName,omitempty"` } -// ClaimSourceApplyConfiguration constructs an declarative configuration of the ClaimSource type for use with +// ClaimSourceApplyConfiguration constructs a declarative configuration of the ClaimSource type for use with // apply. func ClaimSource() *ClaimSourceApplyConfiguration { return &ClaimSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/clientipconfig.go b/applyconfigurations/core/v1/clientipconfig.go index a666e8faae..02c4e55e13 100644 --- a/applyconfigurations/core/v1/clientipconfig.go +++ b/applyconfigurations/core/v1/clientipconfig.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// ClientIPConfigApplyConfiguration represents an declarative configuration of the ClientIPConfig type for use +// ClientIPConfigApplyConfiguration represents a declarative configuration of the ClientIPConfig type for use // with apply. type ClientIPConfigApplyConfiguration struct { TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` } -// ClientIPConfigApplyConfiguration constructs an declarative configuration of the ClientIPConfig type for use with +// ClientIPConfigApplyConfiguration constructs a declarative configuration of the ClientIPConfig type for use with // apply. func ClientIPConfig() *ClientIPConfigApplyConfiguration { return &ClientIPConfigApplyConfiguration{} diff --git a/applyconfigurations/core/v1/clustertrustbundleprojection.go b/applyconfigurations/core/v1/clustertrustbundleprojection.go index 5aa686782b..bcfbac63e7 100644 --- a/applyconfigurations/core/v1/clustertrustbundleprojection.go +++ b/applyconfigurations/core/v1/clustertrustbundleprojection.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ClusterTrustBundleProjectionApplyConfiguration represents an declarative configuration of the ClusterTrustBundleProjection type for use +// ClusterTrustBundleProjectionApplyConfiguration represents a declarative configuration of the ClusterTrustBundleProjection type for use // with apply. type ClusterTrustBundleProjectionApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -32,7 +32,7 @@ type ClusterTrustBundleProjectionApplyConfiguration struct { Path *string `json:"path,omitempty"` } -// ClusterTrustBundleProjectionApplyConfiguration constructs an declarative configuration of the ClusterTrustBundleProjection type for use with +// ClusterTrustBundleProjectionApplyConfiguration constructs a declarative configuration of the ClusterTrustBundleProjection type for use with // apply. func ClusterTrustBundleProjection() *ClusterTrustBundleProjectionApplyConfiguration { return &ClusterTrustBundleProjectionApplyConfiguration{} diff --git a/applyconfigurations/core/v1/componentcondition.go b/applyconfigurations/core/v1/componentcondition.go index 1ef65f5a0c..0044c7c0bb 100644 --- a/applyconfigurations/core/v1/componentcondition.go +++ b/applyconfigurations/core/v1/componentcondition.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// ComponentConditionApplyConfiguration represents an declarative configuration of the ComponentCondition type for use +// ComponentConditionApplyConfiguration represents a declarative configuration of the ComponentCondition type for use // with apply. type ComponentConditionApplyConfiguration struct { Type *v1.ComponentConditionType `json:"type,omitempty"` @@ -31,7 +31,7 @@ type ComponentConditionApplyConfiguration struct { Error *string `json:"error,omitempty"` } -// ComponentConditionApplyConfiguration constructs an declarative configuration of the ComponentCondition type for use with +// ComponentConditionApplyConfiguration constructs a declarative configuration of the ComponentCondition type for use with // apply. func ComponentCondition() *ComponentConditionApplyConfiguration { return &ComponentConditionApplyConfiguration{} diff --git a/applyconfigurations/core/v1/componentstatus.go b/applyconfigurations/core/v1/componentstatus.go index e5526366c9..195bde7219 100644 --- a/applyconfigurations/core/v1/componentstatus.go +++ b/applyconfigurations/core/v1/componentstatus.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ComponentStatusApplyConfiguration represents an declarative configuration of the ComponentStatus type for use +// ComponentStatusApplyConfiguration represents a declarative configuration of the ComponentStatus type for use // with apply. type ComponentStatusApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type ComponentStatusApplyConfiguration struct { Conditions []ComponentConditionApplyConfiguration `json:"conditions,omitempty"` } -// ComponentStatus constructs an declarative configuration of the ComponentStatus type for use with +// ComponentStatus constructs a declarative configuration of the ComponentStatus type for use with // apply. func ComponentStatus(name string) *ComponentStatusApplyConfiguration { b := &ComponentStatusApplyConfiguration{} diff --git a/applyconfigurations/core/v1/configmap.go b/applyconfigurations/core/v1/configmap.go index 64e421d32e..576b7a3d68 100644 --- a/applyconfigurations/core/v1/configmap.go +++ b/applyconfigurations/core/v1/configmap.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ConfigMapApplyConfiguration represents an declarative configuration of the ConfigMap type for use +// ConfigMapApplyConfiguration represents a declarative configuration of the ConfigMap type for use // with apply. type ConfigMapApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +37,7 @@ type ConfigMapApplyConfiguration struct { BinaryData map[string][]byte `json:"binaryData,omitempty"` } -// ConfigMap constructs an declarative configuration of the ConfigMap type for use with +// ConfigMap constructs a declarative configuration of the ConfigMap type for use with // apply. func ConfigMap(name, namespace string) *ConfigMapApplyConfiguration { b := &ConfigMapApplyConfiguration{} diff --git a/applyconfigurations/core/v1/configmapenvsource.go b/applyconfigurations/core/v1/configmapenvsource.go index 8802fff48f..b1fccd7000 100644 --- a/applyconfigurations/core/v1/configmapenvsource.go +++ b/applyconfigurations/core/v1/configmapenvsource.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// ConfigMapEnvSourceApplyConfiguration represents an declarative configuration of the ConfigMapEnvSource type for use +// ConfigMapEnvSourceApplyConfiguration represents a declarative configuration of the ConfigMapEnvSource type for use // with apply. type ConfigMapEnvSourceApplyConfiguration struct { LocalObjectReferenceApplyConfiguration `json:",inline"` Optional *bool `json:"optional,omitempty"` } -// ConfigMapEnvSourceApplyConfiguration constructs an declarative configuration of the ConfigMapEnvSource type for use with +// ConfigMapEnvSourceApplyConfiguration constructs a declarative configuration of the ConfigMapEnvSource type for use with // apply. func ConfigMapEnvSource() *ConfigMapEnvSourceApplyConfiguration { return &ConfigMapEnvSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/configmapkeyselector.go b/applyconfigurations/core/v1/configmapkeyselector.go index 2a8c800afc..26c2a75b5a 100644 --- a/applyconfigurations/core/v1/configmapkeyselector.go +++ b/applyconfigurations/core/v1/configmapkeyselector.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// ConfigMapKeySelectorApplyConfiguration represents an declarative configuration of the ConfigMapKeySelector type for use +// ConfigMapKeySelectorApplyConfiguration represents a declarative configuration of the ConfigMapKeySelector type for use // with apply. type ConfigMapKeySelectorApplyConfiguration struct { LocalObjectReferenceApplyConfiguration `json:",inline"` @@ -26,7 +26,7 @@ type ConfigMapKeySelectorApplyConfiguration struct { Optional *bool `json:"optional,omitempty"` } -// ConfigMapKeySelectorApplyConfiguration constructs an declarative configuration of the ConfigMapKeySelector type for use with +// ConfigMapKeySelectorApplyConfiguration constructs a declarative configuration of the ConfigMapKeySelector type for use with // apply. func ConfigMapKeySelector() *ConfigMapKeySelectorApplyConfiguration { return &ConfigMapKeySelectorApplyConfiguration{} diff --git a/applyconfigurations/core/v1/configmapnodeconfigsource.go b/applyconfigurations/core/v1/configmapnodeconfigsource.go index da9655a544..135bb7d427 100644 --- a/applyconfigurations/core/v1/configmapnodeconfigsource.go +++ b/applyconfigurations/core/v1/configmapnodeconfigsource.go @@ -22,7 +22,7 @@ import ( types "k8s.io/apimachinery/pkg/types" ) -// ConfigMapNodeConfigSourceApplyConfiguration represents an declarative configuration of the ConfigMapNodeConfigSource type for use +// ConfigMapNodeConfigSourceApplyConfiguration represents a declarative configuration of the ConfigMapNodeConfigSource type for use // with apply. type ConfigMapNodeConfigSourceApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` @@ -32,7 +32,7 @@ type ConfigMapNodeConfigSourceApplyConfiguration struct { KubeletConfigKey *string `json:"kubeletConfigKey,omitempty"` } -// ConfigMapNodeConfigSourceApplyConfiguration constructs an declarative configuration of the ConfigMapNodeConfigSource type for use with +// ConfigMapNodeConfigSourceApplyConfiguration constructs a declarative configuration of the ConfigMapNodeConfigSource type for use with // apply. func ConfigMapNodeConfigSource() *ConfigMapNodeConfigSourceApplyConfiguration { return &ConfigMapNodeConfigSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/configmapprojection.go b/applyconfigurations/core/v1/configmapprojection.go index 7297d3a437..308b28f57d 100644 --- a/applyconfigurations/core/v1/configmapprojection.go +++ b/applyconfigurations/core/v1/configmapprojection.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// ConfigMapProjectionApplyConfiguration represents an declarative configuration of the ConfigMapProjection type for use +// ConfigMapProjectionApplyConfiguration represents a declarative configuration of the ConfigMapProjection type for use // with apply. type ConfigMapProjectionApplyConfiguration struct { LocalObjectReferenceApplyConfiguration `json:",inline"` @@ -26,7 +26,7 @@ type ConfigMapProjectionApplyConfiguration struct { Optional *bool `json:"optional,omitempty"` } -// ConfigMapProjectionApplyConfiguration constructs an declarative configuration of the ConfigMapProjection type for use with +// ConfigMapProjectionApplyConfiguration constructs a declarative configuration of the ConfigMapProjection type for use with // apply. func ConfigMapProjection() *ConfigMapProjectionApplyConfiguration { return &ConfigMapProjectionApplyConfiguration{} diff --git a/applyconfigurations/core/v1/configmapvolumesource.go b/applyconfigurations/core/v1/configmapvolumesource.go index deaebde319..8e0e8dc0f4 100644 --- a/applyconfigurations/core/v1/configmapvolumesource.go +++ b/applyconfigurations/core/v1/configmapvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// ConfigMapVolumeSourceApplyConfiguration represents an declarative configuration of the ConfigMapVolumeSource type for use +// ConfigMapVolumeSourceApplyConfiguration represents a declarative configuration of the ConfigMapVolumeSource type for use // with apply. type ConfigMapVolumeSourceApplyConfiguration struct { LocalObjectReferenceApplyConfiguration `json:",inline"` @@ -27,7 +27,7 @@ type ConfigMapVolumeSourceApplyConfiguration struct { Optional *bool `json:"optional,omitempty"` } -// ConfigMapVolumeSourceApplyConfiguration constructs an declarative configuration of the ConfigMapVolumeSource type for use with +// ConfigMapVolumeSourceApplyConfiguration constructs a declarative configuration of the ConfigMapVolumeSource type for use with // apply. func ConfigMapVolumeSource() *ConfigMapVolumeSourceApplyConfiguration { return &ConfigMapVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/container.go b/applyconfigurations/core/v1/container.go index 32d7156063..eed5f7d027 100644 --- a/applyconfigurations/core/v1/container.go +++ b/applyconfigurations/core/v1/container.go @@ -22,7 +22,7 @@ import ( corev1 "k8s.io/api/core/v1" ) -// ContainerApplyConfiguration represents an declarative configuration of the Container type for use +// ContainerApplyConfiguration represents a declarative configuration of the Container type for use // with apply. type ContainerApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -51,7 +51,7 @@ type ContainerApplyConfiguration struct { TTY *bool `json:"tty,omitempty"` } -// ContainerApplyConfiguration constructs an declarative configuration of the Container type for use with +// ContainerApplyConfiguration constructs a declarative configuration of the Container type for use with // apply. func Container() *ContainerApplyConfiguration { return &ContainerApplyConfiguration{} diff --git a/applyconfigurations/core/v1/containerimage.go b/applyconfigurations/core/v1/containerimage.go index d5c874a7ce..bc9428fd10 100644 --- a/applyconfigurations/core/v1/containerimage.go +++ b/applyconfigurations/core/v1/containerimage.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// ContainerImageApplyConfiguration represents an declarative configuration of the ContainerImage type for use +// ContainerImageApplyConfiguration represents a declarative configuration of the ContainerImage type for use // with apply. type ContainerImageApplyConfiguration struct { Names []string `json:"names,omitempty"` SizeBytes *int64 `json:"sizeBytes,omitempty"` } -// ContainerImageApplyConfiguration constructs an declarative configuration of the ContainerImage type for use with +// ContainerImageApplyConfiguration constructs a declarative configuration of the ContainerImage type for use with // apply. func ContainerImage() *ContainerImageApplyConfiguration { return &ContainerImageApplyConfiguration{} diff --git a/applyconfigurations/core/v1/containerport.go b/applyconfigurations/core/v1/containerport.go index a23ad9268a..7acc0638f2 100644 --- a/applyconfigurations/core/v1/containerport.go +++ b/applyconfigurations/core/v1/containerport.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// ContainerPortApplyConfiguration represents an declarative configuration of the ContainerPort type for use +// ContainerPortApplyConfiguration represents a declarative configuration of the ContainerPort type for use // with apply. type ContainerPortApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -32,7 +32,7 @@ type ContainerPortApplyConfiguration struct { HostIP *string `json:"hostIP,omitempty"` } -// ContainerPortApplyConfiguration constructs an declarative configuration of the ContainerPort type for use with +// ContainerPortApplyConfiguration constructs a declarative configuration of the ContainerPort type for use with // apply. func ContainerPort() *ContainerPortApplyConfiguration { return &ContainerPortApplyConfiguration{} diff --git a/applyconfigurations/core/v1/containerresizepolicy.go b/applyconfigurations/core/v1/containerresizepolicy.go index bbbcbc9f13..ea60e3d987 100644 --- a/applyconfigurations/core/v1/containerresizepolicy.go +++ b/applyconfigurations/core/v1/containerresizepolicy.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// ContainerResizePolicyApplyConfiguration represents an declarative configuration of the ContainerResizePolicy type for use +// ContainerResizePolicyApplyConfiguration represents a declarative configuration of the ContainerResizePolicy type for use // with apply. type ContainerResizePolicyApplyConfiguration struct { ResourceName *v1.ResourceName `json:"resourceName,omitempty"` RestartPolicy *v1.ResourceResizeRestartPolicy `json:"restartPolicy,omitempty"` } -// ContainerResizePolicyApplyConfiguration constructs an declarative configuration of the ContainerResizePolicy type for use with +// ContainerResizePolicyApplyConfiguration constructs a declarative configuration of the ContainerResizePolicy type for use with // apply. func ContainerResizePolicy() *ContainerResizePolicyApplyConfiguration { return &ContainerResizePolicyApplyConfiguration{} diff --git a/applyconfigurations/core/v1/containerstate.go b/applyconfigurations/core/v1/containerstate.go index 6cbfc7fd9b..b958e01774 100644 --- a/applyconfigurations/core/v1/containerstate.go +++ b/applyconfigurations/core/v1/containerstate.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// ContainerStateApplyConfiguration represents an declarative configuration of the ContainerState type for use +// ContainerStateApplyConfiguration represents a declarative configuration of the ContainerState type for use // with apply. type ContainerStateApplyConfiguration struct { Waiting *ContainerStateWaitingApplyConfiguration `json:"waiting,omitempty"` @@ -26,7 +26,7 @@ type ContainerStateApplyConfiguration struct { Terminated *ContainerStateTerminatedApplyConfiguration `json:"terminated,omitempty"` } -// ContainerStateApplyConfiguration constructs an declarative configuration of the ContainerState type for use with +// ContainerStateApplyConfiguration constructs a declarative configuration of the ContainerState type for use with // apply. func ContainerState() *ContainerStateApplyConfiguration { return &ContainerStateApplyConfiguration{} diff --git a/applyconfigurations/core/v1/containerstaterunning.go b/applyconfigurations/core/v1/containerstaterunning.go index 6c1d7311e7..6eec9f7f2c 100644 --- a/applyconfigurations/core/v1/containerstaterunning.go +++ b/applyconfigurations/core/v1/containerstaterunning.go @@ -22,13 +22,13 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// ContainerStateRunningApplyConfiguration represents an declarative configuration of the ContainerStateRunning type for use +// ContainerStateRunningApplyConfiguration represents a declarative configuration of the ContainerStateRunning type for use // with apply. type ContainerStateRunningApplyConfiguration struct { StartedAt *v1.Time `json:"startedAt,omitempty"` } -// ContainerStateRunningApplyConfiguration constructs an declarative configuration of the ContainerStateRunning type for use with +// ContainerStateRunningApplyConfiguration constructs a declarative configuration of the ContainerStateRunning type for use with // apply. func ContainerStateRunning() *ContainerStateRunningApplyConfiguration { return &ContainerStateRunningApplyConfiguration{} diff --git a/applyconfigurations/core/v1/containerstateterminated.go b/applyconfigurations/core/v1/containerstateterminated.go index 0383c9dd9d..b067aa211e 100644 --- a/applyconfigurations/core/v1/containerstateterminated.go +++ b/applyconfigurations/core/v1/containerstateterminated.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// ContainerStateTerminatedApplyConfiguration represents an declarative configuration of the ContainerStateTerminated type for use +// ContainerStateTerminatedApplyConfiguration represents a declarative configuration of the ContainerStateTerminated type for use // with apply. type ContainerStateTerminatedApplyConfiguration struct { ExitCode *int32 `json:"exitCode,omitempty"` @@ -34,7 +34,7 @@ type ContainerStateTerminatedApplyConfiguration struct { ContainerID *string `json:"containerID,omitempty"` } -// ContainerStateTerminatedApplyConfiguration constructs an declarative configuration of the ContainerStateTerminated type for use with +// ContainerStateTerminatedApplyConfiguration constructs a declarative configuration of the ContainerStateTerminated type for use with // apply. func ContainerStateTerminated() *ContainerStateTerminatedApplyConfiguration { return &ContainerStateTerminatedApplyConfiguration{} diff --git a/applyconfigurations/core/v1/containerstatewaiting.go b/applyconfigurations/core/v1/containerstatewaiting.go index e51b778c0d..7756c7da03 100644 --- a/applyconfigurations/core/v1/containerstatewaiting.go +++ b/applyconfigurations/core/v1/containerstatewaiting.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// ContainerStateWaitingApplyConfiguration represents an declarative configuration of the ContainerStateWaiting type for use +// ContainerStateWaitingApplyConfiguration represents a declarative configuration of the ContainerStateWaiting type for use // with apply. type ContainerStateWaitingApplyConfiguration struct { Reason *string `json:"reason,omitempty"` Message *string `json:"message,omitempty"` } -// ContainerStateWaitingApplyConfiguration constructs an declarative configuration of the ContainerStateWaiting type for use with +// ContainerStateWaitingApplyConfiguration constructs a declarative configuration of the ContainerStateWaiting type for use with // apply. func ContainerStateWaiting() *ContainerStateWaitingApplyConfiguration { return &ContainerStateWaitingApplyConfiguration{} diff --git a/applyconfigurations/core/v1/containerstatus.go b/applyconfigurations/core/v1/containerstatus.go index 5918f3603d..bdf696aaa7 100644 --- a/applyconfigurations/core/v1/containerstatus.go +++ b/applyconfigurations/core/v1/containerstatus.go @@ -22,7 +22,7 @@ import ( corev1 "k8s.io/api/core/v1" ) -// ContainerStatusApplyConfiguration represents an declarative configuration of the ContainerStatus type for use +// ContainerStatusApplyConfiguration represents a declarative configuration of the ContainerStatus type for use // with apply. type ContainerStatusApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -40,7 +40,7 @@ type ContainerStatusApplyConfiguration struct { User *ContainerUserApplyConfiguration `json:"user,omitempty"` } -// ContainerStatusApplyConfiguration constructs an declarative configuration of the ContainerStatus type for use with +// ContainerStatusApplyConfiguration constructs a declarative configuration of the ContainerStatus type for use with // apply. func ContainerStatus() *ContainerStatusApplyConfiguration { return &ContainerStatusApplyConfiguration{} diff --git a/applyconfigurations/core/v1/containeruser.go b/applyconfigurations/core/v1/containeruser.go index e538a46d6e..34ec8e4146 100644 --- a/applyconfigurations/core/v1/containeruser.go +++ b/applyconfigurations/core/v1/containeruser.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// ContainerUserApplyConfiguration represents an declarative configuration of the ContainerUser type for use +// ContainerUserApplyConfiguration represents a declarative configuration of the ContainerUser type for use // with apply. type ContainerUserApplyConfiguration struct { Linux *LinuxContainerUserApplyConfiguration `json:"linux,omitempty"` } -// ContainerUserApplyConfiguration constructs an declarative configuration of the ContainerUser type for use with +// ContainerUserApplyConfiguration constructs a declarative configuration of the ContainerUser type for use with // apply. func ContainerUser() *ContainerUserApplyConfiguration { return &ContainerUserApplyConfiguration{} diff --git a/applyconfigurations/core/v1/csipersistentvolumesource.go b/applyconfigurations/core/v1/csipersistentvolumesource.go index 2fc681604e..a614d10805 100644 --- a/applyconfigurations/core/v1/csipersistentvolumesource.go +++ b/applyconfigurations/core/v1/csipersistentvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// CSIPersistentVolumeSourceApplyConfiguration represents an declarative configuration of the CSIPersistentVolumeSource type for use +// CSIPersistentVolumeSourceApplyConfiguration represents a declarative configuration of the CSIPersistentVolumeSource type for use // with apply. type CSIPersistentVolumeSourceApplyConfiguration struct { Driver *string `json:"driver,omitempty"` @@ -33,7 +33,7 @@ type CSIPersistentVolumeSourceApplyConfiguration struct { NodeExpandSecretRef *SecretReferenceApplyConfiguration `json:"nodeExpandSecretRef,omitempty"` } -// CSIPersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the CSIPersistentVolumeSource type for use with +// CSIPersistentVolumeSourceApplyConfiguration constructs a declarative configuration of the CSIPersistentVolumeSource type for use with // apply. func CSIPersistentVolumeSource() *CSIPersistentVolumeSourceApplyConfiguration { return &CSIPersistentVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/csivolumesource.go b/applyconfigurations/core/v1/csivolumesource.go index c2a32df8d0..b58d9bbb4b 100644 --- a/applyconfigurations/core/v1/csivolumesource.go +++ b/applyconfigurations/core/v1/csivolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// CSIVolumeSourceApplyConfiguration represents an declarative configuration of the CSIVolumeSource type for use +// CSIVolumeSourceApplyConfiguration represents a declarative configuration of the CSIVolumeSource type for use // with apply. type CSIVolumeSourceApplyConfiguration struct { Driver *string `json:"driver,omitempty"` @@ -28,7 +28,7 @@ type CSIVolumeSourceApplyConfiguration struct { NodePublishSecretRef *LocalObjectReferenceApplyConfiguration `json:"nodePublishSecretRef,omitempty"` } -// CSIVolumeSourceApplyConfiguration constructs an declarative configuration of the CSIVolumeSource type for use with +// CSIVolumeSourceApplyConfiguration constructs a declarative configuration of the CSIVolumeSource type for use with // apply. func CSIVolumeSource() *CSIVolumeSourceApplyConfiguration { return &CSIVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/daemonendpoint.go b/applyconfigurations/core/v1/daemonendpoint.go index 13a2e948f1..5be27ec0c5 100644 --- a/applyconfigurations/core/v1/daemonendpoint.go +++ b/applyconfigurations/core/v1/daemonendpoint.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// DaemonEndpointApplyConfiguration represents an declarative configuration of the DaemonEndpoint type for use +// DaemonEndpointApplyConfiguration represents a declarative configuration of the DaemonEndpoint type for use // with apply. type DaemonEndpointApplyConfiguration struct { Port *int32 `json:"Port,omitempty"` } -// DaemonEndpointApplyConfiguration constructs an declarative configuration of the DaemonEndpoint type for use with +// DaemonEndpointApplyConfiguration constructs a declarative configuration of the DaemonEndpoint type for use with // apply. func DaemonEndpoint() *DaemonEndpointApplyConfiguration { return &DaemonEndpointApplyConfiguration{} diff --git a/applyconfigurations/core/v1/downwardapiprojection.go b/applyconfigurations/core/v1/downwardapiprojection.go index f88a87c0b5..ed6b8b1bbe 100644 --- a/applyconfigurations/core/v1/downwardapiprojection.go +++ b/applyconfigurations/core/v1/downwardapiprojection.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// DownwardAPIProjectionApplyConfiguration represents an declarative configuration of the DownwardAPIProjection type for use +// DownwardAPIProjectionApplyConfiguration represents a declarative configuration of the DownwardAPIProjection type for use // with apply. type DownwardAPIProjectionApplyConfiguration struct { Items []DownwardAPIVolumeFileApplyConfiguration `json:"items,omitempty"` } -// DownwardAPIProjectionApplyConfiguration constructs an declarative configuration of the DownwardAPIProjection type for use with +// DownwardAPIProjectionApplyConfiguration constructs a declarative configuration of the DownwardAPIProjection type for use with // apply. func DownwardAPIProjection() *DownwardAPIProjectionApplyConfiguration { return &DownwardAPIProjectionApplyConfiguration{} diff --git a/applyconfigurations/core/v1/downwardapivolumefile.go b/applyconfigurations/core/v1/downwardapivolumefile.go index b25ff25fa9..ec9d013dd9 100644 --- a/applyconfigurations/core/v1/downwardapivolumefile.go +++ b/applyconfigurations/core/v1/downwardapivolumefile.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// DownwardAPIVolumeFileApplyConfiguration represents an declarative configuration of the DownwardAPIVolumeFile type for use +// DownwardAPIVolumeFileApplyConfiguration represents a declarative configuration of the DownwardAPIVolumeFile type for use // with apply. type DownwardAPIVolumeFileApplyConfiguration struct { Path *string `json:"path,omitempty"` @@ -27,7 +27,7 @@ type DownwardAPIVolumeFileApplyConfiguration struct { Mode *int32 `json:"mode,omitempty"` } -// DownwardAPIVolumeFileApplyConfiguration constructs an declarative configuration of the DownwardAPIVolumeFile type for use with +// DownwardAPIVolumeFileApplyConfiguration constructs a declarative configuration of the DownwardAPIVolumeFile type for use with // apply. func DownwardAPIVolumeFile() *DownwardAPIVolumeFileApplyConfiguration { return &DownwardAPIVolumeFileApplyConfiguration{} diff --git a/applyconfigurations/core/v1/downwardapivolumesource.go b/applyconfigurations/core/v1/downwardapivolumesource.go index 6913bb5218..eef9d7ef8d 100644 --- a/applyconfigurations/core/v1/downwardapivolumesource.go +++ b/applyconfigurations/core/v1/downwardapivolumesource.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// DownwardAPIVolumeSourceApplyConfiguration represents an declarative configuration of the DownwardAPIVolumeSource type for use +// DownwardAPIVolumeSourceApplyConfiguration represents a declarative configuration of the DownwardAPIVolumeSource type for use // with apply. type DownwardAPIVolumeSourceApplyConfiguration struct { Items []DownwardAPIVolumeFileApplyConfiguration `json:"items,omitempty"` DefaultMode *int32 `json:"defaultMode,omitempty"` } -// DownwardAPIVolumeSourceApplyConfiguration constructs an declarative configuration of the DownwardAPIVolumeSource type for use with +// DownwardAPIVolumeSourceApplyConfiguration constructs a declarative configuration of the DownwardAPIVolumeSource type for use with // apply. func DownwardAPIVolumeSource() *DownwardAPIVolumeSourceApplyConfiguration { return &DownwardAPIVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/emptydirvolumesource.go b/applyconfigurations/core/v1/emptydirvolumesource.go index 021280daf6..a619fdb074 100644 --- a/applyconfigurations/core/v1/emptydirvolumesource.go +++ b/applyconfigurations/core/v1/emptydirvolumesource.go @@ -23,14 +23,14 @@ import ( resource "k8s.io/apimachinery/pkg/api/resource" ) -// EmptyDirVolumeSourceApplyConfiguration represents an declarative configuration of the EmptyDirVolumeSource type for use +// EmptyDirVolumeSourceApplyConfiguration represents a declarative configuration of the EmptyDirVolumeSource type for use // with apply. type EmptyDirVolumeSourceApplyConfiguration struct { Medium *v1.StorageMedium `json:"medium,omitempty"` SizeLimit *resource.Quantity `json:"sizeLimit,omitempty"` } -// EmptyDirVolumeSourceApplyConfiguration constructs an declarative configuration of the EmptyDirVolumeSource type for use with +// EmptyDirVolumeSourceApplyConfiguration constructs a declarative configuration of the EmptyDirVolumeSource type for use with // apply. func EmptyDirVolumeSource() *EmptyDirVolumeSourceApplyConfiguration { return &EmptyDirVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/endpointaddress.go b/applyconfigurations/core/v1/endpointaddress.go index 52a54b6008..536e697a9a 100644 --- a/applyconfigurations/core/v1/endpointaddress.go +++ b/applyconfigurations/core/v1/endpointaddress.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// EndpointAddressApplyConfiguration represents an declarative configuration of the EndpointAddress type for use +// EndpointAddressApplyConfiguration represents a declarative configuration of the EndpointAddress type for use // with apply. type EndpointAddressApplyConfiguration struct { IP *string `json:"ip,omitempty"` @@ -27,7 +27,7 @@ type EndpointAddressApplyConfiguration struct { TargetRef *ObjectReferenceApplyConfiguration `json:"targetRef,omitempty"` } -// EndpointAddressApplyConfiguration constructs an declarative configuration of the EndpointAddress type for use with +// EndpointAddressApplyConfiguration constructs a declarative configuration of the EndpointAddress type for use with // apply. func EndpointAddress() *EndpointAddressApplyConfiguration { return &EndpointAddressApplyConfiguration{} diff --git a/applyconfigurations/core/v1/endpointport.go b/applyconfigurations/core/v1/endpointport.go index cc00d0e491..d0d96230ce 100644 --- a/applyconfigurations/core/v1/endpointport.go +++ b/applyconfigurations/core/v1/endpointport.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// EndpointPortApplyConfiguration represents an declarative configuration of the EndpointPort type for use +// EndpointPortApplyConfiguration represents a declarative configuration of the EndpointPort type for use // with apply. type EndpointPortApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -31,7 +31,7 @@ type EndpointPortApplyConfiguration struct { AppProtocol *string `json:"appProtocol,omitempty"` } -// EndpointPortApplyConfiguration constructs an declarative configuration of the EndpointPort type for use with +// EndpointPortApplyConfiguration constructs a declarative configuration of the EndpointPort type for use with // apply. func EndpointPort() *EndpointPortApplyConfiguration { return &EndpointPortApplyConfiguration{} diff --git a/applyconfigurations/core/v1/endpoints.go b/applyconfigurations/core/v1/endpoints.go index 5185b5ac80..98dc69aaab 100644 --- a/applyconfigurations/core/v1/endpoints.go +++ b/applyconfigurations/core/v1/endpoints.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// EndpointsApplyConfiguration represents an declarative configuration of the Endpoints type for use +// EndpointsApplyConfiguration represents a declarative configuration of the Endpoints type for use // with apply. type EndpointsApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type EndpointsApplyConfiguration struct { Subsets []EndpointSubsetApplyConfiguration `json:"subsets,omitempty"` } -// Endpoints constructs an declarative configuration of the Endpoints type for use with +// Endpoints constructs a declarative configuration of the Endpoints type for use with // apply. func Endpoints(name, namespace string) *EndpointsApplyConfiguration { b := &EndpointsApplyConfiguration{} diff --git a/applyconfigurations/core/v1/endpointsubset.go b/applyconfigurations/core/v1/endpointsubset.go index cd0657a80c..33cd8496a7 100644 --- a/applyconfigurations/core/v1/endpointsubset.go +++ b/applyconfigurations/core/v1/endpointsubset.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// EndpointSubsetApplyConfiguration represents an declarative configuration of the EndpointSubset type for use +// EndpointSubsetApplyConfiguration represents a declarative configuration of the EndpointSubset type for use // with apply. type EndpointSubsetApplyConfiguration struct { Addresses []EndpointAddressApplyConfiguration `json:"addresses,omitempty"` @@ -26,7 +26,7 @@ type EndpointSubsetApplyConfiguration struct { Ports []EndpointPortApplyConfiguration `json:"ports,omitempty"` } -// EndpointSubsetApplyConfiguration constructs an declarative configuration of the EndpointSubset type for use with +// EndpointSubsetApplyConfiguration constructs a declarative configuration of the EndpointSubset type for use with // apply. func EndpointSubset() *EndpointSubsetApplyConfiguration { return &EndpointSubsetApplyConfiguration{} diff --git a/applyconfigurations/core/v1/envfromsource.go b/applyconfigurations/core/v1/envfromsource.go index 9e46d25ded..7aa181cf1a 100644 --- a/applyconfigurations/core/v1/envfromsource.go +++ b/applyconfigurations/core/v1/envfromsource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// EnvFromSourceApplyConfiguration represents an declarative configuration of the EnvFromSource type for use +// EnvFromSourceApplyConfiguration represents a declarative configuration of the EnvFromSource type for use // with apply. type EnvFromSourceApplyConfiguration struct { Prefix *string `json:"prefix,omitempty"` @@ -26,7 +26,7 @@ type EnvFromSourceApplyConfiguration struct { SecretRef *SecretEnvSourceApplyConfiguration `json:"secretRef,omitempty"` } -// EnvFromSourceApplyConfiguration constructs an declarative configuration of the EnvFromSource type for use with +// EnvFromSourceApplyConfiguration constructs a declarative configuration of the EnvFromSource type for use with // apply. func EnvFromSource() *EnvFromSourceApplyConfiguration { return &EnvFromSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/envvar.go b/applyconfigurations/core/v1/envvar.go index a83528a28e..5894166ca4 100644 --- a/applyconfigurations/core/v1/envvar.go +++ b/applyconfigurations/core/v1/envvar.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// EnvVarApplyConfiguration represents an declarative configuration of the EnvVar type for use +// EnvVarApplyConfiguration represents a declarative configuration of the EnvVar type for use // with apply. type EnvVarApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -26,7 +26,7 @@ type EnvVarApplyConfiguration struct { ValueFrom *EnvVarSourceApplyConfiguration `json:"valueFrom,omitempty"` } -// EnvVarApplyConfiguration constructs an declarative configuration of the EnvVar type for use with +// EnvVarApplyConfiguration constructs a declarative configuration of the EnvVar type for use with // apply. func EnvVar() *EnvVarApplyConfiguration { return &EnvVarApplyConfiguration{} diff --git a/applyconfigurations/core/v1/envvarsource.go b/applyconfigurations/core/v1/envvarsource.go index 70c695bd5b..a3a55ea7af 100644 --- a/applyconfigurations/core/v1/envvarsource.go +++ b/applyconfigurations/core/v1/envvarsource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// EnvVarSourceApplyConfiguration represents an declarative configuration of the EnvVarSource type for use +// EnvVarSourceApplyConfiguration represents a declarative configuration of the EnvVarSource type for use // with apply. type EnvVarSourceApplyConfiguration struct { FieldRef *ObjectFieldSelectorApplyConfiguration `json:"fieldRef,omitempty"` @@ -27,7 +27,7 @@ type EnvVarSourceApplyConfiguration struct { SecretKeyRef *SecretKeySelectorApplyConfiguration `json:"secretKeyRef,omitempty"` } -// EnvVarSourceApplyConfiguration constructs an declarative configuration of the EnvVarSource type for use with +// EnvVarSourceApplyConfiguration constructs a declarative configuration of the EnvVarSource type for use with // apply. func EnvVarSource() *EnvVarSourceApplyConfiguration { return &EnvVarSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/ephemeralcontainer.go b/applyconfigurations/core/v1/ephemeralcontainer.go index 5fa79a246e..a15ac6ec34 100644 --- a/applyconfigurations/core/v1/ephemeralcontainer.go +++ b/applyconfigurations/core/v1/ephemeralcontainer.go @@ -22,14 +22,14 @@ import ( corev1 "k8s.io/api/core/v1" ) -// EphemeralContainerApplyConfiguration represents an declarative configuration of the EphemeralContainer type for use +// EphemeralContainerApplyConfiguration represents a declarative configuration of the EphemeralContainer type for use // with apply. type EphemeralContainerApplyConfiguration struct { EphemeralContainerCommonApplyConfiguration `json:",inline"` TargetContainerName *string `json:"targetContainerName,omitempty"` } -// EphemeralContainerApplyConfiguration constructs an declarative configuration of the EphemeralContainer type for use with +// EphemeralContainerApplyConfiguration constructs a declarative configuration of the EphemeralContainer type for use with // apply. func EphemeralContainer() *EphemeralContainerApplyConfiguration { return &EphemeralContainerApplyConfiguration{} diff --git a/applyconfigurations/core/v1/ephemeralcontainercommon.go b/applyconfigurations/core/v1/ephemeralcontainercommon.go index 8cded29a9e..d5d13d27a0 100644 --- a/applyconfigurations/core/v1/ephemeralcontainercommon.go +++ b/applyconfigurations/core/v1/ephemeralcontainercommon.go @@ -22,7 +22,7 @@ import ( corev1 "k8s.io/api/core/v1" ) -// EphemeralContainerCommonApplyConfiguration represents an declarative configuration of the EphemeralContainerCommon type for use +// EphemeralContainerCommonApplyConfiguration represents a declarative configuration of the EphemeralContainerCommon type for use // with apply. type EphemeralContainerCommonApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -51,7 +51,7 @@ type EphemeralContainerCommonApplyConfiguration struct { TTY *bool `json:"tty,omitempty"` } -// EphemeralContainerCommonApplyConfiguration constructs an declarative configuration of the EphemeralContainerCommon type for use with +// EphemeralContainerCommonApplyConfiguration constructs a declarative configuration of the EphemeralContainerCommon type for use with // apply. func EphemeralContainerCommon() *EphemeralContainerCommonApplyConfiguration { return &EphemeralContainerCommonApplyConfiguration{} diff --git a/applyconfigurations/core/v1/ephemeralvolumesource.go b/applyconfigurations/core/v1/ephemeralvolumesource.go index 31859404cc..d2c8c6722e 100644 --- a/applyconfigurations/core/v1/ephemeralvolumesource.go +++ b/applyconfigurations/core/v1/ephemeralvolumesource.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// EphemeralVolumeSourceApplyConfiguration represents an declarative configuration of the EphemeralVolumeSource type for use +// EphemeralVolumeSourceApplyConfiguration represents a declarative configuration of the EphemeralVolumeSource type for use // with apply. type EphemeralVolumeSourceApplyConfiguration struct { VolumeClaimTemplate *PersistentVolumeClaimTemplateApplyConfiguration `json:"volumeClaimTemplate,omitempty"` } -// EphemeralVolumeSourceApplyConfiguration constructs an declarative configuration of the EphemeralVolumeSource type for use with +// EphemeralVolumeSourceApplyConfiguration constructs a declarative configuration of the EphemeralVolumeSource type for use with // apply. func EphemeralVolumeSource() *EphemeralVolumeSourceApplyConfiguration { return &EphemeralVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/event.go b/applyconfigurations/core/v1/event.go index d35f0ae510..65d6577ab6 100644 --- a/applyconfigurations/core/v1/event.go +++ b/applyconfigurations/core/v1/event.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// EventApplyConfiguration represents an declarative configuration of the Event type for use +// EventApplyConfiguration represents a declarative configuration of the Event type for use // with apply. type EventApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -48,7 +48,7 @@ type EventApplyConfiguration struct { ReportingInstance *string `json:"reportingInstance,omitempty"` } -// Event constructs an declarative configuration of the Event type for use with +// Event constructs a declarative configuration of the Event type for use with // apply. func Event(name, namespace string) *EventApplyConfiguration { b := &EventApplyConfiguration{} diff --git a/applyconfigurations/core/v1/eventseries.go b/applyconfigurations/core/v1/eventseries.go index e66fb41271..18069c0d1b 100644 --- a/applyconfigurations/core/v1/eventseries.go +++ b/applyconfigurations/core/v1/eventseries.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// EventSeriesApplyConfiguration represents an declarative configuration of the EventSeries type for use +// EventSeriesApplyConfiguration represents a declarative configuration of the EventSeries type for use // with apply. type EventSeriesApplyConfiguration struct { Count *int32 `json:"count,omitempty"` LastObservedTime *v1.MicroTime `json:"lastObservedTime,omitempty"` } -// EventSeriesApplyConfiguration constructs an declarative configuration of the EventSeries type for use with +// EventSeriesApplyConfiguration constructs a declarative configuration of the EventSeries type for use with // apply. func EventSeries() *EventSeriesApplyConfiguration { return &EventSeriesApplyConfiguration{} diff --git a/applyconfigurations/core/v1/eventsource.go b/applyconfigurations/core/v1/eventsource.go index 2eb4aa8e44..97edb04931 100644 --- a/applyconfigurations/core/v1/eventsource.go +++ b/applyconfigurations/core/v1/eventsource.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// EventSourceApplyConfiguration represents an declarative configuration of the EventSource type for use +// EventSourceApplyConfiguration represents a declarative configuration of the EventSource type for use // with apply. type EventSourceApplyConfiguration struct { Component *string `json:"component,omitempty"` Host *string `json:"host,omitempty"` } -// EventSourceApplyConfiguration constructs an declarative configuration of the EventSource type for use with +// EventSourceApplyConfiguration constructs a declarative configuration of the EventSource type for use with // apply. func EventSource() *EventSourceApplyConfiguration { return &EventSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/execaction.go b/applyconfigurations/core/v1/execaction.go index 1df52144d7..b7208a91cf 100644 --- a/applyconfigurations/core/v1/execaction.go +++ b/applyconfigurations/core/v1/execaction.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// ExecActionApplyConfiguration represents an declarative configuration of the ExecAction type for use +// ExecActionApplyConfiguration represents a declarative configuration of the ExecAction type for use // with apply. type ExecActionApplyConfiguration struct { Command []string `json:"command,omitempty"` } -// ExecActionApplyConfiguration constructs an declarative configuration of the ExecAction type for use with +// ExecActionApplyConfiguration constructs a declarative configuration of the ExecAction type for use with // apply. func ExecAction() *ExecActionApplyConfiguration { return &ExecActionApplyConfiguration{} diff --git a/applyconfigurations/core/v1/fcvolumesource.go b/applyconfigurations/core/v1/fcvolumesource.go index 43069de9a6..000ff2cc62 100644 --- a/applyconfigurations/core/v1/fcvolumesource.go +++ b/applyconfigurations/core/v1/fcvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// FCVolumeSourceApplyConfiguration represents an declarative configuration of the FCVolumeSource type for use +// FCVolumeSourceApplyConfiguration represents a declarative configuration of the FCVolumeSource type for use // with apply. type FCVolumeSourceApplyConfiguration struct { TargetWWNs []string `json:"targetWWNs,omitempty"` @@ -28,7 +28,7 @@ type FCVolumeSourceApplyConfiguration struct { WWIDs []string `json:"wwids,omitempty"` } -// FCVolumeSourceApplyConfiguration constructs an declarative configuration of the FCVolumeSource type for use with +// FCVolumeSourceApplyConfiguration constructs a declarative configuration of the FCVolumeSource type for use with // apply. func FCVolumeSource() *FCVolumeSourceApplyConfiguration { return &FCVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/flexpersistentvolumesource.go b/applyconfigurations/core/v1/flexpersistentvolumesource.go index 47e7c746ee..355c2c82d0 100644 --- a/applyconfigurations/core/v1/flexpersistentvolumesource.go +++ b/applyconfigurations/core/v1/flexpersistentvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// FlexPersistentVolumeSourceApplyConfiguration represents an declarative configuration of the FlexPersistentVolumeSource type for use +// FlexPersistentVolumeSourceApplyConfiguration represents a declarative configuration of the FlexPersistentVolumeSource type for use // with apply. type FlexPersistentVolumeSourceApplyConfiguration struct { Driver *string `json:"driver,omitempty"` @@ -28,7 +28,7 @@ type FlexPersistentVolumeSourceApplyConfiguration struct { Options map[string]string `json:"options,omitempty"` } -// FlexPersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the FlexPersistentVolumeSource type for use with +// FlexPersistentVolumeSourceApplyConfiguration constructs a declarative configuration of the FlexPersistentVolumeSource type for use with // apply. func FlexPersistentVolumeSource() *FlexPersistentVolumeSourceApplyConfiguration { return &FlexPersistentVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/flexvolumesource.go b/applyconfigurations/core/v1/flexvolumesource.go index 7c09516a98..08ae9e1bea 100644 --- a/applyconfigurations/core/v1/flexvolumesource.go +++ b/applyconfigurations/core/v1/flexvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// FlexVolumeSourceApplyConfiguration represents an declarative configuration of the FlexVolumeSource type for use +// FlexVolumeSourceApplyConfiguration represents a declarative configuration of the FlexVolumeSource type for use // with apply. type FlexVolumeSourceApplyConfiguration struct { Driver *string `json:"driver,omitempty"` @@ -28,7 +28,7 @@ type FlexVolumeSourceApplyConfiguration struct { Options map[string]string `json:"options,omitempty"` } -// FlexVolumeSourceApplyConfiguration constructs an declarative configuration of the FlexVolumeSource type for use with +// FlexVolumeSourceApplyConfiguration constructs a declarative configuration of the FlexVolumeSource type for use with // apply. func FlexVolumeSource() *FlexVolumeSourceApplyConfiguration { return &FlexVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/flockervolumesource.go b/applyconfigurations/core/v1/flockervolumesource.go index 74896d55ac..e4ecbba0e4 100644 --- a/applyconfigurations/core/v1/flockervolumesource.go +++ b/applyconfigurations/core/v1/flockervolumesource.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// FlockerVolumeSourceApplyConfiguration represents an declarative configuration of the FlockerVolumeSource type for use +// FlockerVolumeSourceApplyConfiguration represents a declarative configuration of the FlockerVolumeSource type for use // with apply. type FlockerVolumeSourceApplyConfiguration struct { DatasetName *string `json:"datasetName,omitempty"` DatasetUUID *string `json:"datasetUUID,omitempty"` } -// FlockerVolumeSourceApplyConfiguration constructs an declarative configuration of the FlockerVolumeSource type for use with +// FlockerVolumeSourceApplyConfiguration constructs a declarative configuration of the FlockerVolumeSource type for use with // apply. func FlockerVolumeSource() *FlockerVolumeSourceApplyConfiguration { return &FlockerVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/gcepersistentdiskvolumesource.go b/applyconfigurations/core/v1/gcepersistentdiskvolumesource.go index 0869d3eaa6..56c4d03fa2 100644 --- a/applyconfigurations/core/v1/gcepersistentdiskvolumesource.go +++ b/applyconfigurations/core/v1/gcepersistentdiskvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// GCEPersistentDiskVolumeSourceApplyConfiguration represents an declarative configuration of the GCEPersistentDiskVolumeSource type for use +// GCEPersistentDiskVolumeSourceApplyConfiguration represents a declarative configuration of the GCEPersistentDiskVolumeSource type for use // with apply. type GCEPersistentDiskVolumeSourceApplyConfiguration struct { PDName *string `json:"pdName,omitempty"` @@ -27,7 +27,7 @@ type GCEPersistentDiskVolumeSourceApplyConfiguration struct { ReadOnly *bool `json:"readOnly,omitempty"` } -// GCEPersistentDiskVolumeSourceApplyConfiguration constructs an declarative configuration of the GCEPersistentDiskVolumeSource type for use with +// GCEPersistentDiskVolumeSourceApplyConfiguration constructs a declarative configuration of the GCEPersistentDiskVolumeSource type for use with // apply. func GCEPersistentDiskVolumeSource() *GCEPersistentDiskVolumeSourceApplyConfiguration { return &GCEPersistentDiskVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/gitrepovolumesource.go b/applyconfigurations/core/v1/gitrepovolumesource.go index 825e02e4e4..4ed92317c8 100644 --- a/applyconfigurations/core/v1/gitrepovolumesource.go +++ b/applyconfigurations/core/v1/gitrepovolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// GitRepoVolumeSourceApplyConfiguration represents an declarative configuration of the GitRepoVolumeSource type for use +// GitRepoVolumeSourceApplyConfiguration represents a declarative configuration of the GitRepoVolumeSource type for use // with apply. type GitRepoVolumeSourceApplyConfiguration struct { Repository *string `json:"repository,omitempty"` @@ -26,7 +26,7 @@ type GitRepoVolumeSourceApplyConfiguration struct { Directory *string `json:"directory,omitempty"` } -// GitRepoVolumeSourceApplyConfiguration constructs an declarative configuration of the GitRepoVolumeSource type for use with +// GitRepoVolumeSourceApplyConfiguration constructs a declarative configuration of the GitRepoVolumeSource type for use with // apply. func GitRepoVolumeSource() *GitRepoVolumeSourceApplyConfiguration { return &GitRepoVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/glusterfspersistentvolumesource.go b/applyconfigurations/core/v1/glusterfspersistentvolumesource.go index 21a3925e52..c9a23ca5d7 100644 --- a/applyconfigurations/core/v1/glusterfspersistentvolumesource.go +++ b/applyconfigurations/core/v1/glusterfspersistentvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// GlusterfsPersistentVolumeSourceApplyConfiguration represents an declarative configuration of the GlusterfsPersistentVolumeSource type for use +// GlusterfsPersistentVolumeSourceApplyConfiguration represents a declarative configuration of the GlusterfsPersistentVolumeSource type for use // with apply. type GlusterfsPersistentVolumeSourceApplyConfiguration struct { EndpointsName *string `json:"endpoints,omitempty"` @@ -27,7 +27,7 @@ type GlusterfsPersistentVolumeSourceApplyConfiguration struct { EndpointsNamespace *string `json:"endpointsNamespace,omitempty"` } -// GlusterfsPersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the GlusterfsPersistentVolumeSource type for use with +// GlusterfsPersistentVolumeSourceApplyConfiguration constructs a declarative configuration of the GlusterfsPersistentVolumeSource type for use with // apply. func GlusterfsPersistentVolumeSource() *GlusterfsPersistentVolumeSourceApplyConfiguration { return &GlusterfsPersistentVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/glusterfsvolumesource.go b/applyconfigurations/core/v1/glusterfsvolumesource.go index 7ce6f0b399..8c27f8c70d 100644 --- a/applyconfigurations/core/v1/glusterfsvolumesource.go +++ b/applyconfigurations/core/v1/glusterfsvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// GlusterfsVolumeSourceApplyConfiguration represents an declarative configuration of the GlusterfsVolumeSource type for use +// GlusterfsVolumeSourceApplyConfiguration represents a declarative configuration of the GlusterfsVolumeSource type for use // with apply. type GlusterfsVolumeSourceApplyConfiguration struct { EndpointsName *string `json:"endpoints,omitempty"` @@ -26,7 +26,7 @@ type GlusterfsVolumeSourceApplyConfiguration struct { ReadOnly *bool `json:"readOnly,omitempty"` } -// GlusterfsVolumeSourceApplyConfiguration constructs an declarative configuration of the GlusterfsVolumeSource type for use with +// GlusterfsVolumeSourceApplyConfiguration constructs a declarative configuration of the GlusterfsVolumeSource type for use with // apply. func GlusterfsVolumeSource() *GlusterfsVolumeSourceApplyConfiguration { return &GlusterfsVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/grpcaction.go b/applyconfigurations/core/v1/grpcaction.go index f94e55937a..0f3a886714 100644 --- a/applyconfigurations/core/v1/grpcaction.go +++ b/applyconfigurations/core/v1/grpcaction.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// GRPCActionApplyConfiguration represents an declarative configuration of the GRPCAction type for use +// GRPCActionApplyConfiguration represents a declarative configuration of the GRPCAction type for use // with apply. type GRPCActionApplyConfiguration struct { Port *int32 `json:"port,omitempty"` Service *string `json:"service,omitempty"` } -// GRPCActionApplyConfiguration constructs an declarative configuration of the GRPCAction type for use with +// GRPCActionApplyConfiguration constructs a declarative configuration of the GRPCAction type for use with // apply. func GRPCAction() *GRPCActionApplyConfiguration { return &GRPCActionApplyConfiguration{} diff --git a/applyconfigurations/core/v1/hostalias.go b/applyconfigurations/core/v1/hostalias.go index 861508ef53..ec9ea17413 100644 --- a/applyconfigurations/core/v1/hostalias.go +++ b/applyconfigurations/core/v1/hostalias.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// HostAliasApplyConfiguration represents an declarative configuration of the HostAlias type for use +// HostAliasApplyConfiguration represents a declarative configuration of the HostAlias type for use // with apply. type HostAliasApplyConfiguration struct { IP *string `json:"ip,omitempty"` Hostnames []string `json:"hostnames,omitempty"` } -// HostAliasApplyConfiguration constructs an declarative configuration of the HostAlias type for use with +// HostAliasApplyConfiguration constructs a declarative configuration of the HostAlias type for use with // apply. func HostAlias() *HostAliasApplyConfiguration { return &HostAliasApplyConfiguration{} diff --git a/applyconfigurations/core/v1/hostip.go b/applyconfigurations/core/v1/hostip.go index c2a42cf747..439b5ce2d6 100644 --- a/applyconfigurations/core/v1/hostip.go +++ b/applyconfigurations/core/v1/hostip.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// HostIPApplyConfiguration represents an declarative configuration of the HostIP type for use +// HostIPApplyConfiguration represents a declarative configuration of the HostIP type for use // with apply. type HostIPApplyConfiguration struct { IP *string `json:"ip,omitempty"` } -// HostIPApplyConfiguration constructs an declarative configuration of the HostIP type for use with +// HostIPApplyConfiguration constructs a declarative configuration of the HostIP type for use with // apply. func HostIP() *HostIPApplyConfiguration { return &HostIPApplyConfiguration{} diff --git a/applyconfigurations/core/v1/hostpathvolumesource.go b/applyconfigurations/core/v1/hostpathvolumesource.go index 8b15689eef..10dfedfdef 100644 --- a/applyconfigurations/core/v1/hostpathvolumesource.go +++ b/applyconfigurations/core/v1/hostpathvolumesource.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// HostPathVolumeSourceApplyConfiguration represents an declarative configuration of the HostPathVolumeSource type for use +// HostPathVolumeSourceApplyConfiguration represents a declarative configuration of the HostPathVolumeSource type for use // with apply. type HostPathVolumeSourceApplyConfiguration struct { Path *string `json:"path,omitempty"` Type *v1.HostPathType `json:"type,omitempty"` } -// HostPathVolumeSourceApplyConfiguration constructs an declarative configuration of the HostPathVolumeSource type for use with +// HostPathVolumeSourceApplyConfiguration constructs a declarative configuration of the HostPathVolumeSource type for use with // apply. func HostPathVolumeSource() *HostPathVolumeSourceApplyConfiguration { return &HostPathVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/httpgetaction.go b/applyconfigurations/core/v1/httpgetaction.go index e4ecdd4303..5ecbc27fea 100644 --- a/applyconfigurations/core/v1/httpgetaction.go +++ b/applyconfigurations/core/v1/httpgetaction.go @@ -23,7 +23,7 @@ import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) -// HTTPGetActionApplyConfiguration represents an declarative configuration of the HTTPGetAction type for use +// HTTPGetActionApplyConfiguration represents a declarative configuration of the HTTPGetAction type for use // with apply. type HTTPGetActionApplyConfiguration struct { Path *string `json:"path,omitempty"` @@ -33,7 +33,7 @@ type HTTPGetActionApplyConfiguration struct { HTTPHeaders []HTTPHeaderApplyConfiguration `json:"httpHeaders,omitempty"` } -// HTTPGetActionApplyConfiguration constructs an declarative configuration of the HTTPGetAction type for use with +// HTTPGetActionApplyConfiguration constructs a declarative configuration of the HTTPGetAction type for use with // apply. func HTTPGetAction() *HTTPGetActionApplyConfiguration { return &HTTPGetActionApplyConfiguration{} diff --git a/applyconfigurations/core/v1/httpheader.go b/applyconfigurations/core/v1/httpheader.go index d55f36bfd2..2526371669 100644 --- a/applyconfigurations/core/v1/httpheader.go +++ b/applyconfigurations/core/v1/httpheader.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// HTTPHeaderApplyConfiguration represents an declarative configuration of the HTTPHeader type for use +// HTTPHeaderApplyConfiguration represents a declarative configuration of the HTTPHeader type for use // with apply. type HTTPHeaderApplyConfiguration struct { Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` } -// HTTPHeaderApplyConfiguration constructs an declarative configuration of the HTTPHeader type for use with +// HTTPHeaderApplyConfiguration constructs a declarative configuration of the HTTPHeader type for use with // apply. func HTTPHeader() *HTTPHeaderApplyConfiguration { return &HTTPHeaderApplyConfiguration{} diff --git a/applyconfigurations/core/v1/iscsipersistentvolumesource.go b/applyconfigurations/core/v1/iscsipersistentvolumesource.go index c7b248181a..42f420c568 100644 --- a/applyconfigurations/core/v1/iscsipersistentvolumesource.go +++ b/applyconfigurations/core/v1/iscsipersistentvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// ISCSIPersistentVolumeSourceApplyConfiguration represents an declarative configuration of the ISCSIPersistentVolumeSource type for use +// ISCSIPersistentVolumeSourceApplyConfiguration represents a declarative configuration of the ISCSIPersistentVolumeSource type for use // with apply. type ISCSIPersistentVolumeSourceApplyConfiguration struct { TargetPortal *string `json:"targetPortal,omitempty"` @@ -34,7 +34,7 @@ type ISCSIPersistentVolumeSourceApplyConfiguration struct { InitiatorName *string `json:"initiatorName,omitempty"` } -// ISCSIPersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the ISCSIPersistentVolumeSource type for use with +// ISCSIPersistentVolumeSourceApplyConfiguration constructs a declarative configuration of the ISCSIPersistentVolumeSource type for use with // apply. func ISCSIPersistentVolumeSource() *ISCSIPersistentVolumeSourceApplyConfiguration { return &ISCSIPersistentVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/iscsivolumesource.go b/applyconfigurations/core/v1/iscsivolumesource.go index c95941a9c7..61055434bc 100644 --- a/applyconfigurations/core/v1/iscsivolumesource.go +++ b/applyconfigurations/core/v1/iscsivolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// ISCSIVolumeSourceApplyConfiguration represents an declarative configuration of the ISCSIVolumeSource type for use +// ISCSIVolumeSourceApplyConfiguration represents a declarative configuration of the ISCSIVolumeSource type for use // with apply. type ISCSIVolumeSourceApplyConfiguration struct { TargetPortal *string `json:"targetPortal,omitempty"` @@ -34,7 +34,7 @@ type ISCSIVolumeSourceApplyConfiguration struct { InitiatorName *string `json:"initiatorName,omitempty"` } -// ISCSIVolumeSourceApplyConfiguration constructs an declarative configuration of the ISCSIVolumeSource type for use with +// ISCSIVolumeSourceApplyConfiguration constructs a declarative configuration of the ISCSIVolumeSource type for use with // apply. func ISCSIVolumeSource() *ISCSIVolumeSourceApplyConfiguration { return &ISCSIVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/keytopath.go b/applyconfigurations/core/v1/keytopath.go index d58676d34c..c961b07955 100644 --- a/applyconfigurations/core/v1/keytopath.go +++ b/applyconfigurations/core/v1/keytopath.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// KeyToPathApplyConfiguration represents an declarative configuration of the KeyToPath type for use +// KeyToPathApplyConfiguration represents a declarative configuration of the KeyToPath type for use // with apply. type KeyToPathApplyConfiguration struct { Key *string `json:"key,omitempty"` @@ -26,7 +26,7 @@ type KeyToPathApplyConfiguration struct { Mode *int32 `json:"mode,omitempty"` } -// KeyToPathApplyConfiguration constructs an declarative configuration of the KeyToPath type for use with +// KeyToPathApplyConfiguration constructs a declarative configuration of the KeyToPath type for use with // apply. func KeyToPath() *KeyToPathApplyConfiguration { return &KeyToPathApplyConfiguration{} diff --git a/applyconfigurations/core/v1/lifecycle.go b/applyconfigurations/core/v1/lifecycle.go index db9abf8af7..e37a30f597 100644 --- a/applyconfigurations/core/v1/lifecycle.go +++ b/applyconfigurations/core/v1/lifecycle.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// LifecycleApplyConfiguration represents an declarative configuration of the Lifecycle type for use +// LifecycleApplyConfiguration represents a declarative configuration of the Lifecycle type for use // with apply. type LifecycleApplyConfiguration struct { PostStart *LifecycleHandlerApplyConfiguration `json:"postStart,omitempty"` PreStop *LifecycleHandlerApplyConfiguration `json:"preStop,omitempty"` } -// LifecycleApplyConfiguration constructs an declarative configuration of the Lifecycle type for use with +// LifecycleApplyConfiguration constructs a declarative configuration of the Lifecycle type for use with // apply. func Lifecycle() *LifecycleApplyConfiguration { return &LifecycleApplyConfiguration{} diff --git a/applyconfigurations/core/v1/lifecyclehandler.go b/applyconfigurations/core/v1/lifecyclehandler.go index e4ae9c49f7..b7c706d58d 100644 --- a/applyconfigurations/core/v1/lifecyclehandler.go +++ b/applyconfigurations/core/v1/lifecyclehandler.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// LifecycleHandlerApplyConfiguration represents an declarative configuration of the LifecycleHandler type for use +// LifecycleHandlerApplyConfiguration represents a declarative configuration of the LifecycleHandler type for use // with apply. type LifecycleHandlerApplyConfiguration struct { Exec *ExecActionApplyConfiguration `json:"exec,omitempty"` @@ -27,7 +27,7 @@ type LifecycleHandlerApplyConfiguration struct { Sleep *SleepActionApplyConfiguration `json:"sleep,omitempty"` } -// LifecycleHandlerApplyConfiguration constructs an declarative configuration of the LifecycleHandler type for use with +// LifecycleHandlerApplyConfiguration constructs a declarative configuration of the LifecycleHandler type for use with // apply. func LifecycleHandler() *LifecycleHandlerApplyConfiguration { return &LifecycleHandlerApplyConfiguration{} diff --git a/applyconfigurations/core/v1/limitrange.go b/applyconfigurations/core/v1/limitrange.go index 70362d3e96..7770200a0a 100644 --- a/applyconfigurations/core/v1/limitrange.go +++ b/applyconfigurations/core/v1/limitrange.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// LimitRangeApplyConfiguration represents an declarative configuration of the LimitRange type for use +// LimitRangeApplyConfiguration represents a declarative configuration of the LimitRange type for use // with apply. type LimitRangeApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type LimitRangeApplyConfiguration struct { Spec *LimitRangeSpecApplyConfiguration `json:"spec,omitempty"` } -// LimitRange constructs an declarative configuration of the LimitRange type for use with +// LimitRange constructs a declarative configuration of the LimitRange type for use with // apply. func LimitRange(name, namespace string) *LimitRangeApplyConfiguration { b := &LimitRangeApplyConfiguration{} diff --git a/applyconfigurations/core/v1/limitrangeitem.go b/applyconfigurations/core/v1/limitrangeitem.go index 084650fdaa..61d8344e80 100644 --- a/applyconfigurations/core/v1/limitrangeitem.go +++ b/applyconfigurations/core/v1/limitrangeitem.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// LimitRangeItemApplyConfiguration represents an declarative configuration of the LimitRangeItem type for use +// LimitRangeItemApplyConfiguration represents a declarative configuration of the LimitRangeItem type for use // with apply. type LimitRangeItemApplyConfiguration struct { Type *v1.LimitType `json:"type,omitempty"` @@ -33,7 +33,7 @@ type LimitRangeItemApplyConfiguration struct { MaxLimitRequestRatio *v1.ResourceList `json:"maxLimitRequestRatio,omitempty"` } -// LimitRangeItemApplyConfiguration constructs an declarative configuration of the LimitRangeItem type for use with +// LimitRangeItemApplyConfiguration constructs a declarative configuration of the LimitRangeItem type for use with // apply. func LimitRangeItem() *LimitRangeItemApplyConfiguration { return &LimitRangeItemApplyConfiguration{} diff --git a/applyconfigurations/core/v1/limitrangespec.go b/applyconfigurations/core/v1/limitrangespec.go index 5eee5c498e..8d69c1c0cd 100644 --- a/applyconfigurations/core/v1/limitrangespec.go +++ b/applyconfigurations/core/v1/limitrangespec.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// LimitRangeSpecApplyConfiguration represents an declarative configuration of the LimitRangeSpec type for use +// LimitRangeSpecApplyConfiguration represents a declarative configuration of the LimitRangeSpec type for use // with apply. type LimitRangeSpecApplyConfiguration struct { Limits []LimitRangeItemApplyConfiguration `json:"limits,omitempty"` } -// LimitRangeSpecApplyConfiguration constructs an declarative configuration of the LimitRangeSpec type for use with +// LimitRangeSpecApplyConfiguration constructs a declarative configuration of the LimitRangeSpec type for use with // apply. func LimitRangeSpec() *LimitRangeSpecApplyConfiguration { return &LimitRangeSpecApplyConfiguration{} diff --git a/applyconfigurations/core/v1/linuxcontaineruser.go b/applyconfigurations/core/v1/linuxcontaineruser.go index fdafd78e11..fbab4815ab 100644 --- a/applyconfigurations/core/v1/linuxcontaineruser.go +++ b/applyconfigurations/core/v1/linuxcontaineruser.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// LinuxContainerUserApplyConfiguration represents an declarative configuration of the LinuxContainerUser type for use +// LinuxContainerUserApplyConfiguration represents a declarative configuration of the LinuxContainerUser type for use // with apply. type LinuxContainerUserApplyConfiguration struct { UID *int64 `json:"uid,omitempty"` @@ -26,7 +26,7 @@ type LinuxContainerUserApplyConfiguration struct { SupplementalGroups []int64 `json:"supplementalGroups,omitempty"` } -// LinuxContainerUserApplyConfiguration constructs an declarative configuration of the LinuxContainerUser type for use with +// LinuxContainerUserApplyConfiguration constructs a declarative configuration of the LinuxContainerUser type for use with // apply. func LinuxContainerUser() *LinuxContainerUserApplyConfiguration { return &LinuxContainerUserApplyConfiguration{} diff --git a/applyconfigurations/core/v1/loadbalanceringress.go b/applyconfigurations/core/v1/loadbalanceringress.go index a48dac6810..1a7d998152 100644 --- a/applyconfigurations/core/v1/loadbalanceringress.go +++ b/applyconfigurations/core/v1/loadbalanceringress.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// LoadBalancerIngressApplyConfiguration represents an declarative configuration of the LoadBalancerIngress type for use +// LoadBalancerIngressApplyConfiguration represents a declarative configuration of the LoadBalancerIngress type for use // with apply. type LoadBalancerIngressApplyConfiguration struct { IP *string `json:"ip,omitempty"` @@ -31,7 +31,7 @@ type LoadBalancerIngressApplyConfiguration struct { Ports []PortStatusApplyConfiguration `json:"ports,omitempty"` } -// LoadBalancerIngressApplyConfiguration constructs an declarative configuration of the LoadBalancerIngress type for use with +// LoadBalancerIngressApplyConfiguration constructs a declarative configuration of the LoadBalancerIngress type for use with // apply. func LoadBalancerIngress() *LoadBalancerIngressApplyConfiguration { return &LoadBalancerIngressApplyConfiguration{} diff --git a/applyconfigurations/core/v1/loadbalancerstatus.go b/applyconfigurations/core/v1/loadbalancerstatus.go index 2fcc0cad18..bb3d616c15 100644 --- a/applyconfigurations/core/v1/loadbalancerstatus.go +++ b/applyconfigurations/core/v1/loadbalancerstatus.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// 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 { Ingress []LoadBalancerIngressApplyConfiguration `json:"ingress,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/applyconfigurations/core/v1/localobjectreference.go b/applyconfigurations/core/v1/localobjectreference.go index 7662e32b31..c55d6803dc 100644 --- a/applyconfigurations/core/v1/localobjectreference.go +++ b/applyconfigurations/core/v1/localobjectreference.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// LocalObjectReferenceApplyConfiguration represents an declarative configuration of the LocalObjectReference type for use +// LocalObjectReferenceApplyConfiguration represents a declarative configuration of the LocalObjectReference type for use // with apply. type LocalObjectReferenceApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// LocalObjectReferenceApplyConfiguration constructs an declarative configuration of the LocalObjectReference type for use with +// LocalObjectReferenceApplyConfiguration constructs a declarative configuration of the LocalObjectReference type for use with // apply. func LocalObjectReference() *LocalObjectReferenceApplyConfiguration { return &LocalObjectReferenceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/localvolumesource.go b/applyconfigurations/core/v1/localvolumesource.go index 5d289bd12d..db711d9934 100644 --- a/applyconfigurations/core/v1/localvolumesource.go +++ b/applyconfigurations/core/v1/localvolumesource.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// LocalVolumeSourceApplyConfiguration represents an declarative configuration of the LocalVolumeSource type for use +// LocalVolumeSourceApplyConfiguration represents a declarative configuration of the LocalVolumeSource type for use // with apply. type LocalVolumeSourceApplyConfiguration struct { Path *string `json:"path,omitempty"` FSType *string `json:"fsType,omitempty"` } -// LocalVolumeSourceApplyConfiguration constructs an declarative configuration of the LocalVolumeSource type for use with +// LocalVolumeSourceApplyConfiguration constructs a declarative configuration of the LocalVolumeSource type for use with // apply. func LocalVolumeSource() *LocalVolumeSourceApplyConfiguration { return &LocalVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/modifyvolumestatus.go b/applyconfigurations/core/v1/modifyvolumestatus.go index 4ff1d040cf..704c321652 100644 --- a/applyconfigurations/core/v1/modifyvolumestatus.go +++ b/applyconfigurations/core/v1/modifyvolumestatus.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// ModifyVolumeStatusApplyConfiguration represents an declarative configuration of the ModifyVolumeStatus type for use +// ModifyVolumeStatusApplyConfiguration represents a declarative configuration of the ModifyVolumeStatus type for use // with apply. type ModifyVolumeStatusApplyConfiguration struct { TargetVolumeAttributesClassName *string `json:"targetVolumeAttributesClassName,omitempty"` Status *v1.PersistentVolumeClaimModifyVolumeStatus `json:"status,omitempty"` } -// ModifyVolumeStatusApplyConfiguration constructs an declarative configuration of the ModifyVolumeStatus type for use with +// ModifyVolumeStatusApplyConfiguration constructs a declarative configuration of the ModifyVolumeStatus type for use with // apply. func ModifyVolumeStatus() *ModifyVolumeStatusApplyConfiguration { return &ModifyVolumeStatusApplyConfiguration{} diff --git a/applyconfigurations/core/v1/namespace.go b/applyconfigurations/core/v1/namespace.go index ca3701a081..0b77af183d 100644 --- a/applyconfigurations/core/v1/namespace.go +++ b/applyconfigurations/core/v1/namespace.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// NamespaceApplyConfiguration represents an declarative configuration of the Namespace type for use +// NamespaceApplyConfiguration represents a declarative configuration of the Namespace type for use // with apply. type NamespaceApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type NamespaceApplyConfiguration struct { Status *NamespaceStatusApplyConfiguration `json:"status,omitempty"` } -// Namespace constructs an declarative configuration of the Namespace type for use with +// Namespace constructs a declarative configuration of the Namespace type for use with // apply. func Namespace(name string) *NamespaceApplyConfiguration { b := &NamespaceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/namespacecondition.go b/applyconfigurations/core/v1/namespacecondition.go index 8651978b0f..9784c3e6f4 100644 --- a/applyconfigurations/core/v1/namespacecondition.go +++ b/applyconfigurations/core/v1/namespacecondition.go @@ -23,7 +23,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// NamespaceConditionApplyConfiguration represents an declarative configuration of the NamespaceCondition type for use +// NamespaceConditionApplyConfiguration represents a declarative configuration of the NamespaceCondition type for use // with apply. type NamespaceConditionApplyConfiguration struct { Type *v1.NamespaceConditionType `json:"type,omitempty"` @@ -33,7 +33,7 @@ type NamespaceConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// NamespaceConditionApplyConfiguration constructs an declarative configuration of the NamespaceCondition type for use with +// NamespaceConditionApplyConfiguration constructs a declarative configuration of the NamespaceCondition type for use with // apply. func NamespaceCondition() *NamespaceConditionApplyConfiguration { return &NamespaceConditionApplyConfiguration{} diff --git a/applyconfigurations/core/v1/namespacespec.go b/applyconfigurations/core/v1/namespacespec.go index 9bc02d1fa2..6d7b7f1f95 100644 --- a/applyconfigurations/core/v1/namespacespec.go +++ b/applyconfigurations/core/v1/namespacespec.go @@ -22,13 +22,13 @@ import ( v1 "k8s.io/api/core/v1" ) -// NamespaceSpecApplyConfiguration represents an declarative configuration of the NamespaceSpec type for use +// NamespaceSpecApplyConfiguration represents a declarative configuration of the NamespaceSpec type for use // with apply. type NamespaceSpecApplyConfiguration struct { Finalizers []v1.FinalizerName `json:"finalizers,omitempty"` } -// NamespaceSpecApplyConfiguration constructs an declarative configuration of the NamespaceSpec type for use with +// NamespaceSpecApplyConfiguration constructs a declarative configuration of the NamespaceSpec type for use with // apply. func NamespaceSpec() *NamespaceSpecApplyConfiguration { return &NamespaceSpecApplyConfiguration{} diff --git a/applyconfigurations/core/v1/namespacestatus.go b/applyconfigurations/core/v1/namespacestatus.go index d950fd3161..314908109f 100644 --- a/applyconfigurations/core/v1/namespacestatus.go +++ b/applyconfigurations/core/v1/namespacestatus.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// NamespaceStatusApplyConfiguration represents an declarative configuration of the NamespaceStatus type for use +// NamespaceStatusApplyConfiguration represents a declarative configuration of the NamespaceStatus type for use // with apply. type NamespaceStatusApplyConfiguration struct { Phase *v1.NamespacePhase `json:"phase,omitempty"` Conditions []NamespaceConditionApplyConfiguration `json:"conditions,omitempty"` } -// NamespaceStatusApplyConfiguration constructs an declarative configuration of the NamespaceStatus type for use with +// NamespaceStatusApplyConfiguration constructs a declarative configuration of the NamespaceStatus type for use with // apply. func NamespaceStatus() *NamespaceStatusApplyConfiguration { return &NamespaceStatusApplyConfiguration{} diff --git a/applyconfigurations/core/v1/nfsvolumesource.go b/applyconfigurations/core/v1/nfsvolumesource.go index cb300ee81e..ed49a87a9e 100644 --- a/applyconfigurations/core/v1/nfsvolumesource.go +++ b/applyconfigurations/core/v1/nfsvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// NFSVolumeSourceApplyConfiguration represents an declarative configuration of the NFSVolumeSource type for use +// NFSVolumeSourceApplyConfiguration represents a declarative configuration of the NFSVolumeSource type for use // with apply. type NFSVolumeSourceApplyConfiguration struct { Server *string `json:"server,omitempty"` @@ -26,7 +26,7 @@ type NFSVolumeSourceApplyConfiguration struct { ReadOnly *bool `json:"readOnly,omitempty"` } -// NFSVolumeSourceApplyConfiguration constructs an declarative configuration of the NFSVolumeSource type for use with +// NFSVolumeSourceApplyConfiguration constructs a declarative configuration of the NFSVolumeSource type for use with // apply. func NFSVolumeSource() *NFSVolumeSourceApplyConfiguration { return &NFSVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/node.go b/applyconfigurations/core/v1/node.go index 59109da0dd..ef13392591 100644 --- a/applyconfigurations/core/v1/node.go +++ b/applyconfigurations/core/v1/node.go @@ -27,7 +27,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"` @@ -36,7 +36,7 @@ type NodeApplyConfiguration struct { Status *NodeStatusApplyConfiguration `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{} diff --git a/applyconfigurations/core/v1/nodeaddress.go b/applyconfigurations/core/v1/nodeaddress.go index a1d4fbe04e..a9cb036c54 100644 --- a/applyconfigurations/core/v1/nodeaddress.go +++ b/applyconfigurations/core/v1/nodeaddress.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// NodeAddressApplyConfiguration represents an declarative configuration of the NodeAddress type for use +// NodeAddressApplyConfiguration represents a declarative configuration of the NodeAddress type for use // with apply. type NodeAddressApplyConfiguration struct { Type *v1.NodeAddressType `json:"type,omitempty"` Address *string `json:"address,omitempty"` } -// NodeAddressApplyConfiguration constructs an declarative configuration of the NodeAddress type for use with +// NodeAddressApplyConfiguration constructs a declarative configuration of the NodeAddress type for use with // apply. func NodeAddress() *NodeAddressApplyConfiguration { return &NodeAddressApplyConfiguration{} diff --git a/applyconfigurations/core/v1/nodeaffinity.go b/applyconfigurations/core/v1/nodeaffinity.go index e28ced6e46..5d11d746dc 100644 --- a/applyconfigurations/core/v1/nodeaffinity.go +++ b/applyconfigurations/core/v1/nodeaffinity.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// 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"` PreferredDuringSchedulingIgnoredDuringExecution []PreferredSchedulingTermApplyConfiguration `json:"preferredDuringSchedulingIgnoredDuringExecution,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/applyconfigurations/core/v1/nodecondition.go b/applyconfigurations/core/v1/nodecondition.go index eb81ca543f..a1b8ed0f38 100644 --- a/applyconfigurations/core/v1/nodecondition.go +++ b/applyconfigurations/core/v1/nodecondition.go @@ -23,7 +23,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// NodeConditionApplyConfiguration represents an declarative configuration of the NodeCondition type for use +// NodeConditionApplyConfiguration represents a declarative configuration of the NodeCondition type for use // with apply. type NodeConditionApplyConfiguration struct { Type *v1.NodeConditionType `json:"type,omitempty"` @@ -34,7 +34,7 @@ type NodeConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// NodeConditionApplyConfiguration constructs an declarative configuration of the NodeCondition type for use with +// NodeConditionApplyConfiguration constructs a declarative configuration of the NodeCondition type for use with // apply. func NodeCondition() *NodeConditionApplyConfiguration { return &NodeConditionApplyConfiguration{} diff --git a/applyconfigurations/core/v1/nodeconfigsource.go b/applyconfigurations/core/v1/nodeconfigsource.go index 60567aa431..00a671fc0c 100644 --- a/applyconfigurations/core/v1/nodeconfigsource.go +++ b/applyconfigurations/core/v1/nodeconfigsource.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// NodeConfigSourceApplyConfiguration represents an declarative configuration of the NodeConfigSource type for use +// NodeConfigSourceApplyConfiguration represents a declarative configuration of the NodeConfigSource type for use // with apply. type NodeConfigSourceApplyConfiguration struct { ConfigMap *ConfigMapNodeConfigSourceApplyConfiguration `json:"configMap,omitempty"` } -// NodeConfigSourceApplyConfiguration constructs an declarative configuration of the NodeConfigSource type for use with +// NodeConfigSourceApplyConfiguration constructs a declarative configuration of the NodeConfigSource type for use with // apply. func NodeConfigSource() *NodeConfigSourceApplyConfiguration { return &NodeConfigSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/nodeconfigstatus.go b/applyconfigurations/core/v1/nodeconfigstatus.go index 71447fe9c0..d5ccc45c6a 100644 --- a/applyconfigurations/core/v1/nodeconfigstatus.go +++ b/applyconfigurations/core/v1/nodeconfigstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// NodeConfigStatusApplyConfiguration represents an declarative configuration of the NodeConfigStatus type for use +// NodeConfigStatusApplyConfiguration represents a declarative configuration of the NodeConfigStatus type for use // with apply. type NodeConfigStatusApplyConfiguration struct { Assigned *NodeConfigSourceApplyConfiguration `json:"assigned,omitempty"` @@ -27,7 +27,7 @@ type NodeConfigStatusApplyConfiguration struct { Error *string `json:"error,omitempty"` } -// NodeConfigStatusApplyConfiguration constructs an declarative configuration of the NodeConfigStatus type for use with +// NodeConfigStatusApplyConfiguration constructs a declarative configuration of the NodeConfigStatus type for use with // apply. func NodeConfigStatus() *NodeConfigStatusApplyConfiguration { return &NodeConfigStatusApplyConfiguration{} diff --git a/applyconfigurations/core/v1/nodedaemonendpoints.go b/applyconfigurations/core/v1/nodedaemonendpoints.go index 4cabc7f526..11228b3691 100644 --- a/applyconfigurations/core/v1/nodedaemonendpoints.go +++ b/applyconfigurations/core/v1/nodedaemonendpoints.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// NodeDaemonEndpointsApplyConfiguration represents an declarative configuration of the NodeDaemonEndpoints type for use +// NodeDaemonEndpointsApplyConfiguration represents a declarative configuration of the NodeDaemonEndpoints type for use // with apply. type NodeDaemonEndpointsApplyConfiguration struct { KubeletEndpoint *DaemonEndpointApplyConfiguration `json:"kubeletEndpoint,omitempty"` } -// NodeDaemonEndpointsApplyConfiguration constructs an declarative configuration of the NodeDaemonEndpoints type for use with +// NodeDaemonEndpointsApplyConfiguration constructs a declarative configuration of the NodeDaemonEndpoints type for use with // apply. func NodeDaemonEndpoints() *NodeDaemonEndpointsApplyConfiguration { return &NodeDaemonEndpointsApplyConfiguration{} diff --git a/applyconfigurations/core/v1/noderuntimehandler.go b/applyconfigurations/core/v1/noderuntimehandler.go index 9ada0a18ef..c7c664974e 100644 --- a/applyconfigurations/core/v1/noderuntimehandler.go +++ b/applyconfigurations/core/v1/noderuntimehandler.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// NodeRuntimeHandlerApplyConfiguration represents an declarative configuration of the NodeRuntimeHandler type for use +// NodeRuntimeHandlerApplyConfiguration represents a declarative configuration of the NodeRuntimeHandler type for use // with apply. type NodeRuntimeHandlerApplyConfiguration struct { Name *string `json:"name,omitempty"` Features *NodeRuntimeHandlerFeaturesApplyConfiguration `json:"features,omitempty"` } -// NodeRuntimeHandlerApplyConfiguration constructs an declarative configuration of the NodeRuntimeHandler type for use with +// NodeRuntimeHandlerApplyConfiguration constructs a declarative configuration of the NodeRuntimeHandler type for use with // apply. func NodeRuntimeHandler() *NodeRuntimeHandlerApplyConfiguration { return &NodeRuntimeHandlerApplyConfiguration{} diff --git a/applyconfigurations/core/v1/noderuntimehandlerfeatures.go b/applyconfigurations/core/v1/noderuntimehandlerfeatures.go index a3e3a52e88..d6273ceb1b 100644 --- a/applyconfigurations/core/v1/noderuntimehandlerfeatures.go +++ b/applyconfigurations/core/v1/noderuntimehandlerfeatures.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// NodeRuntimeHandlerFeaturesApplyConfiguration represents an declarative configuration of the NodeRuntimeHandlerFeatures type for use +// NodeRuntimeHandlerFeaturesApplyConfiguration represents a declarative configuration of the NodeRuntimeHandlerFeatures type for use // with apply. type NodeRuntimeHandlerFeaturesApplyConfiguration struct { RecursiveReadOnlyMounts *bool `json:"recursiveReadOnlyMounts,omitempty"` } -// NodeRuntimeHandlerFeaturesApplyConfiguration constructs an declarative configuration of the NodeRuntimeHandlerFeatures type for use with +// NodeRuntimeHandlerFeaturesApplyConfiguration constructs a declarative configuration of the NodeRuntimeHandlerFeatures type for use with // apply. func NodeRuntimeHandlerFeatures() *NodeRuntimeHandlerFeaturesApplyConfiguration { return &NodeRuntimeHandlerFeaturesApplyConfiguration{} diff --git a/applyconfigurations/core/v1/nodeselector.go b/applyconfigurations/core/v1/nodeselector.go index 5489097f5a..6eab109795 100644 --- a/applyconfigurations/core/v1/nodeselector.go +++ b/applyconfigurations/core/v1/nodeselector.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// 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/applyconfigurations/core/v1/nodeselectorrequirement.go b/applyconfigurations/core/v1/nodeselectorrequirement.go index a6e43e607e..7c383e06c2 100644 --- a/applyconfigurations/core/v1/nodeselectorrequirement.go +++ b/applyconfigurations/core/v1/nodeselectorrequirement.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// 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"` @@ -30,7 +30,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/applyconfigurations/core/v1/nodeselectorterm.go b/applyconfigurations/core/v1/nodeselectorterm.go index 13b3ddbc1b..9d0d780f3e 100644 --- a/applyconfigurations/core/v1/nodeselectorterm.go +++ b/applyconfigurations/core/v1/nodeselectorterm.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// 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/applyconfigurations/core/v1/nodespec.go b/applyconfigurations/core/v1/nodespec.go index 63b61078d0..8ac3497127 100644 --- a/applyconfigurations/core/v1/nodespec.go +++ b/applyconfigurations/core/v1/nodespec.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// NodeSpecApplyConfiguration represents an declarative configuration of the NodeSpec type for use +// NodeSpecApplyConfiguration represents a declarative configuration of the NodeSpec type for use // with apply. type NodeSpecApplyConfiguration struct { PodCIDR *string `json:"podCIDR,omitempty"` @@ -30,7 +30,7 @@ type NodeSpecApplyConfiguration struct { DoNotUseExternalID *string `json:"externalID,omitempty"` } -// NodeSpecApplyConfiguration constructs an declarative configuration of the NodeSpec type for use with +// NodeSpecApplyConfiguration constructs a declarative configuration of the NodeSpec type for use with // apply. func NodeSpec() *NodeSpecApplyConfiguration { return &NodeSpecApplyConfiguration{} diff --git a/applyconfigurations/core/v1/nodestatus.go b/applyconfigurations/core/v1/nodestatus.go index a4a30a2685..43dea7e576 100644 --- a/applyconfigurations/core/v1/nodestatus.go +++ b/applyconfigurations/core/v1/nodestatus.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// NodeStatusApplyConfiguration represents an declarative configuration of the NodeStatus type for use +// NodeStatusApplyConfiguration represents a declarative configuration of the NodeStatus type for use // with apply. type NodeStatusApplyConfiguration struct { Capacity *v1.ResourceList `json:"capacity,omitempty"` @@ -39,7 +39,7 @@ type NodeStatusApplyConfiguration struct { RuntimeHandlers []NodeRuntimeHandlerApplyConfiguration `json:"runtimeHandlers,omitempty"` } -// NodeStatusApplyConfiguration constructs an declarative configuration of the NodeStatus type for use with +// NodeStatusApplyConfiguration constructs a declarative configuration of the NodeStatus type for use with // apply. func NodeStatus() *NodeStatusApplyConfiguration { return &NodeStatusApplyConfiguration{} diff --git a/applyconfigurations/core/v1/nodesysteminfo.go b/applyconfigurations/core/v1/nodesysteminfo.go index 2634ea9842..11ac50713c 100644 --- a/applyconfigurations/core/v1/nodesysteminfo.go +++ b/applyconfigurations/core/v1/nodesysteminfo.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// NodeSystemInfoApplyConfiguration represents an declarative configuration of the NodeSystemInfo type for use +// NodeSystemInfoApplyConfiguration represents a declarative configuration of the NodeSystemInfo type for use // with apply. type NodeSystemInfoApplyConfiguration struct { MachineID *string `json:"machineID,omitempty"` @@ -33,7 +33,7 @@ type NodeSystemInfoApplyConfiguration struct { Architecture *string `json:"architecture,omitempty"` } -// NodeSystemInfoApplyConfiguration constructs an declarative configuration of the NodeSystemInfo type for use with +// NodeSystemInfoApplyConfiguration constructs a declarative configuration of the NodeSystemInfo type for use with // apply. func NodeSystemInfo() *NodeSystemInfoApplyConfiguration { return &NodeSystemInfoApplyConfiguration{} diff --git a/applyconfigurations/core/v1/objectfieldselector.go b/applyconfigurations/core/v1/objectfieldselector.go index 0c2402b3c7..c129c998b1 100644 --- a/applyconfigurations/core/v1/objectfieldselector.go +++ b/applyconfigurations/core/v1/objectfieldselector.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// ObjectFieldSelectorApplyConfiguration represents an declarative configuration of the ObjectFieldSelector type for use +// ObjectFieldSelectorApplyConfiguration represents a declarative configuration of the ObjectFieldSelector type for use // with apply. type ObjectFieldSelectorApplyConfiguration struct { APIVersion *string `json:"apiVersion,omitempty"` FieldPath *string `json:"fieldPath,omitempty"` } -// ObjectFieldSelectorApplyConfiguration constructs an declarative configuration of the ObjectFieldSelector type for use with +// ObjectFieldSelectorApplyConfiguration constructs a declarative configuration of the ObjectFieldSelector type for use with // apply. func ObjectFieldSelector() *ObjectFieldSelectorApplyConfiguration { return &ObjectFieldSelectorApplyConfiguration{} diff --git a/applyconfigurations/core/v1/objectreference.go b/applyconfigurations/core/v1/objectreference.go index 667fa84a81..4cd3f226ef 100644 --- a/applyconfigurations/core/v1/objectreference.go +++ b/applyconfigurations/core/v1/objectreference.go @@ -22,7 +22,7 @@ import ( types "k8s.io/apimachinery/pkg/types" ) -// ObjectReferenceApplyConfiguration represents an declarative configuration of the ObjectReference type for use +// ObjectReferenceApplyConfiguration represents a declarative configuration of the ObjectReference type for use // with apply. type ObjectReferenceApplyConfiguration struct { Kind *string `json:"kind,omitempty"` @@ -34,7 +34,7 @@ type ObjectReferenceApplyConfiguration struct { FieldPath *string `json:"fieldPath,omitempty"` } -// ObjectReferenceApplyConfiguration constructs an declarative configuration of the ObjectReference type for use with +// ObjectReferenceApplyConfiguration constructs a declarative configuration of the ObjectReference type for use with // apply. func ObjectReference() *ObjectReferenceApplyConfiguration { return &ObjectReferenceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/persistentvolume.go b/applyconfigurations/core/v1/persistentvolume.go index 8cd01390b1..020f87411e 100644 --- a/applyconfigurations/core/v1/persistentvolume.go +++ b/applyconfigurations/core/v1/persistentvolume.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PersistentVolumeApplyConfiguration represents an declarative configuration of the PersistentVolume type for use +// PersistentVolumeApplyConfiguration represents a declarative configuration of the PersistentVolume type for use // with apply. type PersistentVolumeApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type PersistentVolumeApplyConfiguration struct { Status *PersistentVolumeStatusApplyConfiguration `json:"status,omitempty"` } -// PersistentVolume constructs an declarative configuration of the PersistentVolume type for use with +// PersistentVolume constructs a declarative configuration of the PersistentVolume type for use with // apply. func PersistentVolume(name string) *PersistentVolumeApplyConfiguration { b := &PersistentVolumeApplyConfiguration{} diff --git a/applyconfigurations/core/v1/persistentvolumeclaim.go b/applyconfigurations/core/v1/persistentvolumeclaim.go index b19ada16c7..81cf791443 100644 --- a/applyconfigurations/core/v1/persistentvolumeclaim.go +++ b/applyconfigurations/core/v1/persistentvolumeclaim.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PersistentVolumeClaimApplyConfiguration represents an declarative configuration of the PersistentVolumeClaim type for use +// PersistentVolumeClaimApplyConfiguration represents a declarative configuration of the PersistentVolumeClaim type for use // with apply. type PersistentVolumeClaimApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type PersistentVolumeClaimApplyConfiguration struct { Status *PersistentVolumeClaimStatusApplyConfiguration `json:"status,omitempty"` } -// PersistentVolumeClaim constructs an declarative configuration of the PersistentVolumeClaim type for use with +// PersistentVolumeClaim constructs a declarative configuration of the PersistentVolumeClaim type for use with // apply. func PersistentVolumeClaim(name, namespace string) *PersistentVolumeClaimApplyConfiguration { b := &PersistentVolumeClaimApplyConfiguration{} diff --git a/applyconfigurations/core/v1/persistentvolumeclaimcondition.go b/applyconfigurations/core/v1/persistentvolumeclaimcondition.go index 65449e92eb..80038c0677 100644 --- a/applyconfigurations/core/v1/persistentvolumeclaimcondition.go +++ b/applyconfigurations/core/v1/persistentvolumeclaimcondition.go @@ -23,7 +23,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// PersistentVolumeClaimConditionApplyConfiguration represents an declarative configuration of the PersistentVolumeClaimCondition type for use +// PersistentVolumeClaimConditionApplyConfiguration represents a declarative configuration of the PersistentVolumeClaimCondition type for use // with apply. type PersistentVolumeClaimConditionApplyConfiguration struct { Type *v1.PersistentVolumeClaimConditionType `json:"type,omitempty"` @@ -34,7 +34,7 @@ type PersistentVolumeClaimConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// PersistentVolumeClaimConditionApplyConfiguration constructs an declarative configuration of the PersistentVolumeClaimCondition type for use with +// PersistentVolumeClaimConditionApplyConfiguration constructs a declarative configuration of the PersistentVolumeClaimCondition type for use with // apply. func PersistentVolumeClaimCondition() *PersistentVolumeClaimConditionApplyConfiguration { return &PersistentVolumeClaimConditionApplyConfiguration{} diff --git a/applyconfigurations/core/v1/persistentvolumeclaimspec.go b/applyconfigurations/core/v1/persistentvolumeclaimspec.go index 4db12fadb3..5ce671cd99 100644 --- a/applyconfigurations/core/v1/persistentvolumeclaimspec.go +++ b/applyconfigurations/core/v1/persistentvolumeclaimspec.go @@ -23,7 +23,7 @@ import ( metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PersistentVolumeClaimSpecApplyConfiguration represents an declarative configuration of the PersistentVolumeClaimSpec type for use +// PersistentVolumeClaimSpecApplyConfiguration represents a declarative configuration of the PersistentVolumeClaimSpec type for use // with apply. type PersistentVolumeClaimSpecApplyConfiguration struct { AccessModes []v1.PersistentVolumeAccessMode `json:"accessModes,omitempty"` @@ -37,7 +37,7 @@ type PersistentVolumeClaimSpecApplyConfiguration struct { VolumeAttributesClassName *string `json:"volumeAttributesClassName,omitempty"` } -// PersistentVolumeClaimSpecApplyConfiguration constructs an declarative configuration of the PersistentVolumeClaimSpec type for use with +// PersistentVolumeClaimSpecApplyConfiguration constructs a declarative configuration of the PersistentVolumeClaimSpec type for use with // apply. func PersistentVolumeClaimSpec() *PersistentVolumeClaimSpecApplyConfiguration { return &PersistentVolumeClaimSpecApplyConfiguration{} diff --git a/applyconfigurations/core/v1/persistentvolumeclaimstatus.go b/applyconfigurations/core/v1/persistentvolumeclaimstatus.go index 1f6d5ae323..3eebf95ad5 100644 --- a/applyconfigurations/core/v1/persistentvolumeclaimstatus.go +++ b/applyconfigurations/core/v1/persistentvolumeclaimstatus.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// PersistentVolumeClaimStatusApplyConfiguration represents an declarative configuration of the PersistentVolumeClaimStatus type for use +// PersistentVolumeClaimStatusApplyConfiguration represents a declarative configuration of the PersistentVolumeClaimStatus type for use // with apply. type PersistentVolumeClaimStatusApplyConfiguration struct { Phase *v1.PersistentVolumeClaimPhase `json:"phase,omitempty"` @@ -35,7 +35,7 @@ type PersistentVolumeClaimStatusApplyConfiguration struct { ModifyVolumeStatus *ModifyVolumeStatusApplyConfiguration `json:"modifyVolumeStatus,omitempty"` } -// PersistentVolumeClaimStatusApplyConfiguration constructs an declarative configuration of the PersistentVolumeClaimStatus type for use with +// PersistentVolumeClaimStatusApplyConfiguration constructs a declarative configuration of the PersistentVolumeClaimStatus type for use with // apply. func PersistentVolumeClaimStatus() *PersistentVolumeClaimStatusApplyConfiguration { return &PersistentVolumeClaimStatusApplyConfiguration{} diff --git a/applyconfigurations/core/v1/persistentvolumeclaimtemplate.go b/applyconfigurations/core/v1/persistentvolumeclaimtemplate.go index a616c4d40c..ed49702913 100644 --- a/applyconfigurations/core/v1/persistentvolumeclaimtemplate.go +++ b/applyconfigurations/core/v1/persistentvolumeclaimtemplate.go @@ -24,14 +24,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PersistentVolumeClaimTemplateApplyConfiguration represents an declarative configuration of the PersistentVolumeClaimTemplate type for use +// PersistentVolumeClaimTemplateApplyConfiguration represents a declarative configuration of the PersistentVolumeClaimTemplate type for use // with apply. type PersistentVolumeClaimTemplateApplyConfiguration struct { *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *PersistentVolumeClaimSpecApplyConfiguration `json:"spec,omitempty"` } -// PersistentVolumeClaimTemplateApplyConfiguration constructs an declarative configuration of the PersistentVolumeClaimTemplate type for use with +// PersistentVolumeClaimTemplateApplyConfiguration constructs a declarative configuration of the PersistentVolumeClaimTemplate type for use with // apply. func PersistentVolumeClaimTemplate() *PersistentVolumeClaimTemplateApplyConfiguration { return &PersistentVolumeClaimTemplateApplyConfiguration{} diff --git a/applyconfigurations/core/v1/persistentvolumeclaimvolumesource.go b/applyconfigurations/core/v1/persistentvolumeclaimvolumesource.go index a498fa6a5e..ccccdfb493 100644 --- a/applyconfigurations/core/v1/persistentvolumeclaimvolumesource.go +++ b/applyconfigurations/core/v1/persistentvolumeclaimvolumesource.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// PersistentVolumeClaimVolumeSourceApplyConfiguration represents an declarative configuration of the PersistentVolumeClaimVolumeSource type for use +// PersistentVolumeClaimVolumeSourceApplyConfiguration represents a declarative configuration of the PersistentVolumeClaimVolumeSource type for use // with apply. type PersistentVolumeClaimVolumeSourceApplyConfiguration struct { ClaimName *string `json:"claimName,omitempty"` ReadOnly *bool `json:"readOnly,omitempty"` } -// PersistentVolumeClaimVolumeSourceApplyConfiguration constructs an declarative configuration of the PersistentVolumeClaimVolumeSource type for use with +// PersistentVolumeClaimVolumeSourceApplyConfiguration constructs a declarative configuration of the PersistentVolumeClaimVolumeSource type for use with // apply. func PersistentVolumeClaimVolumeSource() *PersistentVolumeClaimVolumeSourceApplyConfiguration { return &PersistentVolumeClaimVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/persistentvolumesource.go b/applyconfigurations/core/v1/persistentvolumesource.go index 0576e7dd31..aba0124622 100644 --- a/applyconfigurations/core/v1/persistentvolumesource.go +++ b/applyconfigurations/core/v1/persistentvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// PersistentVolumeSourceApplyConfiguration represents an declarative configuration of the PersistentVolumeSource type for use +// PersistentVolumeSourceApplyConfiguration represents a declarative configuration of the PersistentVolumeSource type for use // with apply. type PersistentVolumeSourceApplyConfiguration struct { GCEPersistentDisk *GCEPersistentDiskVolumeSourceApplyConfiguration `json:"gcePersistentDisk,omitempty"` @@ -45,7 +45,7 @@ type PersistentVolumeSourceApplyConfiguration struct { CSI *CSIPersistentVolumeSourceApplyConfiguration `json:"csi,omitempty"` } -// PersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the PersistentVolumeSource type for use with +// PersistentVolumeSourceApplyConfiguration constructs a declarative configuration of the PersistentVolumeSource type for use with // apply. func PersistentVolumeSource() *PersistentVolumeSourceApplyConfiguration { return &PersistentVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/persistentvolumespec.go b/applyconfigurations/core/v1/persistentvolumespec.go index 8a30dab649..074fa55d1f 100644 --- a/applyconfigurations/core/v1/persistentvolumespec.go +++ b/applyconfigurations/core/v1/persistentvolumespec.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// PersistentVolumeSpecApplyConfiguration represents an declarative configuration of the PersistentVolumeSpec type for use +// PersistentVolumeSpecApplyConfiguration represents a declarative configuration of the PersistentVolumeSpec type for use // with apply. type PersistentVolumeSpecApplyConfiguration struct { Capacity *v1.ResourceList `json:"capacity,omitempty"` @@ -37,7 +37,7 @@ type PersistentVolumeSpecApplyConfiguration struct { VolumeAttributesClassName *string `json:"volumeAttributesClassName,omitempty"` } -// PersistentVolumeSpecApplyConfiguration constructs an declarative configuration of the PersistentVolumeSpec type for use with +// PersistentVolumeSpecApplyConfiguration constructs a declarative configuration of the PersistentVolumeSpec type for use with // apply. func PersistentVolumeSpec() *PersistentVolumeSpecApplyConfiguration { return &PersistentVolumeSpecApplyConfiguration{} diff --git a/applyconfigurations/core/v1/persistentvolumestatus.go b/applyconfigurations/core/v1/persistentvolumestatus.go index a473c0e927..95ba90f48b 100644 --- a/applyconfigurations/core/v1/persistentvolumestatus.go +++ b/applyconfigurations/core/v1/persistentvolumestatus.go @@ -23,7 +23,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// PersistentVolumeStatusApplyConfiguration represents an declarative configuration of the PersistentVolumeStatus type for use +// PersistentVolumeStatusApplyConfiguration represents a declarative configuration of the PersistentVolumeStatus type for use // with apply. type PersistentVolumeStatusApplyConfiguration struct { Phase *v1.PersistentVolumePhase `json:"phase,omitempty"` @@ -32,7 +32,7 @@ type PersistentVolumeStatusApplyConfiguration struct { LastPhaseTransitionTime *metav1.Time `json:"lastPhaseTransitionTime,omitempty"` } -// PersistentVolumeStatusApplyConfiguration constructs an declarative configuration of the PersistentVolumeStatus type for use with +// PersistentVolumeStatusApplyConfiguration constructs a declarative configuration of the PersistentVolumeStatus type for use with // apply. func PersistentVolumeStatus() *PersistentVolumeStatusApplyConfiguration { return &PersistentVolumeStatusApplyConfiguration{} diff --git a/applyconfigurations/core/v1/photonpersistentdiskvolumesource.go b/applyconfigurations/core/v1/photonpersistentdiskvolumesource.go index 43587d6768..d8dc103e2a 100644 --- a/applyconfigurations/core/v1/photonpersistentdiskvolumesource.go +++ b/applyconfigurations/core/v1/photonpersistentdiskvolumesource.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// PhotonPersistentDiskVolumeSourceApplyConfiguration represents an declarative configuration of the PhotonPersistentDiskVolumeSource type for use +// PhotonPersistentDiskVolumeSourceApplyConfiguration represents a declarative configuration of the PhotonPersistentDiskVolumeSource type for use // with apply. type PhotonPersistentDiskVolumeSourceApplyConfiguration struct { PdID *string `json:"pdID,omitempty"` FSType *string `json:"fsType,omitempty"` } -// PhotonPersistentDiskVolumeSourceApplyConfiguration constructs an declarative configuration of the PhotonPersistentDiskVolumeSource type for use with +// PhotonPersistentDiskVolumeSourceApplyConfiguration constructs a declarative configuration of the PhotonPersistentDiskVolumeSource type for use with // apply. func PhotonPersistentDiskVolumeSource() *PhotonPersistentDiskVolumeSourceApplyConfiguration { return &PhotonPersistentDiskVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/pod.go b/applyconfigurations/core/v1/pod.go index ef8b540dd2..507d57d6f3 100644 --- a/applyconfigurations/core/v1/pod.go +++ b/applyconfigurations/core/v1/pod.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PodApplyConfiguration represents an declarative configuration of the Pod type for use +// PodApplyConfiguration represents a declarative configuration of the Pod type for use // with apply. type PodApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type PodApplyConfiguration struct { Status *PodStatusApplyConfiguration `json:"status,omitempty"` } -// Pod constructs an declarative configuration of the Pod type for use with +// Pod constructs a declarative configuration of the Pod type for use with // apply. func Pod(name, namespace string) *PodApplyConfiguration { b := &PodApplyConfiguration{} diff --git a/applyconfigurations/core/v1/podaffinity.go b/applyconfigurations/core/v1/podaffinity.go index 7049c62121..23fed95464 100644 --- a/applyconfigurations/core/v1/podaffinity.go +++ b/applyconfigurations/core/v1/podaffinity.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// PodAffinityApplyConfiguration represents an declarative configuration of the PodAffinity type for use +// PodAffinityApplyConfiguration represents a declarative configuration of the PodAffinity type for use // with apply. type PodAffinityApplyConfiguration struct { RequiredDuringSchedulingIgnoredDuringExecution []PodAffinityTermApplyConfiguration `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` PreferredDuringSchedulingIgnoredDuringExecution []WeightedPodAffinityTermApplyConfiguration `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` } -// PodAffinityApplyConfiguration constructs an declarative configuration of the PodAffinity type for use with +// PodAffinityApplyConfiguration constructs a declarative configuration of the PodAffinity type for use with // apply. func PodAffinity() *PodAffinityApplyConfiguration { return &PodAffinityApplyConfiguration{} diff --git a/applyconfigurations/core/v1/podaffinityterm.go b/applyconfigurations/core/v1/podaffinityterm.go index ac1eab3d8c..3afce026d4 100644 --- a/applyconfigurations/core/v1/podaffinityterm.go +++ b/applyconfigurations/core/v1/podaffinityterm.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PodAffinityTermApplyConfiguration represents an declarative configuration of the PodAffinityTerm type for use +// PodAffinityTermApplyConfiguration represents a declarative configuration of the PodAffinityTerm type for use // with apply. type PodAffinityTermApplyConfiguration struct { LabelSelector *v1.LabelSelectorApplyConfiguration `json:"labelSelector,omitempty"` @@ -33,7 +33,7 @@ type PodAffinityTermApplyConfiguration struct { MismatchLabelKeys []string `json:"mismatchLabelKeys,omitempty"` } -// PodAffinityTermApplyConfiguration constructs an declarative configuration of the PodAffinityTerm type for use with +// PodAffinityTermApplyConfiguration constructs a declarative configuration of the PodAffinityTerm type for use with // apply. func PodAffinityTerm() *PodAffinityTermApplyConfiguration { return &PodAffinityTermApplyConfiguration{} diff --git a/applyconfigurations/core/v1/podantiaffinity.go b/applyconfigurations/core/v1/podantiaffinity.go index 42681c54c4..ae9848963d 100644 --- a/applyconfigurations/core/v1/podantiaffinity.go +++ b/applyconfigurations/core/v1/podantiaffinity.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// PodAntiAffinityApplyConfiguration represents an declarative configuration of the PodAntiAffinity type for use +// PodAntiAffinityApplyConfiguration represents a declarative configuration of the PodAntiAffinity type for use // with apply. type PodAntiAffinityApplyConfiguration struct { RequiredDuringSchedulingIgnoredDuringExecution []PodAffinityTermApplyConfiguration `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` PreferredDuringSchedulingIgnoredDuringExecution []WeightedPodAffinityTermApplyConfiguration `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` } -// PodAntiAffinityApplyConfiguration constructs an declarative configuration of the PodAntiAffinity type for use with +// PodAntiAffinityApplyConfiguration constructs a declarative configuration of the PodAntiAffinity type for use with // apply. func PodAntiAffinity() *PodAntiAffinityApplyConfiguration { return &PodAntiAffinityApplyConfiguration{} diff --git a/applyconfigurations/core/v1/podcondition.go b/applyconfigurations/core/v1/podcondition.go index 610209f3c4..98968d26d0 100644 --- a/applyconfigurations/core/v1/podcondition.go +++ b/applyconfigurations/core/v1/podcondition.go @@ -23,7 +23,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// PodConditionApplyConfiguration represents an declarative configuration of the PodCondition type for use +// PodConditionApplyConfiguration represents a declarative configuration of the PodCondition type for use // with apply. type PodConditionApplyConfiguration struct { Type *v1.PodConditionType `json:"type,omitempty"` @@ -34,7 +34,7 @@ type PodConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// PodConditionApplyConfiguration constructs an declarative configuration of the PodCondition type for use with +// PodConditionApplyConfiguration constructs a declarative configuration of the PodCondition type for use with // apply. func PodCondition() *PodConditionApplyConfiguration { return &PodConditionApplyConfiguration{} diff --git a/applyconfigurations/core/v1/poddnsconfig.go b/applyconfigurations/core/v1/poddnsconfig.go index 0fe6a08349..2e0ce9a91e 100644 --- a/applyconfigurations/core/v1/poddnsconfig.go +++ b/applyconfigurations/core/v1/poddnsconfig.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// PodDNSConfigApplyConfiguration represents an declarative configuration of the PodDNSConfig type for use +// PodDNSConfigApplyConfiguration represents a declarative configuration of the PodDNSConfig type for use // with apply. type PodDNSConfigApplyConfiguration struct { Nameservers []string `json:"nameservers,omitempty"` @@ -26,7 +26,7 @@ type PodDNSConfigApplyConfiguration struct { Options []PodDNSConfigOptionApplyConfiguration `json:"options,omitempty"` } -// PodDNSConfigApplyConfiguration constructs an declarative configuration of the PodDNSConfig type for use with +// PodDNSConfigApplyConfiguration constructs a declarative configuration of the PodDNSConfig type for use with // apply. func PodDNSConfig() *PodDNSConfigApplyConfiguration { return &PodDNSConfigApplyConfiguration{} diff --git a/applyconfigurations/core/v1/poddnsconfigoption.go b/applyconfigurations/core/v1/poddnsconfigoption.go index 327bf803b3..458b333bf2 100644 --- a/applyconfigurations/core/v1/poddnsconfigoption.go +++ b/applyconfigurations/core/v1/poddnsconfigoption.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// PodDNSConfigOptionApplyConfiguration represents an declarative configuration of the PodDNSConfigOption type for use +// PodDNSConfigOptionApplyConfiguration represents a declarative configuration of the PodDNSConfigOption type for use // with apply. type PodDNSConfigOptionApplyConfiguration struct { Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` } -// PodDNSConfigOptionApplyConfiguration constructs an declarative configuration of the PodDNSConfigOption type for use with +// PodDNSConfigOptionApplyConfiguration constructs a declarative configuration of the PodDNSConfigOption type for use with // apply. func PodDNSConfigOption() *PodDNSConfigOptionApplyConfiguration { return &PodDNSConfigOptionApplyConfiguration{} diff --git a/applyconfigurations/core/v1/podip.go b/applyconfigurations/core/v1/podip.go index 3c6e6b87ac..73f089856f 100644 --- a/applyconfigurations/core/v1/podip.go +++ b/applyconfigurations/core/v1/podip.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// PodIPApplyConfiguration represents an declarative configuration of the PodIP type for use +// PodIPApplyConfiguration represents a declarative configuration of the PodIP type for use // with apply. type PodIPApplyConfiguration struct { IP *string `json:"ip,omitempty"` } -// PodIPApplyConfiguration constructs an declarative configuration of the PodIP type for use with +// PodIPApplyConfiguration constructs a declarative configuration of the PodIP type for use with // apply. func PodIP() *PodIPApplyConfiguration { return &PodIPApplyConfiguration{} diff --git a/applyconfigurations/core/v1/podos.go b/applyconfigurations/core/v1/podos.go index a5315d636b..7f156f817d 100644 --- a/applyconfigurations/core/v1/podos.go +++ b/applyconfigurations/core/v1/podos.go @@ -22,13 +22,13 @@ import ( v1 "k8s.io/api/core/v1" ) -// PodOSApplyConfiguration represents an declarative configuration of the PodOS type for use +// PodOSApplyConfiguration represents a declarative configuration of the PodOS type for use // with apply. type PodOSApplyConfiguration struct { Name *v1.OSName `json:"name,omitempty"` } -// PodOSApplyConfiguration constructs an declarative configuration of the PodOS type for use with +// PodOSApplyConfiguration constructs a declarative configuration of the PodOS type for use with // apply. func PodOS() *PodOSApplyConfiguration { return &PodOSApplyConfiguration{} diff --git a/applyconfigurations/core/v1/podreadinessgate.go b/applyconfigurations/core/v1/podreadinessgate.go index 9d3ad458ac..09746df1bd 100644 --- a/applyconfigurations/core/v1/podreadinessgate.go +++ b/applyconfigurations/core/v1/podreadinessgate.go @@ -22,13 +22,13 @@ import ( v1 "k8s.io/api/core/v1" ) -// PodReadinessGateApplyConfiguration represents an declarative configuration of the PodReadinessGate type for use +// PodReadinessGateApplyConfiguration represents a declarative configuration of the PodReadinessGate type for use // with apply. type PodReadinessGateApplyConfiguration struct { ConditionType *v1.PodConditionType `json:"conditionType,omitempty"` } -// PodReadinessGateApplyConfiguration constructs an declarative configuration of the PodReadinessGate type for use with +// PodReadinessGateApplyConfiguration constructs a declarative configuration of the PodReadinessGate type for use with // apply. func PodReadinessGate() *PodReadinessGateApplyConfiguration { return &PodReadinessGateApplyConfiguration{} diff --git a/applyconfigurations/core/v1/podresourceclaim.go b/applyconfigurations/core/v1/podresourceclaim.go index 69b250d474..8206210f79 100644 --- a/applyconfigurations/core/v1/podresourceclaim.go +++ b/applyconfigurations/core/v1/podresourceclaim.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// PodResourceClaimApplyConfiguration represents an declarative configuration of the PodResourceClaim type for use +// PodResourceClaimApplyConfiguration represents a declarative configuration of the PodResourceClaim type for use // with apply. type PodResourceClaimApplyConfiguration struct { Name *string `json:"name,omitempty"` Source *ClaimSourceApplyConfiguration `json:"source,omitempty"` } -// PodResourceClaimApplyConfiguration constructs an declarative configuration of the PodResourceClaim type for use with +// PodResourceClaimApplyConfiguration constructs a declarative configuration of the PodResourceClaim type for use with // apply. func PodResourceClaim() *PodResourceClaimApplyConfiguration { return &PodResourceClaimApplyConfiguration{} diff --git a/applyconfigurations/core/v1/podresourceclaimstatus.go b/applyconfigurations/core/v1/podresourceclaimstatus.go index ae79ca01b7..f60ad4b052 100644 --- a/applyconfigurations/core/v1/podresourceclaimstatus.go +++ b/applyconfigurations/core/v1/podresourceclaimstatus.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// PodResourceClaimStatusApplyConfiguration represents an declarative configuration of the PodResourceClaimStatus type for use +// PodResourceClaimStatusApplyConfiguration represents a declarative configuration of the PodResourceClaimStatus type for use // with apply. type PodResourceClaimStatusApplyConfiguration struct { Name *string `json:"name,omitempty"` ResourceClaimName *string `json:"resourceClaimName,omitempty"` } -// PodResourceClaimStatusApplyConfiguration constructs an declarative configuration of the PodResourceClaimStatus type for use with +// PodResourceClaimStatusApplyConfiguration constructs a declarative configuration of the PodResourceClaimStatus type for use with // apply. func PodResourceClaimStatus() *PodResourceClaimStatusApplyConfiguration { return &PodResourceClaimStatusApplyConfiguration{} diff --git a/applyconfigurations/core/v1/podschedulinggate.go b/applyconfigurations/core/v1/podschedulinggate.go index f7649c2e92..3d91092776 100644 --- a/applyconfigurations/core/v1/podschedulinggate.go +++ b/applyconfigurations/core/v1/podschedulinggate.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// PodSchedulingGateApplyConfiguration represents an declarative configuration of the PodSchedulingGate type for use +// PodSchedulingGateApplyConfiguration represents a declarative configuration of the PodSchedulingGate type for use // with apply. type PodSchedulingGateApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// PodSchedulingGateApplyConfiguration constructs an declarative configuration of the PodSchedulingGate type for use with +// PodSchedulingGateApplyConfiguration constructs a declarative configuration of the PodSchedulingGate type for use with // apply. func PodSchedulingGate() *PodSchedulingGateApplyConfiguration { return &PodSchedulingGateApplyConfiguration{} diff --git a/applyconfigurations/core/v1/podsecuritycontext.go b/applyconfigurations/core/v1/podsecuritycontext.go index 344c40fb85..55085e6307 100644 --- a/applyconfigurations/core/v1/podsecuritycontext.go +++ b/applyconfigurations/core/v1/podsecuritycontext.go @@ -22,7 +22,7 @@ import ( corev1 "k8s.io/api/core/v1" ) -// PodSecurityContextApplyConfiguration represents an declarative configuration of the PodSecurityContext type for use +// PodSecurityContextApplyConfiguration represents a declarative configuration of the PodSecurityContext type for use // with apply. type PodSecurityContextApplyConfiguration struct { SELinuxOptions *SELinuxOptionsApplyConfiguration `json:"seLinuxOptions,omitempty"` @@ -39,7 +39,7 @@ type PodSecurityContextApplyConfiguration struct { AppArmorProfile *AppArmorProfileApplyConfiguration `json:"appArmorProfile,omitempty"` } -// PodSecurityContextApplyConfiguration constructs an declarative configuration of the PodSecurityContext type for use with +// PodSecurityContextApplyConfiguration constructs a declarative configuration of the PodSecurityContext type for use with // apply. func PodSecurityContext() *PodSecurityContextApplyConfiguration { return &PodSecurityContextApplyConfiguration{} diff --git a/applyconfigurations/core/v1/podspec.go b/applyconfigurations/core/v1/podspec.go index a9acd36fc7..8134e044f1 100644 --- a/applyconfigurations/core/v1/podspec.go +++ b/applyconfigurations/core/v1/podspec.go @@ -22,7 +22,7 @@ import ( corev1 "k8s.io/api/core/v1" ) -// PodSpecApplyConfiguration represents an declarative configuration of the PodSpec type for use +// PodSpecApplyConfiguration represents a declarative configuration of the PodSpec type for use // with apply. type PodSpecApplyConfiguration struct { Volumes []VolumeApplyConfiguration `json:"volumes,omitempty"` @@ -66,7 +66,7 @@ type PodSpecApplyConfiguration struct { ResourceClaims []PodResourceClaimApplyConfiguration `json:"resourceClaims,omitempty"` } -// PodSpecApplyConfiguration constructs an declarative configuration of the PodSpec type for use with +// PodSpecApplyConfiguration constructs a declarative configuration of the PodSpec type for use with // apply. func PodSpec() *PodSpecApplyConfiguration { return &PodSpecApplyConfiguration{} diff --git a/applyconfigurations/core/v1/podstatus.go b/applyconfigurations/core/v1/podstatus.go index 1a58ab6be2..0b68996cd1 100644 --- a/applyconfigurations/core/v1/podstatus.go +++ b/applyconfigurations/core/v1/podstatus.go @@ -23,7 +23,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// PodStatusApplyConfiguration represents an declarative configuration of the PodStatus type for use +// PodStatusApplyConfiguration represents a declarative configuration of the PodStatus type for use // with apply. type PodStatusApplyConfiguration struct { Phase *v1.PodPhase `json:"phase,omitempty"` @@ -44,7 +44,7 @@ type PodStatusApplyConfiguration struct { ResourceClaimStatuses []PodResourceClaimStatusApplyConfiguration `json:"resourceClaimStatuses,omitempty"` } -// PodStatusApplyConfiguration constructs an declarative configuration of the PodStatus type for use with +// PodStatusApplyConfiguration constructs a declarative configuration of the PodStatus type for use with // apply. func PodStatus() *PodStatusApplyConfiguration { return &PodStatusApplyConfiguration{} diff --git a/applyconfigurations/core/v1/podtemplate.go b/applyconfigurations/core/v1/podtemplate.go index 826f71b12d..b4c8a658a4 100644 --- a/applyconfigurations/core/v1/podtemplate.go +++ b/applyconfigurations/core/v1/podtemplate.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PodTemplateApplyConfiguration represents an declarative configuration of the PodTemplate type for use +// PodTemplateApplyConfiguration represents a declarative configuration of the PodTemplate type for use // with apply. type PodTemplateApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type PodTemplateApplyConfiguration struct { Template *PodTemplateSpecApplyConfiguration `json:"template,omitempty"` } -// PodTemplate constructs an declarative configuration of the PodTemplate type for use with +// PodTemplate constructs a declarative configuration of the PodTemplate type for use with // apply. func PodTemplate(name, namespace string) *PodTemplateApplyConfiguration { b := &PodTemplateApplyConfiguration{} diff --git a/applyconfigurations/core/v1/podtemplatespec.go b/applyconfigurations/core/v1/podtemplatespec.go index 05e89ec66a..6146c01c7c 100644 --- a/applyconfigurations/core/v1/podtemplatespec.go +++ b/applyconfigurations/core/v1/podtemplatespec.go @@ -24,14 +24,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PodTemplateSpecApplyConfiguration represents an declarative configuration of the PodTemplateSpec type for use +// PodTemplateSpecApplyConfiguration represents a declarative configuration of the PodTemplateSpec type for use // with apply. type PodTemplateSpecApplyConfiguration struct { *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *PodSpecApplyConfiguration `json:"spec,omitempty"` } -// PodTemplateSpecApplyConfiguration constructs an declarative configuration of the PodTemplateSpec type for use with +// PodTemplateSpecApplyConfiguration constructs a declarative configuration of the PodTemplateSpec type for use with // apply. func PodTemplateSpec() *PodTemplateSpecApplyConfiguration { return &PodTemplateSpecApplyConfiguration{} diff --git a/applyconfigurations/core/v1/portstatus.go b/applyconfigurations/core/v1/portstatus.go index 8c70c8f6cf..5e738cabdb 100644 --- a/applyconfigurations/core/v1/portstatus.go +++ b/applyconfigurations/core/v1/portstatus.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// PortStatusApplyConfiguration represents an declarative configuration of the PortStatus type for use +// PortStatusApplyConfiguration represents a declarative configuration of the PortStatus type for use // with apply. type PortStatusApplyConfiguration struct { Port *int32 `json:"port,omitempty"` @@ -30,7 +30,7 @@ type PortStatusApplyConfiguration struct { Error *string `json:"error,omitempty"` } -// PortStatusApplyConfiguration constructs an declarative configuration of the PortStatus type for use with +// PortStatusApplyConfiguration constructs a declarative configuration of the PortStatus type for use with // apply. func PortStatus() *PortStatusApplyConfiguration { return &PortStatusApplyConfiguration{} diff --git a/applyconfigurations/core/v1/portworxvolumesource.go b/applyconfigurations/core/v1/portworxvolumesource.go index 19cbb82edb..29715e0219 100644 --- a/applyconfigurations/core/v1/portworxvolumesource.go +++ b/applyconfigurations/core/v1/portworxvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// PortworxVolumeSourceApplyConfiguration represents an declarative configuration of the PortworxVolumeSource type for use +// PortworxVolumeSourceApplyConfiguration represents a declarative configuration of the PortworxVolumeSource type for use // with apply. type PortworxVolumeSourceApplyConfiguration struct { VolumeID *string `json:"volumeID,omitempty"` @@ -26,7 +26,7 @@ type PortworxVolumeSourceApplyConfiguration struct { ReadOnly *bool `json:"readOnly,omitempty"` } -// PortworxVolumeSourceApplyConfiguration constructs an declarative configuration of the PortworxVolumeSource type for use with +// PortworxVolumeSourceApplyConfiguration constructs a declarative configuration of the PortworxVolumeSource type for use with // apply. func PortworxVolumeSource() *PortworxVolumeSourceApplyConfiguration { return &PortworxVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/preferredschedulingterm.go b/applyconfigurations/core/v1/preferredschedulingterm.go index a373e4afe0..b88a3646fc 100644 --- a/applyconfigurations/core/v1/preferredschedulingterm.go +++ b/applyconfigurations/core/v1/preferredschedulingterm.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// PreferredSchedulingTermApplyConfiguration represents an declarative configuration of the PreferredSchedulingTerm type for use +// PreferredSchedulingTermApplyConfiguration represents a declarative configuration of the PreferredSchedulingTerm type for use // with apply. type PreferredSchedulingTermApplyConfiguration struct { Weight *int32 `json:"weight,omitempty"` Preference *NodeSelectorTermApplyConfiguration `json:"preference,omitempty"` } -// PreferredSchedulingTermApplyConfiguration constructs an declarative configuration of the PreferredSchedulingTerm type for use with +// PreferredSchedulingTermApplyConfiguration constructs a declarative configuration of the PreferredSchedulingTerm type for use with // apply. func PreferredSchedulingTerm() *PreferredSchedulingTermApplyConfiguration { return &PreferredSchedulingTermApplyConfiguration{} diff --git a/applyconfigurations/core/v1/probe.go b/applyconfigurations/core/v1/probe.go index 10730557a0..3be1c9650b 100644 --- a/applyconfigurations/core/v1/probe.go +++ b/applyconfigurations/core/v1/probe.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// ProbeApplyConfiguration represents an declarative configuration of the Probe type for use +// ProbeApplyConfiguration represents a declarative configuration of the Probe type for use // with apply. type ProbeApplyConfiguration struct { ProbeHandlerApplyConfiguration `json:",inline"` @@ -30,7 +30,7 @@ type ProbeApplyConfiguration struct { TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"` } -// ProbeApplyConfiguration constructs an declarative configuration of the Probe type for use with +// ProbeApplyConfiguration constructs a declarative configuration of the Probe type for use with // apply. func Probe() *ProbeApplyConfiguration { return &ProbeApplyConfiguration{} diff --git a/applyconfigurations/core/v1/probehandler.go b/applyconfigurations/core/v1/probehandler.go index 54f3344ac7..1f88745eab 100644 --- a/applyconfigurations/core/v1/probehandler.go +++ b/applyconfigurations/core/v1/probehandler.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// ProbeHandlerApplyConfiguration represents an declarative configuration of the ProbeHandler type for use +// ProbeHandlerApplyConfiguration represents a declarative configuration of the ProbeHandler type for use // with apply. type ProbeHandlerApplyConfiguration struct { Exec *ExecActionApplyConfiguration `json:"exec,omitempty"` @@ -27,7 +27,7 @@ type ProbeHandlerApplyConfiguration struct { GRPC *GRPCActionApplyConfiguration `json:"grpc,omitempty"` } -// ProbeHandlerApplyConfiguration constructs an declarative configuration of the ProbeHandler type for use with +// ProbeHandlerApplyConfiguration constructs a declarative configuration of the ProbeHandler type for use with // apply. func ProbeHandler() *ProbeHandlerApplyConfiguration { return &ProbeHandlerApplyConfiguration{} diff --git a/applyconfigurations/core/v1/projectedvolumesource.go b/applyconfigurations/core/v1/projectedvolumesource.go index 0a9d1d88e6..c922ec8cc2 100644 --- a/applyconfigurations/core/v1/projectedvolumesource.go +++ b/applyconfigurations/core/v1/projectedvolumesource.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// ProjectedVolumeSourceApplyConfiguration represents an declarative configuration of the ProjectedVolumeSource type for use +// ProjectedVolumeSourceApplyConfiguration represents a declarative configuration of the ProjectedVolumeSource type for use // with apply. type ProjectedVolumeSourceApplyConfiguration struct { Sources []VolumeProjectionApplyConfiguration `json:"sources,omitempty"` DefaultMode *int32 `json:"defaultMode,omitempty"` } -// ProjectedVolumeSourceApplyConfiguration constructs an declarative configuration of the ProjectedVolumeSource type for use with +// ProjectedVolumeSourceApplyConfiguration constructs a declarative configuration of the ProjectedVolumeSource type for use with // apply. func ProjectedVolumeSource() *ProjectedVolumeSourceApplyConfiguration { return &ProjectedVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/quobytevolumesource.go b/applyconfigurations/core/v1/quobytevolumesource.go index 646052ea4a..9a042a0a12 100644 --- a/applyconfigurations/core/v1/quobytevolumesource.go +++ b/applyconfigurations/core/v1/quobytevolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// QuobyteVolumeSourceApplyConfiguration represents an declarative configuration of the QuobyteVolumeSource type for use +// QuobyteVolumeSourceApplyConfiguration represents a declarative configuration of the QuobyteVolumeSource type for use // with apply. type QuobyteVolumeSourceApplyConfiguration struct { Registry *string `json:"registry,omitempty"` @@ -29,7 +29,7 @@ type QuobyteVolumeSourceApplyConfiguration struct { Tenant *string `json:"tenant,omitempty"` } -// QuobyteVolumeSourceApplyConfiguration constructs an declarative configuration of the QuobyteVolumeSource type for use with +// QuobyteVolumeSourceApplyConfiguration constructs a declarative configuration of the QuobyteVolumeSource type for use with // apply. func QuobyteVolumeSource() *QuobyteVolumeSourceApplyConfiguration { return &QuobyteVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/rbdpersistentvolumesource.go b/applyconfigurations/core/v1/rbdpersistentvolumesource.go index ffcb836eb0..64f25724a3 100644 --- a/applyconfigurations/core/v1/rbdpersistentvolumesource.go +++ b/applyconfigurations/core/v1/rbdpersistentvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// RBDPersistentVolumeSourceApplyConfiguration represents an declarative configuration of the RBDPersistentVolumeSource type for use +// RBDPersistentVolumeSourceApplyConfiguration represents a declarative configuration of the RBDPersistentVolumeSource type for use // with apply. type RBDPersistentVolumeSourceApplyConfiguration struct { CephMonitors []string `json:"monitors,omitempty"` @@ -31,7 +31,7 @@ type RBDPersistentVolumeSourceApplyConfiguration struct { ReadOnly *bool `json:"readOnly,omitempty"` } -// RBDPersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the RBDPersistentVolumeSource type for use with +// RBDPersistentVolumeSourceApplyConfiguration constructs a declarative configuration of the RBDPersistentVolumeSource type for use with // apply. func RBDPersistentVolumeSource() *RBDPersistentVolumeSourceApplyConfiguration { return &RBDPersistentVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/rbdvolumesource.go b/applyconfigurations/core/v1/rbdvolumesource.go index 8e7c81732c..8dae198c09 100644 --- a/applyconfigurations/core/v1/rbdvolumesource.go +++ b/applyconfigurations/core/v1/rbdvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// RBDVolumeSourceApplyConfiguration represents an declarative configuration of the RBDVolumeSource type for use +// RBDVolumeSourceApplyConfiguration represents a declarative configuration of the RBDVolumeSource type for use // with apply. type RBDVolumeSourceApplyConfiguration struct { CephMonitors []string `json:"monitors,omitempty"` @@ -31,7 +31,7 @@ type RBDVolumeSourceApplyConfiguration struct { ReadOnly *bool `json:"readOnly,omitempty"` } -// RBDVolumeSourceApplyConfiguration constructs an declarative configuration of the RBDVolumeSource type for use with +// RBDVolumeSourceApplyConfiguration constructs a declarative configuration of the RBDVolumeSource type for use with // apply. func RBDVolumeSource() *RBDVolumeSourceApplyConfiguration { return &RBDVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/replicationcontroller.go b/applyconfigurations/core/v1/replicationcontroller.go index aa4ae9a904..b28f422dc7 100644 --- a/applyconfigurations/core/v1/replicationcontroller.go +++ b/applyconfigurations/core/v1/replicationcontroller.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ReplicationControllerApplyConfiguration represents an declarative configuration of the ReplicationController type for use +// ReplicationControllerApplyConfiguration represents a declarative configuration of the ReplicationController type for use // with apply. type ReplicationControllerApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type ReplicationControllerApplyConfiguration struct { Status *ReplicationControllerStatusApplyConfiguration `json:"status,omitempty"` } -// ReplicationController constructs an declarative configuration of the ReplicationController type for use with +// ReplicationController constructs a declarative configuration of the ReplicationController type for use with // apply. func ReplicationController(name, namespace string) *ReplicationControllerApplyConfiguration { b := &ReplicationControllerApplyConfiguration{} diff --git a/applyconfigurations/core/v1/replicationcontrollercondition.go b/applyconfigurations/core/v1/replicationcontrollercondition.go index c3d56cc697..0d74c1db9a 100644 --- a/applyconfigurations/core/v1/replicationcontrollercondition.go +++ b/applyconfigurations/core/v1/replicationcontrollercondition.go @@ -23,7 +23,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// ReplicationControllerConditionApplyConfiguration represents an declarative configuration of the ReplicationControllerCondition type for use +// ReplicationControllerConditionApplyConfiguration represents a declarative configuration of the ReplicationControllerCondition type for use // with apply. type ReplicationControllerConditionApplyConfiguration struct { Type *v1.ReplicationControllerConditionType `json:"type,omitempty"` @@ -33,7 +33,7 @@ type ReplicationControllerConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// ReplicationControllerConditionApplyConfiguration constructs an declarative configuration of the ReplicationControllerCondition type for use with +// ReplicationControllerConditionApplyConfiguration constructs a declarative configuration of the ReplicationControllerCondition type for use with // apply. func ReplicationControllerCondition() *ReplicationControllerConditionApplyConfiguration { return &ReplicationControllerConditionApplyConfiguration{} diff --git a/applyconfigurations/core/v1/replicationcontrollerspec.go b/applyconfigurations/core/v1/replicationcontrollerspec.go index dd4e081d9f..07bac9f4c9 100644 --- a/applyconfigurations/core/v1/replicationcontrollerspec.go +++ b/applyconfigurations/core/v1/replicationcontrollerspec.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// ReplicationControllerSpecApplyConfiguration represents an declarative configuration of the ReplicationControllerSpec type for use +// ReplicationControllerSpecApplyConfiguration represents a declarative configuration of the ReplicationControllerSpec type for use // with apply. type ReplicationControllerSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` @@ -27,7 +27,7 @@ type ReplicationControllerSpecApplyConfiguration struct { Template *PodTemplateSpecApplyConfiguration `json:"template,omitempty"` } -// ReplicationControllerSpecApplyConfiguration constructs an declarative configuration of the ReplicationControllerSpec type for use with +// ReplicationControllerSpecApplyConfiguration constructs a declarative configuration of the ReplicationControllerSpec type for use with // apply. func ReplicationControllerSpec() *ReplicationControllerSpecApplyConfiguration { return &ReplicationControllerSpecApplyConfiguration{} diff --git a/applyconfigurations/core/v1/replicationcontrollerstatus.go b/applyconfigurations/core/v1/replicationcontrollerstatus.go index 1b994cfb8c..c8046aa5a4 100644 --- a/applyconfigurations/core/v1/replicationcontrollerstatus.go +++ b/applyconfigurations/core/v1/replicationcontrollerstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// ReplicationControllerStatusApplyConfiguration represents an declarative configuration of the ReplicationControllerStatus type for use +// ReplicationControllerStatusApplyConfiguration represents a declarative configuration of the ReplicationControllerStatus type for use // with apply. type ReplicationControllerStatusApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` @@ -29,7 +29,7 @@ type ReplicationControllerStatusApplyConfiguration struct { Conditions []ReplicationControllerConditionApplyConfiguration `json:"conditions,omitempty"` } -// ReplicationControllerStatusApplyConfiguration constructs an declarative configuration of the ReplicationControllerStatus type for use with +// ReplicationControllerStatusApplyConfiguration constructs a declarative configuration of the ReplicationControllerStatus type for use with // apply. func ReplicationControllerStatus() *ReplicationControllerStatusApplyConfiguration { return &ReplicationControllerStatusApplyConfiguration{} diff --git a/applyconfigurations/core/v1/resourceclaim.go b/applyconfigurations/core/v1/resourceclaim.go index 064dd4e2e4..a9d79ae341 100644 --- a/applyconfigurations/core/v1/resourceclaim.go +++ b/applyconfigurations/core/v1/resourceclaim.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// ResourceClaimApplyConfiguration represents an declarative configuration of the ResourceClaim type for use +// ResourceClaimApplyConfiguration represents a declarative configuration of the ResourceClaim type for use // with apply. type ResourceClaimApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// ResourceClaimApplyConfiguration constructs an declarative configuration of the ResourceClaim type for use with +// ResourceClaimApplyConfiguration constructs a declarative configuration of the ResourceClaim type for use with // apply. func ResourceClaim() *ResourceClaimApplyConfiguration { return &ResourceClaimApplyConfiguration{} diff --git a/applyconfigurations/core/v1/resourcefieldselector.go b/applyconfigurations/core/v1/resourcefieldselector.go index 2741227dd7..1b4918a633 100644 --- a/applyconfigurations/core/v1/resourcefieldselector.go +++ b/applyconfigurations/core/v1/resourcefieldselector.go @@ -22,7 +22,7 @@ import ( resource "k8s.io/apimachinery/pkg/api/resource" ) -// ResourceFieldSelectorApplyConfiguration represents an declarative configuration of the ResourceFieldSelector type for use +// ResourceFieldSelectorApplyConfiguration represents a declarative configuration of the ResourceFieldSelector type for use // with apply. type ResourceFieldSelectorApplyConfiguration struct { ContainerName *string `json:"containerName,omitempty"` @@ -30,7 +30,7 @@ type ResourceFieldSelectorApplyConfiguration struct { Divisor *resource.Quantity `json:"divisor,omitempty"` } -// ResourceFieldSelectorApplyConfiguration constructs an declarative configuration of the ResourceFieldSelector type for use with +// ResourceFieldSelectorApplyConfiguration constructs a declarative configuration of the ResourceFieldSelector type for use with // apply. func ResourceFieldSelector() *ResourceFieldSelectorApplyConfiguration { return &ResourceFieldSelectorApplyConfiguration{} diff --git a/applyconfigurations/core/v1/resourcequota.go b/applyconfigurations/core/v1/resourcequota.go index fd304166d4..2b78ba7038 100644 --- a/applyconfigurations/core/v1/resourcequota.go +++ b/applyconfigurations/core/v1/resourcequota.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ResourceQuotaApplyConfiguration represents an declarative configuration of the ResourceQuota type for use +// ResourceQuotaApplyConfiguration represents a declarative configuration of the ResourceQuota type for use // with apply. type ResourceQuotaApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type ResourceQuotaApplyConfiguration struct { Status *ResourceQuotaStatusApplyConfiguration `json:"status,omitempty"` } -// ResourceQuota constructs an declarative configuration of the ResourceQuota type for use with +// ResourceQuota constructs a declarative configuration of the ResourceQuota type for use with // apply. func ResourceQuota(name, namespace string) *ResourceQuotaApplyConfiguration { b := &ResourceQuotaApplyConfiguration{} diff --git a/applyconfigurations/core/v1/resourcequotaspec.go b/applyconfigurations/core/v1/resourcequotaspec.go index feb454bc4b..0012ace25f 100644 --- a/applyconfigurations/core/v1/resourcequotaspec.go +++ b/applyconfigurations/core/v1/resourcequotaspec.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// ResourceQuotaSpecApplyConfiguration represents an declarative configuration of the ResourceQuotaSpec type for use +// ResourceQuotaSpecApplyConfiguration represents a declarative configuration of the ResourceQuotaSpec type for use // with apply. type ResourceQuotaSpecApplyConfiguration struct { Hard *v1.ResourceList `json:"hard,omitempty"` @@ -30,7 +30,7 @@ type ResourceQuotaSpecApplyConfiguration struct { ScopeSelector *ScopeSelectorApplyConfiguration `json:"scopeSelector,omitempty"` } -// ResourceQuotaSpecApplyConfiguration constructs an declarative configuration of the ResourceQuotaSpec type for use with +// ResourceQuotaSpecApplyConfiguration constructs a declarative configuration of the ResourceQuotaSpec type for use with // apply. func ResourceQuotaSpec() *ResourceQuotaSpecApplyConfiguration { return &ResourceQuotaSpecApplyConfiguration{} diff --git a/applyconfigurations/core/v1/resourcequotastatus.go b/applyconfigurations/core/v1/resourcequotastatus.go index 4dced90f7a..364b96eecf 100644 --- a/applyconfigurations/core/v1/resourcequotastatus.go +++ b/applyconfigurations/core/v1/resourcequotastatus.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// ResourceQuotaStatusApplyConfiguration represents an declarative configuration of the ResourceQuotaStatus type for use +// ResourceQuotaStatusApplyConfiguration represents a declarative configuration of the ResourceQuotaStatus type for use // with apply. type ResourceQuotaStatusApplyConfiguration struct { Hard *v1.ResourceList `json:"hard,omitempty"` Used *v1.ResourceList `json:"used,omitempty"` } -// ResourceQuotaStatusApplyConfiguration constructs an declarative configuration of the ResourceQuotaStatus type for use with +// ResourceQuotaStatusApplyConfiguration constructs a declarative configuration of the ResourceQuotaStatus type for use with // apply. func ResourceQuotaStatus() *ResourceQuotaStatusApplyConfiguration { return &ResourceQuotaStatusApplyConfiguration{} diff --git a/applyconfigurations/core/v1/resourcerequirements.go b/applyconfigurations/core/v1/resourcerequirements.go index 9482b8d713..51197862c9 100644 --- a/applyconfigurations/core/v1/resourcerequirements.go +++ b/applyconfigurations/core/v1/resourcerequirements.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// ResourceRequirementsApplyConfiguration represents an declarative configuration of the ResourceRequirements type for use +// ResourceRequirementsApplyConfiguration represents a declarative configuration of the ResourceRequirements type for use // with apply. type ResourceRequirementsApplyConfiguration struct { Limits *v1.ResourceList `json:"limits,omitempty"` @@ -30,7 +30,7 @@ type ResourceRequirementsApplyConfiguration struct { Claims []ResourceClaimApplyConfiguration `json:"claims,omitempty"` } -// ResourceRequirementsApplyConfiguration constructs an declarative configuration of the ResourceRequirements type for use with +// ResourceRequirementsApplyConfiguration constructs a declarative configuration of the ResourceRequirements type for use with // apply. func ResourceRequirements() *ResourceRequirementsApplyConfiguration { return &ResourceRequirementsApplyConfiguration{} diff --git a/applyconfigurations/core/v1/scaleiopersistentvolumesource.go b/applyconfigurations/core/v1/scaleiopersistentvolumesource.go index fffb5b186d..b07f46de91 100644 --- a/applyconfigurations/core/v1/scaleiopersistentvolumesource.go +++ b/applyconfigurations/core/v1/scaleiopersistentvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// ScaleIOPersistentVolumeSourceApplyConfiguration represents an declarative configuration of the ScaleIOPersistentVolumeSource type for use +// ScaleIOPersistentVolumeSourceApplyConfiguration represents a declarative configuration of the ScaleIOPersistentVolumeSource type for use // with apply. type ScaleIOPersistentVolumeSourceApplyConfiguration struct { Gateway *string `json:"gateway,omitempty"` @@ -33,7 +33,7 @@ type ScaleIOPersistentVolumeSourceApplyConfiguration struct { ReadOnly *bool `json:"readOnly,omitempty"` } -// ScaleIOPersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the ScaleIOPersistentVolumeSource type for use with +// ScaleIOPersistentVolumeSourceApplyConfiguration constructs a declarative configuration of the ScaleIOPersistentVolumeSource type for use with // apply. func ScaleIOPersistentVolumeSource() *ScaleIOPersistentVolumeSourceApplyConfiguration { return &ScaleIOPersistentVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/scaleiovolumesource.go b/applyconfigurations/core/v1/scaleiovolumesource.go index b54e1161eb..740c05ebb7 100644 --- a/applyconfigurations/core/v1/scaleiovolumesource.go +++ b/applyconfigurations/core/v1/scaleiovolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// ScaleIOVolumeSourceApplyConfiguration represents an declarative configuration of the ScaleIOVolumeSource type for use +// ScaleIOVolumeSourceApplyConfiguration represents a declarative configuration of the ScaleIOVolumeSource type for use // with apply. type ScaleIOVolumeSourceApplyConfiguration struct { Gateway *string `json:"gateway,omitempty"` @@ -33,7 +33,7 @@ type ScaleIOVolumeSourceApplyConfiguration struct { ReadOnly *bool `json:"readOnly,omitempty"` } -// ScaleIOVolumeSourceApplyConfiguration constructs an declarative configuration of the ScaleIOVolumeSource type for use with +// ScaleIOVolumeSourceApplyConfiguration constructs a declarative configuration of the ScaleIOVolumeSource type for use with // apply. func ScaleIOVolumeSource() *ScaleIOVolumeSourceApplyConfiguration { return &ScaleIOVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/scopedresourceselectorrequirement.go b/applyconfigurations/core/v1/scopedresourceselectorrequirement.go index c901a2ae6d..c6ec87827f 100644 --- a/applyconfigurations/core/v1/scopedresourceselectorrequirement.go +++ b/applyconfigurations/core/v1/scopedresourceselectorrequirement.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// ScopedResourceSelectorRequirementApplyConfiguration represents an declarative configuration of the ScopedResourceSelectorRequirement type for use +// ScopedResourceSelectorRequirementApplyConfiguration represents a declarative configuration of the ScopedResourceSelectorRequirement type for use // with apply. type ScopedResourceSelectorRequirementApplyConfiguration struct { ScopeName *v1.ResourceQuotaScope `json:"scopeName,omitempty"` @@ -30,7 +30,7 @@ type ScopedResourceSelectorRequirementApplyConfiguration struct { Values []string `json:"values,omitempty"` } -// ScopedResourceSelectorRequirementApplyConfiguration constructs an declarative configuration of the ScopedResourceSelectorRequirement type for use with +// ScopedResourceSelectorRequirementApplyConfiguration constructs a declarative configuration of the ScopedResourceSelectorRequirement type for use with // apply. func ScopedResourceSelectorRequirement() *ScopedResourceSelectorRequirementApplyConfiguration { return &ScopedResourceSelectorRequirementApplyConfiguration{} diff --git a/applyconfigurations/core/v1/scopeselector.go b/applyconfigurations/core/v1/scopeselector.go index 3251e9dc18..a9fb9a1b19 100644 --- a/applyconfigurations/core/v1/scopeselector.go +++ b/applyconfigurations/core/v1/scopeselector.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// ScopeSelectorApplyConfiguration represents an declarative configuration of the ScopeSelector type for use +// ScopeSelectorApplyConfiguration represents a declarative configuration of the ScopeSelector type for use // with apply. type ScopeSelectorApplyConfiguration struct { MatchExpressions []ScopedResourceSelectorRequirementApplyConfiguration `json:"matchExpressions,omitempty"` } -// ScopeSelectorApplyConfiguration constructs an declarative configuration of the ScopeSelector type for use with +// ScopeSelectorApplyConfiguration constructs a declarative configuration of the ScopeSelector type for use with // apply. func ScopeSelector() *ScopeSelectorApplyConfiguration { return &ScopeSelectorApplyConfiguration{} diff --git a/applyconfigurations/core/v1/seccompprofile.go b/applyconfigurations/core/v1/seccompprofile.go index 9818a00e7a..eb3077a051 100644 --- a/applyconfigurations/core/v1/seccompprofile.go +++ b/applyconfigurations/core/v1/seccompprofile.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// SeccompProfileApplyConfiguration represents an declarative configuration of the SeccompProfile type for use +// SeccompProfileApplyConfiguration represents a declarative configuration of the SeccompProfile type for use // with apply. type SeccompProfileApplyConfiguration struct { Type *v1.SeccompProfileType `json:"type,omitempty"` LocalhostProfile *string `json:"localhostProfile,omitempty"` } -// SeccompProfileApplyConfiguration constructs an declarative configuration of the SeccompProfile type for use with +// SeccompProfileApplyConfiguration constructs a declarative configuration of the SeccompProfile type for use with // apply. func SeccompProfile() *SeccompProfileApplyConfiguration { return &SeccompProfileApplyConfiguration{} diff --git a/applyconfigurations/core/v1/secret.go b/applyconfigurations/core/v1/secret.go index d62ca0697f..1d850b00bb 100644 --- a/applyconfigurations/core/v1/secret.go +++ b/applyconfigurations/core/v1/secret.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// SecretApplyConfiguration represents an declarative configuration of the Secret type for use +// SecretApplyConfiguration represents a declarative configuration of the Secret type for use // with apply. type SecretApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -38,7 +38,7 @@ type SecretApplyConfiguration struct { Type *corev1.SecretType `json:"type,omitempty"` } -// Secret constructs an declarative configuration of the Secret type for use with +// Secret constructs a declarative configuration of the Secret type for use with // apply. func Secret(name, namespace string) *SecretApplyConfiguration { b := &SecretApplyConfiguration{} diff --git a/applyconfigurations/core/v1/secretenvsource.go b/applyconfigurations/core/v1/secretenvsource.go index 7b22a8d0b2..ba99b7f5fd 100644 --- a/applyconfigurations/core/v1/secretenvsource.go +++ b/applyconfigurations/core/v1/secretenvsource.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// SecretEnvSourceApplyConfiguration represents an declarative configuration of the SecretEnvSource type for use +// SecretEnvSourceApplyConfiguration represents a declarative configuration of the SecretEnvSource type for use // with apply. type SecretEnvSourceApplyConfiguration struct { LocalObjectReferenceApplyConfiguration `json:",inline"` Optional *bool `json:"optional,omitempty"` } -// SecretEnvSourceApplyConfiguration constructs an declarative configuration of the SecretEnvSource type for use with +// SecretEnvSourceApplyConfiguration constructs a declarative configuration of the SecretEnvSource type for use with // apply. func SecretEnvSource() *SecretEnvSourceApplyConfiguration { return &SecretEnvSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/secretkeyselector.go b/applyconfigurations/core/v1/secretkeyselector.go index b8464a348a..2d490b8108 100644 --- a/applyconfigurations/core/v1/secretkeyselector.go +++ b/applyconfigurations/core/v1/secretkeyselector.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// SecretKeySelectorApplyConfiguration represents an declarative configuration of the SecretKeySelector type for use +// SecretKeySelectorApplyConfiguration represents a declarative configuration of the SecretKeySelector type for use // with apply. type SecretKeySelectorApplyConfiguration struct { LocalObjectReferenceApplyConfiguration `json:",inline"` @@ -26,7 +26,7 @@ type SecretKeySelectorApplyConfiguration struct { Optional *bool `json:"optional,omitempty"` } -// SecretKeySelectorApplyConfiguration constructs an declarative configuration of the SecretKeySelector type for use with +// SecretKeySelectorApplyConfiguration constructs a declarative configuration of the SecretKeySelector type for use with // apply. func SecretKeySelector() *SecretKeySelectorApplyConfiguration { return &SecretKeySelectorApplyConfiguration{} diff --git a/applyconfigurations/core/v1/secretprojection.go b/applyconfigurations/core/v1/secretprojection.go index e8edc61273..65ce3c66da 100644 --- a/applyconfigurations/core/v1/secretprojection.go +++ b/applyconfigurations/core/v1/secretprojection.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// SecretProjectionApplyConfiguration represents an declarative configuration of the SecretProjection type for use +// SecretProjectionApplyConfiguration represents a declarative configuration of the SecretProjection type for use // with apply. type SecretProjectionApplyConfiguration struct { LocalObjectReferenceApplyConfiguration `json:",inline"` @@ -26,7 +26,7 @@ type SecretProjectionApplyConfiguration struct { Optional *bool `json:"optional,omitempty"` } -// SecretProjectionApplyConfiguration constructs an declarative configuration of the SecretProjection type for use with +// SecretProjectionApplyConfiguration constructs a declarative configuration of the SecretProjection type for use with // apply. func SecretProjection() *SecretProjectionApplyConfiguration { return &SecretProjectionApplyConfiguration{} diff --git a/applyconfigurations/core/v1/secretreference.go b/applyconfigurations/core/v1/secretreference.go index 95579d003e..f5e0de23aa 100644 --- a/applyconfigurations/core/v1/secretreference.go +++ b/applyconfigurations/core/v1/secretreference.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// SecretReferenceApplyConfiguration represents an declarative configuration of the SecretReference type for use +// SecretReferenceApplyConfiguration represents a declarative configuration of the SecretReference type for use // with apply. type SecretReferenceApplyConfiguration struct { Name *string `json:"name,omitempty"` Namespace *string `json:"namespace,omitempty"` } -// SecretReferenceApplyConfiguration constructs an declarative configuration of the SecretReference type for use with +// SecretReferenceApplyConfiguration constructs a declarative configuration of the SecretReference type for use with // apply. func SecretReference() *SecretReferenceApplyConfiguration { return &SecretReferenceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/secretvolumesource.go b/applyconfigurations/core/v1/secretvolumesource.go index bcb441e9f3..9f765d354d 100644 --- a/applyconfigurations/core/v1/secretvolumesource.go +++ b/applyconfigurations/core/v1/secretvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// SecretVolumeSourceApplyConfiguration represents an declarative configuration of the SecretVolumeSource type for use +// SecretVolumeSourceApplyConfiguration represents a declarative configuration of the SecretVolumeSource type for use // with apply. type SecretVolumeSourceApplyConfiguration struct { SecretName *string `json:"secretName,omitempty"` @@ -27,7 +27,7 @@ type SecretVolumeSourceApplyConfiguration struct { Optional *bool `json:"optional,omitempty"` } -// SecretVolumeSourceApplyConfiguration constructs an declarative configuration of the SecretVolumeSource type for use with +// SecretVolumeSourceApplyConfiguration constructs a declarative configuration of the SecretVolumeSource type for use with // apply. func SecretVolumeSource() *SecretVolumeSourceApplyConfiguration { return &SecretVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/securitycontext.go b/applyconfigurations/core/v1/securitycontext.go index 4146b765da..99faab72da 100644 --- a/applyconfigurations/core/v1/securitycontext.go +++ b/applyconfigurations/core/v1/securitycontext.go @@ -22,7 +22,7 @@ import ( corev1 "k8s.io/api/core/v1" ) -// SecurityContextApplyConfiguration represents an declarative configuration of the SecurityContext type for use +// SecurityContextApplyConfiguration represents a declarative configuration of the SecurityContext type for use // with apply. type SecurityContextApplyConfiguration struct { Capabilities *CapabilitiesApplyConfiguration `json:"capabilities,omitempty"` @@ -39,7 +39,7 @@ type SecurityContextApplyConfiguration struct { AppArmorProfile *AppArmorProfileApplyConfiguration `json:"appArmorProfile,omitempty"` } -// SecurityContextApplyConfiguration constructs an declarative configuration of the SecurityContext type for use with +// SecurityContextApplyConfiguration constructs a declarative configuration of the SecurityContext type for use with // apply. func SecurityContext() *SecurityContextApplyConfiguration { return &SecurityContextApplyConfiguration{} diff --git a/applyconfigurations/core/v1/selinuxoptions.go b/applyconfigurations/core/v1/selinuxoptions.go index 2938faa18e..bad01300f0 100644 --- a/applyconfigurations/core/v1/selinuxoptions.go +++ b/applyconfigurations/core/v1/selinuxoptions.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// SELinuxOptionsApplyConfiguration represents an declarative configuration of the SELinuxOptions type for use +// SELinuxOptionsApplyConfiguration represents a declarative configuration of the SELinuxOptions type for use // with apply. type SELinuxOptionsApplyConfiguration struct { User *string `json:"user,omitempty"` @@ -27,7 +27,7 @@ type SELinuxOptionsApplyConfiguration struct { Level *string `json:"level,omitempty"` } -// SELinuxOptionsApplyConfiguration constructs an declarative configuration of the SELinuxOptions type for use with +// SELinuxOptionsApplyConfiguration constructs a declarative configuration of the SELinuxOptions type for use with // apply. func SELinuxOptions() *SELinuxOptionsApplyConfiguration { return &SELinuxOptionsApplyConfiguration{} diff --git a/applyconfigurations/core/v1/service.go b/applyconfigurations/core/v1/service.go index 541aa3d50e..2dac0589d2 100644 --- a/applyconfigurations/core/v1/service.go +++ b/applyconfigurations/core/v1/service.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ServiceApplyConfiguration represents an declarative configuration of the Service type for use +// ServiceApplyConfiguration represents a declarative configuration of the Service type for use // with apply. type ServiceApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type ServiceApplyConfiguration struct { Status *ServiceStatusApplyConfiguration `json:"status,omitempty"` } -// Service constructs an declarative configuration of the Service type for use with +// Service constructs a declarative configuration of the Service type for use with // apply. func Service(name, namespace string) *ServiceApplyConfiguration { b := &ServiceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/serviceaccount.go b/applyconfigurations/core/v1/serviceaccount.go index a413b38c2c..26d33deb95 100644 --- a/applyconfigurations/core/v1/serviceaccount.go +++ b/applyconfigurations/core/v1/serviceaccount.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ServiceAccountApplyConfiguration represents an declarative configuration of the ServiceAccount type for use +// ServiceAccountApplyConfiguration represents a declarative configuration of the ServiceAccount type for use // with apply. type ServiceAccountApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +37,7 @@ type ServiceAccountApplyConfiguration struct { AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty"` } -// ServiceAccount constructs an declarative configuration of the ServiceAccount type for use with +// ServiceAccount constructs a declarative configuration of the ServiceAccount type for use with // apply. func ServiceAccount(name, namespace string) *ServiceAccountApplyConfiguration { b := &ServiceAccountApplyConfiguration{} diff --git a/applyconfigurations/core/v1/serviceaccounttokenprojection.go b/applyconfigurations/core/v1/serviceaccounttokenprojection.go index a52fad7d8d..fab81bf8a2 100644 --- a/applyconfigurations/core/v1/serviceaccounttokenprojection.go +++ b/applyconfigurations/core/v1/serviceaccounttokenprojection.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// ServiceAccountTokenProjectionApplyConfiguration represents an declarative configuration of the ServiceAccountTokenProjection type for use +// ServiceAccountTokenProjectionApplyConfiguration represents a declarative configuration of the ServiceAccountTokenProjection type for use // with apply. type ServiceAccountTokenProjectionApplyConfiguration struct { Audience *string `json:"audience,omitempty"` @@ -26,7 +26,7 @@ type ServiceAccountTokenProjectionApplyConfiguration struct { Path *string `json:"path,omitempty"` } -// ServiceAccountTokenProjectionApplyConfiguration constructs an declarative configuration of the ServiceAccountTokenProjection type for use with +// ServiceAccountTokenProjectionApplyConfiguration constructs a declarative configuration of the ServiceAccountTokenProjection type for use with // apply. func ServiceAccountTokenProjection() *ServiceAccountTokenProjectionApplyConfiguration { return &ServiceAccountTokenProjectionApplyConfiguration{} diff --git a/applyconfigurations/core/v1/serviceport.go b/applyconfigurations/core/v1/serviceport.go index 8bc63bd950..e889f21345 100644 --- a/applyconfigurations/core/v1/serviceport.go +++ b/applyconfigurations/core/v1/serviceport.go @@ -23,7 +23,7 @@ import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) -// ServicePortApplyConfiguration represents an declarative configuration of the ServicePort type for use +// ServicePortApplyConfiguration represents a declarative configuration of the ServicePort type for use // with apply. type ServicePortApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -34,7 +34,7 @@ type ServicePortApplyConfiguration struct { NodePort *int32 `json:"nodePort,omitempty"` } -// ServicePortApplyConfiguration constructs an declarative configuration of the ServicePort type for use with +// ServicePortApplyConfiguration constructs a declarative configuration of the ServicePort type for use with // apply. func ServicePort() *ServicePortApplyConfiguration { return &ServicePortApplyConfiguration{} diff --git a/applyconfigurations/core/v1/servicespec.go b/applyconfigurations/core/v1/servicespec.go index 5cfbcb700f..41367dce4f 100644 --- a/applyconfigurations/core/v1/servicespec.go +++ b/applyconfigurations/core/v1/servicespec.go @@ -22,7 +22,7 @@ import ( corev1 "k8s.io/api/core/v1" ) -// ServiceSpecApplyConfiguration represents an declarative configuration of the ServiceSpec type for use +// ServiceSpecApplyConfiguration represents a declarative configuration of the ServiceSpec type for use // with apply. type ServiceSpecApplyConfiguration struct { Ports []ServicePortApplyConfiguration `json:"ports,omitempty"` @@ -47,7 +47,7 @@ type ServiceSpecApplyConfiguration struct { TrafficDistribution *string `json:"trafficDistribution,omitempty"` } -// ServiceSpecApplyConfiguration constructs an declarative configuration of the ServiceSpec type for use with +// ServiceSpecApplyConfiguration constructs a declarative configuration of the ServiceSpec type for use with // apply. func ServiceSpec() *ServiceSpecApplyConfiguration { return &ServiceSpecApplyConfiguration{} diff --git a/applyconfigurations/core/v1/servicestatus.go b/applyconfigurations/core/v1/servicestatus.go index 2347cec678..11c3f8a80a 100644 --- a/applyconfigurations/core/v1/servicestatus.go +++ b/applyconfigurations/core/v1/servicestatus.go @@ -22,14 +22,14 @@ import ( metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ServiceStatusApplyConfiguration represents an declarative configuration of the ServiceStatus type for use +// ServiceStatusApplyConfiguration represents a declarative configuration of the ServiceStatus type for use // with apply. type ServiceStatusApplyConfiguration struct { LoadBalancer *LoadBalancerStatusApplyConfiguration `json:"loadBalancer,omitempty"` Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` } -// ServiceStatusApplyConfiguration constructs an declarative configuration of the ServiceStatus type for use with +// ServiceStatusApplyConfiguration constructs a declarative configuration of the ServiceStatus type for use with // apply. func ServiceStatus() *ServiceStatusApplyConfiguration { return &ServiceStatusApplyConfiguration{} diff --git a/applyconfigurations/core/v1/sessionaffinityconfig.go b/applyconfigurations/core/v1/sessionaffinityconfig.go index 7016f836a1..13b045fffc 100644 --- a/applyconfigurations/core/v1/sessionaffinityconfig.go +++ b/applyconfigurations/core/v1/sessionaffinityconfig.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// SessionAffinityConfigApplyConfiguration represents an declarative configuration of the SessionAffinityConfig type for use +// SessionAffinityConfigApplyConfiguration represents a declarative configuration of the SessionAffinityConfig type for use // with apply. type SessionAffinityConfigApplyConfiguration struct { ClientIP *ClientIPConfigApplyConfiguration `json:"clientIP,omitempty"` } -// SessionAffinityConfigApplyConfiguration constructs an declarative configuration of the SessionAffinityConfig type for use with +// SessionAffinityConfigApplyConfiguration constructs a declarative configuration of the SessionAffinityConfig type for use with // apply. func SessionAffinityConfig() *SessionAffinityConfigApplyConfiguration { return &SessionAffinityConfigApplyConfiguration{} diff --git a/applyconfigurations/core/v1/sleepaction.go b/applyconfigurations/core/v1/sleepaction.go index 8b3284536a..b4115609b1 100644 --- a/applyconfigurations/core/v1/sleepaction.go +++ b/applyconfigurations/core/v1/sleepaction.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// SleepActionApplyConfiguration represents an declarative configuration of the SleepAction type for use +// SleepActionApplyConfiguration represents a declarative configuration of the SleepAction type for use // with apply. type SleepActionApplyConfiguration struct { Seconds *int64 `json:"seconds,omitempty"` } -// SleepActionApplyConfiguration constructs an declarative configuration of the SleepAction type for use with +// SleepActionApplyConfiguration constructs a declarative configuration of the SleepAction type for use with // apply. func SleepAction() *SleepActionApplyConfiguration { return &SleepActionApplyConfiguration{} diff --git a/applyconfigurations/core/v1/storageospersistentvolumesource.go b/applyconfigurations/core/v1/storageospersistentvolumesource.go index 00ed39ccb0..7381a498e1 100644 --- a/applyconfigurations/core/v1/storageospersistentvolumesource.go +++ b/applyconfigurations/core/v1/storageospersistentvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// StorageOSPersistentVolumeSourceApplyConfiguration represents an declarative configuration of the StorageOSPersistentVolumeSource type for use +// StorageOSPersistentVolumeSourceApplyConfiguration represents a declarative configuration of the StorageOSPersistentVolumeSource type for use // with apply. type StorageOSPersistentVolumeSourceApplyConfiguration struct { VolumeName *string `json:"volumeName,omitempty"` @@ -28,7 +28,7 @@ type StorageOSPersistentVolumeSourceApplyConfiguration struct { SecretRef *ObjectReferenceApplyConfiguration `json:"secretRef,omitempty"` } -// StorageOSPersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the StorageOSPersistentVolumeSource type for use with +// StorageOSPersistentVolumeSourceApplyConfiguration constructs a declarative configuration of the StorageOSPersistentVolumeSource type for use with // apply. func StorageOSPersistentVolumeSource() *StorageOSPersistentVolumeSourceApplyConfiguration { return &StorageOSPersistentVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/storageosvolumesource.go b/applyconfigurations/core/v1/storageosvolumesource.go index 7f3b810cf6..81d9373c19 100644 --- a/applyconfigurations/core/v1/storageosvolumesource.go +++ b/applyconfigurations/core/v1/storageosvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// StorageOSVolumeSourceApplyConfiguration represents an declarative configuration of the StorageOSVolumeSource type for use +// StorageOSVolumeSourceApplyConfiguration represents a declarative configuration of the StorageOSVolumeSource type for use // with apply. type StorageOSVolumeSourceApplyConfiguration struct { VolumeName *string `json:"volumeName,omitempty"` @@ -28,7 +28,7 @@ type StorageOSVolumeSourceApplyConfiguration struct { SecretRef *LocalObjectReferenceApplyConfiguration `json:"secretRef,omitempty"` } -// StorageOSVolumeSourceApplyConfiguration constructs an declarative configuration of the StorageOSVolumeSource type for use with +// StorageOSVolumeSourceApplyConfiguration constructs a declarative configuration of the StorageOSVolumeSource type for use with // apply. func StorageOSVolumeSource() *StorageOSVolumeSourceApplyConfiguration { return &StorageOSVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/sysctl.go b/applyconfigurations/core/v1/sysctl.go index deab9e0b38..7719eb7d60 100644 --- a/applyconfigurations/core/v1/sysctl.go +++ b/applyconfigurations/core/v1/sysctl.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// SysctlApplyConfiguration represents an declarative configuration of the Sysctl type for use +// SysctlApplyConfiguration represents a declarative configuration of the Sysctl type for use // with apply. type SysctlApplyConfiguration struct { Name *string `json:"name,omitempty"` Value *string `json:"value,omitempty"` } -// SysctlApplyConfiguration constructs an declarative configuration of the Sysctl type for use with +// SysctlApplyConfiguration constructs a declarative configuration of the Sysctl type for use with // apply. func Sysctl() *SysctlApplyConfiguration { return &SysctlApplyConfiguration{} diff --git a/applyconfigurations/core/v1/taint.go b/applyconfigurations/core/v1/taint.go index 4672b87427..a34fb05526 100644 --- a/applyconfigurations/core/v1/taint.go +++ b/applyconfigurations/core/v1/taint.go @@ -23,7 +23,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// TaintApplyConfiguration represents an declarative configuration of the Taint type for use +// TaintApplyConfiguration represents a declarative configuration of the Taint type for use // with apply. type TaintApplyConfiguration struct { Key *string `json:"key,omitempty"` @@ -32,7 +32,7 @@ type TaintApplyConfiguration struct { TimeAdded *metav1.Time `json:"timeAdded,omitempty"` } -// TaintApplyConfiguration constructs an declarative configuration of the Taint type for use with +// TaintApplyConfiguration constructs a declarative configuration of the Taint type for use with // apply. func Taint() *TaintApplyConfiguration { return &TaintApplyConfiguration{} diff --git a/applyconfigurations/core/v1/tcpsocketaction.go b/applyconfigurations/core/v1/tcpsocketaction.go index bd038fc3ae..cba1a7d081 100644 --- a/applyconfigurations/core/v1/tcpsocketaction.go +++ b/applyconfigurations/core/v1/tcpsocketaction.go @@ -22,14 +22,14 @@ import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) -// TCPSocketActionApplyConfiguration represents an declarative configuration of the TCPSocketAction type for use +// TCPSocketActionApplyConfiguration represents a declarative configuration of the TCPSocketAction type for use // with apply. type TCPSocketActionApplyConfiguration struct { Port *intstr.IntOrString `json:"port,omitempty"` Host *string `json:"host,omitempty"` } -// TCPSocketActionApplyConfiguration constructs an declarative configuration of the TCPSocketAction type for use with +// TCPSocketActionApplyConfiguration constructs a declarative configuration of the TCPSocketAction type for use with // apply. func TCPSocketAction() *TCPSocketActionApplyConfiguration { return &TCPSocketActionApplyConfiguration{} diff --git a/applyconfigurations/core/v1/toleration.go b/applyconfigurations/core/v1/toleration.go index 1a92a8c668..1bcc85b65f 100644 --- a/applyconfigurations/core/v1/toleration.go +++ b/applyconfigurations/core/v1/toleration.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// TolerationApplyConfiguration represents an declarative configuration of the Toleration type for use +// TolerationApplyConfiguration represents a declarative configuration of the Toleration type for use // with apply. type TolerationApplyConfiguration struct { Key *string `json:"key,omitempty"` @@ -32,7 +32,7 @@ type TolerationApplyConfiguration struct { TolerationSeconds *int64 `json:"tolerationSeconds,omitempty"` } -// TolerationApplyConfiguration constructs an declarative configuration of the Toleration type for use with +// TolerationApplyConfiguration constructs a declarative configuration of the Toleration type for use with // apply. func Toleration() *TolerationApplyConfiguration { return &TolerationApplyConfiguration{} diff --git a/applyconfigurations/core/v1/topologyselectorlabelrequirement.go b/applyconfigurations/core/v1/topologyselectorlabelrequirement.go index 9581490de2..674ddec93c 100644 --- a/applyconfigurations/core/v1/topologyselectorlabelrequirement.go +++ b/applyconfigurations/core/v1/topologyselectorlabelrequirement.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// TopologySelectorLabelRequirementApplyConfiguration represents an declarative configuration of the TopologySelectorLabelRequirement type for use +// TopologySelectorLabelRequirementApplyConfiguration represents a declarative configuration of the TopologySelectorLabelRequirement type for use // with apply. type TopologySelectorLabelRequirementApplyConfiguration struct { Key *string `json:"key,omitempty"` Values []string `json:"values,omitempty"` } -// TopologySelectorLabelRequirementApplyConfiguration constructs an declarative configuration of the TopologySelectorLabelRequirement type for use with +// TopologySelectorLabelRequirementApplyConfiguration constructs a declarative configuration of the TopologySelectorLabelRequirement type for use with // apply. func TopologySelectorLabelRequirement() *TopologySelectorLabelRequirementApplyConfiguration { return &TopologySelectorLabelRequirementApplyConfiguration{} diff --git a/applyconfigurations/core/v1/topologyselectorterm.go b/applyconfigurations/core/v1/topologyselectorterm.go index a025b8a2a8..7812ae5204 100644 --- a/applyconfigurations/core/v1/topologyselectorterm.go +++ b/applyconfigurations/core/v1/topologyselectorterm.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// TopologySelectorTermApplyConfiguration represents an declarative configuration of the TopologySelectorTerm type for use +// TopologySelectorTermApplyConfiguration represents a declarative configuration of the TopologySelectorTerm type for use // with apply. type TopologySelectorTermApplyConfiguration struct { MatchLabelExpressions []TopologySelectorLabelRequirementApplyConfiguration `json:"matchLabelExpressions,omitempty"` } -// TopologySelectorTermApplyConfiguration constructs an declarative configuration of the TopologySelectorTerm type for use with +// TopologySelectorTermApplyConfiguration constructs a declarative configuration of the TopologySelectorTerm type for use with // apply. func TopologySelectorTerm() *TopologySelectorTermApplyConfiguration { return &TopologySelectorTermApplyConfiguration{} diff --git a/applyconfigurations/core/v1/topologyspreadconstraint.go b/applyconfigurations/core/v1/topologyspreadconstraint.go index fbfa8fa886..b21d233513 100644 --- a/applyconfigurations/core/v1/topologyspreadconstraint.go +++ b/applyconfigurations/core/v1/topologyspreadconstraint.go @@ -23,7 +23,7 @@ import ( metav1 "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"` @@ -36,7 +36,7 @@ type TopologySpreadConstraintApplyConfiguration struct { MatchLabelKeys []string `json:"matchLabelKeys,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/applyconfigurations/core/v1/typedlocalobjectreference.go b/applyconfigurations/core/v1/typedlocalobjectreference.go index cdc2eb7d34..1e63b79889 100644 --- a/applyconfigurations/core/v1/typedlocalobjectreference.go +++ b/applyconfigurations/core/v1/typedlocalobjectreference.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// TypedLocalObjectReferenceApplyConfiguration represents an declarative configuration of the TypedLocalObjectReference type for use +// TypedLocalObjectReferenceApplyConfiguration represents a declarative configuration of the TypedLocalObjectReference type for use // with apply. type TypedLocalObjectReferenceApplyConfiguration struct { APIGroup *string `json:"apiGroup,omitempty"` @@ -26,7 +26,7 @@ type TypedLocalObjectReferenceApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// TypedLocalObjectReferenceApplyConfiguration constructs an declarative configuration of the TypedLocalObjectReference type for use with +// TypedLocalObjectReferenceApplyConfiguration constructs a declarative configuration of the TypedLocalObjectReference type for use with // apply. func TypedLocalObjectReference() *TypedLocalObjectReferenceApplyConfiguration { return &TypedLocalObjectReferenceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/typedobjectreference.go b/applyconfigurations/core/v1/typedobjectreference.go index d9a01c9c3a..f07de8902e 100644 --- a/applyconfigurations/core/v1/typedobjectreference.go +++ b/applyconfigurations/core/v1/typedobjectreference.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// TypedObjectReferenceApplyConfiguration represents an declarative configuration of the TypedObjectReference type for use +// TypedObjectReferenceApplyConfiguration represents a declarative configuration of the TypedObjectReference type for use // with apply. type TypedObjectReferenceApplyConfiguration struct { APIGroup *string `json:"apiGroup,omitempty"` @@ -27,7 +27,7 @@ type TypedObjectReferenceApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` } -// TypedObjectReferenceApplyConfiguration constructs an declarative configuration of the TypedObjectReference type for use with +// TypedObjectReferenceApplyConfiguration constructs a declarative configuration of the TypedObjectReference type for use with // apply. func TypedObjectReference() *TypedObjectReferenceApplyConfiguration { return &TypedObjectReferenceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/volume.go b/applyconfigurations/core/v1/volume.go index db0686bce7..25de1fac9b 100644 --- a/applyconfigurations/core/v1/volume.go +++ b/applyconfigurations/core/v1/volume.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// VolumeApplyConfiguration represents an declarative configuration of the Volume type for use +// VolumeApplyConfiguration represents a declarative configuration of the Volume type for use // with apply. type VolumeApplyConfiguration struct { Name *string `json:"name,omitempty"` VolumeSourceApplyConfiguration `json:",inline"` } -// VolumeApplyConfiguration constructs an declarative configuration of the Volume type for use with +// VolumeApplyConfiguration constructs a declarative configuration of the Volume type for use with // apply. func Volume() *VolumeApplyConfiguration { return &VolumeApplyConfiguration{} diff --git a/applyconfigurations/core/v1/volumedevice.go b/applyconfigurations/core/v1/volumedevice.go index ea18ca8d9e..0bc52aad2a 100644 --- a/applyconfigurations/core/v1/volumedevice.go +++ b/applyconfigurations/core/v1/volumedevice.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// VolumeDeviceApplyConfiguration represents an declarative configuration of the VolumeDevice type for use +// VolumeDeviceApplyConfiguration represents a declarative configuration of the VolumeDevice type for use // with apply. type VolumeDeviceApplyConfiguration struct { Name *string `json:"name,omitempty"` DevicePath *string `json:"devicePath,omitempty"` } -// VolumeDeviceApplyConfiguration constructs an declarative configuration of the VolumeDevice type for use with +// VolumeDeviceApplyConfiguration constructs a declarative configuration of the VolumeDevice type for use with // apply. func VolumeDevice() *VolumeDeviceApplyConfiguration { return &VolumeDeviceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/volumemount.go b/applyconfigurations/core/v1/volumemount.go index 358658350e..49f22cc4e7 100644 --- a/applyconfigurations/core/v1/volumemount.go +++ b/applyconfigurations/core/v1/volumemount.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// VolumeMountApplyConfiguration represents an declarative configuration of the VolumeMount type for use +// VolumeMountApplyConfiguration represents a declarative configuration of the VolumeMount type for use // with apply. type VolumeMountApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -34,7 +34,7 @@ type VolumeMountApplyConfiguration struct { SubPathExpr *string `json:"subPathExpr,omitempty"` } -// VolumeMountApplyConfiguration constructs an declarative configuration of the VolumeMount type for use with +// VolumeMountApplyConfiguration constructs a declarative configuration of the VolumeMount type for use with // apply. func VolumeMount() *VolumeMountApplyConfiguration { return &VolumeMountApplyConfiguration{} diff --git a/applyconfigurations/core/v1/volumemountstatus.go b/applyconfigurations/core/v1/volumemountstatus.go index c3d187fdfa..a0a9b5401c 100644 --- a/applyconfigurations/core/v1/volumemountstatus.go +++ b/applyconfigurations/core/v1/volumemountstatus.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// VolumeMountStatusApplyConfiguration represents an declarative configuration of the VolumeMountStatus type for use +// VolumeMountStatusApplyConfiguration represents a declarative configuration of the VolumeMountStatus type for use // with apply. type VolumeMountStatusApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -31,7 +31,7 @@ type VolumeMountStatusApplyConfiguration struct { RecursiveReadOnly *v1.RecursiveReadOnlyMode `json:"recursiveReadOnly,omitempty"` } -// VolumeMountStatusApplyConfiguration constructs an declarative configuration of the VolumeMountStatus type for use with +// VolumeMountStatusApplyConfiguration constructs a declarative configuration of the VolumeMountStatus type for use with // apply. func VolumeMountStatus() *VolumeMountStatusApplyConfiguration { return &VolumeMountStatusApplyConfiguration{} diff --git a/applyconfigurations/core/v1/volumenodeaffinity.go b/applyconfigurations/core/v1/volumenodeaffinity.go index 32bfd82928..9198c25dc8 100644 --- a/applyconfigurations/core/v1/volumenodeaffinity.go +++ b/applyconfigurations/core/v1/volumenodeaffinity.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// VolumeNodeAffinityApplyConfiguration represents an declarative configuration of the VolumeNodeAffinity type for use +// VolumeNodeAffinityApplyConfiguration represents a declarative configuration of the VolumeNodeAffinity type for use // with apply. type VolumeNodeAffinityApplyConfiguration struct { Required *NodeSelectorApplyConfiguration `json:"required,omitempty"` } -// VolumeNodeAffinityApplyConfiguration constructs an declarative configuration of the VolumeNodeAffinity type for use with +// VolumeNodeAffinityApplyConfiguration constructs a declarative configuration of the VolumeNodeAffinity type for use with // apply. func VolumeNodeAffinity() *VolumeNodeAffinityApplyConfiguration { return &VolumeNodeAffinityApplyConfiguration{} diff --git a/applyconfigurations/core/v1/volumeprojection.go b/applyconfigurations/core/v1/volumeprojection.go index a2ef0a9943..c14e9fe697 100644 --- a/applyconfigurations/core/v1/volumeprojection.go +++ b/applyconfigurations/core/v1/volumeprojection.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// VolumeProjectionApplyConfiguration represents an declarative configuration of the VolumeProjection type for use +// VolumeProjectionApplyConfiguration represents a declarative configuration of the VolumeProjection type for use // with apply. type VolumeProjectionApplyConfiguration struct { Secret *SecretProjectionApplyConfiguration `json:"secret,omitempty"` @@ -28,7 +28,7 @@ type VolumeProjectionApplyConfiguration struct { ClusterTrustBundle *ClusterTrustBundleProjectionApplyConfiguration `json:"clusterTrustBundle,omitempty"` } -// VolumeProjectionApplyConfiguration constructs an declarative configuration of the VolumeProjection type for use with +// VolumeProjectionApplyConfiguration constructs a declarative configuration of the VolumeProjection type for use with // apply. func VolumeProjection() *VolumeProjectionApplyConfiguration { return &VolumeProjectionApplyConfiguration{} diff --git a/applyconfigurations/core/v1/volumeresourcerequirements.go b/applyconfigurations/core/v1/volumeresourcerequirements.go index 89ad1da8b3..ae849f7741 100644 --- a/applyconfigurations/core/v1/volumeresourcerequirements.go +++ b/applyconfigurations/core/v1/volumeresourcerequirements.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/core/v1" ) -// VolumeResourceRequirementsApplyConfiguration represents an declarative configuration of the VolumeResourceRequirements type for use +// VolumeResourceRequirementsApplyConfiguration represents a declarative configuration of the VolumeResourceRequirements type for use // with apply. type VolumeResourceRequirementsApplyConfiguration struct { Limits *v1.ResourceList `json:"limits,omitempty"` Requests *v1.ResourceList `json:"requests,omitempty"` } -// VolumeResourceRequirementsApplyConfiguration constructs an declarative configuration of the VolumeResourceRequirements type for use with +// VolumeResourceRequirementsApplyConfiguration constructs a declarative configuration of the VolumeResourceRequirements type for use with // apply. func VolumeResourceRequirements() *VolumeResourceRequirementsApplyConfiguration { return &VolumeResourceRequirementsApplyConfiguration{} diff --git a/applyconfigurations/core/v1/volumesource.go b/applyconfigurations/core/v1/volumesource.go index 4a8d316dd5..59fc805aea 100644 --- a/applyconfigurations/core/v1/volumesource.go +++ b/applyconfigurations/core/v1/volumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// VolumeSourceApplyConfiguration represents an declarative configuration of the VolumeSource type for use +// VolumeSourceApplyConfiguration represents a declarative configuration of the VolumeSource type for use // with apply. type VolumeSourceApplyConfiguration struct { HostPath *HostPathVolumeSourceApplyConfiguration `json:"hostPath,omitempty"` @@ -52,7 +52,7 @@ type VolumeSourceApplyConfiguration struct { Ephemeral *EphemeralVolumeSourceApplyConfiguration `json:"ephemeral,omitempty"` } -// VolumeSourceApplyConfiguration constructs an declarative configuration of the VolumeSource type for use with +// VolumeSourceApplyConfiguration constructs a declarative configuration of the VolumeSource type for use with // apply. func VolumeSource() *VolumeSourceApplyConfiguration { return &VolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/vspherevirtualdiskvolumesource.go b/applyconfigurations/core/v1/vspherevirtualdiskvolumesource.go index ff3e3e27d9..ea8fd8d62e 100644 --- a/applyconfigurations/core/v1/vspherevirtualdiskvolumesource.go +++ b/applyconfigurations/core/v1/vspherevirtualdiskvolumesource.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// VsphereVirtualDiskVolumeSourceApplyConfiguration represents an declarative configuration of the VsphereVirtualDiskVolumeSource type for use +// VsphereVirtualDiskVolumeSourceApplyConfiguration represents a declarative configuration of the VsphereVirtualDiskVolumeSource type for use // with apply. type VsphereVirtualDiskVolumeSourceApplyConfiguration struct { VolumePath *string `json:"volumePath,omitempty"` @@ -27,7 +27,7 @@ type VsphereVirtualDiskVolumeSourceApplyConfiguration struct { StoragePolicyID *string `json:"storagePolicyID,omitempty"` } -// VsphereVirtualDiskVolumeSourceApplyConfiguration constructs an declarative configuration of the VsphereVirtualDiskVolumeSource type for use with +// VsphereVirtualDiskVolumeSourceApplyConfiguration constructs a declarative configuration of the VsphereVirtualDiskVolumeSource type for use with // apply. func VsphereVirtualDiskVolumeSource() *VsphereVirtualDiskVolumeSourceApplyConfiguration { return &VsphereVirtualDiskVolumeSourceApplyConfiguration{} diff --git a/applyconfigurations/core/v1/weightedpodaffinityterm.go b/applyconfigurations/core/v1/weightedpodaffinityterm.go index eb99d06ffa..c49ef93eb4 100644 --- a/applyconfigurations/core/v1/weightedpodaffinityterm.go +++ b/applyconfigurations/core/v1/weightedpodaffinityterm.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// WeightedPodAffinityTermApplyConfiguration represents an declarative configuration of the WeightedPodAffinityTerm type for use +// WeightedPodAffinityTermApplyConfiguration represents a declarative configuration of the WeightedPodAffinityTerm type for use // with apply. type WeightedPodAffinityTermApplyConfiguration struct { Weight *int32 `json:"weight,omitempty"` PodAffinityTerm *PodAffinityTermApplyConfiguration `json:"podAffinityTerm,omitempty"` } -// WeightedPodAffinityTermApplyConfiguration constructs an declarative configuration of the WeightedPodAffinityTerm type for use with +// WeightedPodAffinityTermApplyConfiguration constructs a declarative configuration of the WeightedPodAffinityTerm type for use with // apply. func WeightedPodAffinityTerm() *WeightedPodAffinityTermApplyConfiguration { return &WeightedPodAffinityTermApplyConfiguration{} diff --git a/applyconfigurations/core/v1/windowssecuritycontextoptions.go b/applyconfigurations/core/v1/windowssecuritycontextoptions.go index 20692e0146..bb37a500b4 100644 --- a/applyconfigurations/core/v1/windowssecuritycontextoptions.go +++ b/applyconfigurations/core/v1/windowssecuritycontextoptions.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// WindowsSecurityContextOptionsApplyConfiguration represents an declarative configuration of the WindowsSecurityContextOptions type for use +// WindowsSecurityContextOptionsApplyConfiguration represents a declarative configuration of the WindowsSecurityContextOptions type for use // with apply. type WindowsSecurityContextOptionsApplyConfiguration struct { GMSACredentialSpecName *string `json:"gmsaCredentialSpecName,omitempty"` @@ -27,7 +27,7 @@ type WindowsSecurityContextOptionsApplyConfiguration struct { HostProcess *bool `json:"hostProcess,omitempty"` } -// WindowsSecurityContextOptionsApplyConfiguration constructs an declarative configuration of the WindowsSecurityContextOptions type for use with +// WindowsSecurityContextOptionsApplyConfiguration constructs a declarative configuration of the WindowsSecurityContextOptions type for use with // apply. func WindowsSecurityContextOptions() *WindowsSecurityContextOptionsApplyConfiguration { return &WindowsSecurityContextOptionsApplyConfiguration{} diff --git a/applyconfigurations/discovery/v1/endpoint.go b/applyconfigurations/discovery/v1/endpoint.go index d8c2359a3b..df45a6fb8a 100644 --- a/applyconfigurations/discovery/v1/endpoint.go +++ b/applyconfigurations/discovery/v1/endpoint.go @@ -22,7 +22,7 @@ import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" ) -// EndpointApplyConfiguration represents an declarative configuration of the Endpoint type for use +// EndpointApplyConfiguration represents a declarative configuration of the Endpoint type for use // with apply. type EndpointApplyConfiguration struct { Addresses []string `json:"addresses,omitempty"` @@ -35,7 +35,7 @@ type EndpointApplyConfiguration struct { Hints *EndpointHintsApplyConfiguration `json:"hints,omitempty"` } -// EndpointApplyConfiguration constructs an declarative configuration of the Endpoint type for use with +// EndpointApplyConfiguration constructs a declarative configuration of the Endpoint type for use with // apply. func Endpoint() *EndpointApplyConfiguration { return &EndpointApplyConfiguration{} diff --git a/applyconfigurations/discovery/v1/endpointconditions.go b/applyconfigurations/discovery/v1/endpointconditions.go index 68c25dd57c..20f0b97124 100644 --- a/applyconfigurations/discovery/v1/endpointconditions.go +++ b/applyconfigurations/discovery/v1/endpointconditions.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// EndpointConditionsApplyConfiguration represents an declarative configuration of the EndpointConditions type for use +// EndpointConditionsApplyConfiguration represents a declarative configuration of the EndpointConditions type for use // with apply. type EndpointConditionsApplyConfiguration struct { Ready *bool `json:"ready,omitempty"` @@ -26,7 +26,7 @@ type EndpointConditionsApplyConfiguration struct { Terminating *bool `json:"terminating,omitempty"` } -// EndpointConditionsApplyConfiguration constructs an declarative configuration of the EndpointConditions type for use with +// EndpointConditionsApplyConfiguration constructs a declarative configuration of the EndpointConditions type for use with // apply. func EndpointConditions() *EndpointConditionsApplyConfiguration { return &EndpointConditionsApplyConfiguration{} diff --git a/applyconfigurations/discovery/v1/endpointhints.go b/applyconfigurations/discovery/v1/endpointhints.go index 6eb9f21a51..d2d0f67769 100644 --- a/applyconfigurations/discovery/v1/endpointhints.go +++ b/applyconfigurations/discovery/v1/endpointhints.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// EndpointHintsApplyConfiguration represents an declarative configuration of the EndpointHints type for use +// EndpointHintsApplyConfiguration represents a declarative configuration of the EndpointHints type for use // with apply. type EndpointHintsApplyConfiguration struct { ForZones []ForZoneApplyConfiguration `json:"forZones,omitempty"` } -// EndpointHintsApplyConfiguration constructs an declarative configuration of the EndpointHints type for use with +// EndpointHintsApplyConfiguration constructs a declarative configuration of the EndpointHints type for use with // apply. func EndpointHints() *EndpointHintsApplyConfiguration { return &EndpointHintsApplyConfiguration{} diff --git a/applyconfigurations/discovery/v1/endpointport.go b/applyconfigurations/discovery/v1/endpointport.go index c712956009..12908deb61 100644 --- a/applyconfigurations/discovery/v1/endpointport.go +++ b/applyconfigurations/discovery/v1/endpointport.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// EndpointPortApplyConfiguration represents an declarative configuration of the EndpointPort type for use +// EndpointPortApplyConfiguration represents a declarative configuration of the EndpointPort type for use // with apply. type EndpointPortApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -31,7 +31,7 @@ type EndpointPortApplyConfiguration struct { AppProtocol *string `json:"appProtocol,omitempty"` } -// EndpointPortApplyConfiguration constructs an declarative configuration of the EndpointPort type for use with +// EndpointPortApplyConfiguration constructs a declarative configuration of the EndpointPort type for use with // apply. func EndpointPort() *EndpointPortApplyConfiguration { return &EndpointPortApplyConfiguration{} diff --git a/applyconfigurations/discovery/v1/endpointslice.go b/applyconfigurations/discovery/v1/endpointslice.go index 96c10dc5b9..97002d2bbb 100644 --- a/applyconfigurations/discovery/v1/endpointslice.go +++ b/applyconfigurations/discovery/v1/endpointslice.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// EndpointSliceApplyConfiguration represents an declarative configuration of the EndpointSlice type for use +// EndpointSliceApplyConfiguration represents a declarative configuration of the EndpointSlice type for use // with apply. type EndpointSliceApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +37,7 @@ type EndpointSliceApplyConfiguration struct { Ports []EndpointPortApplyConfiguration `json:"ports,omitempty"` } -// EndpointSlice constructs an declarative configuration of the EndpointSlice type for use with +// EndpointSlice constructs a declarative configuration of the EndpointSlice type for use with // apply. func EndpointSlice(name, namespace string) *EndpointSliceApplyConfiguration { b := &EndpointSliceApplyConfiguration{} diff --git a/applyconfigurations/discovery/v1/forzone.go b/applyconfigurations/discovery/v1/forzone.go index 192a5ad2e8..505d11ae2f 100644 --- a/applyconfigurations/discovery/v1/forzone.go +++ b/applyconfigurations/discovery/v1/forzone.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// ForZoneApplyConfiguration represents an declarative configuration of the ForZone type for use +// ForZoneApplyConfiguration represents a declarative configuration of the ForZone type for use // with apply. type ForZoneApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// ForZoneApplyConfiguration constructs an declarative configuration of the ForZone type for use with +// ForZoneApplyConfiguration constructs a declarative configuration of the ForZone type for use with // apply. func ForZone() *ForZoneApplyConfiguration { return &ForZoneApplyConfiguration{} diff --git a/applyconfigurations/discovery/v1beta1/endpoint.go b/applyconfigurations/discovery/v1beta1/endpoint.go index 724c2d007c..5d87dae72e 100644 --- a/applyconfigurations/discovery/v1beta1/endpoint.go +++ b/applyconfigurations/discovery/v1beta1/endpoint.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" ) -// EndpointApplyConfiguration represents an declarative configuration of the Endpoint type for use +// EndpointApplyConfiguration represents a declarative configuration of the Endpoint type for use // with apply. type EndpointApplyConfiguration struct { Addresses []string `json:"addresses,omitempty"` @@ -34,7 +34,7 @@ type EndpointApplyConfiguration struct { Hints *EndpointHintsApplyConfiguration `json:"hints,omitempty"` } -// EndpointApplyConfiguration constructs an declarative configuration of the Endpoint type for use with +// EndpointApplyConfiguration constructs a declarative configuration of the Endpoint type for use with // apply. func Endpoint() *EndpointApplyConfiguration { return &EndpointApplyConfiguration{} diff --git a/applyconfigurations/discovery/v1beta1/endpointconditions.go b/applyconfigurations/discovery/v1beta1/endpointconditions.go index bc0438f90b..13f5fa5575 100644 --- a/applyconfigurations/discovery/v1beta1/endpointconditions.go +++ b/applyconfigurations/discovery/v1beta1/endpointconditions.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// EndpointConditionsApplyConfiguration represents an declarative configuration of the EndpointConditions type for use +// EndpointConditionsApplyConfiguration represents a declarative configuration of the EndpointConditions type for use // with apply. type EndpointConditionsApplyConfiguration struct { Ready *bool `json:"ready,omitempty"` @@ -26,7 +26,7 @@ type EndpointConditionsApplyConfiguration struct { Terminating *bool `json:"terminating,omitempty"` } -// EndpointConditionsApplyConfiguration constructs an declarative configuration of the EndpointConditions type for use with +// EndpointConditionsApplyConfiguration constructs a declarative configuration of the EndpointConditions type for use with // apply. func EndpointConditions() *EndpointConditionsApplyConfiguration { return &EndpointConditionsApplyConfiguration{} diff --git a/applyconfigurations/discovery/v1beta1/endpointhints.go b/applyconfigurations/discovery/v1beta1/endpointhints.go index 41d80206b3..99f69027a8 100644 --- a/applyconfigurations/discovery/v1beta1/endpointhints.go +++ b/applyconfigurations/discovery/v1beta1/endpointhints.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta1 -// EndpointHintsApplyConfiguration represents an declarative configuration of the EndpointHints type for use +// EndpointHintsApplyConfiguration represents a declarative configuration of the EndpointHints type for use // with apply. type EndpointHintsApplyConfiguration struct { ForZones []ForZoneApplyConfiguration `json:"forZones,omitempty"` } -// EndpointHintsApplyConfiguration constructs an declarative configuration of the EndpointHints type for use with +// EndpointHintsApplyConfiguration constructs a declarative configuration of the EndpointHints type for use with // apply. func EndpointHints() *EndpointHintsApplyConfiguration { return &EndpointHintsApplyConfiguration{} diff --git a/applyconfigurations/discovery/v1beta1/endpointport.go b/applyconfigurations/discovery/v1beta1/endpointport.go index 9a3a31b965..07cfc684b2 100644 --- a/applyconfigurations/discovery/v1beta1/endpointport.go +++ b/applyconfigurations/discovery/v1beta1/endpointport.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// EndpointPortApplyConfiguration represents an declarative configuration of the EndpointPort type for use +// EndpointPortApplyConfiguration represents a declarative configuration of the EndpointPort type for use // with apply. type EndpointPortApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -31,7 +31,7 @@ type EndpointPortApplyConfiguration struct { AppProtocol *string `json:"appProtocol,omitempty"` } -// EndpointPortApplyConfiguration constructs an declarative configuration of the EndpointPort type for use with +// EndpointPortApplyConfiguration constructs a declarative configuration of the EndpointPort type for use with // apply. func EndpointPort() *EndpointPortApplyConfiguration { return &EndpointPortApplyConfiguration{} diff --git a/applyconfigurations/discovery/v1beta1/endpointslice.go b/applyconfigurations/discovery/v1beta1/endpointslice.go index 75d1b8b28c..888319bc0f 100644 --- a/applyconfigurations/discovery/v1beta1/endpointslice.go +++ b/applyconfigurations/discovery/v1beta1/endpointslice.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// EndpointSliceApplyConfiguration represents an declarative configuration of the EndpointSlice type for use +// EndpointSliceApplyConfiguration represents a declarative configuration of the EndpointSlice type for use // with apply. type EndpointSliceApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +37,7 @@ type EndpointSliceApplyConfiguration struct { Ports []EndpointPortApplyConfiguration `json:"ports,omitempty"` } -// EndpointSlice constructs an declarative configuration of the EndpointSlice type for use with +// EndpointSlice constructs a declarative configuration of the EndpointSlice type for use with // apply. func EndpointSlice(name, namespace string) *EndpointSliceApplyConfiguration { b := &EndpointSliceApplyConfiguration{} diff --git a/applyconfigurations/discovery/v1beta1/forzone.go b/applyconfigurations/discovery/v1beta1/forzone.go index 4d1455ed38..4af09cc49b 100644 --- a/applyconfigurations/discovery/v1beta1/forzone.go +++ b/applyconfigurations/discovery/v1beta1/forzone.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta1 -// ForZoneApplyConfiguration represents an declarative configuration of the ForZone type for use +// ForZoneApplyConfiguration represents a declarative configuration of the ForZone type for use // with apply. type ForZoneApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// ForZoneApplyConfiguration constructs an declarative configuration of the ForZone type for use with +// ForZoneApplyConfiguration constructs a declarative configuration of the ForZone type for use with // apply. func ForZone() *ForZoneApplyConfiguration { return &ForZoneApplyConfiguration{} diff --git a/applyconfigurations/events/v1/event.go b/applyconfigurations/events/v1/event.go index 2c6b8addff..a6e98d1c82 100644 --- a/applyconfigurations/events/v1/event.go +++ b/applyconfigurations/events/v1/event.go @@ -28,7 +28,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// EventApplyConfiguration represents an declarative configuration of the Event type for use +// EventApplyConfiguration represents a declarative configuration of the Event type for use // with apply. type EventApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -49,7 +49,7 @@ type EventApplyConfiguration struct { DeprecatedCount *int32 `json:"deprecatedCount,omitempty"` } -// Event constructs an declarative configuration of the Event type for use with +// Event constructs a declarative configuration of the Event type for use with // apply. func Event(name, namespace string) *EventApplyConfiguration { b := &EventApplyConfiguration{} diff --git a/applyconfigurations/events/v1/eventseries.go b/applyconfigurations/events/v1/eventseries.go index e66fb41271..18069c0d1b 100644 --- a/applyconfigurations/events/v1/eventseries.go +++ b/applyconfigurations/events/v1/eventseries.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// EventSeriesApplyConfiguration represents an declarative configuration of the EventSeries type for use +// EventSeriesApplyConfiguration represents a declarative configuration of the EventSeries type for use // with apply. type EventSeriesApplyConfiguration struct { Count *int32 `json:"count,omitempty"` LastObservedTime *v1.MicroTime `json:"lastObservedTime,omitempty"` } -// EventSeriesApplyConfiguration constructs an declarative configuration of the EventSeries type for use with +// EventSeriesApplyConfiguration constructs a declarative configuration of the EventSeries type for use with // apply. func EventSeries() *EventSeriesApplyConfiguration { return &EventSeriesApplyConfiguration{} diff --git a/applyconfigurations/events/v1beta1/event.go b/applyconfigurations/events/v1beta1/event.go index 12fd53898c..890d95748b 100644 --- a/applyconfigurations/events/v1beta1/event.go +++ b/applyconfigurations/events/v1beta1/event.go @@ -28,7 +28,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// EventApplyConfiguration represents an declarative configuration of the Event type for use +// EventApplyConfiguration represents a declarative configuration of the Event type for use // with apply. type EventApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -49,7 +49,7 @@ type EventApplyConfiguration struct { DeprecatedCount *int32 `json:"deprecatedCount,omitempty"` } -// Event constructs an declarative configuration of the Event type for use with +// Event constructs a declarative configuration of the Event type for use with // apply. func Event(name, namespace string) *EventApplyConfiguration { b := &EventApplyConfiguration{} diff --git a/applyconfigurations/events/v1beta1/eventseries.go b/applyconfigurations/events/v1beta1/eventseries.go index 640a265172..75d936e8be 100644 --- a/applyconfigurations/events/v1beta1/eventseries.go +++ b/applyconfigurations/events/v1beta1/eventseries.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// EventSeriesApplyConfiguration represents an declarative configuration of the EventSeries type for use +// EventSeriesApplyConfiguration represents a declarative configuration of the EventSeries type for use // with apply. type EventSeriesApplyConfiguration struct { Count *int32 `json:"count,omitempty"` LastObservedTime *v1.MicroTime `json:"lastObservedTime,omitempty"` } -// EventSeriesApplyConfiguration constructs an declarative configuration of the EventSeries type for use with +// EventSeriesApplyConfiguration constructs a declarative configuration of the EventSeries type for use with // apply. func EventSeries() *EventSeriesApplyConfiguration { return &EventSeriesApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/daemonset.go b/applyconfigurations/extensions/v1beta1/daemonset.go index 7efbff07fb..ff778529c9 100644 --- a/applyconfigurations/extensions/v1beta1/daemonset.go +++ b/applyconfigurations/extensions/v1beta1/daemonset.go @@ -27,7 +27,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"` @@ -36,7 +36,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{} diff --git a/applyconfigurations/extensions/v1beta1/daemonsetcondition.go b/applyconfigurations/extensions/v1beta1/daemonsetcondition.go index bbf718f0f2..9b8057e69d 100644 --- a/applyconfigurations/extensions/v1beta1/daemonsetcondition.go +++ b/applyconfigurations/extensions/v1beta1/daemonsetcondition.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// DaemonSetConditionApplyConfiguration represents an declarative configuration of the DaemonSetCondition type for use +// DaemonSetConditionApplyConfiguration represents a declarative configuration of the DaemonSetCondition type for use // with apply. type DaemonSetConditionApplyConfiguration struct { Type *v1beta1.DaemonSetConditionType `json:"type,omitempty"` @@ -34,7 +34,7 @@ type DaemonSetConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// DaemonSetConditionApplyConfiguration constructs an declarative configuration of the DaemonSetCondition type for use with +// DaemonSetConditionApplyConfiguration constructs a declarative configuration of the DaemonSetCondition type for use with // apply. func DaemonSetCondition() *DaemonSetConditionApplyConfiguration { return &DaemonSetConditionApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/daemonsetspec.go b/applyconfigurations/extensions/v1beta1/daemonsetspec.go index b5d7a0c161..d628969187 100644 --- a/applyconfigurations/extensions/v1beta1/daemonsetspec.go +++ b/applyconfigurations/extensions/v1beta1/daemonsetspec.go @@ -23,7 +23,7 @@ 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:"selector,omitempty"` @@ -34,7 +34,7 @@ type DaemonSetSpecApplyConfiguration struct { RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,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/applyconfigurations/extensions/v1beta1/daemonsetstatus.go b/applyconfigurations/extensions/v1beta1/daemonsetstatus.go index be6b3b2853..373f9ef97a 100644 --- a/applyconfigurations/extensions/v1beta1/daemonsetstatus.go +++ b/applyconfigurations/extensions/v1beta1/daemonsetstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// 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 { CurrentNumberScheduled *int32 `json:"currentNumberScheduled,omitempty"` @@ -33,7 +33,7 @@ type DaemonSetStatusApplyConfiguration struct { Conditions []DaemonSetConditionApplyConfiguration `json:"conditions,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/applyconfigurations/extensions/v1beta1/daemonsetupdatestrategy.go b/applyconfigurations/extensions/v1beta1/daemonsetupdatestrategy.go index 2c827e62d4..e597b15a6a 100644 --- a/applyconfigurations/extensions/v1beta1/daemonsetupdatestrategy.go +++ b/applyconfigurations/extensions/v1beta1/daemonsetupdatestrategy.go @@ -22,14 +22,14 @@ import ( v1beta1 "k8s.io/api/extensions/v1beta1" ) -// DaemonSetUpdateStrategyApplyConfiguration represents an declarative configuration of the DaemonSetUpdateStrategy type for use +// DaemonSetUpdateStrategyApplyConfiguration represents a declarative configuration of the DaemonSetUpdateStrategy type for use // with apply. type DaemonSetUpdateStrategyApplyConfiguration struct { Type *v1beta1.DaemonSetUpdateStrategyType `json:"type,omitempty"` RollingUpdate *RollingUpdateDaemonSetApplyConfiguration `json:"rollingUpdate,omitempty"` } -// DaemonSetUpdateStrategyApplyConfiguration constructs an declarative configuration of the DaemonSetUpdateStrategy type for use with +// DaemonSetUpdateStrategyApplyConfiguration constructs a declarative configuration of the DaemonSetUpdateStrategy type for use with // apply. func DaemonSetUpdateStrategy() *DaemonSetUpdateStrategyApplyConfiguration { return &DaemonSetUpdateStrategyApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/deployment.go b/applyconfigurations/extensions/v1beta1/deployment.go index d16ebed903..6badc64d82 100644 --- a/applyconfigurations/extensions/v1beta1/deployment.go +++ b/applyconfigurations/extensions/v1beta1/deployment.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// DeploymentApplyConfiguration represents an declarative configuration of the Deployment type for use +// DeploymentApplyConfiguration represents a declarative configuration of the Deployment type for use // with apply. type DeploymentApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type DeploymentApplyConfiguration struct { Status *DeploymentStatusApplyConfiguration `json:"status,omitempty"` } -// Deployment constructs an declarative configuration of the Deployment type for use with +// Deployment constructs a declarative configuration of the Deployment type for use with // apply. func Deployment(name, namespace string) *DeploymentApplyConfiguration { b := &DeploymentApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/deploymentcondition.go b/applyconfigurations/extensions/v1beta1/deploymentcondition.go index d8a214b7fc..79e109a779 100644 --- a/applyconfigurations/extensions/v1beta1/deploymentcondition.go +++ b/applyconfigurations/extensions/v1beta1/deploymentcondition.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// DeploymentConditionApplyConfiguration represents an declarative configuration of the DeploymentCondition type for use +// DeploymentConditionApplyConfiguration represents a declarative configuration of the DeploymentCondition type for use // with apply. type DeploymentConditionApplyConfiguration struct { Type *v1beta1.DeploymentConditionType `json:"type,omitempty"` @@ -35,7 +35,7 @@ type DeploymentConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// DeploymentConditionApplyConfiguration constructs an declarative configuration of the DeploymentCondition type for use with +// DeploymentConditionApplyConfiguration constructs a declarative configuration of the DeploymentCondition type for use with // apply. func DeploymentCondition() *DeploymentConditionApplyConfiguration { return &DeploymentConditionApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/deploymentspec.go b/applyconfigurations/extensions/v1beta1/deploymentspec.go index 5e18476bdc..5531c756f9 100644 --- a/applyconfigurations/extensions/v1beta1/deploymentspec.go +++ b/applyconfigurations/extensions/v1beta1/deploymentspec.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// DeploymentSpecApplyConfiguration represents an declarative configuration of the DeploymentSpec type for use +// DeploymentSpecApplyConfiguration represents a declarative configuration of the DeploymentSpec type for use // with apply. type DeploymentSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` @@ -37,7 +37,7 @@ type DeploymentSpecApplyConfiguration struct { ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"` } -// DeploymentSpecApplyConfiguration constructs an declarative configuration of the DeploymentSpec type for use with +// DeploymentSpecApplyConfiguration constructs a declarative configuration of the DeploymentSpec type for use with // apply. func DeploymentSpec() *DeploymentSpecApplyConfiguration { return &DeploymentSpecApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/deploymentstatus.go b/applyconfigurations/extensions/v1beta1/deploymentstatus.go index f8d1cf5d25..adc023a34d 100644 --- a/applyconfigurations/extensions/v1beta1/deploymentstatus.go +++ b/applyconfigurations/extensions/v1beta1/deploymentstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// DeploymentStatusApplyConfiguration represents an declarative configuration of the DeploymentStatus type for use +// DeploymentStatusApplyConfiguration represents a declarative configuration of the DeploymentStatus type for use // with apply. type DeploymentStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` @@ -31,7 +31,7 @@ type DeploymentStatusApplyConfiguration struct { CollisionCount *int32 `json:"collisionCount,omitempty"` } -// DeploymentStatusApplyConfiguration constructs an declarative configuration of the DeploymentStatus type for use with +// DeploymentStatusApplyConfiguration constructs a declarative configuration of the DeploymentStatus type for use with // apply. func DeploymentStatus() *DeploymentStatusApplyConfiguration { return &DeploymentStatusApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/deploymentstrategy.go b/applyconfigurations/extensions/v1beta1/deploymentstrategy.go index 7c17b40722..2d88406eb9 100644 --- a/applyconfigurations/extensions/v1beta1/deploymentstrategy.go +++ b/applyconfigurations/extensions/v1beta1/deploymentstrategy.go @@ -22,14 +22,14 @@ import ( v1beta1 "k8s.io/api/extensions/v1beta1" ) -// DeploymentStrategyApplyConfiguration represents an declarative configuration of the DeploymentStrategy type for use +// DeploymentStrategyApplyConfiguration represents a declarative configuration of the DeploymentStrategy type for use // with apply. type DeploymentStrategyApplyConfiguration struct { Type *v1beta1.DeploymentStrategyType `json:"type,omitempty"` RollingUpdate *RollingUpdateDeploymentApplyConfiguration `json:"rollingUpdate,omitempty"` } -// DeploymentStrategyApplyConfiguration constructs an declarative configuration of the DeploymentStrategy type for use with +// DeploymentStrategyApplyConfiguration constructs a declarative configuration of the DeploymentStrategy type for use with // apply. func DeploymentStrategy() *DeploymentStrategyApplyConfiguration { return &DeploymentStrategyApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/httpingresspath.go b/applyconfigurations/extensions/v1beta1/httpingresspath.go index 361605d8cd..3826e0dddc 100644 --- a/applyconfigurations/extensions/v1beta1/httpingresspath.go +++ b/applyconfigurations/extensions/v1beta1/httpingresspath.go @@ -22,7 +22,7 @@ import ( v1beta1 "k8s.io/api/extensions/v1beta1" ) -// HTTPIngressPathApplyConfiguration represents an declarative configuration of the HTTPIngressPath type for use +// HTTPIngressPathApplyConfiguration represents a declarative configuration of the HTTPIngressPath type for use // with apply. type HTTPIngressPathApplyConfiguration struct { Path *string `json:"path,omitempty"` @@ -30,7 +30,7 @@ type HTTPIngressPathApplyConfiguration struct { Backend *IngressBackendApplyConfiguration `json:"backend,omitempty"` } -// HTTPIngressPathApplyConfiguration constructs an declarative configuration of the HTTPIngressPath type for use with +// HTTPIngressPathApplyConfiguration constructs a declarative configuration of the HTTPIngressPath type for use with // apply. func HTTPIngressPath() *HTTPIngressPathApplyConfiguration { return &HTTPIngressPathApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/httpingressrulevalue.go b/applyconfigurations/extensions/v1beta1/httpingressrulevalue.go index 3137bc5eb0..1245452237 100644 --- a/applyconfigurations/extensions/v1beta1/httpingressrulevalue.go +++ b/applyconfigurations/extensions/v1beta1/httpingressrulevalue.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta1 -// HTTPIngressRuleValueApplyConfiguration represents an declarative configuration of the HTTPIngressRuleValue type for use +// HTTPIngressRuleValueApplyConfiguration represents a declarative configuration of the HTTPIngressRuleValue type for use // with apply. type HTTPIngressRuleValueApplyConfiguration struct { Paths []HTTPIngressPathApplyConfiguration `json:"paths,omitempty"` } -// HTTPIngressRuleValueApplyConfiguration constructs an declarative configuration of the HTTPIngressRuleValue type for use with +// HTTPIngressRuleValueApplyConfiguration constructs a declarative configuration of the HTTPIngressRuleValue type for use with // apply. func HTTPIngressRuleValue() *HTTPIngressRuleValueApplyConfiguration { return &HTTPIngressRuleValueApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/ingress.go b/applyconfigurations/extensions/v1beta1/ingress.go index 26b42c0490..6738bf07bf 100644 --- a/applyconfigurations/extensions/v1beta1/ingress.go +++ b/applyconfigurations/extensions/v1beta1/ingress.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// IngressApplyConfiguration represents an declarative configuration of the Ingress type for use +// IngressApplyConfiguration represents a declarative configuration of the Ingress type for use // with apply. type IngressApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type IngressApplyConfiguration struct { Status *IngressStatusApplyConfiguration `json:"status,omitempty"` } -// Ingress constructs an declarative configuration of the Ingress type for use with +// Ingress constructs a declarative configuration of the Ingress type for use with // apply. func Ingress(name, namespace string) *IngressApplyConfiguration { b := &IngressApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/ingressbackend.go b/applyconfigurations/extensions/v1beta1/ingressbackend.go index f19c2f2ee2..9d386f1608 100644 --- a/applyconfigurations/extensions/v1beta1/ingressbackend.go +++ b/applyconfigurations/extensions/v1beta1/ingressbackend.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" ) -// IngressBackendApplyConfiguration represents an declarative configuration of the IngressBackend type for use +// IngressBackendApplyConfiguration represents a declarative configuration of the IngressBackend type for use // with apply. type IngressBackendApplyConfiguration struct { ServiceName *string `json:"serviceName,omitempty"` @@ -31,7 +31,7 @@ type IngressBackendApplyConfiguration struct { Resource *v1.TypedLocalObjectReferenceApplyConfiguration `json:"resource,omitempty"` } -// IngressBackendApplyConfiguration constructs an declarative configuration of the IngressBackend type for use with +// IngressBackendApplyConfiguration constructs a declarative configuration of the IngressBackend type for use with // apply. func IngressBackend() *IngressBackendApplyConfiguration { return &IngressBackendApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/ingressloadbalanceringress.go b/applyconfigurations/extensions/v1beta1/ingressloadbalanceringress.go index 20bf637805..12dbc35969 100644 --- a/applyconfigurations/extensions/v1beta1/ingressloadbalanceringress.go +++ b/applyconfigurations/extensions/v1beta1/ingressloadbalanceringress.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// IngressLoadBalancerIngressApplyConfiguration represents an declarative configuration of the IngressLoadBalancerIngress type for use +// IngressLoadBalancerIngressApplyConfiguration represents a declarative configuration of the IngressLoadBalancerIngress type for use // with apply. type IngressLoadBalancerIngressApplyConfiguration struct { IP *string `json:"ip,omitempty"` @@ -26,7 +26,7 @@ type IngressLoadBalancerIngressApplyConfiguration struct { Ports []IngressPortStatusApplyConfiguration `json:"ports,omitempty"` } -// IngressLoadBalancerIngressApplyConfiguration constructs an declarative configuration of the IngressLoadBalancerIngress type for use with +// IngressLoadBalancerIngressApplyConfiguration constructs a declarative configuration of the IngressLoadBalancerIngress type for use with // apply. func IngressLoadBalancerIngress() *IngressLoadBalancerIngressApplyConfiguration { return &IngressLoadBalancerIngressApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/ingressloadbalancerstatus.go b/applyconfigurations/extensions/v1beta1/ingressloadbalancerstatus.go index e16dd23633..e896ab3415 100644 --- a/applyconfigurations/extensions/v1beta1/ingressloadbalancerstatus.go +++ b/applyconfigurations/extensions/v1beta1/ingressloadbalancerstatus.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta1 -// IngressLoadBalancerStatusApplyConfiguration represents an declarative configuration of the IngressLoadBalancerStatus type for use +// IngressLoadBalancerStatusApplyConfiguration represents a declarative configuration of the IngressLoadBalancerStatus type for use // with apply. type IngressLoadBalancerStatusApplyConfiguration struct { Ingress []IngressLoadBalancerIngressApplyConfiguration `json:"ingress,omitempty"` } -// IngressLoadBalancerStatusApplyConfiguration constructs an declarative configuration of the IngressLoadBalancerStatus type for use with +// IngressLoadBalancerStatusApplyConfiguration constructs a declarative configuration of the IngressLoadBalancerStatus type for use with // apply. func IngressLoadBalancerStatus() *IngressLoadBalancerStatusApplyConfiguration { return &IngressLoadBalancerStatusApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/ingressportstatus.go b/applyconfigurations/extensions/v1beta1/ingressportstatus.go index 0836537979..4ee3f01617 100644 --- a/applyconfigurations/extensions/v1beta1/ingressportstatus.go +++ b/applyconfigurations/extensions/v1beta1/ingressportstatus.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// IngressPortStatusApplyConfiguration represents an declarative configuration of the IngressPortStatus type for use +// IngressPortStatusApplyConfiguration represents a declarative configuration of the IngressPortStatus type for use // with apply. type IngressPortStatusApplyConfiguration struct { Port *int32 `json:"port,omitempty"` @@ -30,7 +30,7 @@ type IngressPortStatusApplyConfiguration struct { Error *string `json:"error,omitempty"` } -// IngressPortStatusApplyConfiguration constructs an declarative configuration of the IngressPortStatus type for use with +// IngressPortStatusApplyConfiguration constructs a declarative configuration of the IngressPortStatus type for use with // apply. func IngressPortStatus() *IngressPortStatusApplyConfiguration { return &IngressPortStatusApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/ingressrule.go b/applyconfigurations/extensions/v1beta1/ingressrule.go index 015541eeb9..dc0f93aaaf 100644 --- a/applyconfigurations/extensions/v1beta1/ingressrule.go +++ b/applyconfigurations/extensions/v1beta1/ingressrule.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta1 -// IngressRuleApplyConfiguration represents an declarative configuration of the IngressRule type for use +// IngressRuleApplyConfiguration represents a declarative configuration of the IngressRule type for use // with apply. type IngressRuleApplyConfiguration struct { Host *string `json:"host,omitempty"` IngressRuleValueApplyConfiguration `json:",omitempty,inline"` } -// IngressRuleApplyConfiguration constructs an declarative configuration of the IngressRule type for use with +// IngressRuleApplyConfiguration constructs a declarative configuration of the IngressRule type for use with // apply. func IngressRule() *IngressRuleApplyConfiguration { return &IngressRuleApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/ingressrulevalue.go b/applyconfigurations/extensions/v1beta1/ingressrulevalue.go index 2d03c7b132..4a64124755 100644 --- a/applyconfigurations/extensions/v1beta1/ingressrulevalue.go +++ b/applyconfigurations/extensions/v1beta1/ingressrulevalue.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta1 -// IngressRuleValueApplyConfiguration represents an declarative configuration of the IngressRuleValue type for use +// IngressRuleValueApplyConfiguration represents a declarative configuration of the IngressRuleValue type for use // with apply. type IngressRuleValueApplyConfiguration struct { HTTP *HTTPIngressRuleValueApplyConfiguration `json:"http,omitempty"` } -// IngressRuleValueApplyConfiguration constructs an declarative configuration of the IngressRuleValue type for use with +// IngressRuleValueApplyConfiguration constructs a declarative configuration of the IngressRuleValue type for use with // apply. func IngressRuleValue() *IngressRuleValueApplyConfiguration { return &IngressRuleValueApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/ingressspec.go b/applyconfigurations/extensions/v1beta1/ingressspec.go index 1ab4d8bb73..58fbde8b35 100644 --- a/applyconfigurations/extensions/v1beta1/ingressspec.go +++ b/applyconfigurations/extensions/v1beta1/ingressspec.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// IngressSpecApplyConfiguration represents an declarative configuration of the IngressSpec type for use +// IngressSpecApplyConfiguration represents a declarative configuration of the IngressSpec type for use // with apply. type IngressSpecApplyConfiguration struct { IngressClassName *string `json:"ingressClassName,omitempty"` @@ -27,7 +27,7 @@ type IngressSpecApplyConfiguration struct { Rules []IngressRuleApplyConfiguration `json:"rules,omitempty"` } -// IngressSpecApplyConfiguration constructs an declarative configuration of the IngressSpec type for use with +// IngressSpecApplyConfiguration constructs a declarative configuration of the IngressSpec type for use with // apply. func IngressSpec() *IngressSpecApplyConfiguration { return &IngressSpecApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/ingressstatus.go b/applyconfigurations/extensions/v1beta1/ingressstatus.go index faa7e2446f..3aed616889 100644 --- a/applyconfigurations/extensions/v1beta1/ingressstatus.go +++ b/applyconfigurations/extensions/v1beta1/ingressstatus.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta1 -// IngressStatusApplyConfiguration represents an declarative configuration of the IngressStatus type for use +// IngressStatusApplyConfiguration represents a declarative configuration of the IngressStatus type for use // with apply. type IngressStatusApplyConfiguration struct { LoadBalancer *IngressLoadBalancerStatusApplyConfiguration `json:"loadBalancer,omitempty"` } -// IngressStatusApplyConfiguration constructs an declarative configuration of the IngressStatus type for use with +// IngressStatusApplyConfiguration constructs a declarative configuration of the IngressStatus type for use with // apply. func IngressStatus() *IngressStatusApplyConfiguration { return &IngressStatusApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/ingresstls.go b/applyconfigurations/extensions/v1beta1/ingresstls.go index 8ca93a0bc2..63648cd464 100644 --- a/applyconfigurations/extensions/v1beta1/ingresstls.go +++ b/applyconfigurations/extensions/v1beta1/ingresstls.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta1 -// IngressTLSApplyConfiguration represents an declarative configuration of the IngressTLS type for use +// IngressTLSApplyConfiguration represents a declarative configuration of the IngressTLS type for use // with apply. type IngressTLSApplyConfiguration struct { Hosts []string `json:"hosts,omitempty"` SecretName *string `json:"secretName,omitempty"` } -// IngressTLSApplyConfiguration constructs an declarative configuration of the IngressTLS type for use with +// IngressTLSApplyConfiguration constructs a declarative configuration of the IngressTLS type for use with // apply. func IngressTLS() *IngressTLSApplyConfiguration { return &IngressTLSApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/ipblock.go b/applyconfigurations/extensions/v1beta1/ipblock.go index a90d3b2207..4a671130b8 100644 --- a/applyconfigurations/extensions/v1beta1/ipblock.go +++ b/applyconfigurations/extensions/v1beta1/ipblock.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta1 -// 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 *string `json:"cidr,omitempty"` Except []string `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/applyconfigurations/extensions/v1beta1/networkpolicy.go b/applyconfigurations/extensions/v1beta1/networkpolicy.go index 9f5869e464..fb1f95a6d6 100644 --- a/applyconfigurations/extensions/v1beta1/networkpolicy.go +++ b/applyconfigurations/extensions/v1beta1/networkpolicy.go @@ -27,7 +27,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"` @@ -35,7 +35,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{} diff --git a/applyconfigurations/extensions/v1beta1/networkpolicyegressrule.go b/applyconfigurations/extensions/v1beta1/networkpolicyegressrule.go index 6335ec375d..ca3e174f93 100644 --- a/applyconfigurations/extensions/v1beta1/networkpolicyegressrule.go +++ b/applyconfigurations/extensions/v1beta1/networkpolicyegressrule.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta1 -// 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/applyconfigurations/extensions/v1beta1/networkpolicyingressrule.go b/applyconfigurations/extensions/v1beta1/networkpolicyingressrule.go index 2ecc4c8c65..1607137204 100644 --- a/applyconfigurations/extensions/v1beta1/networkpolicyingressrule.go +++ b/applyconfigurations/extensions/v1beta1/networkpolicyingressrule.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta1 -// NetworkPolicyIngressRuleApplyConfiguration represents an declarative configuration of the NetworkPolicyIngressRule type for use +// NetworkPolicyIngressRuleApplyConfiguration represents a declarative configuration of the NetworkPolicyIngressRule type for use // with apply. type NetworkPolicyIngressRuleApplyConfiguration struct { Ports []NetworkPolicyPortApplyConfiguration `json:"ports,omitempty"` From []NetworkPolicyPeerApplyConfiguration `json:"from,omitempty"` } -// NetworkPolicyIngressRuleApplyConfiguration constructs an declarative configuration of the NetworkPolicyIngressRule type for use with +// NetworkPolicyIngressRuleApplyConfiguration constructs a declarative configuration of the NetworkPolicyIngressRule type for use with // apply. func NetworkPolicyIngressRule() *NetworkPolicyIngressRuleApplyConfiguration { return &NetworkPolicyIngressRuleApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/networkpolicypeer.go b/applyconfigurations/extensions/v1beta1/networkpolicypeer.go index c69b281225..8a0fa57415 100644 --- a/applyconfigurations/extensions/v1beta1/networkpolicypeer.go +++ b/applyconfigurations/extensions/v1beta1/networkpolicypeer.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// 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 { PodSelector *v1.LabelSelectorApplyConfiguration `json:"podSelector,omitempty"` @@ -30,7 +30,7 @@ type NetworkPolicyPeerApplyConfiguration struct { 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/applyconfigurations/extensions/v1beta1/networkpolicyport.go b/applyconfigurations/extensions/v1beta1/networkpolicyport.go index 0140d771bf..6bc1c1977b 100644 --- a/applyconfigurations/extensions/v1beta1/networkpolicyport.go +++ b/applyconfigurations/extensions/v1beta1/networkpolicyport.go @@ -23,7 +23,7 @@ import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) -// 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"` @@ -31,7 +31,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/applyconfigurations/extensions/v1beta1/networkpolicyspec.go b/applyconfigurations/extensions/v1beta1/networkpolicyspec.go index 179e4bd024..4454329c5b 100644 --- a/applyconfigurations/extensions/v1beta1/networkpolicyspec.go +++ b/applyconfigurations/extensions/v1beta1/networkpolicyspec.go @@ -23,7 +23,7 @@ import ( v1 "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 { PodSelector *v1.LabelSelectorApplyConfiguration `json:"podSelector,omitempty"` @@ -32,7 +32,7 @@ type NetworkPolicySpecApplyConfiguration struct { PolicyTypes []extensionsv1beta1.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/applyconfigurations/extensions/v1beta1/replicaset.go b/applyconfigurations/extensions/v1beta1/replicaset.go index 391e91031b..24c6b6ad1a 100644 --- a/applyconfigurations/extensions/v1beta1/replicaset.go +++ b/applyconfigurations/extensions/v1beta1/replicaset.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ReplicaSetApplyConfiguration represents an declarative configuration of the ReplicaSet type for use +// ReplicaSetApplyConfiguration represents a declarative configuration of the ReplicaSet type for use // with apply. type ReplicaSetApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type ReplicaSetApplyConfiguration struct { Status *ReplicaSetStatusApplyConfiguration `json:"status,omitempty"` } -// ReplicaSet constructs an declarative configuration of the ReplicaSet type for use with +// ReplicaSet constructs a declarative configuration of the ReplicaSet type for use with // apply. func ReplicaSet(name, namespace string) *ReplicaSetApplyConfiguration { b := &ReplicaSetApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/replicasetcondition.go b/applyconfigurations/extensions/v1beta1/replicasetcondition.go index b717365175..21a25ae81f 100644 --- a/applyconfigurations/extensions/v1beta1/replicasetcondition.go +++ b/applyconfigurations/extensions/v1beta1/replicasetcondition.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// ReplicaSetConditionApplyConfiguration represents an declarative configuration of the ReplicaSetCondition type for use +// ReplicaSetConditionApplyConfiguration represents a declarative configuration of the ReplicaSetCondition type for use // with apply. type ReplicaSetConditionApplyConfiguration struct { Type *v1beta1.ReplicaSetConditionType `json:"type,omitempty"` @@ -34,7 +34,7 @@ type ReplicaSetConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// ReplicaSetConditionApplyConfiguration constructs an declarative configuration of the ReplicaSetCondition type for use with +// ReplicaSetConditionApplyConfiguration constructs a declarative configuration of the ReplicaSetCondition type for use with // apply. func ReplicaSetCondition() *ReplicaSetConditionApplyConfiguration { return &ReplicaSetConditionApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/replicasetspec.go b/applyconfigurations/extensions/v1beta1/replicasetspec.go index 5d0c570149..27653dd1af 100644 --- a/applyconfigurations/extensions/v1beta1/replicasetspec.go +++ b/applyconfigurations/extensions/v1beta1/replicasetspec.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ReplicaSetSpecApplyConfiguration represents an declarative configuration of the ReplicaSetSpec type for use +// ReplicaSetSpecApplyConfiguration represents a declarative configuration of the ReplicaSetSpec type for use // with apply. type ReplicaSetSpecApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` @@ -32,7 +32,7 @@ type ReplicaSetSpecApplyConfiguration struct { Template *corev1.PodTemplateSpecApplyConfiguration `json:"template,omitempty"` } -// ReplicaSetSpecApplyConfiguration constructs an declarative configuration of the ReplicaSetSpec type for use with +// ReplicaSetSpecApplyConfiguration constructs a declarative configuration of the ReplicaSetSpec type for use with // apply. func ReplicaSetSpec() *ReplicaSetSpecApplyConfiguration { return &ReplicaSetSpecApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/replicasetstatus.go b/applyconfigurations/extensions/v1beta1/replicasetstatus.go index 45dc4bf319..9a5b468a3f 100644 --- a/applyconfigurations/extensions/v1beta1/replicasetstatus.go +++ b/applyconfigurations/extensions/v1beta1/replicasetstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// ReplicaSetStatusApplyConfiguration represents an declarative configuration of the ReplicaSetStatus type for use +// ReplicaSetStatusApplyConfiguration represents a declarative configuration of the ReplicaSetStatus type for use // with apply. type ReplicaSetStatusApplyConfiguration struct { Replicas *int32 `json:"replicas,omitempty"` @@ -29,7 +29,7 @@ type ReplicaSetStatusApplyConfiguration struct { Conditions []ReplicaSetConditionApplyConfiguration `json:"conditions,omitempty"` } -// ReplicaSetStatusApplyConfiguration constructs an declarative configuration of the ReplicaSetStatus type for use with +// ReplicaSetStatusApplyConfiguration constructs a declarative configuration of the ReplicaSetStatus type for use with // apply. func ReplicaSetStatus() *ReplicaSetStatusApplyConfiguration { return &ReplicaSetStatusApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/rollbackconfig.go b/applyconfigurations/extensions/v1beta1/rollbackconfig.go index 131e57a39d..775f82eef8 100644 --- a/applyconfigurations/extensions/v1beta1/rollbackconfig.go +++ b/applyconfigurations/extensions/v1beta1/rollbackconfig.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta1 -// RollbackConfigApplyConfiguration represents an declarative configuration of the RollbackConfig type for use +// RollbackConfigApplyConfiguration represents a declarative configuration of the RollbackConfig type for use // with apply. type RollbackConfigApplyConfiguration struct { Revision *int64 `json:"revision,omitempty"` } -// RollbackConfigApplyConfiguration constructs an declarative configuration of the RollbackConfig type for use with +// RollbackConfigApplyConfiguration constructs a declarative configuration of the RollbackConfig type for use with // apply. func RollbackConfig() *RollbackConfigApplyConfiguration { return &RollbackConfigApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/rollingupdatedaemonset.go b/applyconfigurations/extensions/v1beta1/rollingupdatedaemonset.go index 3aa5e2f891..4352f7fac7 100644 --- a/applyconfigurations/extensions/v1beta1/rollingupdatedaemonset.go +++ b/applyconfigurations/extensions/v1beta1/rollingupdatedaemonset.go @@ -22,14 +22,14 @@ import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) -// RollingUpdateDaemonSetApplyConfiguration represents an declarative configuration of the RollingUpdateDaemonSet type for use +// RollingUpdateDaemonSetApplyConfiguration represents a declarative configuration of the RollingUpdateDaemonSet type for use // with apply. type RollingUpdateDaemonSetApplyConfiguration struct { MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` } -// RollingUpdateDaemonSetApplyConfiguration constructs an declarative configuration of the RollingUpdateDaemonSet type for use with +// RollingUpdateDaemonSetApplyConfiguration constructs a declarative configuration of the RollingUpdateDaemonSet type for use with // apply. func RollingUpdateDaemonSet() *RollingUpdateDaemonSetApplyConfiguration { return &RollingUpdateDaemonSetApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/rollingupdatedeployment.go b/applyconfigurations/extensions/v1beta1/rollingupdatedeployment.go index dde5f064b0..244701a5e0 100644 --- a/applyconfigurations/extensions/v1beta1/rollingupdatedeployment.go +++ b/applyconfigurations/extensions/v1beta1/rollingupdatedeployment.go @@ -22,14 +22,14 @@ import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) -// RollingUpdateDeploymentApplyConfiguration represents an declarative configuration of the RollingUpdateDeployment type for use +// RollingUpdateDeploymentApplyConfiguration represents a declarative configuration of the RollingUpdateDeployment type for use // with apply. type RollingUpdateDeploymentApplyConfiguration struct { MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` } -// RollingUpdateDeploymentApplyConfiguration constructs an declarative configuration of the RollingUpdateDeployment type for use with +// RollingUpdateDeploymentApplyConfiguration constructs a declarative configuration of the RollingUpdateDeployment type for use with // apply. func RollingUpdateDeployment() *RollingUpdateDeploymentApplyConfiguration { return &RollingUpdateDeploymentApplyConfiguration{} diff --git a/applyconfigurations/extensions/v1beta1/scale.go b/applyconfigurations/extensions/v1beta1/scale.go index 2a2065728f..101aa055b0 100644 --- a/applyconfigurations/extensions/v1beta1/scale.go +++ b/applyconfigurations/extensions/v1beta1/scale.go @@ -25,7 +25,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ScaleApplyConfiguration represents an declarative configuration of the Scale type for use +// ScaleApplyConfiguration represents a declarative configuration of the Scale type for use // with apply. type ScaleApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -34,7 +34,7 @@ type ScaleApplyConfiguration struct { Status *v1beta1.ScaleStatus `json:"status,omitempty"` } -// ScaleApplyConfiguration constructs an declarative configuration of the Scale type for use with +// ScaleApplyConfiguration constructs a declarative configuration of the Scale type for use with // apply. func Scale() *ScaleApplyConfiguration { b := &ScaleApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1/exemptprioritylevelconfiguration.go b/applyconfigurations/flowcontrol/v1/exemptprioritylevelconfiguration.go index cd21214f5a..4e5805f394 100644 --- a/applyconfigurations/flowcontrol/v1/exemptprioritylevelconfiguration.go +++ b/applyconfigurations/flowcontrol/v1/exemptprioritylevelconfiguration.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// ExemptPriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the ExemptPriorityLevelConfiguration type for use +// ExemptPriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the ExemptPriorityLevelConfiguration type for use // with apply. type ExemptPriorityLevelConfigurationApplyConfiguration struct { NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares,omitempty"` LendablePercent *int32 `json:"lendablePercent,omitempty"` } -// ExemptPriorityLevelConfigurationApplyConfiguration constructs an declarative configuration of the ExemptPriorityLevelConfiguration type for use with +// ExemptPriorityLevelConfigurationApplyConfiguration constructs a declarative configuration of the ExemptPriorityLevelConfiguration type for use with // apply. func ExemptPriorityLevelConfiguration() *ExemptPriorityLevelConfigurationApplyConfiguration { return &ExemptPriorityLevelConfigurationApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1/flowdistinguishermethod.go b/applyconfigurations/flowcontrol/v1/flowdistinguishermethod.go index d9c8a79cc8..0f3b61af97 100644 --- a/applyconfigurations/flowcontrol/v1/flowdistinguishermethod.go +++ b/applyconfigurations/flowcontrol/v1/flowdistinguishermethod.go @@ -22,13 +22,13 @@ import ( v1 "k8s.io/api/flowcontrol/v1" ) -// FlowDistinguisherMethodApplyConfiguration represents an declarative configuration of the FlowDistinguisherMethod type for use +// FlowDistinguisherMethodApplyConfiguration represents a declarative configuration of the FlowDistinguisherMethod type for use // with apply. type FlowDistinguisherMethodApplyConfiguration struct { Type *v1.FlowDistinguisherMethodType `json:"type,omitempty"` } -// FlowDistinguisherMethodApplyConfiguration constructs an declarative configuration of the FlowDistinguisherMethod type for use with +// FlowDistinguisherMethodApplyConfiguration constructs a declarative configuration of the FlowDistinguisherMethod type for use with // apply. func FlowDistinguisherMethod() *FlowDistinguisherMethodApplyConfiguration { return &FlowDistinguisherMethodApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1/flowschema.go b/applyconfigurations/flowcontrol/v1/flowschema.go index 2faaa1e330..9e3978af5b 100644 --- a/applyconfigurations/flowcontrol/v1/flowschema.go +++ b/applyconfigurations/flowcontrol/v1/flowschema.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// FlowSchemaApplyConfiguration represents an declarative configuration of the FlowSchema type for use +// FlowSchemaApplyConfiguration represents a declarative configuration of the FlowSchema type for use // with apply. type FlowSchemaApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type FlowSchemaApplyConfiguration struct { Status *FlowSchemaStatusApplyConfiguration `json:"status,omitempty"` } -// FlowSchema constructs an declarative configuration of the FlowSchema type for use with +// FlowSchema constructs a declarative configuration of the FlowSchema type for use with // apply. func FlowSchema(name string) *FlowSchemaApplyConfiguration { b := &FlowSchemaApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1/flowschemacondition.go b/applyconfigurations/flowcontrol/v1/flowschemacondition.go index 808ab09a55..5f26a66d2f 100644 --- a/applyconfigurations/flowcontrol/v1/flowschemacondition.go +++ b/applyconfigurations/flowcontrol/v1/flowschemacondition.go @@ -23,7 +23,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// FlowSchemaConditionApplyConfiguration represents an declarative configuration of the FlowSchemaCondition type for use +// FlowSchemaConditionApplyConfiguration represents a declarative configuration of the FlowSchemaCondition type for use // with apply. type FlowSchemaConditionApplyConfiguration struct { Type *v1.FlowSchemaConditionType `json:"type,omitempty"` @@ -33,7 +33,7 @@ type FlowSchemaConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// FlowSchemaConditionApplyConfiguration constructs an declarative configuration of the FlowSchemaCondition type for use with +// FlowSchemaConditionApplyConfiguration constructs a declarative configuration of the FlowSchemaCondition type for use with // apply. func FlowSchemaCondition() *FlowSchemaConditionApplyConfiguration { return &FlowSchemaConditionApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1/flowschemaspec.go b/applyconfigurations/flowcontrol/v1/flowschemaspec.go index 2785f5baf3..4efd5d2875 100644 --- a/applyconfigurations/flowcontrol/v1/flowschemaspec.go +++ b/applyconfigurations/flowcontrol/v1/flowschemaspec.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// FlowSchemaSpecApplyConfiguration represents an declarative configuration of the FlowSchemaSpec type for use +// FlowSchemaSpecApplyConfiguration represents a declarative configuration of the FlowSchemaSpec type for use // with apply. type FlowSchemaSpecApplyConfiguration struct { PriorityLevelConfiguration *PriorityLevelConfigurationReferenceApplyConfiguration `json:"priorityLevelConfiguration,omitempty"` @@ -27,7 +27,7 @@ type FlowSchemaSpecApplyConfiguration struct { Rules []PolicyRulesWithSubjectsApplyConfiguration `json:"rules,omitempty"` } -// FlowSchemaSpecApplyConfiguration constructs an declarative configuration of the FlowSchemaSpec type for use with +// FlowSchemaSpecApplyConfiguration constructs a declarative configuration of the FlowSchemaSpec type for use with // apply. func FlowSchemaSpec() *FlowSchemaSpecApplyConfiguration { return &FlowSchemaSpecApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1/flowschemastatus.go b/applyconfigurations/flowcontrol/v1/flowschemastatus.go index 7c61360a53..6f951967e8 100644 --- a/applyconfigurations/flowcontrol/v1/flowschemastatus.go +++ b/applyconfigurations/flowcontrol/v1/flowschemastatus.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// FlowSchemaStatusApplyConfiguration represents an declarative configuration of the FlowSchemaStatus type for use +// FlowSchemaStatusApplyConfiguration represents a declarative configuration of the FlowSchemaStatus type for use // with apply. type FlowSchemaStatusApplyConfiguration struct { Conditions []FlowSchemaConditionApplyConfiguration `json:"conditions,omitempty"` } -// FlowSchemaStatusApplyConfiguration constructs an declarative configuration of the FlowSchemaStatus type for use with +// FlowSchemaStatusApplyConfiguration constructs a declarative configuration of the FlowSchemaStatus type for use with // apply. func FlowSchemaStatus() *FlowSchemaStatusApplyConfiguration { return &FlowSchemaStatusApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1/groupsubject.go b/applyconfigurations/flowcontrol/v1/groupsubject.go index 92a03d8628..0be9eddfd6 100644 --- a/applyconfigurations/flowcontrol/v1/groupsubject.go +++ b/applyconfigurations/flowcontrol/v1/groupsubject.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// GroupSubjectApplyConfiguration represents an declarative configuration of the GroupSubject type for use +// GroupSubjectApplyConfiguration represents a declarative configuration of the GroupSubject type for use // with apply. type GroupSubjectApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// GroupSubjectApplyConfiguration constructs an declarative configuration of the GroupSubject type for use with +// GroupSubjectApplyConfiguration constructs a declarative configuration of the GroupSubject type for use with // apply. func GroupSubject() *GroupSubjectApplyConfiguration { return &GroupSubjectApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1/limitedprioritylevelconfiguration.go b/applyconfigurations/flowcontrol/v1/limitedprioritylevelconfiguration.go index c19f097035..8e27642985 100644 --- a/applyconfigurations/flowcontrol/v1/limitedprioritylevelconfiguration.go +++ b/applyconfigurations/flowcontrol/v1/limitedprioritylevelconfiguration.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// LimitedPriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the LimitedPriorityLevelConfiguration type for use +// LimitedPriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the LimitedPriorityLevelConfiguration type for use // with apply. type LimitedPriorityLevelConfigurationApplyConfiguration struct { NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares,omitempty"` @@ -27,7 +27,7 @@ type LimitedPriorityLevelConfigurationApplyConfiguration struct { BorrowingLimitPercent *int32 `json:"borrowingLimitPercent,omitempty"` } -// LimitedPriorityLevelConfigurationApplyConfiguration constructs an declarative configuration of the LimitedPriorityLevelConfiguration type for use with +// LimitedPriorityLevelConfigurationApplyConfiguration constructs a declarative configuration of the LimitedPriorityLevelConfiguration type for use with // apply. func LimitedPriorityLevelConfiguration() *LimitedPriorityLevelConfigurationApplyConfiguration { return &LimitedPriorityLevelConfigurationApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1/limitresponse.go b/applyconfigurations/flowcontrol/v1/limitresponse.go index 03ff6d9103..454ed8beb4 100644 --- a/applyconfigurations/flowcontrol/v1/limitresponse.go +++ b/applyconfigurations/flowcontrol/v1/limitresponse.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/api/flowcontrol/v1" ) -// LimitResponseApplyConfiguration represents an declarative configuration of the LimitResponse type for use +// LimitResponseApplyConfiguration represents a declarative configuration of the LimitResponse type for use // with apply. type LimitResponseApplyConfiguration struct { Type *v1.LimitResponseType `json:"type,omitempty"` Queuing *QueuingConfigurationApplyConfiguration `json:"queuing,omitempty"` } -// LimitResponseApplyConfiguration constructs an declarative configuration of the LimitResponse type for use with +// LimitResponseApplyConfiguration constructs a declarative configuration of the LimitResponse type for use with // apply. func LimitResponse() *LimitResponseApplyConfiguration { return &LimitResponseApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1/nonresourcepolicyrule.go b/applyconfigurations/flowcontrol/v1/nonresourcepolicyrule.go index d9f8c2eccf..29c26b3406 100644 --- a/applyconfigurations/flowcontrol/v1/nonresourcepolicyrule.go +++ b/applyconfigurations/flowcontrol/v1/nonresourcepolicyrule.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// NonResourcePolicyRuleApplyConfiguration represents an declarative configuration of the NonResourcePolicyRule type for use +// NonResourcePolicyRuleApplyConfiguration represents a declarative configuration of the NonResourcePolicyRule type for use // with apply. type NonResourcePolicyRuleApplyConfiguration struct { Verbs []string `json:"verbs,omitempty"` NonResourceURLs []string `json:"nonResourceURLs,omitempty"` } -// NonResourcePolicyRuleApplyConfiguration constructs an declarative configuration of the NonResourcePolicyRule type for use with +// NonResourcePolicyRuleApplyConfiguration constructs a declarative configuration of the NonResourcePolicyRule type for use with // apply. func NonResourcePolicyRule() *NonResourcePolicyRuleApplyConfiguration { return &NonResourcePolicyRuleApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1/policyruleswithsubjects.go b/applyconfigurations/flowcontrol/v1/policyruleswithsubjects.go index b193efa8bf..088afdc584 100644 --- a/applyconfigurations/flowcontrol/v1/policyruleswithsubjects.go +++ b/applyconfigurations/flowcontrol/v1/policyruleswithsubjects.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// PolicyRulesWithSubjectsApplyConfiguration represents an declarative configuration of the PolicyRulesWithSubjects type for use +// PolicyRulesWithSubjectsApplyConfiguration represents a declarative configuration of the PolicyRulesWithSubjects type for use // with apply. type PolicyRulesWithSubjectsApplyConfiguration struct { Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"` @@ -26,7 +26,7 @@ type PolicyRulesWithSubjectsApplyConfiguration struct { NonResourceRules []NonResourcePolicyRuleApplyConfiguration `json:"nonResourceRules,omitempty"` } -// PolicyRulesWithSubjectsApplyConfiguration constructs an declarative configuration of the PolicyRulesWithSubjects type for use with +// PolicyRulesWithSubjectsApplyConfiguration constructs a declarative configuration of the PolicyRulesWithSubjects type for use with // apply. func PolicyRulesWithSubjects() *PolicyRulesWithSubjectsApplyConfiguration { return &PolicyRulesWithSubjectsApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1/prioritylevelconfiguration.go b/applyconfigurations/flowcontrol/v1/prioritylevelconfiguration.go index 32ca469050..bcce2679c6 100644 --- a/applyconfigurations/flowcontrol/v1/prioritylevelconfiguration.go +++ b/applyconfigurations/flowcontrol/v1/prioritylevelconfiguration.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the PriorityLevelConfiguration type for use +// PriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the PriorityLevelConfiguration type for use // with apply. type PriorityLevelConfigurationApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type PriorityLevelConfigurationApplyConfiguration struct { Status *PriorityLevelConfigurationStatusApplyConfiguration `json:"status,omitempty"` } -// PriorityLevelConfiguration constructs an declarative configuration of the PriorityLevelConfiguration type for use with +// PriorityLevelConfiguration constructs a declarative configuration of the PriorityLevelConfiguration type for use with // apply. func PriorityLevelConfiguration(name string) *PriorityLevelConfigurationApplyConfiguration { b := &PriorityLevelConfigurationApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationcondition.go b/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationcondition.go index 6ce588c8d9..42ccbfbf9d 100644 --- a/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationcondition.go +++ b/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationcondition.go @@ -23,7 +23,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// PriorityLevelConfigurationConditionApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationCondition type for use +// PriorityLevelConfigurationConditionApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationCondition type for use // with apply. type PriorityLevelConfigurationConditionApplyConfiguration struct { Type *v1.PriorityLevelConfigurationConditionType `json:"type,omitempty"` @@ -33,7 +33,7 @@ type PriorityLevelConfigurationConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// PriorityLevelConfigurationConditionApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationCondition type for use with +// PriorityLevelConfigurationConditionApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationCondition type for use with // apply. func PriorityLevelConfigurationCondition() *PriorityLevelConfigurationConditionApplyConfiguration { return &PriorityLevelConfigurationConditionApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationreference.go b/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationreference.go index 0638aee8b8..f445713f0c 100644 --- a/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationreference.go +++ b/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationreference.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// PriorityLevelConfigurationReferenceApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationReference type for use +// PriorityLevelConfigurationReferenceApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationReference type for use // with apply. type PriorityLevelConfigurationReferenceApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// PriorityLevelConfigurationReferenceApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationReference type for use with +// PriorityLevelConfigurationReferenceApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationReference type for use with // apply. func PriorityLevelConfigurationReference() *PriorityLevelConfigurationReferenceApplyConfiguration { return &PriorityLevelConfigurationReferenceApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationspec.go b/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationspec.go index 5d88749593..2262dedca9 100644 --- a/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationspec.go +++ b/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationspec.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/flowcontrol/v1" ) -// PriorityLevelConfigurationSpecApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationSpec type for use +// PriorityLevelConfigurationSpecApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationSpec type for use // with apply. type PriorityLevelConfigurationSpecApplyConfiguration struct { Type *v1.PriorityLevelEnablement `json:"type,omitempty"` @@ -30,7 +30,7 @@ type PriorityLevelConfigurationSpecApplyConfiguration struct { Exempt *ExemptPriorityLevelConfigurationApplyConfiguration `json:"exempt,omitempty"` } -// PriorityLevelConfigurationSpecApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationSpec type for use with +// PriorityLevelConfigurationSpecApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationSpec type for use with // apply. func PriorityLevelConfigurationSpec() *PriorityLevelConfigurationSpecApplyConfiguration { return &PriorityLevelConfigurationSpecApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationstatus.go b/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationstatus.go index 322871edc6..ff650bc3d5 100644 --- a/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationstatus.go +++ b/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationstatus.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// PriorityLevelConfigurationStatusApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationStatus type for use +// PriorityLevelConfigurationStatusApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationStatus type for use // with apply. type PriorityLevelConfigurationStatusApplyConfiguration struct { Conditions []PriorityLevelConfigurationConditionApplyConfiguration `json:"conditions,omitempty"` } -// PriorityLevelConfigurationStatusApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationStatus type for use with +// PriorityLevelConfigurationStatusApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationStatus type for use with // apply. func PriorityLevelConfigurationStatus() *PriorityLevelConfigurationStatusApplyConfiguration { return &PriorityLevelConfigurationStatusApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1/queuingconfiguration.go b/applyconfigurations/flowcontrol/v1/queuingconfiguration.go index 69fd2c23cc..7488f9bbe2 100644 --- a/applyconfigurations/flowcontrol/v1/queuingconfiguration.go +++ b/applyconfigurations/flowcontrol/v1/queuingconfiguration.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// QueuingConfigurationApplyConfiguration represents an declarative configuration of the QueuingConfiguration type for use +// QueuingConfigurationApplyConfiguration represents a declarative configuration of the QueuingConfiguration type for use // with apply. type QueuingConfigurationApplyConfiguration struct { Queues *int32 `json:"queues,omitempty"` @@ -26,7 +26,7 @@ type QueuingConfigurationApplyConfiguration struct { QueueLengthLimit *int32 `json:"queueLengthLimit,omitempty"` } -// QueuingConfigurationApplyConfiguration constructs an declarative configuration of the QueuingConfiguration type for use with +// QueuingConfigurationApplyConfiguration constructs a declarative configuration of the QueuingConfiguration type for use with // apply. func QueuingConfiguration() *QueuingConfigurationApplyConfiguration { return &QueuingConfigurationApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1/resourcepolicyrule.go b/applyconfigurations/flowcontrol/v1/resourcepolicyrule.go index 0991ce9445..7428582a82 100644 --- a/applyconfigurations/flowcontrol/v1/resourcepolicyrule.go +++ b/applyconfigurations/flowcontrol/v1/resourcepolicyrule.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// ResourcePolicyRuleApplyConfiguration represents an declarative configuration of the ResourcePolicyRule type for use +// ResourcePolicyRuleApplyConfiguration represents a declarative configuration of the ResourcePolicyRule type for use // with apply. type ResourcePolicyRuleApplyConfiguration struct { Verbs []string `json:"verbs,omitempty"` @@ -28,7 +28,7 @@ type ResourcePolicyRuleApplyConfiguration struct { Namespaces []string `json:"namespaces,omitempty"` } -// ResourcePolicyRuleApplyConfiguration constructs an declarative configuration of the ResourcePolicyRule type for use with +// ResourcePolicyRuleApplyConfiguration constructs a declarative configuration of the ResourcePolicyRule type for use with // apply. func ResourcePolicyRule() *ResourcePolicyRuleApplyConfiguration { return &ResourcePolicyRuleApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1/serviceaccountsubject.go b/applyconfigurations/flowcontrol/v1/serviceaccountsubject.go index 55787ca767..58ad10764b 100644 --- a/applyconfigurations/flowcontrol/v1/serviceaccountsubject.go +++ b/applyconfigurations/flowcontrol/v1/serviceaccountsubject.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// ServiceAccountSubjectApplyConfiguration represents an declarative configuration of the ServiceAccountSubject type for use +// ServiceAccountSubjectApplyConfiguration represents a declarative configuration of the ServiceAccountSubject type for use // with apply. type ServiceAccountSubjectApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` Name *string `json:"name,omitempty"` } -// ServiceAccountSubjectApplyConfiguration constructs an declarative configuration of the ServiceAccountSubject type for use with +// ServiceAccountSubjectApplyConfiguration constructs a declarative configuration of the ServiceAccountSubject type for use with // apply. func ServiceAccountSubject() *ServiceAccountSubjectApplyConfiguration { return &ServiceAccountSubjectApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1/subject.go b/applyconfigurations/flowcontrol/v1/subject.go index f02b03bdc7..1ec77ae89b 100644 --- a/applyconfigurations/flowcontrol/v1/subject.go +++ b/applyconfigurations/flowcontrol/v1/subject.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/flowcontrol/v1" ) -// SubjectApplyConfiguration represents an declarative configuration of the Subject type for use +// SubjectApplyConfiguration represents a declarative configuration of the Subject type for use // with apply. type SubjectApplyConfiguration struct { Kind *v1.SubjectKind `json:"kind,omitempty"` @@ -31,7 +31,7 @@ type SubjectApplyConfiguration struct { ServiceAccount *ServiceAccountSubjectApplyConfiguration `json:"serviceAccount,omitempty"` } -// SubjectApplyConfiguration constructs an declarative configuration of the Subject type for use with +// SubjectApplyConfiguration constructs a declarative configuration of the Subject type for use with // apply. func Subject() *SubjectApplyConfiguration { return &SubjectApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1/usersubject.go b/applyconfigurations/flowcontrol/v1/usersubject.go index 2d17c111c6..fd90067d4d 100644 --- a/applyconfigurations/flowcontrol/v1/usersubject.go +++ b/applyconfigurations/flowcontrol/v1/usersubject.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// UserSubjectApplyConfiguration represents an declarative configuration of the UserSubject type for use +// UserSubjectApplyConfiguration represents a declarative configuration of the UserSubject type for use // with apply. type UserSubjectApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// UserSubjectApplyConfiguration constructs an declarative configuration of the UserSubject type for use with +// UserSubjectApplyConfiguration constructs a declarative configuration of the UserSubject type for use with // apply. func UserSubject() *UserSubjectApplyConfiguration { return &UserSubjectApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta1/exemptprioritylevelconfiguration.go b/applyconfigurations/flowcontrol/v1beta1/exemptprioritylevelconfiguration.go index 0710480900..45ccc5cb75 100644 --- a/applyconfigurations/flowcontrol/v1beta1/exemptprioritylevelconfiguration.go +++ b/applyconfigurations/flowcontrol/v1beta1/exemptprioritylevelconfiguration.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta1 -// ExemptPriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the ExemptPriorityLevelConfiguration type for use +// ExemptPriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the ExemptPriorityLevelConfiguration type for use // with apply. type ExemptPriorityLevelConfigurationApplyConfiguration struct { NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares,omitempty"` LendablePercent *int32 `json:"lendablePercent,omitempty"` } -// ExemptPriorityLevelConfigurationApplyConfiguration constructs an declarative configuration of the ExemptPriorityLevelConfiguration type for use with +// ExemptPriorityLevelConfigurationApplyConfiguration constructs a declarative configuration of the ExemptPriorityLevelConfiguration type for use with // apply. func ExemptPriorityLevelConfiguration() *ExemptPriorityLevelConfigurationApplyConfiguration { return &ExemptPriorityLevelConfigurationApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta1/flowdistinguishermethod.go b/applyconfigurations/flowcontrol/v1beta1/flowdistinguishermethod.go index 6dc1bb4d68..29a8999b8d 100644 --- a/applyconfigurations/flowcontrol/v1beta1/flowdistinguishermethod.go +++ b/applyconfigurations/flowcontrol/v1beta1/flowdistinguishermethod.go @@ -22,13 +22,13 @@ import ( v1beta1 "k8s.io/api/flowcontrol/v1beta1" ) -// FlowDistinguisherMethodApplyConfiguration represents an declarative configuration of the FlowDistinguisherMethod type for use +// FlowDistinguisherMethodApplyConfiguration represents a declarative configuration of the FlowDistinguisherMethod type for use // with apply. type FlowDistinguisherMethodApplyConfiguration struct { Type *v1beta1.FlowDistinguisherMethodType `json:"type,omitempty"` } -// FlowDistinguisherMethodApplyConfiguration constructs an declarative configuration of the FlowDistinguisherMethod type for use with +// FlowDistinguisherMethodApplyConfiguration constructs a declarative configuration of the FlowDistinguisherMethod type for use with // apply. func FlowDistinguisherMethod() *FlowDistinguisherMethodApplyConfiguration { return &FlowDistinguisherMethodApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta1/flowschema.go b/applyconfigurations/flowcontrol/v1beta1/flowschema.go index bacc2fc033..09bd258905 100644 --- a/applyconfigurations/flowcontrol/v1beta1/flowschema.go +++ b/applyconfigurations/flowcontrol/v1beta1/flowschema.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// FlowSchemaApplyConfiguration represents an declarative configuration of the FlowSchema type for use +// FlowSchemaApplyConfiguration represents a declarative configuration of the FlowSchema type for use // with apply. type FlowSchemaApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type FlowSchemaApplyConfiguration struct { Status *FlowSchemaStatusApplyConfiguration `json:"status,omitempty"` } -// FlowSchema constructs an declarative configuration of the FlowSchema type for use with +// FlowSchema constructs a declarative configuration of the FlowSchema type for use with // apply. func FlowSchema(name string) *FlowSchemaApplyConfiguration { b := &FlowSchemaApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta1/flowschemacondition.go b/applyconfigurations/flowcontrol/v1beta1/flowschemacondition.go index b62e9a22ff..d1c3dbec6f 100644 --- a/applyconfigurations/flowcontrol/v1beta1/flowschemacondition.go +++ b/applyconfigurations/flowcontrol/v1beta1/flowschemacondition.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// FlowSchemaConditionApplyConfiguration represents an declarative configuration of the FlowSchemaCondition type for use +// FlowSchemaConditionApplyConfiguration represents a declarative configuration of the FlowSchemaCondition type for use // with apply. type FlowSchemaConditionApplyConfiguration struct { Type *v1beta1.FlowSchemaConditionType `json:"type,omitempty"` @@ -33,7 +33,7 @@ type FlowSchemaConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// FlowSchemaConditionApplyConfiguration constructs an declarative configuration of the FlowSchemaCondition type for use with +// FlowSchemaConditionApplyConfiguration constructs a declarative configuration of the FlowSchemaCondition type for use with // apply. func FlowSchemaCondition() *FlowSchemaConditionApplyConfiguration { return &FlowSchemaConditionApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta1/flowschemaspec.go b/applyconfigurations/flowcontrol/v1beta1/flowschemaspec.go index 8d72c2d0d7..1d6e8fc58e 100644 --- a/applyconfigurations/flowcontrol/v1beta1/flowschemaspec.go +++ b/applyconfigurations/flowcontrol/v1beta1/flowschemaspec.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// FlowSchemaSpecApplyConfiguration represents an declarative configuration of the FlowSchemaSpec type for use +// FlowSchemaSpecApplyConfiguration represents a declarative configuration of the FlowSchemaSpec type for use // with apply. type FlowSchemaSpecApplyConfiguration struct { PriorityLevelConfiguration *PriorityLevelConfigurationReferenceApplyConfiguration `json:"priorityLevelConfiguration,omitempty"` @@ -27,7 +27,7 @@ type FlowSchemaSpecApplyConfiguration struct { Rules []PolicyRulesWithSubjectsApplyConfiguration `json:"rules,omitempty"` } -// FlowSchemaSpecApplyConfiguration constructs an declarative configuration of the FlowSchemaSpec type for use with +// FlowSchemaSpecApplyConfiguration constructs a declarative configuration of the FlowSchemaSpec type for use with // apply. func FlowSchemaSpec() *FlowSchemaSpecApplyConfiguration { return &FlowSchemaSpecApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta1/flowschemastatus.go b/applyconfigurations/flowcontrol/v1beta1/flowschemastatus.go index 6bc6d0543a..5ad8a432b2 100644 --- a/applyconfigurations/flowcontrol/v1beta1/flowschemastatus.go +++ b/applyconfigurations/flowcontrol/v1beta1/flowschemastatus.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta1 -// FlowSchemaStatusApplyConfiguration represents an declarative configuration of the FlowSchemaStatus type for use +// FlowSchemaStatusApplyConfiguration represents a declarative configuration of the FlowSchemaStatus type for use // with apply. type FlowSchemaStatusApplyConfiguration struct { Conditions []FlowSchemaConditionApplyConfiguration `json:"conditions,omitempty"` } -// FlowSchemaStatusApplyConfiguration constructs an declarative configuration of the FlowSchemaStatus type for use with +// FlowSchemaStatusApplyConfiguration constructs a declarative configuration of the FlowSchemaStatus type for use with // apply. func FlowSchemaStatus() *FlowSchemaStatusApplyConfiguration { return &FlowSchemaStatusApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta1/groupsubject.go b/applyconfigurations/flowcontrol/v1beta1/groupsubject.go index 95b416e426..cc274fe2f3 100644 --- a/applyconfigurations/flowcontrol/v1beta1/groupsubject.go +++ b/applyconfigurations/flowcontrol/v1beta1/groupsubject.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta1 -// GroupSubjectApplyConfiguration represents an declarative configuration of the GroupSubject type for use +// GroupSubjectApplyConfiguration represents a declarative configuration of the GroupSubject type for use // with apply. type GroupSubjectApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// GroupSubjectApplyConfiguration constructs an declarative configuration of the GroupSubject type for use with +// GroupSubjectApplyConfiguration constructs a declarative configuration of the GroupSubject type for use with // apply. func GroupSubject() *GroupSubjectApplyConfiguration { return &GroupSubjectApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta1/limitedprioritylevelconfiguration.go b/applyconfigurations/flowcontrol/v1beta1/limitedprioritylevelconfiguration.go index 6f57169e1f..0fe5feca12 100644 --- a/applyconfigurations/flowcontrol/v1beta1/limitedprioritylevelconfiguration.go +++ b/applyconfigurations/flowcontrol/v1beta1/limitedprioritylevelconfiguration.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// LimitedPriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the LimitedPriorityLevelConfiguration type for use +// LimitedPriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the LimitedPriorityLevelConfiguration type for use // with apply. type LimitedPriorityLevelConfigurationApplyConfiguration struct { AssuredConcurrencyShares *int32 `json:"assuredConcurrencyShares,omitempty"` @@ -27,7 +27,7 @@ type LimitedPriorityLevelConfigurationApplyConfiguration struct { BorrowingLimitPercent *int32 `json:"borrowingLimitPercent,omitempty"` } -// LimitedPriorityLevelConfigurationApplyConfiguration constructs an declarative configuration of the LimitedPriorityLevelConfiguration type for use with +// LimitedPriorityLevelConfigurationApplyConfiguration constructs a declarative configuration of the LimitedPriorityLevelConfiguration type for use with // apply. func LimitedPriorityLevelConfiguration() *LimitedPriorityLevelConfigurationApplyConfiguration { return &LimitedPriorityLevelConfigurationApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta1/limitresponse.go b/applyconfigurations/flowcontrol/v1beta1/limitresponse.go index 86e1bef6b9..66f3276010 100644 --- a/applyconfigurations/flowcontrol/v1beta1/limitresponse.go +++ b/applyconfigurations/flowcontrol/v1beta1/limitresponse.go @@ -22,14 +22,14 @@ import ( v1beta1 "k8s.io/api/flowcontrol/v1beta1" ) -// LimitResponseApplyConfiguration represents an declarative configuration of the LimitResponse type for use +// LimitResponseApplyConfiguration represents a declarative configuration of the LimitResponse type for use // with apply. type LimitResponseApplyConfiguration struct { Type *v1beta1.LimitResponseType `json:"type,omitempty"` Queuing *QueuingConfigurationApplyConfiguration `json:"queuing,omitempty"` } -// LimitResponseApplyConfiguration constructs an declarative configuration of the LimitResponse type for use with +// LimitResponseApplyConfiguration constructs a declarative configuration of the LimitResponse type for use with // apply. func LimitResponse() *LimitResponseApplyConfiguration { return &LimitResponseApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta1/nonresourcepolicyrule.go b/applyconfigurations/flowcontrol/v1beta1/nonresourcepolicyrule.go index 594ebc9912..3c571ccb06 100644 --- a/applyconfigurations/flowcontrol/v1beta1/nonresourcepolicyrule.go +++ b/applyconfigurations/flowcontrol/v1beta1/nonresourcepolicyrule.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta1 -// NonResourcePolicyRuleApplyConfiguration represents an declarative configuration of the NonResourcePolicyRule type for use +// NonResourcePolicyRuleApplyConfiguration represents a declarative configuration of the NonResourcePolicyRule type for use // with apply. type NonResourcePolicyRuleApplyConfiguration struct { Verbs []string `json:"verbs,omitempty"` NonResourceURLs []string `json:"nonResourceURLs,omitempty"` } -// NonResourcePolicyRuleApplyConfiguration constructs an declarative configuration of the NonResourcePolicyRule type for use with +// NonResourcePolicyRuleApplyConfiguration constructs a declarative configuration of the NonResourcePolicyRule type for use with // apply. func NonResourcePolicyRule() *NonResourcePolicyRuleApplyConfiguration { return &NonResourcePolicyRuleApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta1/policyruleswithsubjects.go b/applyconfigurations/flowcontrol/v1beta1/policyruleswithsubjects.go index ea5b266b4c..32a082dc76 100644 --- a/applyconfigurations/flowcontrol/v1beta1/policyruleswithsubjects.go +++ b/applyconfigurations/flowcontrol/v1beta1/policyruleswithsubjects.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// PolicyRulesWithSubjectsApplyConfiguration represents an declarative configuration of the PolicyRulesWithSubjects type for use +// PolicyRulesWithSubjectsApplyConfiguration represents a declarative configuration of the PolicyRulesWithSubjects type for use // with apply. type PolicyRulesWithSubjectsApplyConfiguration struct { Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"` @@ -26,7 +26,7 @@ type PolicyRulesWithSubjectsApplyConfiguration struct { NonResourceRules []NonResourcePolicyRuleApplyConfiguration `json:"nonResourceRules,omitempty"` } -// PolicyRulesWithSubjectsApplyConfiguration constructs an declarative configuration of the PolicyRulesWithSubjects type for use with +// PolicyRulesWithSubjectsApplyConfiguration constructs a declarative configuration of the PolicyRulesWithSubjects type for use with // apply. func PolicyRulesWithSubjects() *PolicyRulesWithSubjectsApplyConfiguration { return &PolicyRulesWithSubjectsApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfiguration.go b/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfiguration.go index 018758f0b9..c4243f874c 100644 --- a/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfiguration.go +++ b/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfiguration.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the PriorityLevelConfiguration type for use +// PriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the PriorityLevelConfiguration type for use // with apply. type PriorityLevelConfigurationApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type PriorityLevelConfigurationApplyConfiguration struct { Status *PriorityLevelConfigurationStatusApplyConfiguration `json:"status,omitempty"` } -// PriorityLevelConfiguration constructs an declarative configuration of the PriorityLevelConfiguration type for use with +// PriorityLevelConfiguration constructs a declarative configuration of the PriorityLevelConfiguration type for use with // apply. func PriorityLevelConfiguration(name string) *PriorityLevelConfigurationApplyConfiguration { b := &PriorityLevelConfigurationApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfigurationcondition.go b/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfigurationcondition.go index 59bc610510..1ad4a554b7 100644 --- a/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfigurationcondition.go +++ b/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfigurationcondition.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// PriorityLevelConfigurationConditionApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationCondition type for use +// PriorityLevelConfigurationConditionApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationCondition type for use // with apply. type PriorityLevelConfigurationConditionApplyConfiguration struct { Type *v1beta1.PriorityLevelConfigurationConditionType `json:"type,omitempty"` @@ -33,7 +33,7 @@ type PriorityLevelConfigurationConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// PriorityLevelConfigurationConditionApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationCondition type for use with +// PriorityLevelConfigurationConditionApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationCondition type for use with // apply. func PriorityLevelConfigurationCondition() *PriorityLevelConfigurationConditionApplyConfiguration { return &PriorityLevelConfigurationConditionApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfigurationreference.go b/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfigurationreference.go index c44bcc08b4..b5e773e82a 100644 --- a/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfigurationreference.go +++ b/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfigurationreference.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta1 -// PriorityLevelConfigurationReferenceApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationReference type for use +// PriorityLevelConfigurationReferenceApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationReference type for use // with apply. type PriorityLevelConfigurationReferenceApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// PriorityLevelConfigurationReferenceApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationReference type for use with +// PriorityLevelConfigurationReferenceApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationReference type for use with // apply. func PriorityLevelConfigurationReference() *PriorityLevelConfigurationReferenceApplyConfiguration { return &PriorityLevelConfigurationReferenceApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfigurationspec.go b/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfigurationspec.go index 19146d9f66..b013845f43 100644 --- a/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfigurationspec.go +++ b/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfigurationspec.go @@ -22,7 +22,7 @@ import ( v1beta1 "k8s.io/api/flowcontrol/v1beta1" ) -// PriorityLevelConfigurationSpecApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationSpec type for use +// PriorityLevelConfigurationSpecApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationSpec type for use // with apply. type PriorityLevelConfigurationSpecApplyConfiguration struct { Type *v1beta1.PriorityLevelEnablement `json:"type,omitempty"` @@ -30,7 +30,7 @@ type PriorityLevelConfigurationSpecApplyConfiguration struct { Exempt *ExemptPriorityLevelConfigurationApplyConfiguration `json:"exempt,omitempty"` } -// PriorityLevelConfigurationSpecApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationSpec type for use with +// PriorityLevelConfigurationSpecApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationSpec type for use with // apply. func PriorityLevelConfigurationSpec() *PriorityLevelConfigurationSpecApplyConfiguration { return &PriorityLevelConfigurationSpecApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfigurationstatus.go b/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfigurationstatus.go index 3c27e6aa62..875b01efec 100644 --- a/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfigurationstatus.go +++ b/applyconfigurations/flowcontrol/v1beta1/prioritylevelconfigurationstatus.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta1 -// PriorityLevelConfigurationStatusApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationStatus type for use +// PriorityLevelConfigurationStatusApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationStatus type for use // with apply. type PriorityLevelConfigurationStatusApplyConfiguration struct { Conditions []PriorityLevelConfigurationConditionApplyConfiguration `json:"conditions,omitempty"` } -// PriorityLevelConfigurationStatusApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationStatus type for use with +// PriorityLevelConfigurationStatusApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationStatus type for use with // apply. func PriorityLevelConfigurationStatus() *PriorityLevelConfigurationStatusApplyConfiguration { return &PriorityLevelConfigurationStatusApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta1/queuingconfiguration.go b/applyconfigurations/flowcontrol/v1beta1/queuingconfiguration.go index 5e6e6e7b01..85a8b88630 100644 --- a/applyconfigurations/flowcontrol/v1beta1/queuingconfiguration.go +++ b/applyconfigurations/flowcontrol/v1beta1/queuingconfiguration.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// QueuingConfigurationApplyConfiguration represents an declarative configuration of the QueuingConfiguration type for use +// QueuingConfigurationApplyConfiguration represents a declarative configuration of the QueuingConfiguration type for use // with apply. type QueuingConfigurationApplyConfiguration struct { Queues *int32 `json:"queues,omitempty"` @@ -26,7 +26,7 @@ type QueuingConfigurationApplyConfiguration struct { QueueLengthLimit *int32 `json:"queueLengthLimit,omitempty"` } -// QueuingConfigurationApplyConfiguration constructs an declarative configuration of the QueuingConfiguration type for use with +// QueuingConfigurationApplyConfiguration constructs a declarative configuration of the QueuingConfiguration type for use with // apply. func QueuingConfiguration() *QueuingConfigurationApplyConfiguration { return &QueuingConfigurationApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta1/resourcepolicyrule.go b/applyconfigurations/flowcontrol/v1beta1/resourcepolicyrule.go index 2e12ee1cc0..5c67dad759 100644 --- a/applyconfigurations/flowcontrol/v1beta1/resourcepolicyrule.go +++ b/applyconfigurations/flowcontrol/v1beta1/resourcepolicyrule.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// ResourcePolicyRuleApplyConfiguration represents an declarative configuration of the ResourcePolicyRule type for use +// ResourcePolicyRuleApplyConfiguration represents a declarative configuration of the ResourcePolicyRule type for use // with apply. type ResourcePolicyRuleApplyConfiguration struct { Verbs []string `json:"verbs,omitempty"` @@ -28,7 +28,7 @@ type ResourcePolicyRuleApplyConfiguration struct { Namespaces []string `json:"namespaces,omitempty"` } -// ResourcePolicyRuleApplyConfiguration constructs an declarative configuration of the ResourcePolicyRule type for use with +// ResourcePolicyRuleApplyConfiguration constructs a declarative configuration of the ResourcePolicyRule type for use with // apply. func ResourcePolicyRule() *ResourcePolicyRuleApplyConfiguration { return &ResourcePolicyRuleApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta1/serviceaccountsubject.go b/applyconfigurations/flowcontrol/v1beta1/serviceaccountsubject.go index f5a146a9b1..439e5ff753 100644 --- a/applyconfigurations/flowcontrol/v1beta1/serviceaccountsubject.go +++ b/applyconfigurations/flowcontrol/v1beta1/serviceaccountsubject.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta1 -// ServiceAccountSubjectApplyConfiguration represents an declarative configuration of the ServiceAccountSubject type for use +// ServiceAccountSubjectApplyConfiguration represents a declarative configuration of the ServiceAccountSubject type for use // with apply. type ServiceAccountSubjectApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` Name *string `json:"name,omitempty"` } -// ServiceAccountSubjectApplyConfiguration constructs an declarative configuration of the ServiceAccountSubject type for use with +// ServiceAccountSubjectApplyConfiguration constructs a declarative configuration of the ServiceAccountSubject type for use with // apply. func ServiceAccountSubject() *ServiceAccountSubjectApplyConfiguration { return &ServiceAccountSubjectApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta1/subject.go b/applyconfigurations/flowcontrol/v1beta1/subject.go index af571029fc..b5c231f6d2 100644 --- a/applyconfigurations/flowcontrol/v1beta1/subject.go +++ b/applyconfigurations/flowcontrol/v1beta1/subject.go @@ -22,7 +22,7 @@ import ( v1beta1 "k8s.io/api/flowcontrol/v1beta1" ) -// SubjectApplyConfiguration represents an declarative configuration of the Subject type for use +// SubjectApplyConfiguration represents a declarative configuration of the Subject type for use // with apply. type SubjectApplyConfiguration struct { Kind *v1beta1.SubjectKind `json:"kind,omitempty"` @@ -31,7 +31,7 @@ type SubjectApplyConfiguration struct { ServiceAccount *ServiceAccountSubjectApplyConfiguration `json:"serviceAccount,omitempty"` } -// SubjectApplyConfiguration constructs an declarative configuration of the Subject type for use with +// SubjectApplyConfiguration constructs a declarative configuration of the Subject type for use with // apply. func Subject() *SubjectApplyConfiguration { return &SubjectApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta1/usersubject.go b/applyconfigurations/flowcontrol/v1beta1/usersubject.go index 35bf27a593..bc2deae4c2 100644 --- a/applyconfigurations/flowcontrol/v1beta1/usersubject.go +++ b/applyconfigurations/flowcontrol/v1beta1/usersubject.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta1 -// UserSubjectApplyConfiguration represents an declarative configuration of the UserSubject type for use +// UserSubjectApplyConfiguration represents a declarative configuration of the UserSubject type for use // with apply. type UserSubjectApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// UserSubjectApplyConfiguration constructs an declarative configuration of the UserSubject type for use with +// UserSubjectApplyConfiguration constructs a declarative configuration of the UserSubject type for use with // apply. func UserSubject() *UserSubjectApplyConfiguration { return &UserSubjectApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta2/exemptprioritylevelconfiguration.go b/applyconfigurations/flowcontrol/v1beta2/exemptprioritylevelconfiguration.go index d6bc330fe7..0c02d9b389 100644 --- a/applyconfigurations/flowcontrol/v1beta2/exemptprioritylevelconfiguration.go +++ b/applyconfigurations/flowcontrol/v1beta2/exemptprioritylevelconfiguration.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta2 -// ExemptPriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the ExemptPriorityLevelConfiguration type for use +// ExemptPriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the ExemptPriorityLevelConfiguration type for use // with apply. type ExemptPriorityLevelConfigurationApplyConfiguration struct { NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares,omitempty"` LendablePercent *int32 `json:"lendablePercent,omitempty"` } -// ExemptPriorityLevelConfigurationApplyConfiguration constructs an declarative configuration of the ExemptPriorityLevelConfiguration type for use with +// ExemptPriorityLevelConfigurationApplyConfiguration constructs a declarative configuration of the ExemptPriorityLevelConfiguration type for use with // apply. func ExemptPriorityLevelConfiguration() *ExemptPriorityLevelConfigurationApplyConfiguration { return &ExemptPriorityLevelConfigurationApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta2/flowdistinguishermethod.go b/applyconfigurations/flowcontrol/v1beta2/flowdistinguishermethod.go index 924f966d48..e3c4b97a7b 100644 --- a/applyconfigurations/flowcontrol/v1beta2/flowdistinguishermethod.go +++ b/applyconfigurations/flowcontrol/v1beta2/flowdistinguishermethod.go @@ -22,13 +22,13 @@ import ( v1beta2 "k8s.io/api/flowcontrol/v1beta2" ) -// FlowDistinguisherMethodApplyConfiguration represents an declarative configuration of the FlowDistinguisherMethod type for use +// FlowDistinguisherMethodApplyConfiguration represents a declarative configuration of the FlowDistinguisherMethod type for use // with apply. type FlowDistinguisherMethodApplyConfiguration struct { Type *v1beta2.FlowDistinguisherMethodType `json:"type,omitempty"` } -// FlowDistinguisherMethodApplyConfiguration constructs an declarative configuration of the FlowDistinguisherMethod type for use with +// FlowDistinguisherMethodApplyConfiguration constructs a declarative configuration of the FlowDistinguisherMethod type for use with // apply. func FlowDistinguisherMethod() *FlowDistinguisherMethodApplyConfiguration { return &FlowDistinguisherMethodApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta2/flowschema.go b/applyconfigurations/flowcontrol/v1beta2/flowschema.go index 9b0d20ad29..ffc3af950a 100644 --- a/applyconfigurations/flowcontrol/v1beta2/flowschema.go +++ b/applyconfigurations/flowcontrol/v1beta2/flowschema.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// FlowSchemaApplyConfiguration represents an declarative configuration of the FlowSchema type for use +// FlowSchemaApplyConfiguration represents a declarative configuration of the FlowSchema type for use // with apply. type FlowSchemaApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type FlowSchemaApplyConfiguration struct { Status *FlowSchemaStatusApplyConfiguration `json:"status,omitempty"` } -// FlowSchema constructs an declarative configuration of the FlowSchema type for use with +// FlowSchema constructs a declarative configuration of the FlowSchema type for use with // apply. func FlowSchema(name string) *FlowSchemaApplyConfiguration { b := &FlowSchemaApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta2/flowschemacondition.go b/applyconfigurations/flowcontrol/v1beta2/flowschemacondition.go index 04dfcbf11a..44571d263d 100644 --- a/applyconfigurations/flowcontrol/v1beta2/flowschemacondition.go +++ b/applyconfigurations/flowcontrol/v1beta2/flowschemacondition.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// FlowSchemaConditionApplyConfiguration represents an declarative configuration of the FlowSchemaCondition type for use +// FlowSchemaConditionApplyConfiguration represents a declarative configuration of the FlowSchemaCondition type for use // with apply. type FlowSchemaConditionApplyConfiguration struct { Type *v1beta2.FlowSchemaConditionType `json:"type,omitempty"` @@ -33,7 +33,7 @@ type FlowSchemaConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// FlowSchemaConditionApplyConfiguration constructs an declarative configuration of the FlowSchemaCondition type for use with +// FlowSchemaConditionApplyConfiguration constructs a declarative configuration of the FlowSchemaCondition type for use with // apply. func FlowSchemaCondition() *FlowSchemaConditionApplyConfiguration { return &FlowSchemaConditionApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta2/flowschemaspec.go b/applyconfigurations/flowcontrol/v1beta2/flowschemaspec.go index a5477e2768..6eab63bfa9 100644 --- a/applyconfigurations/flowcontrol/v1beta2/flowschemaspec.go +++ b/applyconfigurations/flowcontrol/v1beta2/flowschemaspec.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta2 -// FlowSchemaSpecApplyConfiguration represents an declarative configuration of the FlowSchemaSpec type for use +// FlowSchemaSpecApplyConfiguration represents a declarative configuration of the FlowSchemaSpec type for use // with apply. type FlowSchemaSpecApplyConfiguration struct { PriorityLevelConfiguration *PriorityLevelConfigurationReferenceApplyConfiguration `json:"priorityLevelConfiguration,omitempty"` @@ -27,7 +27,7 @@ type FlowSchemaSpecApplyConfiguration struct { Rules []PolicyRulesWithSubjectsApplyConfiguration `json:"rules,omitempty"` } -// FlowSchemaSpecApplyConfiguration constructs an declarative configuration of the FlowSchemaSpec type for use with +// FlowSchemaSpecApplyConfiguration constructs a declarative configuration of the FlowSchemaSpec type for use with // apply. func FlowSchemaSpec() *FlowSchemaSpecApplyConfiguration { return &FlowSchemaSpecApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta2/flowschemastatus.go b/applyconfigurations/flowcontrol/v1beta2/flowschemastatus.go index 67c5be2cbe..70ac997e45 100644 --- a/applyconfigurations/flowcontrol/v1beta2/flowschemastatus.go +++ b/applyconfigurations/flowcontrol/v1beta2/flowschemastatus.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta2 -// FlowSchemaStatusApplyConfiguration represents an declarative configuration of the FlowSchemaStatus type for use +// FlowSchemaStatusApplyConfiguration represents a declarative configuration of the FlowSchemaStatus type for use // with apply. type FlowSchemaStatusApplyConfiguration struct { Conditions []FlowSchemaConditionApplyConfiguration `json:"conditions,omitempty"` } -// FlowSchemaStatusApplyConfiguration constructs an declarative configuration of the FlowSchemaStatus type for use with +// FlowSchemaStatusApplyConfiguration constructs a declarative configuration of the FlowSchemaStatus type for use with // apply. func FlowSchemaStatus() *FlowSchemaStatusApplyConfiguration { return &FlowSchemaStatusApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta2/groupsubject.go b/applyconfigurations/flowcontrol/v1beta2/groupsubject.go index b670f2cfd9..25207d7c1a 100644 --- a/applyconfigurations/flowcontrol/v1beta2/groupsubject.go +++ b/applyconfigurations/flowcontrol/v1beta2/groupsubject.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta2 -// GroupSubjectApplyConfiguration represents an declarative configuration of the GroupSubject type for use +// GroupSubjectApplyConfiguration represents a declarative configuration of the GroupSubject type for use // with apply. type GroupSubjectApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// GroupSubjectApplyConfiguration constructs an declarative configuration of the GroupSubject type for use with +// GroupSubjectApplyConfiguration constructs a declarative configuration of the GroupSubject type for use with // apply. func GroupSubject() *GroupSubjectApplyConfiguration { return &GroupSubjectApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta2/limitedprioritylevelconfiguration.go b/applyconfigurations/flowcontrol/v1beta2/limitedprioritylevelconfiguration.go index 563b185c74..298dd46370 100644 --- a/applyconfigurations/flowcontrol/v1beta2/limitedprioritylevelconfiguration.go +++ b/applyconfigurations/flowcontrol/v1beta2/limitedprioritylevelconfiguration.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta2 -// LimitedPriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the LimitedPriorityLevelConfiguration type for use +// LimitedPriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the LimitedPriorityLevelConfiguration type for use // with apply. type LimitedPriorityLevelConfigurationApplyConfiguration struct { AssuredConcurrencyShares *int32 `json:"assuredConcurrencyShares,omitempty"` @@ -27,7 +27,7 @@ type LimitedPriorityLevelConfigurationApplyConfiguration struct { BorrowingLimitPercent *int32 `json:"borrowingLimitPercent,omitempty"` } -// LimitedPriorityLevelConfigurationApplyConfiguration constructs an declarative configuration of the LimitedPriorityLevelConfiguration type for use with +// LimitedPriorityLevelConfigurationApplyConfiguration constructs a declarative configuration of the LimitedPriorityLevelConfiguration type for use with // apply. func LimitedPriorityLevelConfiguration() *LimitedPriorityLevelConfigurationApplyConfiguration { return &LimitedPriorityLevelConfigurationApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta2/limitresponse.go b/applyconfigurations/flowcontrol/v1beta2/limitresponse.go index a9b7661fb2..38a513d306 100644 --- a/applyconfigurations/flowcontrol/v1beta2/limitresponse.go +++ b/applyconfigurations/flowcontrol/v1beta2/limitresponse.go @@ -22,14 +22,14 @@ import ( v1beta2 "k8s.io/api/flowcontrol/v1beta2" ) -// LimitResponseApplyConfiguration represents an declarative configuration of the LimitResponse type for use +// LimitResponseApplyConfiguration represents a declarative configuration of the LimitResponse type for use // with apply. type LimitResponseApplyConfiguration struct { Type *v1beta2.LimitResponseType `json:"type,omitempty"` Queuing *QueuingConfigurationApplyConfiguration `json:"queuing,omitempty"` } -// LimitResponseApplyConfiguration constructs an declarative configuration of the LimitResponse type for use with +// LimitResponseApplyConfiguration constructs a declarative configuration of the LimitResponse type for use with // apply. func LimitResponse() *LimitResponseApplyConfiguration { return &LimitResponseApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta2/nonresourcepolicyrule.go b/applyconfigurations/flowcontrol/v1beta2/nonresourcepolicyrule.go index cb8ba0afd6..5032ee4898 100644 --- a/applyconfigurations/flowcontrol/v1beta2/nonresourcepolicyrule.go +++ b/applyconfigurations/flowcontrol/v1beta2/nonresourcepolicyrule.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta2 -// NonResourcePolicyRuleApplyConfiguration represents an declarative configuration of the NonResourcePolicyRule type for use +// NonResourcePolicyRuleApplyConfiguration represents a declarative configuration of the NonResourcePolicyRule type for use // with apply. type NonResourcePolicyRuleApplyConfiguration struct { Verbs []string `json:"verbs,omitempty"` NonResourceURLs []string `json:"nonResourceURLs,omitempty"` } -// NonResourcePolicyRuleApplyConfiguration constructs an declarative configuration of the NonResourcePolicyRule type for use with +// NonResourcePolicyRuleApplyConfiguration constructs a declarative configuration of the NonResourcePolicyRule type for use with // apply. func NonResourcePolicyRule() *NonResourcePolicyRuleApplyConfiguration { return &NonResourcePolicyRuleApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta2/policyruleswithsubjects.go b/applyconfigurations/flowcontrol/v1beta2/policyruleswithsubjects.go index 179c3979db..2bb8c87182 100644 --- a/applyconfigurations/flowcontrol/v1beta2/policyruleswithsubjects.go +++ b/applyconfigurations/flowcontrol/v1beta2/policyruleswithsubjects.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta2 -// PolicyRulesWithSubjectsApplyConfiguration represents an declarative configuration of the PolicyRulesWithSubjects type for use +// PolicyRulesWithSubjectsApplyConfiguration represents a declarative configuration of the PolicyRulesWithSubjects type for use // with apply. type PolicyRulesWithSubjectsApplyConfiguration struct { Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"` @@ -26,7 +26,7 @@ type PolicyRulesWithSubjectsApplyConfiguration struct { NonResourceRules []NonResourcePolicyRuleApplyConfiguration `json:"nonResourceRules,omitempty"` } -// PolicyRulesWithSubjectsApplyConfiguration constructs an declarative configuration of the PolicyRulesWithSubjects type for use with +// PolicyRulesWithSubjectsApplyConfiguration constructs a declarative configuration of the PolicyRulesWithSubjects type for use with // apply. func PolicyRulesWithSubjects() *PolicyRulesWithSubjectsApplyConfiguration { return &PolicyRulesWithSubjectsApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfiguration.go b/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfiguration.go index 7589d9ebe4..7d52ca2c2a 100644 --- a/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfiguration.go +++ b/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfiguration.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the PriorityLevelConfiguration type for use +// PriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the PriorityLevelConfiguration type for use // with apply. type PriorityLevelConfigurationApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type PriorityLevelConfigurationApplyConfiguration struct { Status *PriorityLevelConfigurationStatusApplyConfiguration `json:"status,omitempty"` } -// PriorityLevelConfiguration constructs an declarative configuration of the PriorityLevelConfiguration type for use with +// PriorityLevelConfiguration constructs a declarative configuration of the PriorityLevelConfiguration type for use with // apply. func PriorityLevelConfiguration(name string) *PriorityLevelConfigurationApplyConfiguration { b := &PriorityLevelConfigurationApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfigurationcondition.go b/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfigurationcondition.go index f742adeff0..ddb17e9843 100644 --- a/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfigurationcondition.go +++ b/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfigurationcondition.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// PriorityLevelConfigurationConditionApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationCondition type for use +// PriorityLevelConfigurationConditionApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationCondition type for use // with apply. type PriorityLevelConfigurationConditionApplyConfiguration struct { Type *v1beta2.PriorityLevelConfigurationConditionType `json:"type,omitempty"` @@ -33,7 +33,7 @@ type PriorityLevelConfigurationConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// PriorityLevelConfigurationConditionApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationCondition type for use with +// PriorityLevelConfigurationConditionApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationCondition type for use with // apply. func PriorityLevelConfigurationCondition() *PriorityLevelConfigurationConditionApplyConfiguration { return &PriorityLevelConfigurationConditionApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfigurationreference.go b/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfigurationreference.go index 581b451ffd..bbf718b60f 100644 --- a/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfigurationreference.go +++ b/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfigurationreference.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta2 -// PriorityLevelConfigurationReferenceApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationReference type for use +// PriorityLevelConfigurationReferenceApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationReference type for use // with apply. type PriorityLevelConfigurationReferenceApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// PriorityLevelConfigurationReferenceApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationReference type for use with +// PriorityLevelConfigurationReferenceApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationReference type for use with // apply. func PriorityLevelConfigurationReference() *PriorityLevelConfigurationReferenceApplyConfiguration { return &PriorityLevelConfigurationReferenceApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfigurationspec.go b/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfigurationspec.go index 994a8a16a2..c083ad0ba6 100644 --- a/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfigurationspec.go +++ b/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfigurationspec.go @@ -22,7 +22,7 @@ import ( v1beta2 "k8s.io/api/flowcontrol/v1beta2" ) -// PriorityLevelConfigurationSpecApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationSpec type for use +// PriorityLevelConfigurationSpecApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationSpec type for use // with apply. type PriorityLevelConfigurationSpecApplyConfiguration struct { Type *v1beta2.PriorityLevelEnablement `json:"type,omitempty"` @@ -30,7 +30,7 @@ type PriorityLevelConfigurationSpecApplyConfiguration struct { Exempt *ExemptPriorityLevelConfigurationApplyConfiguration `json:"exempt,omitempty"` } -// PriorityLevelConfigurationSpecApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationSpec type for use with +// PriorityLevelConfigurationSpecApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationSpec type for use with // apply. func PriorityLevelConfigurationSpec() *PriorityLevelConfigurationSpecApplyConfiguration { return &PriorityLevelConfigurationSpecApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfigurationstatus.go b/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfigurationstatus.go index b55e32be00..7a1f8790b9 100644 --- a/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfigurationstatus.go +++ b/applyconfigurations/flowcontrol/v1beta2/prioritylevelconfigurationstatus.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta2 -// PriorityLevelConfigurationStatusApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationStatus type for use +// PriorityLevelConfigurationStatusApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationStatus type for use // with apply. type PriorityLevelConfigurationStatusApplyConfiguration struct { Conditions []PriorityLevelConfigurationConditionApplyConfiguration `json:"conditions,omitempty"` } -// PriorityLevelConfigurationStatusApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationStatus type for use with +// PriorityLevelConfigurationStatusApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationStatus type for use with // apply. func PriorityLevelConfigurationStatus() *PriorityLevelConfigurationStatusApplyConfiguration { return &PriorityLevelConfigurationStatusApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta2/queuingconfiguration.go b/applyconfigurations/flowcontrol/v1beta2/queuingconfiguration.go index 06246fb27e..19c34c5f83 100644 --- a/applyconfigurations/flowcontrol/v1beta2/queuingconfiguration.go +++ b/applyconfigurations/flowcontrol/v1beta2/queuingconfiguration.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta2 -// QueuingConfigurationApplyConfiguration represents an declarative configuration of the QueuingConfiguration type for use +// QueuingConfigurationApplyConfiguration represents a declarative configuration of the QueuingConfiguration type for use // with apply. type QueuingConfigurationApplyConfiguration struct { Queues *int32 `json:"queues,omitempty"` @@ -26,7 +26,7 @@ type QueuingConfigurationApplyConfiguration struct { QueueLengthLimit *int32 `json:"queueLengthLimit,omitempty"` } -// QueuingConfigurationApplyConfiguration constructs an declarative configuration of the QueuingConfiguration type for use with +// QueuingConfigurationApplyConfiguration constructs a declarative configuration of the QueuingConfiguration type for use with // apply. func QueuingConfiguration() *QueuingConfigurationApplyConfiguration { return &QueuingConfigurationApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta2/resourcepolicyrule.go b/applyconfigurations/flowcontrol/v1beta2/resourcepolicyrule.go index b67ea1c7f9..070d2ed465 100644 --- a/applyconfigurations/flowcontrol/v1beta2/resourcepolicyrule.go +++ b/applyconfigurations/flowcontrol/v1beta2/resourcepolicyrule.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta2 -// ResourcePolicyRuleApplyConfiguration represents an declarative configuration of the ResourcePolicyRule type for use +// ResourcePolicyRuleApplyConfiguration represents a declarative configuration of the ResourcePolicyRule type for use // with apply. type ResourcePolicyRuleApplyConfiguration struct { Verbs []string `json:"verbs,omitempty"` @@ -28,7 +28,7 @@ type ResourcePolicyRuleApplyConfiguration struct { Namespaces []string `json:"namespaces,omitempty"` } -// ResourcePolicyRuleApplyConfiguration constructs an declarative configuration of the ResourcePolicyRule type for use with +// ResourcePolicyRuleApplyConfiguration constructs a declarative configuration of the ResourcePolicyRule type for use with // apply. func ResourcePolicyRule() *ResourcePolicyRuleApplyConfiguration { return &ResourcePolicyRuleApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta2/serviceaccountsubject.go b/applyconfigurations/flowcontrol/v1beta2/serviceaccountsubject.go index b6cfdcad3b..c0d44721cc 100644 --- a/applyconfigurations/flowcontrol/v1beta2/serviceaccountsubject.go +++ b/applyconfigurations/flowcontrol/v1beta2/serviceaccountsubject.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta2 -// ServiceAccountSubjectApplyConfiguration represents an declarative configuration of the ServiceAccountSubject type for use +// ServiceAccountSubjectApplyConfiguration represents a declarative configuration of the ServiceAccountSubject type for use // with apply. type ServiceAccountSubjectApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` Name *string `json:"name,omitempty"` } -// ServiceAccountSubjectApplyConfiguration constructs an declarative configuration of the ServiceAccountSubject type for use with +// ServiceAccountSubjectApplyConfiguration constructs a declarative configuration of the ServiceAccountSubject type for use with // apply. func ServiceAccountSubject() *ServiceAccountSubjectApplyConfiguration { return &ServiceAccountSubjectApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta2/subject.go b/applyconfigurations/flowcontrol/v1beta2/subject.go index 7030785b8c..2cfaab43d8 100644 --- a/applyconfigurations/flowcontrol/v1beta2/subject.go +++ b/applyconfigurations/flowcontrol/v1beta2/subject.go @@ -22,7 +22,7 @@ import ( v1beta2 "k8s.io/api/flowcontrol/v1beta2" ) -// SubjectApplyConfiguration represents an declarative configuration of the Subject type for use +// SubjectApplyConfiguration represents a declarative configuration of the Subject type for use // with apply. type SubjectApplyConfiguration struct { Kind *v1beta2.SubjectKind `json:"kind,omitempty"` @@ -31,7 +31,7 @@ type SubjectApplyConfiguration struct { ServiceAccount *ServiceAccountSubjectApplyConfiguration `json:"serviceAccount,omitempty"` } -// SubjectApplyConfiguration constructs an declarative configuration of the Subject type for use with +// SubjectApplyConfiguration constructs a declarative configuration of the Subject type for use with // apply. func Subject() *SubjectApplyConfiguration { return &SubjectApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta2/usersubject.go b/applyconfigurations/flowcontrol/v1beta2/usersubject.go index 8c77b3e8a2..c249f042da 100644 --- a/applyconfigurations/flowcontrol/v1beta2/usersubject.go +++ b/applyconfigurations/flowcontrol/v1beta2/usersubject.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta2 -// UserSubjectApplyConfiguration represents an declarative configuration of the UserSubject type for use +// UserSubjectApplyConfiguration represents a declarative configuration of the UserSubject type for use // with apply. type UserSubjectApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// UserSubjectApplyConfiguration constructs an declarative configuration of the UserSubject type for use with +// UserSubjectApplyConfiguration constructs a declarative configuration of the UserSubject type for use with // apply. func UserSubject() *UserSubjectApplyConfiguration { return &UserSubjectApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta3/exemptprioritylevelconfiguration.go b/applyconfigurations/flowcontrol/v1beta3/exemptprioritylevelconfiguration.go index b03c11d0d9..b9bf6993af 100644 --- a/applyconfigurations/flowcontrol/v1beta3/exemptprioritylevelconfiguration.go +++ b/applyconfigurations/flowcontrol/v1beta3/exemptprioritylevelconfiguration.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta3 -// ExemptPriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the ExemptPriorityLevelConfiguration type for use +// ExemptPriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the ExemptPriorityLevelConfiguration type for use // with apply. type ExemptPriorityLevelConfigurationApplyConfiguration struct { NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares,omitempty"` LendablePercent *int32 `json:"lendablePercent,omitempty"` } -// ExemptPriorityLevelConfigurationApplyConfiguration constructs an declarative configuration of the ExemptPriorityLevelConfiguration type for use with +// ExemptPriorityLevelConfigurationApplyConfiguration constructs a declarative configuration of the ExemptPriorityLevelConfiguration type for use with // apply. func ExemptPriorityLevelConfiguration() *ExemptPriorityLevelConfigurationApplyConfiguration { return &ExemptPriorityLevelConfigurationApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta3/flowdistinguishermethod.go b/applyconfigurations/flowcontrol/v1beta3/flowdistinguishermethod.go index cd45725932..49d84bd866 100644 --- a/applyconfigurations/flowcontrol/v1beta3/flowdistinguishermethod.go +++ b/applyconfigurations/flowcontrol/v1beta3/flowdistinguishermethod.go @@ -22,13 +22,13 @@ import ( v1beta3 "k8s.io/api/flowcontrol/v1beta3" ) -// FlowDistinguisherMethodApplyConfiguration represents an declarative configuration of the FlowDistinguisherMethod type for use +// FlowDistinguisherMethodApplyConfiguration represents a declarative configuration of the FlowDistinguisherMethod type for use // with apply. type FlowDistinguisherMethodApplyConfiguration struct { Type *v1beta3.FlowDistinguisherMethodType `json:"type,omitempty"` } -// FlowDistinguisherMethodApplyConfiguration constructs an declarative configuration of the FlowDistinguisherMethod type for use with +// FlowDistinguisherMethodApplyConfiguration constructs a declarative configuration of the FlowDistinguisherMethod type for use with // apply. func FlowDistinguisherMethod() *FlowDistinguisherMethodApplyConfiguration { return &FlowDistinguisherMethodApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta3/flowschema.go b/applyconfigurations/flowcontrol/v1beta3/flowschema.go index 0523d2140c..1f69c43b23 100644 --- a/applyconfigurations/flowcontrol/v1beta3/flowschema.go +++ b/applyconfigurations/flowcontrol/v1beta3/flowschema.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// FlowSchemaApplyConfiguration represents an declarative configuration of the FlowSchema type for use +// FlowSchemaApplyConfiguration represents a declarative configuration of the FlowSchema type for use // with apply. type FlowSchemaApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type FlowSchemaApplyConfiguration struct { Status *FlowSchemaStatusApplyConfiguration `json:"status,omitempty"` } -// FlowSchema constructs an declarative configuration of the FlowSchema type for use with +// FlowSchema constructs a declarative configuration of the FlowSchema type for use with // apply. func FlowSchema(name string) *FlowSchemaApplyConfiguration { b := &FlowSchemaApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta3/flowschemacondition.go b/applyconfigurations/flowcontrol/v1beta3/flowschemacondition.go index 0ef3a2c921..41d623aeb8 100644 --- a/applyconfigurations/flowcontrol/v1beta3/flowschemacondition.go +++ b/applyconfigurations/flowcontrol/v1beta3/flowschemacondition.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// FlowSchemaConditionApplyConfiguration represents an declarative configuration of the FlowSchemaCondition type for use +// FlowSchemaConditionApplyConfiguration represents a declarative configuration of the FlowSchemaCondition type for use // with apply. type FlowSchemaConditionApplyConfiguration struct { Type *v1beta3.FlowSchemaConditionType `json:"type,omitempty"` @@ -33,7 +33,7 @@ type FlowSchemaConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// FlowSchemaConditionApplyConfiguration constructs an declarative configuration of the FlowSchemaCondition type for use with +// FlowSchemaConditionApplyConfiguration constructs a declarative configuration of the FlowSchemaCondition type for use with // apply. func FlowSchemaCondition() *FlowSchemaConditionApplyConfiguration { return &FlowSchemaConditionApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta3/flowschemaspec.go b/applyconfigurations/flowcontrol/v1beta3/flowschemaspec.go index e077ed3fde..7141f6a6a1 100644 --- a/applyconfigurations/flowcontrol/v1beta3/flowschemaspec.go +++ b/applyconfigurations/flowcontrol/v1beta3/flowschemaspec.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta3 -// FlowSchemaSpecApplyConfiguration represents an declarative configuration of the FlowSchemaSpec type for use +// FlowSchemaSpecApplyConfiguration represents a declarative configuration of the FlowSchemaSpec type for use // with apply. type FlowSchemaSpecApplyConfiguration struct { PriorityLevelConfiguration *PriorityLevelConfigurationReferenceApplyConfiguration `json:"priorityLevelConfiguration,omitempty"` @@ -27,7 +27,7 @@ type FlowSchemaSpecApplyConfiguration struct { Rules []PolicyRulesWithSubjectsApplyConfiguration `json:"rules,omitempty"` } -// FlowSchemaSpecApplyConfiguration constructs an declarative configuration of the FlowSchemaSpec type for use with +// FlowSchemaSpecApplyConfiguration constructs a declarative configuration of the FlowSchemaSpec type for use with // apply. func FlowSchemaSpec() *FlowSchemaSpecApplyConfiguration { return &FlowSchemaSpecApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta3/flowschemastatus.go b/applyconfigurations/flowcontrol/v1beta3/flowschemastatus.go index 18db1c9325..294ddc9098 100644 --- a/applyconfigurations/flowcontrol/v1beta3/flowschemastatus.go +++ b/applyconfigurations/flowcontrol/v1beta3/flowschemastatus.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta3 -// FlowSchemaStatusApplyConfiguration represents an declarative configuration of the FlowSchemaStatus type for use +// FlowSchemaStatusApplyConfiguration represents a declarative configuration of the FlowSchemaStatus type for use // with apply. type FlowSchemaStatusApplyConfiguration struct { Conditions []FlowSchemaConditionApplyConfiguration `json:"conditions,omitempty"` } -// FlowSchemaStatusApplyConfiguration constructs an declarative configuration of the FlowSchemaStatus type for use with +// FlowSchemaStatusApplyConfiguration constructs a declarative configuration of the FlowSchemaStatus type for use with // apply. func FlowSchemaStatus() *FlowSchemaStatusApplyConfiguration { return &FlowSchemaStatusApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta3/groupsubject.go b/applyconfigurations/flowcontrol/v1beta3/groupsubject.go index b919b711b3..6576e716ef 100644 --- a/applyconfigurations/flowcontrol/v1beta3/groupsubject.go +++ b/applyconfigurations/flowcontrol/v1beta3/groupsubject.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta3 -// GroupSubjectApplyConfiguration represents an declarative configuration of the GroupSubject type for use +// GroupSubjectApplyConfiguration represents a declarative configuration of the GroupSubject type for use // with apply. type GroupSubjectApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// GroupSubjectApplyConfiguration constructs an declarative configuration of the GroupSubject type for use with +// GroupSubjectApplyConfiguration constructs a declarative configuration of the GroupSubject type for use with // apply. func GroupSubject() *GroupSubjectApplyConfiguration { return &GroupSubjectApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta3/limitedprioritylevelconfiguration.go b/applyconfigurations/flowcontrol/v1beta3/limitedprioritylevelconfiguration.go index 269a48721c..bd98dd683c 100644 --- a/applyconfigurations/flowcontrol/v1beta3/limitedprioritylevelconfiguration.go +++ b/applyconfigurations/flowcontrol/v1beta3/limitedprioritylevelconfiguration.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta3 -// LimitedPriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the LimitedPriorityLevelConfiguration type for use +// LimitedPriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the LimitedPriorityLevelConfiguration type for use // with apply. type LimitedPriorityLevelConfigurationApplyConfiguration struct { NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares,omitempty"` @@ -27,7 +27,7 @@ type LimitedPriorityLevelConfigurationApplyConfiguration struct { BorrowingLimitPercent *int32 `json:"borrowingLimitPercent,omitempty"` } -// LimitedPriorityLevelConfigurationApplyConfiguration constructs an declarative configuration of the LimitedPriorityLevelConfiguration type for use with +// LimitedPriorityLevelConfigurationApplyConfiguration constructs a declarative configuration of the LimitedPriorityLevelConfiguration type for use with // apply. func LimitedPriorityLevelConfiguration() *LimitedPriorityLevelConfigurationApplyConfiguration { return &LimitedPriorityLevelConfigurationApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta3/limitresponse.go b/applyconfigurations/flowcontrol/v1beta3/limitresponse.go index b7a64ebfee..8deaabdebd 100644 --- a/applyconfigurations/flowcontrol/v1beta3/limitresponse.go +++ b/applyconfigurations/flowcontrol/v1beta3/limitresponse.go @@ -22,14 +22,14 @@ import ( v1beta3 "k8s.io/api/flowcontrol/v1beta3" ) -// LimitResponseApplyConfiguration represents an declarative configuration of the LimitResponse type for use +// LimitResponseApplyConfiguration represents a declarative configuration of the LimitResponse type for use // with apply. type LimitResponseApplyConfiguration struct { Type *v1beta3.LimitResponseType `json:"type,omitempty"` Queuing *QueuingConfigurationApplyConfiguration `json:"queuing,omitempty"` } -// LimitResponseApplyConfiguration constructs an declarative configuration of the LimitResponse type for use with +// LimitResponseApplyConfiguration constructs a declarative configuration of the LimitResponse type for use with // apply. func LimitResponse() *LimitResponseApplyConfiguration { return &LimitResponseApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta3/nonresourcepolicyrule.go b/applyconfigurations/flowcontrol/v1beta3/nonresourcepolicyrule.go index ecb47f52cf..2dd0d2b068 100644 --- a/applyconfigurations/flowcontrol/v1beta3/nonresourcepolicyrule.go +++ b/applyconfigurations/flowcontrol/v1beta3/nonresourcepolicyrule.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta3 -// NonResourcePolicyRuleApplyConfiguration represents an declarative configuration of the NonResourcePolicyRule type for use +// NonResourcePolicyRuleApplyConfiguration represents a declarative configuration of the NonResourcePolicyRule type for use // with apply. type NonResourcePolicyRuleApplyConfiguration struct { Verbs []string `json:"verbs,omitempty"` NonResourceURLs []string `json:"nonResourceURLs,omitempty"` } -// NonResourcePolicyRuleApplyConfiguration constructs an declarative configuration of the NonResourcePolicyRule type for use with +// NonResourcePolicyRuleApplyConfiguration constructs a declarative configuration of the NonResourcePolicyRule type for use with // apply. func NonResourcePolicyRule() *NonResourcePolicyRuleApplyConfiguration { return &NonResourcePolicyRuleApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta3/policyruleswithsubjects.go b/applyconfigurations/flowcontrol/v1beta3/policyruleswithsubjects.go index e30aace194..cc64dc585b 100644 --- a/applyconfigurations/flowcontrol/v1beta3/policyruleswithsubjects.go +++ b/applyconfigurations/flowcontrol/v1beta3/policyruleswithsubjects.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta3 -// PolicyRulesWithSubjectsApplyConfiguration represents an declarative configuration of the PolicyRulesWithSubjects type for use +// PolicyRulesWithSubjectsApplyConfiguration represents a declarative configuration of the PolicyRulesWithSubjects type for use // with apply. type PolicyRulesWithSubjectsApplyConfiguration struct { Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"` @@ -26,7 +26,7 @@ type PolicyRulesWithSubjectsApplyConfiguration struct { NonResourceRules []NonResourcePolicyRuleApplyConfiguration `json:"nonResourceRules,omitempty"` } -// PolicyRulesWithSubjectsApplyConfiguration constructs an declarative configuration of the PolicyRulesWithSubjects type for use with +// PolicyRulesWithSubjectsApplyConfiguration constructs a declarative configuration of the PolicyRulesWithSubjects type for use with // apply. func PolicyRulesWithSubjects() *PolicyRulesWithSubjectsApplyConfiguration { return &PolicyRulesWithSubjectsApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfiguration.go b/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfiguration.go index b21e438518..e7d1a3a5f8 100644 --- a/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfiguration.go +++ b/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfiguration.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the PriorityLevelConfiguration type for use +// PriorityLevelConfigurationApplyConfiguration represents a declarative configuration of the PriorityLevelConfiguration type for use // with apply. type PriorityLevelConfigurationApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type PriorityLevelConfigurationApplyConfiguration struct { Status *PriorityLevelConfigurationStatusApplyConfiguration `json:"status,omitempty"` } -// PriorityLevelConfiguration constructs an declarative configuration of the PriorityLevelConfiguration type for use with +// PriorityLevelConfiguration constructs a declarative configuration of the PriorityLevelConfiguration type for use with // apply. func PriorityLevelConfiguration(name string) *PriorityLevelConfigurationApplyConfiguration { b := &PriorityLevelConfigurationApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationcondition.go b/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationcondition.go index 6e36b6a079..8e9687bb90 100644 --- a/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationcondition.go +++ b/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationcondition.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// PriorityLevelConfigurationConditionApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationCondition type for use +// PriorityLevelConfigurationConditionApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationCondition type for use // with apply. type PriorityLevelConfigurationConditionApplyConfiguration struct { Type *v1beta3.PriorityLevelConfigurationConditionType `json:"type,omitempty"` @@ -33,7 +33,7 @@ type PriorityLevelConfigurationConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// PriorityLevelConfigurationConditionApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationCondition type for use with +// PriorityLevelConfigurationConditionApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationCondition type for use with // apply. func PriorityLevelConfigurationCondition() *PriorityLevelConfigurationConditionApplyConfiguration { return &PriorityLevelConfigurationConditionApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationreference.go b/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationreference.go index cb827b1e62..566aaa916b 100644 --- a/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationreference.go +++ b/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationreference.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta3 -// PriorityLevelConfigurationReferenceApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationReference type for use +// PriorityLevelConfigurationReferenceApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationReference type for use // with apply. type PriorityLevelConfigurationReferenceApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// PriorityLevelConfigurationReferenceApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationReference type for use with +// PriorityLevelConfigurationReferenceApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationReference type for use with // apply. func PriorityLevelConfigurationReference() *PriorityLevelConfigurationReferenceApplyConfiguration { return &PriorityLevelConfigurationReferenceApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationspec.go b/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationspec.go index 5b0680d912..9fa1112ce6 100644 --- a/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationspec.go +++ b/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationspec.go @@ -22,7 +22,7 @@ import ( v1beta3 "k8s.io/api/flowcontrol/v1beta3" ) -// PriorityLevelConfigurationSpecApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationSpec type for use +// PriorityLevelConfigurationSpecApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationSpec type for use // with apply. type PriorityLevelConfigurationSpecApplyConfiguration struct { Type *v1beta3.PriorityLevelEnablement `json:"type,omitempty"` @@ -30,7 +30,7 @@ type PriorityLevelConfigurationSpecApplyConfiguration struct { Exempt *ExemptPriorityLevelConfigurationApplyConfiguration `json:"exempt,omitempty"` } -// PriorityLevelConfigurationSpecApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationSpec type for use with +// PriorityLevelConfigurationSpecApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationSpec type for use with // apply. func PriorityLevelConfigurationSpec() *PriorityLevelConfigurationSpecApplyConfiguration { return &PriorityLevelConfigurationSpecApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationstatus.go b/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationstatus.go index 0ee9e306eb..be2436457e 100644 --- a/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationstatus.go +++ b/applyconfigurations/flowcontrol/v1beta3/prioritylevelconfigurationstatus.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta3 -// PriorityLevelConfigurationStatusApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationStatus type for use +// PriorityLevelConfigurationStatusApplyConfiguration represents a declarative configuration of the PriorityLevelConfigurationStatus type for use // with apply. type PriorityLevelConfigurationStatusApplyConfiguration struct { Conditions []PriorityLevelConfigurationConditionApplyConfiguration `json:"conditions,omitempty"` } -// PriorityLevelConfigurationStatusApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationStatus type for use with +// PriorityLevelConfigurationStatusApplyConfiguration constructs a declarative configuration of the PriorityLevelConfigurationStatus type for use with // apply. func PriorityLevelConfigurationStatus() *PriorityLevelConfigurationStatusApplyConfiguration { return &PriorityLevelConfigurationStatusApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta3/queuingconfiguration.go b/applyconfigurations/flowcontrol/v1beta3/queuingconfiguration.go index fc86c44431..f9a3c6d1a6 100644 --- a/applyconfigurations/flowcontrol/v1beta3/queuingconfiguration.go +++ b/applyconfigurations/flowcontrol/v1beta3/queuingconfiguration.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta3 -// QueuingConfigurationApplyConfiguration represents an declarative configuration of the QueuingConfiguration type for use +// QueuingConfigurationApplyConfiguration represents a declarative configuration of the QueuingConfiguration type for use // with apply. type QueuingConfigurationApplyConfiguration struct { Queues *int32 `json:"queues,omitempty"` @@ -26,7 +26,7 @@ type QueuingConfigurationApplyConfiguration struct { QueueLengthLimit *int32 `json:"queueLengthLimit,omitempty"` } -// QueuingConfigurationApplyConfiguration constructs an declarative configuration of the QueuingConfiguration type for use with +// QueuingConfigurationApplyConfiguration constructs a declarative configuration of the QueuingConfiguration type for use with // apply. func QueuingConfiguration() *QueuingConfigurationApplyConfiguration { return &QueuingConfigurationApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta3/resourcepolicyrule.go b/applyconfigurations/flowcontrol/v1beta3/resourcepolicyrule.go index 72623ffe49..e38f711db0 100644 --- a/applyconfigurations/flowcontrol/v1beta3/resourcepolicyrule.go +++ b/applyconfigurations/flowcontrol/v1beta3/resourcepolicyrule.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta3 -// ResourcePolicyRuleApplyConfiguration represents an declarative configuration of the ResourcePolicyRule type for use +// ResourcePolicyRuleApplyConfiguration represents a declarative configuration of the ResourcePolicyRule type for use // with apply. type ResourcePolicyRuleApplyConfiguration struct { Verbs []string `json:"verbs,omitempty"` @@ -28,7 +28,7 @@ type ResourcePolicyRuleApplyConfiguration struct { Namespaces []string `json:"namespaces,omitempty"` } -// ResourcePolicyRuleApplyConfiguration constructs an declarative configuration of the ResourcePolicyRule type for use with +// ResourcePolicyRuleApplyConfiguration constructs a declarative configuration of the ResourcePolicyRule type for use with // apply. func ResourcePolicyRule() *ResourcePolicyRuleApplyConfiguration { return &ResourcePolicyRuleApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta3/serviceaccountsubject.go b/applyconfigurations/flowcontrol/v1beta3/serviceaccountsubject.go index e2d6b1b213..a5ed40c2ae 100644 --- a/applyconfigurations/flowcontrol/v1beta3/serviceaccountsubject.go +++ b/applyconfigurations/flowcontrol/v1beta3/serviceaccountsubject.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta3 -// ServiceAccountSubjectApplyConfiguration represents an declarative configuration of the ServiceAccountSubject type for use +// ServiceAccountSubjectApplyConfiguration represents a declarative configuration of the ServiceAccountSubject type for use // with apply. type ServiceAccountSubjectApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` Name *string `json:"name,omitempty"` } -// ServiceAccountSubjectApplyConfiguration constructs an declarative configuration of the ServiceAccountSubject type for use with +// ServiceAccountSubjectApplyConfiguration constructs a declarative configuration of the ServiceAccountSubject type for use with // apply. func ServiceAccountSubject() *ServiceAccountSubjectApplyConfiguration { return &ServiceAccountSubjectApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta3/subject.go b/applyconfigurations/flowcontrol/v1beta3/subject.go index f13b8f3ec5..c412b2a7a2 100644 --- a/applyconfigurations/flowcontrol/v1beta3/subject.go +++ b/applyconfigurations/flowcontrol/v1beta3/subject.go @@ -22,7 +22,7 @@ import ( v1beta3 "k8s.io/api/flowcontrol/v1beta3" ) -// SubjectApplyConfiguration represents an declarative configuration of the Subject type for use +// SubjectApplyConfiguration represents a declarative configuration of the Subject type for use // with apply. type SubjectApplyConfiguration struct { Kind *v1beta3.SubjectKind `json:"kind,omitempty"` @@ -31,7 +31,7 @@ type SubjectApplyConfiguration struct { ServiceAccount *ServiceAccountSubjectApplyConfiguration `json:"serviceAccount,omitempty"` } -// SubjectApplyConfiguration constructs an declarative configuration of the Subject type for use with +// SubjectApplyConfiguration constructs a declarative configuration of the Subject type for use with // apply. func Subject() *SubjectApplyConfiguration { return &SubjectApplyConfiguration{} diff --git a/applyconfigurations/flowcontrol/v1beta3/usersubject.go b/applyconfigurations/flowcontrol/v1beta3/usersubject.go index 3db3abbc1a..7b3ec2ba82 100644 --- a/applyconfigurations/flowcontrol/v1beta3/usersubject.go +++ b/applyconfigurations/flowcontrol/v1beta3/usersubject.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta3 -// UserSubjectApplyConfiguration represents an declarative configuration of the UserSubject type for use +// UserSubjectApplyConfiguration represents a declarative configuration of the UserSubject type for use // with apply. type UserSubjectApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// UserSubjectApplyConfiguration constructs an declarative configuration of the UserSubject type for use with +// UserSubjectApplyConfiguration constructs a declarative configuration of the UserSubject type for use with // apply. func UserSubject() *UserSubjectApplyConfiguration { return &UserSubjectApplyConfiguration{} diff --git a/applyconfigurations/imagepolicy/v1alpha1/imagereview.go b/applyconfigurations/imagepolicy/v1alpha1/imagereview.go index caff2c192e..91944002d4 100644 --- a/applyconfigurations/imagepolicy/v1alpha1/imagereview.go +++ b/applyconfigurations/imagepolicy/v1alpha1/imagereview.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ImageReviewApplyConfiguration represents an declarative configuration of the ImageReview type for use +// ImageReviewApplyConfiguration represents a declarative configuration of the ImageReview type for use // with apply. type ImageReviewApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type ImageReviewApplyConfiguration struct { Status *ImageReviewStatusApplyConfiguration `json:"status,omitempty"` } -// ImageReview constructs an declarative configuration of the ImageReview type for use with +// ImageReview constructs a declarative configuration of the ImageReview type for use with // apply. func ImageReview(name string) *ImageReviewApplyConfiguration { b := &ImageReviewApplyConfiguration{} diff --git a/applyconfigurations/imagepolicy/v1alpha1/imagereviewcontainerspec.go b/applyconfigurations/imagepolicy/v1alpha1/imagereviewcontainerspec.go index a5bfaff93b..adfdb32584 100644 --- a/applyconfigurations/imagepolicy/v1alpha1/imagereviewcontainerspec.go +++ b/applyconfigurations/imagepolicy/v1alpha1/imagereviewcontainerspec.go @@ -18,13 +18,13 @@ limitations under the License. package v1alpha1 -// ImageReviewContainerSpecApplyConfiguration represents an declarative configuration of the ImageReviewContainerSpec type for use +// ImageReviewContainerSpecApplyConfiguration represents a declarative configuration of the ImageReviewContainerSpec type for use // with apply. type ImageReviewContainerSpecApplyConfiguration struct { Image *string `json:"image,omitempty"` } -// ImageReviewContainerSpecApplyConfiguration constructs an declarative configuration of the ImageReviewContainerSpec type for use with +// ImageReviewContainerSpecApplyConfiguration constructs a declarative configuration of the ImageReviewContainerSpec type for use with // apply. func ImageReviewContainerSpec() *ImageReviewContainerSpecApplyConfiguration { return &ImageReviewContainerSpecApplyConfiguration{} diff --git a/applyconfigurations/imagepolicy/v1alpha1/imagereviewspec.go b/applyconfigurations/imagepolicy/v1alpha1/imagereviewspec.go index 8a2bf4202d..7efc36a321 100644 --- a/applyconfigurations/imagepolicy/v1alpha1/imagereviewspec.go +++ b/applyconfigurations/imagepolicy/v1alpha1/imagereviewspec.go @@ -18,7 +18,7 @@ limitations under the License. package v1alpha1 -// ImageReviewSpecApplyConfiguration represents an declarative configuration of the ImageReviewSpec type for use +// ImageReviewSpecApplyConfiguration represents a declarative configuration of the ImageReviewSpec type for use // with apply. type ImageReviewSpecApplyConfiguration struct { Containers []ImageReviewContainerSpecApplyConfiguration `json:"containers,omitempty"` @@ -26,7 +26,7 @@ type ImageReviewSpecApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` } -// ImageReviewSpecApplyConfiguration constructs an declarative configuration of the ImageReviewSpec type for use with +// ImageReviewSpecApplyConfiguration constructs a declarative configuration of the ImageReviewSpec type for use with // apply. func ImageReviewSpec() *ImageReviewSpecApplyConfiguration { return &ImageReviewSpecApplyConfiguration{} diff --git a/applyconfigurations/imagepolicy/v1alpha1/imagereviewstatus.go b/applyconfigurations/imagepolicy/v1alpha1/imagereviewstatus.go index 58d400f3ae..e26a427e69 100644 --- a/applyconfigurations/imagepolicy/v1alpha1/imagereviewstatus.go +++ b/applyconfigurations/imagepolicy/v1alpha1/imagereviewstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v1alpha1 -// ImageReviewStatusApplyConfiguration represents an declarative configuration of the ImageReviewStatus type for use +// ImageReviewStatusApplyConfiguration represents a declarative configuration of the ImageReviewStatus type for use // with apply. type ImageReviewStatusApplyConfiguration struct { Allowed *bool `json:"allowed,omitempty"` @@ -26,7 +26,7 @@ type ImageReviewStatusApplyConfiguration struct { AuditAnnotations map[string]string `json:"auditAnnotations,omitempty"` } -// ImageReviewStatusApplyConfiguration constructs an declarative configuration of the ImageReviewStatus type for use with +// ImageReviewStatusApplyConfiguration constructs a declarative configuration of the ImageReviewStatus type for use with // apply. func ImageReviewStatus() *ImageReviewStatusApplyConfiguration { return &ImageReviewStatusApplyConfiguration{} diff --git a/applyconfigurations/meta/v1/condition.go b/applyconfigurations/meta/v1/condition.go index c84102cdde..466aaebb61 100644 --- a/applyconfigurations/meta/v1/condition.go +++ b/applyconfigurations/meta/v1/condition.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// ConditionApplyConfiguration represents an declarative configuration of the Condition type for use +// ConditionApplyConfiguration represents a declarative configuration of the Condition type for use // with apply. type ConditionApplyConfiguration struct { Type *string `json:"type,omitempty"` @@ -33,7 +33,7 @@ type ConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// ConditionApplyConfiguration constructs an declarative configuration of the Condition type for use with +// ConditionApplyConfiguration constructs a declarative configuration of the Condition type for use with // apply. func Condition() *ConditionApplyConfiguration { return &ConditionApplyConfiguration{} diff --git a/applyconfigurations/meta/v1/deleteoptions.go b/applyconfigurations/meta/v1/deleteoptions.go index 7a1d23114d..313bb9784d 100644 --- a/applyconfigurations/meta/v1/deleteoptions.go +++ b/applyconfigurations/meta/v1/deleteoptions.go @@ -22,7 +22,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// DeleteOptionsApplyConfiguration represents an declarative configuration of the DeleteOptions type for use +// DeleteOptionsApplyConfiguration represents a declarative configuration of the DeleteOptions type for use // with apply. type DeleteOptionsApplyConfiguration struct { TypeMetaApplyConfiguration `json:",inline"` @@ -33,7 +33,7 @@ type DeleteOptionsApplyConfiguration struct { DryRun []string `json:"dryRun,omitempty"` } -// DeleteOptionsApplyConfiguration constructs an declarative configuration of the DeleteOptions type for use with +// DeleteOptionsApplyConfiguration constructs a declarative configuration of the DeleteOptions type for use with // apply. func DeleteOptions() *DeleteOptionsApplyConfiguration { b := &DeleteOptionsApplyConfiguration{} diff --git a/applyconfigurations/meta/v1/labelselector.go b/applyconfigurations/meta/v1/labelselector.go index 6d24bc363b..1f33c94e0c 100644 --- a/applyconfigurations/meta/v1/labelselector.go +++ b/applyconfigurations/meta/v1/labelselector.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// LabelSelectorApplyConfiguration represents an declarative configuration of the LabelSelector type for use +// LabelSelectorApplyConfiguration represents a declarative configuration of the LabelSelector type for use // with apply. type LabelSelectorApplyConfiguration struct { MatchLabels map[string]string `json:"matchLabels,omitempty"` MatchExpressions []LabelSelectorRequirementApplyConfiguration `json:"matchExpressions,omitempty"` } -// LabelSelectorApplyConfiguration constructs an declarative configuration of the LabelSelector type for use with +// LabelSelectorApplyConfiguration constructs a declarative configuration of the LabelSelector type for use with // apply. func LabelSelector() *LabelSelectorApplyConfiguration { return &LabelSelectorApplyConfiguration{} diff --git a/applyconfigurations/meta/v1/labelselectorrequirement.go b/applyconfigurations/meta/v1/labelselectorrequirement.go index ff70f365e6..bd9db9659b 100644 --- a/applyconfigurations/meta/v1/labelselectorrequirement.go +++ b/applyconfigurations/meta/v1/labelselectorrequirement.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// LabelSelectorRequirementApplyConfiguration represents an declarative configuration of the LabelSelectorRequirement type for use +// LabelSelectorRequirementApplyConfiguration represents a declarative configuration of the LabelSelectorRequirement type for use // with apply. type LabelSelectorRequirementApplyConfiguration struct { Key *string `json:"key,omitempty"` @@ -30,7 +30,7 @@ type LabelSelectorRequirementApplyConfiguration struct { Values []string `json:"values,omitempty"` } -// LabelSelectorRequirementApplyConfiguration constructs an declarative configuration of the LabelSelectorRequirement type for use with +// LabelSelectorRequirementApplyConfiguration constructs a declarative configuration of the LabelSelectorRequirement type for use with // apply. func LabelSelectorRequirement() *LabelSelectorRequirementApplyConfiguration { return &LabelSelectorRequirementApplyConfiguration{} diff --git a/applyconfigurations/meta/v1/managedfieldsentry.go b/applyconfigurations/meta/v1/managedfieldsentry.go index f4d7e26812..6913df8226 100644 --- a/applyconfigurations/meta/v1/managedfieldsentry.go +++ b/applyconfigurations/meta/v1/managedfieldsentry.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// ManagedFieldsEntryApplyConfiguration represents an declarative configuration of the ManagedFieldsEntry type for use +// ManagedFieldsEntryApplyConfiguration represents a declarative configuration of the ManagedFieldsEntry type for use // with apply. type ManagedFieldsEntryApplyConfiguration struct { Manager *string `json:"manager,omitempty"` @@ -34,7 +34,7 @@ type ManagedFieldsEntryApplyConfiguration struct { Subresource *string `json:"subresource,omitempty"` } -// ManagedFieldsEntryApplyConfiguration constructs an declarative configuration of the ManagedFieldsEntry type for use with +// ManagedFieldsEntryApplyConfiguration constructs a declarative configuration of the ManagedFieldsEntry type for use with // apply. func ManagedFieldsEntry() *ManagedFieldsEntryApplyConfiguration { return &ManagedFieldsEntryApplyConfiguration{} diff --git a/applyconfigurations/meta/v1/objectmeta.go b/applyconfigurations/meta/v1/objectmeta.go index 1cc948f682..a9419975ef 100644 --- a/applyconfigurations/meta/v1/objectmeta.go +++ b/applyconfigurations/meta/v1/objectmeta.go @@ -23,7 +23,7 @@ import ( types "k8s.io/apimachinery/pkg/types" ) -// ObjectMetaApplyConfiguration represents an declarative configuration of the ObjectMeta type for use +// ObjectMetaApplyConfiguration represents a declarative configuration of the ObjectMeta type for use // with apply. type ObjectMetaApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -41,7 +41,7 @@ type ObjectMetaApplyConfiguration struct { Finalizers []string `json:"finalizers,omitempty"` } -// ObjectMetaApplyConfiguration constructs an declarative configuration of the ObjectMeta type for use with +// ObjectMetaApplyConfiguration constructs a declarative configuration of the ObjectMeta type for use with // apply. func ObjectMeta() *ObjectMetaApplyConfiguration { return &ObjectMetaApplyConfiguration{} diff --git a/applyconfigurations/meta/v1/ownerreference.go b/applyconfigurations/meta/v1/ownerreference.go index b3117d6a4b..2776152322 100644 --- a/applyconfigurations/meta/v1/ownerreference.go +++ b/applyconfigurations/meta/v1/ownerreference.go @@ -22,7 +22,7 @@ import ( types "k8s.io/apimachinery/pkg/types" ) -// OwnerReferenceApplyConfiguration represents an declarative configuration of the OwnerReference type for use +// OwnerReferenceApplyConfiguration represents a declarative configuration of the OwnerReference type for use // with apply. type OwnerReferenceApplyConfiguration struct { APIVersion *string `json:"apiVersion,omitempty"` @@ -33,7 +33,7 @@ type OwnerReferenceApplyConfiguration struct { BlockOwnerDeletion *bool `json:"blockOwnerDeletion,omitempty"` } -// OwnerReferenceApplyConfiguration constructs an declarative configuration of the OwnerReference type for use with +// OwnerReferenceApplyConfiguration constructs a declarative configuration of the OwnerReference type for use with // apply. func OwnerReference() *OwnerReferenceApplyConfiguration { return &OwnerReferenceApplyConfiguration{} diff --git a/applyconfigurations/meta/v1/preconditions.go b/applyconfigurations/meta/v1/preconditions.go index f627733f1e..8f8b6c6b3a 100644 --- a/applyconfigurations/meta/v1/preconditions.go +++ b/applyconfigurations/meta/v1/preconditions.go @@ -22,14 +22,14 @@ import ( types "k8s.io/apimachinery/pkg/types" ) -// PreconditionsApplyConfiguration represents an declarative configuration of the Preconditions type for use +// PreconditionsApplyConfiguration represents a declarative configuration of the Preconditions type for use // with apply. type PreconditionsApplyConfiguration struct { UID *types.UID `json:"uid,omitempty"` ResourceVersion *string `json:"resourceVersion,omitempty"` } -// PreconditionsApplyConfiguration constructs an declarative configuration of the Preconditions type for use with +// PreconditionsApplyConfiguration constructs a declarative configuration of the Preconditions type for use with // apply. func Preconditions() *PreconditionsApplyConfiguration { return &PreconditionsApplyConfiguration{} diff --git a/applyconfigurations/meta/v1/typemeta.go b/applyconfigurations/meta/v1/typemeta.go index 877b0890e8..979044384c 100644 --- a/applyconfigurations/meta/v1/typemeta.go +++ b/applyconfigurations/meta/v1/typemeta.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// TypeMetaApplyConfiguration represents an declarative configuration of the TypeMeta type for use +// TypeMetaApplyConfiguration represents a declarative configuration of the TypeMeta type for use // with apply. type TypeMetaApplyConfiguration struct { Kind *string `json:"kind,omitempty"` APIVersion *string `json:"apiVersion,omitempty"` } -// TypeMetaApplyConfiguration constructs an declarative configuration of the TypeMeta type for use with +// TypeMetaApplyConfiguration constructs a declarative configuration of the TypeMeta type for use with // apply. func TypeMeta() *TypeMetaApplyConfiguration { return &TypeMetaApplyConfiguration{} diff --git a/applyconfigurations/networking/v1/httpingresspath.go b/applyconfigurations/networking/v1/httpingresspath.go index 07b6a67f6a..e39670f295 100644 --- a/applyconfigurations/networking/v1/httpingresspath.go +++ b/applyconfigurations/networking/v1/httpingresspath.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/networking/v1" ) -// HTTPIngressPathApplyConfiguration represents an declarative configuration of the HTTPIngressPath type for use +// HTTPIngressPathApplyConfiguration represents a declarative configuration of the HTTPIngressPath type for use // with apply. type HTTPIngressPathApplyConfiguration struct { Path *string `json:"path,omitempty"` @@ -30,7 +30,7 @@ type HTTPIngressPathApplyConfiguration struct { Backend *IngressBackendApplyConfiguration `json:"backend,omitempty"` } -// HTTPIngressPathApplyConfiguration constructs an declarative configuration of the HTTPIngressPath type for use with +// HTTPIngressPathApplyConfiguration constructs a declarative configuration of the HTTPIngressPath type for use with // apply. func HTTPIngressPath() *HTTPIngressPathApplyConfiguration { return &HTTPIngressPathApplyConfiguration{} diff --git a/applyconfigurations/networking/v1/httpingressrulevalue.go b/applyconfigurations/networking/v1/httpingressrulevalue.go index fef529d696..ad9a7a6771 100644 --- a/applyconfigurations/networking/v1/httpingressrulevalue.go +++ b/applyconfigurations/networking/v1/httpingressrulevalue.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// HTTPIngressRuleValueApplyConfiguration represents an declarative configuration of the HTTPIngressRuleValue type for use +// HTTPIngressRuleValueApplyConfiguration represents a declarative configuration of the HTTPIngressRuleValue type for use // with apply. type HTTPIngressRuleValueApplyConfiguration struct { Paths []HTTPIngressPathApplyConfiguration `json:"paths,omitempty"` } -// HTTPIngressRuleValueApplyConfiguration constructs an declarative configuration of the HTTPIngressRuleValue type for use with +// HTTPIngressRuleValueApplyConfiguration constructs a declarative configuration of the HTTPIngressRuleValue type for use with // apply. func HTTPIngressRuleValue() *HTTPIngressRuleValueApplyConfiguration { return &HTTPIngressRuleValueApplyConfiguration{} diff --git a/applyconfigurations/networking/v1/ingress.go b/applyconfigurations/networking/v1/ingress.go index b08d3e6f7b..607c26e943 100644 --- a/applyconfigurations/networking/v1/ingress.go +++ b/applyconfigurations/networking/v1/ingress.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// IngressApplyConfiguration represents an declarative configuration of the Ingress type for use +// IngressApplyConfiguration represents a declarative configuration of the Ingress type for use // with apply. type IngressApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type IngressApplyConfiguration struct { Status *IngressStatusApplyConfiguration `json:"status,omitempty"` } -// Ingress constructs an declarative configuration of the Ingress type for use with +// Ingress constructs a declarative configuration of the Ingress type for use with // apply. func Ingress(name, namespace string) *IngressApplyConfiguration { b := &IngressApplyConfiguration{} diff --git a/applyconfigurations/networking/v1/ingressbackend.go b/applyconfigurations/networking/v1/ingressbackend.go index 5757135991..b014b7beef 100644 --- a/applyconfigurations/networking/v1/ingressbackend.go +++ b/applyconfigurations/networking/v1/ingressbackend.go @@ -22,14 +22,14 @@ import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" ) -// IngressBackendApplyConfiguration represents an declarative configuration of the IngressBackend type for use +// IngressBackendApplyConfiguration represents a declarative configuration of the IngressBackend type for use // with apply. type IngressBackendApplyConfiguration struct { Service *IngressServiceBackendApplyConfiguration `json:"service,omitempty"` Resource *corev1.TypedLocalObjectReferenceApplyConfiguration `json:"resource,omitempty"` } -// IngressBackendApplyConfiguration constructs an declarative configuration of the IngressBackend type for use with +// IngressBackendApplyConfiguration constructs a declarative configuration of the IngressBackend type for use with // apply. func IngressBackend() *IngressBackendApplyConfiguration { return &IngressBackendApplyConfiguration{} diff --git a/applyconfigurations/networking/v1/ingressclass.go b/applyconfigurations/networking/v1/ingressclass.go index 0013f8cb38..14acc7dbd8 100644 --- a/applyconfigurations/networking/v1/ingressclass.go +++ b/applyconfigurations/networking/v1/ingressclass.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// IngressClassApplyConfiguration represents an declarative configuration of the IngressClass type for use +// IngressClassApplyConfiguration represents a declarative configuration of the IngressClass type for use // with apply. type IngressClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type IngressClassApplyConfiguration struct { Spec *IngressClassSpecApplyConfiguration `json:"spec,omitempty"` } -// IngressClass constructs an declarative configuration of the IngressClass type for use with +// IngressClass constructs a declarative configuration of the IngressClass type for use with // apply. func IngressClass(name string) *IngressClassApplyConfiguration { b := &IngressClassApplyConfiguration{} diff --git a/applyconfigurations/networking/v1/ingressclassparametersreference.go b/applyconfigurations/networking/v1/ingressclassparametersreference.go index a020d3a8df..0dba1ebc5d 100644 --- a/applyconfigurations/networking/v1/ingressclassparametersreference.go +++ b/applyconfigurations/networking/v1/ingressclassparametersreference.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// IngressClassParametersReferenceApplyConfiguration represents an declarative configuration of the IngressClassParametersReference type for use +// IngressClassParametersReferenceApplyConfiguration represents a declarative configuration of the IngressClassParametersReference type for use // with apply. type IngressClassParametersReferenceApplyConfiguration struct { APIGroup *string `json:"apiGroup,omitempty"` @@ -28,7 +28,7 @@ type IngressClassParametersReferenceApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` } -// IngressClassParametersReferenceApplyConfiguration constructs an declarative configuration of the IngressClassParametersReference type for use with +// IngressClassParametersReferenceApplyConfiguration constructs a declarative configuration of the IngressClassParametersReference type for use with // apply. func IngressClassParametersReference() *IngressClassParametersReferenceApplyConfiguration { return &IngressClassParametersReferenceApplyConfiguration{} diff --git a/applyconfigurations/networking/v1/ingressclassspec.go b/applyconfigurations/networking/v1/ingressclassspec.go index ec0423e708..23e8484344 100644 --- a/applyconfigurations/networking/v1/ingressclassspec.go +++ b/applyconfigurations/networking/v1/ingressclassspec.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// IngressClassSpecApplyConfiguration represents an declarative configuration of the IngressClassSpec type for use +// IngressClassSpecApplyConfiguration represents a declarative configuration of the IngressClassSpec type for use // with apply. type IngressClassSpecApplyConfiguration struct { Controller *string `json:"controller,omitempty"` Parameters *IngressClassParametersReferenceApplyConfiguration `json:"parameters,omitempty"` } -// IngressClassSpecApplyConfiguration constructs an declarative configuration of the IngressClassSpec type for use with +// IngressClassSpecApplyConfiguration constructs a declarative configuration of the IngressClassSpec type for use with // apply. func IngressClassSpec() *IngressClassSpecApplyConfiguration { return &IngressClassSpecApplyConfiguration{} diff --git a/applyconfigurations/networking/v1/ingressloadbalanceringress.go b/applyconfigurations/networking/v1/ingressloadbalanceringress.go index 444275a127..d0feb44da4 100644 --- a/applyconfigurations/networking/v1/ingressloadbalanceringress.go +++ b/applyconfigurations/networking/v1/ingressloadbalanceringress.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// IngressLoadBalancerIngressApplyConfiguration represents an declarative configuration of the IngressLoadBalancerIngress type for use +// IngressLoadBalancerIngressApplyConfiguration represents a declarative configuration of the IngressLoadBalancerIngress type for use // with apply. type IngressLoadBalancerIngressApplyConfiguration struct { IP *string `json:"ip,omitempty"` @@ -26,7 +26,7 @@ type IngressLoadBalancerIngressApplyConfiguration struct { Ports []IngressPortStatusApplyConfiguration `json:"ports,omitempty"` } -// IngressLoadBalancerIngressApplyConfiguration constructs an declarative configuration of the IngressLoadBalancerIngress type for use with +// IngressLoadBalancerIngressApplyConfiguration constructs a declarative configuration of the IngressLoadBalancerIngress type for use with // apply. func IngressLoadBalancerIngress() *IngressLoadBalancerIngressApplyConfiguration { return &IngressLoadBalancerIngressApplyConfiguration{} diff --git a/applyconfigurations/networking/v1/ingressloadbalancerstatus.go b/applyconfigurations/networking/v1/ingressloadbalancerstatus.go index 8e01a301ac..08c841f06b 100644 --- a/applyconfigurations/networking/v1/ingressloadbalancerstatus.go +++ b/applyconfigurations/networking/v1/ingressloadbalancerstatus.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// IngressLoadBalancerStatusApplyConfiguration represents an declarative configuration of the IngressLoadBalancerStatus type for use +// IngressLoadBalancerStatusApplyConfiguration represents a declarative configuration of the IngressLoadBalancerStatus type for use // with apply. type IngressLoadBalancerStatusApplyConfiguration struct { Ingress []IngressLoadBalancerIngressApplyConfiguration `json:"ingress,omitempty"` } -// IngressLoadBalancerStatusApplyConfiguration constructs an declarative configuration of the IngressLoadBalancerStatus type for use with +// IngressLoadBalancerStatusApplyConfiguration constructs a declarative configuration of the IngressLoadBalancerStatus type for use with // apply. func IngressLoadBalancerStatus() *IngressLoadBalancerStatusApplyConfiguration { return &IngressLoadBalancerStatusApplyConfiguration{} diff --git a/applyconfigurations/networking/v1/ingressportstatus.go b/applyconfigurations/networking/v1/ingressportstatus.go index 82b5babd9c..b6411199fc 100644 --- a/applyconfigurations/networking/v1/ingressportstatus.go +++ b/applyconfigurations/networking/v1/ingressportstatus.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// IngressPortStatusApplyConfiguration represents an declarative configuration of the IngressPortStatus type for use +// IngressPortStatusApplyConfiguration represents a declarative configuration of the IngressPortStatus type for use // with apply. type IngressPortStatusApplyConfiguration struct { Port *int32 `json:"port,omitempty"` @@ -30,7 +30,7 @@ type IngressPortStatusApplyConfiguration struct { Error *string `json:"error,omitempty"` } -// IngressPortStatusApplyConfiguration constructs an declarative configuration of the IngressPortStatus type for use with +// IngressPortStatusApplyConfiguration constructs a declarative configuration of the IngressPortStatus type for use with // apply. func IngressPortStatus() *IngressPortStatusApplyConfiguration { return &IngressPortStatusApplyConfiguration{} diff --git a/applyconfigurations/networking/v1/ingressrule.go b/applyconfigurations/networking/v1/ingressrule.go index 8153e88fe2..a8c83f8e90 100644 --- a/applyconfigurations/networking/v1/ingressrule.go +++ b/applyconfigurations/networking/v1/ingressrule.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// IngressRuleApplyConfiguration represents an declarative configuration of the IngressRule type for use +// IngressRuleApplyConfiguration represents a declarative configuration of the IngressRule type for use // with apply. type IngressRuleApplyConfiguration struct { Host *string `json:"host,omitempty"` IngressRuleValueApplyConfiguration `json:",omitempty,inline"` } -// IngressRuleApplyConfiguration constructs an declarative configuration of the IngressRule type for use with +// IngressRuleApplyConfiguration constructs a declarative configuration of the IngressRule type for use with // apply. func IngressRule() *IngressRuleApplyConfiguration { return &IngressRuleApplyConfiguration{} diff --git a/applyconfigurations/networking/v1/ingressrulevalue.go b/applyconfigurations/networking/v1/ingressrulevalue.go index d0e094387c..1e13e378be 100644 --- a/applyconfigurations/networking/v1/ingressrulevalue.go +++ b/applyconfigurations/networking/v1/ingressrulevalue.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// IngressRuleValueApplyConfiguration represents an declarative configuration of the IngressRuleValue type for use +// IngressRuleValueApplyConfiguration represents a declarative configuration of the IngressRuleValue type for use // with apply. type IngressRuleValueApplyConfiguration struct { HTTP *HTTPIngressRuleValueApplyConfiguration `json:"http,omitempty"` } -// IngressRuleValueApplyConfiguration constructs an declarative configuration of the IngressRuleValue type for use with +// IngressRuleValueApplyConfiguration constructs a declarative configuration of the IngressRuleValue type for use with // apply. func IngressRuleValue() *IngressRuleValueApplyConfiguration { return &IngressRuleValueApplyConfiguration{} diff --git a/applyconfigurations/networking/v1/ingressservicebackend.go b/applyconfigurations/networking/v1/ingressservicebackend.go index 399739631b..07876afd17 100644 --- a/applyconfigurations/networking/v1/ingressservicebackend.go +++ b/applyconfigurations/networking/v1/ingressservicebackend.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// IngressServiceBackendApplyConfiguration represents an declarative configuration of the IngressServiceBackend type for use +// IngressServiceBackendApplyConfiguration represents a declarative configuration of the IngressServiceBackend type for use // with apply. type IngressServiceBackendApplyConfiguration struct { Name *string `json:"name,omitempty"` Port *ServiceBackendPortApplyConfiguration `json:"port,omitempty"` } -// IngressServiceBackendApplyConfiguration constructs an declarative configuration of the IngressServiceBackend type for use with +// IngressServiceBackendApplyConfiguration constructs a declarative configuration of the IngressServiceBackend type for use with // apply. func IngressServiceBackend() *IngressServiceBackendApplyConfiguration { return &IngressServiceBackendApplyConfiguration{} diff --git a/applyconfigurations/networking/v1/ingressspec.go b/applyconfigurations/networking/v1/ingressspec.go index 635514ecf7..0572153aa1 100644 --- a/applyconfigurations/networking/v1/ingressspec.go +++ b/applyconfigurations/networking/v1/ingressspec.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// IngressSpecApplyConfiguration represents an declarative configuration of the IngressSpec type for use +// IngressSpecApplyConfiguration represents a declarative configuration of the IngressSpec type for use // with apply. type IngressSpecApplyConfiguration struct { IngressClassName *string `json:"ingressClassName,omitempty"` @@ -27,7 +27,7 @@ type IngressSpecApplyConfiguration struct { Rules []IngressRuleApplyConfiguration `json:"rules,omitempty"` } -// IngressSpecApplyConfiguration constructs an declarative configuration of the IngressSpec type for use with +// IngressSpecApplyConfiguration constructs a declarative configuration of the IngressSpec type for use with // apply. func IngressSpec() *IngressSpecApplyConfiguration { return &IngressSpecApplyConfiguration{} diff --git a/applyconfigurations/networking/v1/ingressstatus.go b/applyconfigurations/networking/v1/ingressstatus.go index 7131bf8d0d..bd1327c93f 100644 --- a/applyconfigurations/networking/v1/ingressstatus.go +++ b/applyconfigurations/networking/v1/ingressstatus.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// IngressStatusApplyConfiguration represents an declarative configuration of the IngressStatus type for use +// IngressStatusApplyConfiguration represents a declarative configuration of the IngressStatus type for use // with apply. type IngressStatusApplyConfiguration struct { LoadBalancer *IngressLoadBalancerStatusApplyConfiguration `json:"loadBalancer,omitempty"` } -// IngressStatusApplyConfiguration constructs an declarative configuration of the IngressStatus type for use with +// IngressStatusApplyConfiguration constructs a declarative configuration of the IngressStatus type for use with // apply. func IngressStatus() *IngressStatusApplyConfiguration { return &IngressStatusApplyConfiguration{} diff --git a/applyconfigurations/networking/v1/ingresstls.go b/applyconfigurations/networking/v1/ingresstls.go index 4d8d369f7c..44092503f9 100644 --- a/applyconfigurations/networking/v1/ingresstls.go +++ b/applyconfigurations/networking/v1/ingresstls.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// IngressTLSApplyConfiguration represents an declarative configuration of the IngressTLS type for use +// IngressTLSApplyConfiguration represents a declarative configuration of the IngressTLS type for use // with apply. type IngressTLSApplyConfiguration struct { Hosts []string `json:"hosts,omitempty"` SecretName *string `json:"secretName,omitempty"` } -// IngressTLSApplyConfiguration constructs an declarative configuration of the IngressTLS type for use with +// IngressTLSApplyConfiguration constructs a declarative configuration of the IngressTLS type for use with // apply. func IngressTLS() *IngressTLSApplyConfiguration { return &IngressTLSApplyConfiguration{} diff --git a/applyconfigurations/networking/v1/ipblock.go b/applyconfigurations/networking/v1/ipblock.go index 1efd6edfdc..f3447a8f10 100644 --- a/applyconfigurations/networking/v1/ipblock.go +++ b/applyconfigurations/networking/v1/ipblock.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// 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 *string `json:"cidr,omitempty"` Except []string `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/applyconfigurations/networking/v1/networkpolicy.go b/applyconfigurations/networking/v1/networkpolicy.go index 3387ab07d1..3f8c8a5351 100644 --- a/applyconfigurations/networking/v1/networkpolicy.go +++ b/applyconfigurations/networking/v1/networkpolicy.go @@ -27,7 +27,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"` @@ -35,7 +35,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{} diff --git a/applyconfigurations/networking/v1/networkpolicyegressrule.go b/applyconfigurations/networking/v1/networkpolicyegressrule.go index e5751c4413..46e2706ece 100644 --- a/applyconfigurations/networking/v1/networkpolicyegressrule.go +++ b/applyconfigurations/networking/v1/networkpolicyegressrule.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// 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/applyconfigurations/networking/v1/networkpolicyingressrule.go b/applyconfigurations/networking/v1/networkpolicyingressrule.go index 630fe1fabe..6e98759786 100644 --- a/applyconfigurations/networking/v1/networkpolicyingressrule.go +++ b/applyconfigurations/networking/v1/networkpolicyingressrule.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// NetworkPolicyIngressRuleApplyConfiguration represents an declarative configuration of the NetworkPolicyIngressRule type for use +// NetworkPolicyIngressRuleApplyConfiguration represents a declarative configuration of the NetworkPolicyIngressRule type for use // with apply. type NetworkPolicyIngressRuleApplyConfiguration struct { Ports []NetworkPolicyPortApplyConfiguration `json:"ports,omitempty"` From []NetworkPolicyPeerApplyConfiguration `json:"from,omitempty"` } -// NetworkPolicyIngressRuleApplyConfiguration constructs an declarative configuration of the NetworkPolicyIngressRule type for use with +// NetworkPolicyIngressRuleApplyConfiguration constructs a declarative configuration of the NetworkPolicyIngressRule type for use with // apply. func NetworkPolicyIngressRule() *NetworkPolicyIngressRuleApplyConfiguration { return &NetworkPolicyIngressRuleApplyConfiguration{} diff --git a/applyconfigurations/networking/v1/networkpolicypeer.go b/applyconfigurations/networking/v1/networkpolicypeer.go index 909b651c04..046de3e237 100644 --- a/applyconfigurations/networking/v1/networkpolicypeer.go +++ b/applyconfigurations/networking/v1/networkpolicypeer.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// 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 { PodSelector *v1.LabelSelectorApplyConfiguration `json:"podSelector,omitempty"` @@ -30,7 +30,7 @@ type NetworkPolicyPeerApplyConfiguration struct { 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/applyconfigurations/networking/v1/networkpolicyport.go b/applyconfigurations/networking/v1/networkpolicyport.go index 73dbed1d89..581ef1c348 100644 --- a/applyconfigurations/networking/v1/networkpolicyport.go +++ b/applyconfigurations/networking/v1/networkpolicyport.go @@ -23,7 +23,7 @@ import ( intstr "k8s.io/apimachinery/pkg/util/intstr" ) -// 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"` @@ -31,7 +31,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/applyconfigurations/networking/v1/networkpolicyspec.go b/applyconfigurations/networking/v1/networkpolicyspec.go index 882d8233a9..da5ed5d358 100644 --- a/applyconfigurations/networking/v1/networkpolicyspec.go +++ b/applyconfigurations/networking/v1/networkpolicyspec.go @@ -23,7 +23,7 @@ import ( v1 "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 { PodSelector *v1.LabelSelectorApplyConfiguration `json:"podSelector,omitempty"` @@ -32,7 +32,7 @@ type NetworkPolicySpecApplyConfiguration struct { PolicyTypes []apinetworkingv1.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/applyconfigurations/networking/v1/servicebackendport.go b/applyconfigurations/networking/v1/servicebackendport.go index ec278960ca..517f974838 100644 --- a/applyconfigurations/networking/v1/servicebackendport.go +++ b/applyconfigurations/networking/v1/servicebackendport.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// ServiceBackendPortApplyConfiguration represents an declarative configuration of the ServiceBackendPort type for use +// ServiceBackendPortApplyConfiguration represents a declarative configuration of the ServiceBackendPort type for use // with apply. type ServiceBackendPortApplyConfiguration struct { Name *string `json:"name,omitempty"` Number *int32 `json:"number,omitempty"` } -// ServiceBackendPortApplyConfiguration constructs an declarative configuration of the ServiceBackendPort type for use with +// ServiceBackendPortApplyConfiguration constructs a declarative configuration of the ServiceBackendPort type for use with // apply. func ServiceBackendPort() *ServiceBackendPortApplyConfiguration { return &ServiceBackendPortApplyConfiguration{} diff --git a/applyconfigurations/networking/v1alpha1/ipaddress.go b/applyconfigurations/networking/v1alpha1/ipaddress.go index 36ccd06bcb..999c23fa14 100644 --- a/applyconfigurations/networking/v1alpha1/ipaddress.go +++ b/applyconfigurations/networking/v1alpha1/ipaddress.go @@ -27,7 +27,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"` @@ -35,7 +35,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{} diff --git a/applyconfigurations/networking/v1alpha1/ipaddressspec.go b/applyconfigurations/networking/v1alpha1/ipaddressspec.go index 064963d691..bf025a8c1a 100644 --- a/applyconfigurations/networking/v1alpha1/ipaddressspec.go +++ b/applyconfigurations/networking/v1alpha1/ipaddressspec.go @@ -18,13 +18,13 @@ limitations under the License. package v1alpha1 -// 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 { ParentRef *ParentReferenceApplyConfiguration `json:"parentRef,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/applyconfigurations/networking/v1alpha1/parentreference.go b/applyconfigurations/networking/v1alpha1/parentreference.go index ce1049709a..d5a52d503d 100644 --- a/applyconfigurations/networking/v1alpha1/parentreference.go +++ b/applyconfigurations/networking/v1alpha1/parentreference.go @@ -18,7 +18,7 @@ limitations under the License. package v1alpha1 -// ParentReferenceApplyConfiguration represents an declarative configuration of the ParentReference type for use +// ParentReferenceApplyConfiguration represents a declarative configuration of the ParentReference type for use // with apply. type ParentReferenceApplyConfiguration struct { Group *string `json:"group,omitempty"` @@ -27,7 +27,7 @@ type ParentReferenceApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// ParentReferenceApplyConfiguration constructs an declarative configuration of the ParentReference type for use with +// ParentReferenceApplyConfiguration constructs a declarative configuration of the ParentReference type for use with // apply. func ParentReference() *ParentReferenceApplyConfiguration { return &ParentReferenceApplyConfiguration{} diff --git a/applyconfigurations/networking/v1alpha1/servicecidr.go b/applyconfigurations/networking/v1alpha1/servicecidr.go index e3762aaa52..984e049f28 100644 --- a/applyconfigurations/networking/v1alpha1/servicecidr.go +++ b/applyconfigurations/networking/v1alpha1/servicecidr.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ServiceCIDRApplyConfiguration represents an declarative configuration of the ServiceCIDR type for use +// ServiceCIDRApplyConfiguration represents a declarative configuration of the ServiceCIDR type for use // with apply. type ServiceCIDRApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type ServiceCIDRApplyConfiguration struct { Status *ServiceCIDRStatusApplyConfiguration `json:"status,omitempty"` } -// ServiceCIDR constructs an declarative configuration of the ServiceCIDR type for use with +// ServiceCIDR constructs a declarative configuration of the ServiceCIDR type for use with // apply. func ServiceCIDR(name string) *ServiceCIDRApplyConfiguration { b := &ServiceCIDRApplyConfiguration{} diff --git a/applyconfigurations/networking/v1alpha1/servicecidrspec.go b/applyconfigurations/networking/v1alpha1/servicecidrspec.go index 302d69194c..7875ff403b 100644 --- a/applyconfigurations/networking/v1alpha1/servicecidrspec.go +++ b/applyconfigurations/networking/v1alpha1/servicecidrspec.go @@ -18,13 +18,13 @@ limitations under the License. package v1alpha1 -// ServiceCIDRSpecApplyConfiguration represents an declarative configuration of the ServiceCIDRSpec type for use +// ServiceCIDRSpecApplyConfiguration represents a declarative configuration of the ServiceCIDRSpec type for use // with apply. type ServiceCIDRSpecApplyConfiguration struct { CIDRs []string `json:"cidrs,omitempty"` } -// ServiceCIDRSpecApplyConfiguration constructs an declarative configuration of the ServiceCIDRSpec type for use with +// ServiceCIDRSpecApplyConfiguration constructs a declarative configuration of the ServiceCIDRSpec type for use with // apply. func ServiceCIDRSpec() *ServiceCIDRSpecApplyConfiguration { return &ServiceCIDRSpecApplyConfiguration{} diff --git a/applyconfigurations/networking/v1alpha1/servicecidrstatus.go b/applyconfigurations/networking/v1alpha1/servicecidrstatus.go index 5afc549a65..34715e3a49 100644 --- a/applyconfigurations/networking/v1alpha1/servicecidrstatus.go +++ b/applyconfigurations/networking/v1alpha1/servicecidrstatus.go @@ -22,13 +22,13 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ServiceCIDRStatusApplyConfiguration represents an declarative configuration of the ServiceCIDRStatus type for use +// ServiceCIDRStatusApplyConfiguration represents a declarative configuration of the ServiceCIDRStatus type for use // with apply. type ServiceCIDRStatusApplyConfiguration struct { Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` } -// ServiceCIDRStatusApplyConfiguration constructs an declarative configuration of the ServiceCIDRStatus type for use with +// ServiceCIDRStatusApplyConfiguration constructs a declarative configuration of the ServiceCIDRStatus type for use with // apply. func ServiceCIDRStatus() *ServiceCIDRStatusApplyConfiguration { return &ServiceCIDRStatusApplyConfiguration{} diff --git a/applyconfigurations/networking/v1beta1/httpingresspath.go b/applyconfigurations/networking/v1beta1/httpingresspath.go index b12907e81c..61b458f7ee 100644 --- a/applyconfigurations/networking/v1beta1/httpingresspath.go +++ b/applyconfigurations/networking/v1beta1/httpingresspath.go @@ -22,7 +22,7 @@ import ( v1beta1 "k8s.io/api/networking/v1beta1" ) -// HTTPIngressPathApplyConfiguration represents an declarative configuration of the HTTPIngressPath type for use +// HTTPIngressPathApplyConfiguration represents a declarative configuration of the HTTPIngressPath type for use // with apply. type HTTPIngressPathApplyConfiguration struct { Path *string `json:"path,omitempty"` @@ -30,7 +30,7 @@ type HTTPIngressPathApplyConfiguration struct { Backend *IngressBackendApplyConfiguration `json:"backend,omitempty"` } -// HTTPIngressPathApplyConfiguration constructs an declarative configuration of the HTTPIngressPath type for use with +// HTTPIngressPathApplyConfiguration constructs a declarative configuration of the HTTPIngressPath type for use with // apply. func HTTPIngressPath() *HTTPIngressPathApplyConfiguration { return &HTTPIngressPathApplyConfiguration{} diff --git a/applyconfigurations/networking/v1beta1/httpingressrulevalue.go b/applyconfigurations/networking/v1beta1/httpingressrulevalue.go index 3137bc5eb0..1245452237 100644 --- a/applyconfigurations/networking/v1beta1/httpingressrulevalue.go +++ b/applyconfigurations/networking/v1beta1/httpingressrulevalue.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta1 -// HTTPIngressRuleValueApplyConfiguration represents an declarative configuration of the HTTPIngressRuleValue type for use +// HTTPIngressRuleValueApplyConfiguration represents a declarative configuration of the HTTPIngressRuleValue type for use // with apply. type HTTPIngressRuleValueApplyConfiguration struct { Paths []HTTPIngressPathApplyConfiguration `json:"paths,omitempty"` } -// HTTPIngressRuleValueApplyConfiguration constructs an declarative configuration of the HTTPIngressRuleValue type for use with +// HTTPIngressRuleValueApplyConfiguration constructs a declarative configuration of the HTTPIngressRuleValue type for use with // apply. func HTTPIngressRuleValue() *HTTPIngressRuleValueApplyConfiguration { return &HTTPIngressRuleValueApplyConfiguration{} diff --git a/applyconfigurations/networking/v1beta1/ingress.go b/applyconfigurations/networking/v1beta1/ingress.go index 2435c8531b..0df53ea652 100644 --- a/applyconfigurations/networking/v1beta1/ingress.go +++ b/applyconfigurations/networking/v1beta1/ingress.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// IngressApplyConfiguration represents an declarative configuration of the Ingress type for use +// IngressApplyConfiguration represents a declarative configuration of the Ingress type for use // with apply. type IngressApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type IngressApplyConfiguration struct { Status *IngressStatusApplyConfiguration `json:"status,omitempty"` } -// Ingress constructs an declarative configuration of the Ingress type for use with +// Ingress constructs a declarative configuration of the Ingress type for use with // apply. func Ingress(name, namespace string) *IngressApplyConfiguration { b := &IngressApplyConfiguration{} diff --git a/applyconfigurations/networking/v1beta1/ingressbackend.go b/applyconfigurations/networking/v1beta1/ingressbackend.go index f19c2f2ee2..9d386f1608 100644 --- a/applyconfigurations/networking/v1beta1/ingressbackend.go +++ b/applyconfigurations/networking/v1beta1/ingressbackend.go @@ -23,7 +23,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" ) -// IngressBackendApplyConfiguration represents an declarative configuration of the IngressBackend type for use +// IngressBackendApplyConfiguration represents a declarative configuration of the IngressBackend type for use // with apply. type IngressBackendApplyConfiguration struct { ServiceName *string `json:"serviceName,omitempty"` @@ -31,7 +31,7 @@ type IngressBackendApplyConfiguration struct { Resource *v1.TypedLocalObjectReferenceApplyConfiguration `json:"resource,omitempty"` } -// IngressBackendApplyConfiguration constructs an declarative configuration of the IngressBackend type for use with +// IngressBackendApplyConfiguration constructs a declarative configuration of the IngressBackend type for use with // apply. func IngressBackend() *IngressBackendApplyConfiguration { return &IngressBackendApplyConfiguration{} diff --git a/applyconfigurations/networking/v1beta1/ingressclass.go b/applyconfigurations/networking/v1beta1/ingressclass.go index 6098280d45..b0e877b57a 100644 --- a/applyconfigurations/networking/v1beta1/ingressclass.go +++ b/applyconfigurations/networking/v1beta1/ingressclass.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// IngressClassApplyConfiguration represents an declarative configuration of the IngressClass type for use +// IngressClassApplyConfiguration represents a declarative configuration of the IngressClass type for use // with apply. type IngressClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type IngressClassApplyConfiguration struct { Spec *IngressClassSpecApplyConfiguration `json:"spec,omitempty"` } -// IngressClass constructs an declarative configuration of the IngressClass type for use with +// IngressClass constructs a declarative configuration of the IngressClass type for use with // apply. func IngressClass(name string) *IngressClassApplyConfiguration { b := &IngressClassApplyConfiguration{} diff --git a/applyconfigurations/networking/v1beta1/ingressclassparametersreference.go b/applyconfigurations/networking/v1beta1/ingressclassparametersreference.go index e6ca805e47..2a307a6760 100644 --- a/applyconfigurations/networking/v1beta1/ingressclassparametersreference.go +++ b/applyconfigurations/networking/v1beta1/ingressclassparametersreference.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// IngressClassParametersReferenceApplyConfiguration represents an declarative configuration of the IngressClassParametersReference type for use +// IngressClassParametersReferenceApplyConfiguration represents a declarative configuration of the IngressClassParametersReference type for use // with apply. type IngressClassParametersReferenceApplyConfiguration struct { APIGroup *string `json:"apiGroup,omitempty"` @@ -28,7 +28,7 @@ type IngressClassParametersReferenceApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` } -// IngressClassParametersReferenceApplyConfiguration constructs an declarative configuration of the IngressClassParametersReference type for use with +// IngressClassParametersReferenceApplyConfiguration constructs a declarative configuration of the IngressClassParametersReference type for use with // apply. func IngressClassParametersReference() *IngressClassParametersReferenceApplyConfiguration { return &IngressClassParametersReferenceApplyConfiguration{} diff --git a/applyconfigurations/networking/v1beta1/ingressclassspec.go b/applyconfigurations/networking/v1beta1/ingressclassspec.go index 51040462ca..eefbf62b87 100644 --- a/applyconfigurations/networking/v1beta1/ingressclassspec.go +++ b/applyconfigurations/networking/v1beta1/ingressclassspec.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta1 -// IngressClassSpecApplyConfiguration represents an declarative configuration of the IngressClassSpec type for use +// IngressClassSpecApplyConfiguration represents a declarative configuration of the IngressClassSpec type for use // with apply. type IngressClassSpecApplyConfiguration struct { Controller *string `json:"controller,omitempty"` Parameters *IngressClassParametersReferenceApplyConfiguration `json:"parameters,omitempty"` } -// IngressClassSpecApplyConfiguration constructs an declarative configuration of the IngressClassSpec type for use with +// IngressClassSpecApplyConfiguration constructs a declarative configuration of the IngressClassSpec type for use with // apply. func IngressClassSpec() *IngressClassSpecApplyConfiguration { return &IngressClassSpecApplyConfiguration{} diff --git a/applyconfigurations/networking/v1beta1/ingressloadbalanceringress.go b/applyconfigurations/networking/v1beta1/ingressloadbalanceringress.go index 20bf637805..12dbc35969 100644 --- a/applyconfigurations/networking/v1beta1/ingressloadbalanceringress.go +++ b/applyconfigurations/networking/v1beta1/ingressloadbalanceringress.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// IngressLoadBalancerIngressApplyConfiguration represents an declarative configuration of the IngressLoadBalancerIngress type for use +// IngressLoadBalancerIngressApplyConfiguration represents a declarative configuration of the IngressLoadBalancerIngress type for use // with apply. type IngressLoadBalancerIngressApplyConfiguration struct { IP *string `json:"ip,omitempty"` @@ -26,7 +26,7 @@ type IngressLoadBalancerIngressApplyConfiguration struct { Ports []IngressPortStatusApplyConfiguration `json:"ports,omitempty"` } -// IngressLoadBalancerIngressApplyConfiguration constructs an declarative configuration of the IngressLoadBalancerIngress type for use with +// IngressLoadBalancerIngressApplyConfiguration constructs a declarative configuration of the IngressLoadBalancerIngress type for use with // apply. func IngressLoadBalancerIngress() *IngressLoadBalancerIngressApplyConfiguration { return &IngressLoadBalancerIngressApplyConfiguration{} diff --git a/applyconfigurations/networking/v1beta1/ingressloadbalancerstatus.go b/applyconfigurations/networking/v1beta1/ingressloadbalancerstatus.go index e16dd23633..e896ab3415 100644 --- a/applyconfigurations/networking/v1beta1/ingressloadbalancerstatus.go +++ b/applyconfigurations/networking/v1beta1/ingressloadbalancerstatus.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta1 -// IngressLoadBalancerStatusApplyConfiguration represents an declarative configuration of the IngressLoadBalancerStatus type for use +// IngressLoadBalancerStatusApplyConfiguration represents a declarative configuration of the IngressLoadBalancerStatus type for use // with apply. type IngressLoadBalancerStatusApplyConfiguration struct { Ingress []IngressLoadBalancerIngressApplyConfiguration `json:"ingress,omitempty"` } -// IngressLoadBalancerStatusApplyConfiguration constructs an declarative configuration of the IngressLoadBalancerStatus type for use with +// IngressLoadBalancerStatusApplyConfiguration constructs a declarative configuration of the IngressLoadBalancerStatus type for use with // apply. func IngressLoadBalancerStatus() *IngressLoadBalancerStatusApplyConfiguration { return &IngressLoadBalancerStatusApplyConfiguration{} diff --git a/applyconfigurations/networking/v1beta1/ingressportstatus.go b/applyconfigurations/networking/v1beta1/ingressportstatus.go index 0836537979..4ee3f01617 100644 --- a/applyconfigurations/networking/v1beta1/ingressportstatus.go +++ b/applyconfigurations/networking/v1beta1/ingressportstatus.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/core/v1" ) -// IngressPortStatusApplyConfiguration represents an declarative configuration of the IngressPortStatus type for use +// IngressPortStatusApplyConfiguration represents a declarative configuration of the IngressPortStatus type for use // with apply. type IngressPortStatusApplyConfiguration struct { Port *int32 `json:"port,omitempty"` @@ -30,7 +30,7 @@ type IngressPortStatusApplyConfiguration struct { Error *string `json:"error,omitempty"` } -// IngressPortStatusApplyConfiguration constructs an declarative configuration of the IngressPortStatus type for use with +// IngressPortStatusApplyConfiguration constructs a declarative configuration of the IngressPortStatus type for use with // apply. func IngressPortStatus() *IngressPortStatusApplyConfiguration { return &IngressPortStatusApplyConfiguration{} diff --git a/applyconfigurations/networking/v1beta1/ingressrule.go b/applyconfigurations/networking/v1beta1/ingressrule.go index 015541eeb9..dc0f93aaaf 100644 --- a/applyconfigurations/networking/v1beta1/ingressrule.go +++ b/applyconfigurations/networking/v1beta1/ingressrule.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta1 -// IngressRuleApplyConfiguration represents an declarative configuration of the IngressRule type for use +// IngressRuleApplyConfiguration represents a declarative configuration of the IngressRule type for use // with apply. type IngressRuleApplyConfiguration struct { Host *string `json:"host,omitempty"` IngressRuleValueApplyConfiguration `json:",omitempty,inline"` } -// IngressRuleApplyConfiguration constructs an declarative configuration of the IngressRule type for use with +// IngressRuleApplyConfiguration constructs a declarative configuration of the IngressRule type for use with // apply. func IngressRule() *IngressRuleApplyConfiguration { return &IngressRuleApplyConfiguration{} diff --git a/applyconfigurations/networking/v1beta1/ingressrulevalue.go b/applyconfigurations/networking/v1beta1/ingressrulevalue.go index 2d03c7b132..4a64124755 100644 --- a/applyconfigurations/networking/v1beta1/ingressrulevalue.go +++ b/applyconfigurations/networking/v1beta1/ingressrulevalue.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta1 -// IngressRuleValueApplyConfiguration represents an declarative configuration of the IngressRuleValue type for use +// IngressRuleValueApplyConfiguration represents a declarative configuration of the IngressRuleValue type for use // with apply. type IngressRuleValueApplyConfiguration struct { HTTP *HTTPIngressRuleValueApplyConfiguration `json:"http,omitempty"` } -// IngressRuleValueApplyConfiguration constructs an declarative configuration of the IngressRuleValue type for use with +// IngressRuleValueApplyConfiguration constructs a declarative configuration of the IngressRuleValue type for use with // apply. func IngressRuleValue() *IngressRuleValueApplyConfiguration { return &IngressRuleValueApplyConfiguration{} diff --git a/applyconfigurations/networking/v1beta1/ingressspec.go b/applyconfigurations/networking/v1beta1/ingressspec.go index 1ab4d8bb73..58fbde8b35 100644 --- a/applyconfigurations/networking/v1beta1/ingressspec.go +++ b/applyconfigurations/networking/v1beta1/ingressspec.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// IngressSpecApplyConfiguration represents an declarative configuration of the IngressSpec type for use +// IngressSpecApplyConfiguration represents a declarative configuration of the IngressSpec type for use // with apply. type IngressSpecApplyConfiguration struct { IngressClassName *string `json:"ingressClassName,omitempty"` @@ -27,7 +27,7 @@ type IngressSpecApplyConfiguration struct { Rules []IngressRuleApplyConfiguration `json:"rules,omitempty"` } -// IngressSpecApplyConfiguration constructs an declarative configuration of the IngressSpec type for use with +// IngressSpecApplyConfiguration constructs a declarative configuration of the IngressSpec type for use with // apply. func IngressSpec() *IngressSpecApplyConfiguration { return &IngressSpecApplyConfiguration{} diff --git a/applyconfigurations/networking/v1beta1/ingressstatus.go b/applyconfigurations/networking/v1beta1/ingressstatus.go index faa7e2446f..3aed616889 100644 --- a/applyconfigurations/networking/v1beta1/ingressstatus.go +++ b/applyconfigurations/networking/v1beta1/ingressstatus.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta1 -// IngressStatusApplyConfiguration represents an declarative configuration of the IngressStatus type for use +// IngressStatusApplyConfiguration represents a declarative configuration of the IngressStatus type for use // with apply. type IngressStatusApplyConfiguration struct { LoadBalancer *IngressLoadBalancerStatusApplyConfiguration `json:"loadBalancer,omitempty"` } -// IngressStatusApplyConfiguration constructs an declarative configuration of the IngressStatus type for use with +// IngressStatusApplyConfiguration constructs a declarative configuration of the IngressStatus type for use with // apply. func IngressStatus() *IngressStatusApplyConfiguration { return &IngressStatusApplyConfiguration{} diff --git a/applyconfigurations/networking/v1beta1/ingresstls.go b/applyconfigurations/networking/v1beta1/ingresstls.go index 8ca93a0bc2..63648cd464 100644 --- a/applyconfigurations/networking/v1beta1/ingresstls.go +++ b/applyconfigurations/networking/v1beta1/ingresstls.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta1 -// IngressTLSApplyConfiguration represents an declarative configuration of the IngressTLS type for use +// IngressTLSApplyConfiguration represents a declarative configuration of the IngressTLS type for use // with apply. type IngressTLSApplyConfiguration struct { Hosts []string `json:"hosts,omitempty"` SecretName *string `json:"secretName,omitempty"` } -// IngressTLSApplyConfiguration constructs an declarative configuration of the IngressTLS type for use with +// IngressTLSApplyConfiguration constructs a declarative configuration of the IngressTLS type for use with // apply. func IngressTLS() *IngressTLSApplyConfiguration { return &IngressTLSApplyConfiguration{} diff --git a/applyconfigurations/node/v1/overhead.go b/applyconfigurations/node/v1/overhead.go index 9eec002671..6694538fc3 100644 --- a/applyconfigurations/node/v1/overhead.go +++ b/applyconfigurations/node/v1/overhead.go @@ -22,13 +22,13 @@ import ( v1 "k8s.io/api/core/v1" ) -// OverheadApplyConfiguration represents an declarative configuration of the Overhead type for use +// OverheadApplyConfiguration represents a declarative configuration of the Overhead type for use // with apply. type OverheadApplyConfiguration struct { PodFixed *v1.ResourceList `json:"podFixed,omitempty"` } -// OverheadApplyConfiguration constructs an declarative configuration of the Overhead type for use with +// OverheadApplyConfiguration constructs a declarative configuration of the Overhead type for use with // apply. func Overhead() *OverheadApplyConfiguration { return &OverheadApplyConfiguration{} diff --git a/applyconfigurations/node/v1/runtimeclass.go b/applyconfigurations/node/v1/runtimeclass.go index 0db2598fd2..6ce01a319c 100644 --- a/applyconfigurations/node/v1/runtimeclass.go +++ b/applyconfigurations/node/v1/runtimeclass.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// RuntimeClassApplyConfiguration represents an declarative configuration of the RuntimeClass type for use +// RuntimeClassApplyConfiguration represents a declarative configuration of the RuntimeClass type for use // with apply. type RuntimeClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +37,7 @@ type RuntimeClassApplyConfiguration struct { Scheduling *SchedulingApplyConfiguration `json:"scheduling,omitempty"` } -// RuntimeClass constructs an declarative configuration of the RuntimeClass type for use with +// RuntimeClass constructs a declarative configuration of the RuntimeClass type for use with // apply. func RuntimeClass(name string) *RuntimeClassApplyConfiguration { b := &RuntimeClassApplyConfiguration{} diff --git a/applyconfigurations/node/v1/scheduling.go b/applyconfigurations/node/v1/scheduling.go index e01db85d7b..2d084e0f59 100644 --- a/applyconfigurations/node/v1/scheduling.go +++ b/applyconfigurations/node/v1/scheduling.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" ) -// SchedulingApplyConfiguration represents an declarative configuration of the Scheduling type for use +// SchedulingApplyConfiguration represents a declarative configuration of the Scheduling type for use // with apply. type SchedulingApplyConfiguration struct { NodeSelector map[string]string `json:"nodeSelector,omitempty"` Tolerations []v1.TolerationApplyConfiguration `json:"tolerations,omitempty"` } -// SchedulingApplyConfiguration constructs an declarative configuration of the Scheduling type for use with +// SchedulingApplyConfiguration constructs a declarative configuration of the Scheduling type for use with // apply. func Scheduling() *SchedulingApplyConfiguration { return &SchedulingApplyConfiguration{} diff --git a/applyconfigurations/node/v1alpha1/overhead.go b/applyconfigurations/node/v1alpha1/overhead.go index 1ddaa64acc..84770a0920 100644 --- a/applyconfigurations/node/v1alpha1/overhead.go +++ b/applyconfigurations/node/v1alpha1/overhead.go @@ -22,13 +22,13 @@ import ( v1 "k8s.io/api/core/v1" ) -// OverheadApplyConfiguration represents an declarative configuration of the Overhead type for use +// OverheadApplyConfiguration represents a declarative configuration of the Overhead type for use // with apply. type OverheadApplyConfiguration struct { PodFixed *v1.ResourceList `json:"podFixed,omitempty"` } -// OverheadApplyConfiguration constructs an declarative configuration of the Overhead type for use with +// OverheadApplyConfiguration constructs a declarative configuration of the Overhead type for use with // apply. func Overhead() *OverheadApplyConfiguration { return &OverheadApplyConfiguration{} diff --git a/applyconfigurations/node/v1alpha1/runtimeclass.go b/applyconfigurations/node/v1alpha1/runtimeclass.go index f49d1a08cc..9f139ee1b6 100644 --- a/applyconfigurations/node/v1alpha1/runtimeclass.go +++ b/applyconfigurations/node/v1alpha1/runtimeclass.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// RuntimeClassApplyConfiguration represents an declarative configuration of the RuntimeClass type for use +// RuntimeClassApplyConfiguration represents a declarative configuration of the RuntimeClass type for use // with apply. type RuntimeClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type RuntimeClassApplyConfiguration struct { Spec *RuntimeClassSpecApplyConfiguration `json:"spec,omitempty"` } -// RuntimeClass constructs an declarative configuration of the RuntimeClass type for use with +// RuntimeClass constructs a declarative configuration of the RuntimeClass type for use with // apply. func RuntimeClass(name string) *RuntimeClassApplyConfiguration { b := &RuntimeClassApplyConfiguration{} diff --git a/applyconfigurations/node/v1alpha1/runtimeclassspec.go b/applyconfigurations/node/v1alpha1/runtimeclassspec.go index 86e8585ad3..1aa43eb132 100644 --- a/applyconfigurations/node/v1alpha1/runtimeclassspec.go +++ b/applyconfigurations/node/v1alpha1/runtimeclassspec.go @@ -18,7 +18,7 @@ limitations under the License. package v1alpha1 -// RuntimeClassSpecApplyConfiguration represents an declarative configuration of the RuntimeClassSpec type for use +// RuntimeClassSpecApplyConfiguration represents a declarative configuration of the RuntimeClassSpec type for use // with apply. type RuntimeClassSpecApplyConfiguration struct { RuntimeHandler *string `json:"runtimeHandler,omitempty"` @@ -26,7 +26,7 @@ type RuntimeClassSpecApplyConfiguration struct { Scheduling *SchedulingApplyConfiguration `json:"scheduling,omitempty"` } -// RuntimeClassSpecApplyConfiguration constructs an declarative configuration of the RuntimeClassSpec type for use with +// RuntimeClassSpecApplyConfiguration constructs a declarative configuration of the RuntimeClassSpec type for use with // apply. func RuntimeClassSpec() *RuntimeClassSpecApplyConfiguration { return &RuntimeClassSpecApplyConfiguration{} diff --git a/applyconfigurations/node/v1alpha1/scheduling.go b/applyconfigurations/node/v1alpha1/scheduling.go index d4117d6bc7..6ce49ad866 100644 --- a/applyconfigurations/node/v1alpha1/scheduling.go +++ b/applyconfigurations/node/v1alpha1/scheduling.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" ) -// SchedulingApplyConfiguration represents an declarative configuration of the Scheduling type for use +// SchedulingApplyConfiguration represents a declarative configuration of the Scheduling type for use // with apply. type SchedulingApplyConfiguration struct { NodeSelector map[string]string `json:"nodeSelector,omitempty"` Tolerations []v1.TolerationApplyConfiguration `json:"tolerations,omitempty"` } -// SchedulingApplyConfiguration constructs an declarative configuration of the Scheduling type for use with +// SchedulingApplyConfiguration constructs a declarative configuration of the Scheduling type for use with // apply. func Scheduling() *SchedulingApplyConfiguration { return &SchedulingApplyConfiguration{} diff --git a/applyconfigurations/node/v1beta1/overhead.go b/applyconfigurations/node/v1beta1/overhead.go index e8c4895505..cf767e702e 100644 --- a/applyconfigurations/node/v1beta1/overhead.go +++ b/applyconfigurations/node/v1beta1/overhead.go @@ -22,13 +22,13 @@ import ( v1 "k8s.io/api/core/v1" ) -// OverheadApplyConfiguration represents an declarative configuration of the Overhead type for use +// OverheadApplyConfiguration represents a declarative configuration of the Overhead type for use // with apply. type OverheadApplyConfiguration struct { PodFixed *v1.ResourceList `json:"podFixed,omitempty"` } -// OverheadApplyConfiguration constructs an declarative configuration of the Overhead type for use with +// OverheadApplyConfiguration constructs a declarative configuration of the Overhead type for use with // apply. func Overhead() *OverheadApplyConfiguration { return &OverheadApplyConfiguration{} diff --git a/applyconfigurations/node/v1beta1/runtimeclass.go b/applyconfigurations/node/v1beta1/runtimeclass.go index a291b264be..fa6c9f45bf 100644 --- a/applyconfigurations/node/v1beta1/runtimeclass.go +++ b/applyconfigurations/node/v1beta1/runtimeclass.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// RuntimeClassApplyConfiguration represents an declarative configuration of the RuntimeClass type for use +// RuntimeClassApplyConfiguration represents a declarative configuration of the RuntimeClass type for use // with apply. type RuntimeClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +37,7 @@ type RuntimeClassApplyConfiguration struct { Scheduling *SchedulingApplyConfiguration `json:"scheduling,omitempty"` } -// RuntimeClass constructs an declarative configuration of the RuntimeClass type for use with +// RuntimeClass constructs a declarative configuration of the RuntimeClass type for use with // apply. func RuntimeClass(name string) *RuntimeClassApplyConfiguration { b := &RuntimeClassApplyConfiguration{} diff --git a/applyconfigurations/node/v1beta1/scheduling.go b/applyconfigurations/node/v1beta1/scheduling.go index 10831d0ff5..23d0b97527 100644 --- a/applyconfigurations/node/v1beta1/scheduling.go +++ b/applyconfigurations/node/v1beta1/scheduling.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" ) -// SchedulingApplyConfiguration represents an declarative configuration of the Scheduling type for use +// SchedulingApplyConfiguration represents a declarative configuration of the Scheduling type for use // with apply. type SchedulingApplyConfiguration struct { NodeSelector map[string]string `json:"nodeSelector,omitempty"` Tolerations []v1.TolerationApplyConfiguration `json:"tolerations,omitempty"` } -// SchedulingApplyConfiguration constructs an declarative configuration of the Scheduling type for use with +// SchedulingApplyConfiguration constructs a declarative configuration of the Scheduling type for use with // apply. func Scheduling() *SchedulingApplyConfiguration { return &SchedulingApplyConfiguration{} diff --git a/applyconfigurations/policy/v1/eviction.go b/applyconfigurations/policy/v1/eviction.go index c9660c1f7f..3a051619f8 100644 --- a/applyconfigurations/policy/v1/eviction.go +++ b/applyconfigurations/policy/v1/eviction.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// EvictionApplyConfiguration represents an declarative configuration of the Eviction type for use +// EvictionApplyConfiguration represents a declarative configuration of the Eviction type for use // with apply. type EvictionApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type EvictionApplyConfiguration struct { DeleteOptions *v1.DeleteOptionsApplyConfiguration `json:"deleteOptions,omitempty"` } -// Eviction constructs an declarative configuration of the Eviction type for use with +// Eviction constructs a declarative configuration of the Eviction type for use with // apply. func Eviction(name, namespace string) *EvictionApplyConfiguration { b := &EvictionApplyConfiguration{} diff --git a/applyconfigurations/policy/v1/poddisruptionbudget.go b/applyconfigurations/policy/v1/poddisruptionbudget.go index 8896c2c3d2..a765a7b623 100644 --- a/applyconfigurations/policy/v1/poddisruptionbudget.go +++ b/applyconfigurations/policy/v1/poddisruptionbudget.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PodDisruptionBudgetApplyConfiguration represents an declarative configuration of the PodDisruptionBudget type for use +// PodDisruptionBudgetApplyConfiguration represents a declarative configuration of the PodDisruptionBudget type for use // with apply. type PodDisruptionBudgetApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type PodDisruptionBudgetApplyConfiguration struct { Status *PodDisruptionBudgetStatusApplyConfiguration `json:"status,omitempty"` } -// PodDisruptionBudget constructs an declarative configuration of the PodDisruptionBudget type for use with +// PodDisruptionBudget constructs a declarative configuration of the PodDisruptionBudget type for use with // apply. func PodDisruptionBudget(name, namespace string) *PodDisruptionBudgetApplyConfiguration { b := &PodDisruptionBudgetApplyConfiguration{} diff --git a/applyconfigurations/policy/v1/poddisruptionbudgetspec.go b/applyconfigurations/policy/v1/poddisruptionbudgetspec.go index 67d9ba6bba..2917145451 100644 --- a/applyconfigurations/policy/v1/poddisruptionbudgetspec.go +++ b/applyconfigurations/policy/v1/poddisruptionbudgetspec.go @@ -24,7 +24,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PodDisruptionBudgetSpecApplyConfiguration represents an declarative configuration of the PodDisruptionBudgetSpec type for use +// PodDisruptionBudgetSpecApplyConfiguration represents a declarative configuration of the PodDisruptionBudgetSpec type for use // with apply. type PodDisruptionBudgetSpecApplyConfiguration struct { MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty"` @@ -33,7 +33,7 @@ type PodDisruptionBudgetSpecApplyConfiguration struct { UnhealthyPodEvictionPolicy *policyv1.UnhealthyPodEvictionPolicyType `json:"unhealthyPodEvictionPolicy,omitempty"` } -// PodDisruptionBudgetSpecApplyConfiguration constructs an declarative configuration of the PodDisruptionBudgetSpec type for use with +// PodDisruptionBudgetSpecApplyConfiguration constructs a declarative configuration of the PodDisruptionBudgetSpec type for use with // apply. func PodDisruptionBudgetSpec() *PodDisruptionBudgetSpecApplyConfiguration { return &PodDisruptionBudgetSpecApplyConfiguration{} diff --git a/applyconfigurations/policy/v1/poddisruptionbudgetstatus.go b/applyconfigurations/policy/v1/poddisruptionbudgetstatus.go index 2dd427b9e1..d0f9baf41c 100644 --- a/applyconfigurations/policy/v1/poddisruptionbudgetstatus.go +++ b/applyconfigurations/policy/v1/poddisruptionbudgetstatus.go @@ -23,7 +23,7 @@ import ( metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PodDisruptionBudgetStatusApplyConfiguration represents an declarative configuration of the PodDisruptionBudgetStatus type for use +// PodDisruptionBudgetStatusApplyConfiguration represents a declarative configuration of the PodDisruptionBudgetStatus type for use // with apply. type PodDisruptionBudgetStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` @@ -35,7 +35,7 @@ type PodDisruptionBudgetStatusApplyConfiguration struct { Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` } -// PodDisruptionBudgetStatusApplyConfiguration constructs an declarative configuration of the PodDisruptionBudgetStatus type for use with +// PodDisruptionBudgetStatusApplyConfiguration constructs a declarative configuration of the PodDisruptionBudgetStatus type for use with // apply. func PodDisruptionBudgetStatus() *PodDisruptionBudgetStatusApplyConfiguration { return &PodDisruptionBudgetStatusApplyConfiguration{} diff --git a/applyconfigurations/policy/v1beta1/eviction.go b/applyconfigurations/policy/v1beta1/eviction.go index 640167ccc5..d4121af206 100644 --- a/applyconfigurations/policy/v1beta1/eviction.go +++ b/applyconfigurations/policy/v1beta1/eviction.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// EvictionApplyConfiguration represents an declarative configuration of the Eviction type for use +// EvictionApplyConfiguration represents a declarative configuration of the Eviction type for use // with apply. type EvictionApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type EvictionApplyConfiguration struct { DeleteOptions *v1.DeleteOptionsApplyConfiguration `json:"deleteOptions,omitempty"` } -// Eviction constructs an declarative configuration of the Eviction type for use with +// Eviction constructs a declarative configuration of the Eviction type for use with // apply. func Eviction(name, namespace string) *EvictionApplyConfiguration { b := &EvictionApplyConfiguration{} diff --git a/applyconfigurations/policy/v1beta1/poddisruptionbudget.go b/applyconfigurations/policy/v1beta1/poddisruptionbudget.go index 7372cc6b50..813b57bae7 100644 --- a/applyconfigurations/policy/v1beta1/poddisruptionbudget.go +++ b/applyconfigurations/policy/v1beta1/poddisruptionbudget.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PodDisruptionBudgetApplyConfiguration represents an declarative configuration of the PodDisruptionBudget type for use +// PodDisruptionBudgetApplyConfiguration represents a declarative configuration of the PodDisruptionBudget type for use // with apply. type PodDisruptionBudgetApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type PodDisruptionBudgetApplyConfiguration struct { Status *PodDisruptionBudgetStatusApplyConfiguration `json:"status,omitempty"` } -// PodDisruptionBudget constructs an declarative configuration of the PodDisruptionBudget type for use with +// PodDisruptionBudget constructs a declarative configuration of the PodDisruptionBudget type for use with // apply. func PodDisruptionBudget(name, namespace string) *PodDisruptionBudgetApplyConfiguration { b := &PodDisruptionBudgetApplyConfiguration{} diff --git a/applyconfigurations/policy/v1beta1/poddisruptionbudgetspec.go b/applyconfigurations/policy/v1beta1/poddisruptionbudgetspec.go index 0ba3ea1c2e..405f1148b0 100644 --- a/applyconfigurations/policy/v1beta1/poddisruptionbudgetspec.go +++ b/applyconfigurations/policy/v1beta1/poddisruptionbudgetspec.go @@ -24,7 +24,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PodDisruptionBudgetSpecApplyConfiguration represents an declarative configuration of the PodDisruptionBudgetSpec type for use +// PodDisruptionBudgetSpecApplyConfiguration represents a declarative configuration of the PodDisruptionBudgetSpec type for use // with apply. type PodDisruptionBudgetSpecApplyConfiguration struct { MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty"` @@ -33,7 +33,7 @@ type PodDisruptionBudgetSpecApplyConfiguration struct { UnhealthyPodEvictionPolicy *v1beta1.UnhealthyPodEvictionPolicyType `json:"unhealthyPodEvictionPolicy,omitempty"` } -// PodDisruptionBudgetSpecApplyConfiguration constructs an declarative configuration of the PodDisruptionBudgetSpec type for use with +// PodDisruptionBudgetSpecApplyConfiguration constructs a declarative configuration of the PodDisruptionBudgetSpec type for use with // apply. func PodDisruptionBudgetSpec() *PodDisruptionBudgetSpecApplyConfiguration { return &PodDisruptionBudgetSpecApplyConfiguration{} diff --git a/applyconfigurations/policy/v1beta1/poddisruptionbudgetstatus.go b/applyconfigurations/policy/v1beta1/poddisruptionbudgetstatus.go index d0813590e1..e66a7fb386 100644 --- a/applyconfigurations/policy/v1beta1/poddisruptionbudgetstatus.go +++ b/applyconfigurations/policy/v1beta1/poddisruptionbudgetstatus.go @@ -23,7 +23,7 @@ import ( metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PodDisruptionBudgetStatusApplyConfiguration represents an declarative configuration of the PodDisruptionBudgetStatus type for use +// PodDisruptionBudgetStatusApplyConfiguration represents a declarative configuration of the PodDisruptionBudgetStatus type for use // with apply. type PodDisruptionBudgetStatusApplyConfiguration struct { ObservedGeneration *int64 `json:"observedGeneration,omitempty"` @@ -35,7 +35,7 @@ type PodDisruptionBudgetStatusApplyConfiguration struct { Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` } -// PodDisruptionBudgetStatusApplyConfiguration constructs an declarative configuration of the PodDisruptionBudgetStatus type for use with +// PodDisruptionBudgetStatusApplyConfiguration constructs a declarative configuration of the PodDisruptionBudgetStatus type for use with // apply. func PodDisruptionBudgetStatus() *PodDisruptionBudgetStatusApplyConfiguration { return &PodDisruptionBudgetStatusApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1/aggregationrule.go b/applyconfigurations/rbac/v1/aggregationrule.go index fda9205c21..5ae4dc37ff 100644 --- a/applyconfigurations/rbac/v1/aggregationrule.go +++ b/applyconfigurations/rbac/v1/aggregationrule.go @@ -22,13 +22,13 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// AggregationRuleApplyConfiguration represents an declarative configuration of the AggregationRule type for use +// AggregationRuleApplyConfiguration represents a declarative configuration of the AggregationRule type for use // with apply. type AggregationRuleApplyConfiguration struct { ClusterRoleSelectors []v1.LabelSelectorApplyConfiguration `json:"clusterRoleSelectors,omitempty"` } -// AggregationRuleApplyConfiguration constructs an declarative configuration of the AggregationRule type for use with +// AggregationRuleApplyConfiguration constructs a declarative configuration of the AggregationRule type for use with // apply. func AggregationRule() *AggregationRuleApplyConfiguration { return &AggregationRuleApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1/clusterrole.go b/applyconfigurations/rbac/v1/clusterrole.go index 04535e4b23..c5b0075ec0 100644 --- a/applyconfigurations/rbac/v1/clusterrole.go +++ b/applyconfigurations/rbac/v1/clusterrole.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ClusterRoleApplyConfiguration represents an declarative configuration of the ClusterRole type for use +// ClusterRoleApplyConfiguration represents a declarative configuration of the ClusterRole type for use // with apply. type ClusterRoleApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type ClusterRoleApplyConfiguration struct { AggregationRule *AggregationRuleApplyConfiguration `json:"aggregationRule,omitempty"` } -// ClusterRole constructs an declarative configuration of the ClusterRole type for use with +// ClusterRole constructs a declarative configuration of the ClusterRole type for use with // apply. func ClusterRole(name string) *ClusterRoleApplyConfiguration { b := &ClusterRoleApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1/clusterrolebinding.go b/applyconfigurations/rbac/v1/clusterrolebinding.go index 81379a8555..91a9d5df31 100644 --- a/applyconfigurations/rbac/v1/clusterrolebinding.go +++ b/applyconfigurations/rbac/v1/clusterrolebinding.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ClusterRoleBindingApplyConfiguration represents an declarative configuration of the ClusterRoleBinding type for use +// ClusterRoleBindingApplyConfiguration represents a declarative configuration of the ClusterRoleBinding type for use // with apply. type ClusterRoleBindingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type ClusterRoleBindingApplyConfiguration struct { RoleRef *RoleRefApplyConfiguration `json:"roleRef,omitempty"` } -// ClusterRoleBinding constructs an declarative configuration of the ClusterRoleBinding type for use with +// ClusterRoleBinding constructs a declarative configuration of the ClusterRoleBinding type for use with // apply. func ClusterRoleBinding(name string) *ClusterRoleBindingApplyConfiguration { b := &ClusterRoleBindingApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1/policyrule.go b/applyconfigurations/rbac/v1/policyrule.go index 65ee1d4fe5..a2e66d1096 100644 --- a/applyconfigurations/rbac/v1/policyrule.go +++ b/applyconfigurations/rbac/v1/policyrule.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// PolicyRuleApplyConfiguration represents an declarative configuration of the PolicyRule type for use +// PolicyRuleApplyConfiguration represents a declarative configuration of the PolicyRule type for use // with apply. type PolicyRuleApplyConfiguration struct { Verbs []string `json:"verbs,omitempty"` @@ -28,7 +28,7 @@ type PolicyRuleApplyConfiguration struct { NonResourceURLs []string `json:"nonResourceURLs,omitempty"` } -// PolicyRuleApplyConfiguration constructs an declarative configuration of the PolicyRule type for use with +// PolicyRuleApplyConfiguration constructs a declarative configuration of the PolicyRule type for use with // apply. func PolicyRule() *PolicyRuleApplyConfiguration { return &PolicyRuleApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1/role.go b/applyconfigurations/rbac/v1/role.go index 3c8dd3c977..b51f904267 100644 --- a/applyconfigurations/rbac/v1/role.go +++ b/applyconfigurations/rbac/v1/role.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// RoleApplyConfiguration represents an declarative configuration of the Role type for use +// RoleApplyConfiguration represents a declarative configuration of the Role type for use // with apply. type RoleApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type RoleApplyConfiguration struct { Rules []PolicyRuleApplyConfiguration `json:"rules,omitempty"` } -// Role constructs an declarative configuration of the Role type for use with +// Role constructs a declarative configuration of the Role type for use with // apply. func Role(name, namespace string) *RoleApplyConfiguration { b := &RoleApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1/rolebinding.go b/applyconfigurations/rbac/v1/rolebinding.go index 2d9176cc81..e59c8e6d30 100644 --- a/applyconfigurations/rbac/v1/rolebinding.go +++ b/applyconfigurations/rbac/v1/rolebinding.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// RoleBindingApplyConfiguration represents an declarative configuration of the RoleBinding type for use +// RoleBindingApplyConfiguration represents a declarative configuration of the RoleBinding type for use // with apply. type RoleBindingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type RoleBindingApplyConfiguration struct { RoleRef *RoleRefApplyConfiguration `json:"roleRef,omitempty"` } -// RoleBinding constructs an declarative configuration of the RoleBinding type for use with +// RoleBinding constructs a declarative configuration of the RoleBinding type for use with // apply. func RoleBinding(name, namespace string) *RoleBindingApplyConfiguration { b := &RoleBindingApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1/roleref.go b/applyconfigurations/rbac/v1/roleref.go index ef03a48827..646a3bb194 100644 --- a/applyconfigurations/rbac/v1/roleref.go +++ b/applyconfigurations/rbac/v1/roleref.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// RoleRefApplyConfiguration represents an declarative configuration of the RoleRef type for use +// RoleRefApplyConfiguration represents a declarative configuration of the RoleRef type for use // with apply. type RoleRefApplyConfiguration struct { APIGroup *string `json:"apiGroup,omitempty"` @@ -26,7 +26,7 @@ type RoleRefApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// RoleRefApplyConfiguration constructs an declarative configuration of the RoleRef type for use with +// RoleRefApplyConfiguration constructs a declarative configuration of the RoleRef type for use with // apply. func RoleRef() *RoleRefApplyConfiguration { return &RoleRefApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1/subject.go b/applyconfigurations/rbac/v1/subject.go index ebc87fdc45..e1d9c5cfb8 100644 --- a/applyconfigurations/rbac/v1/subject.go +++ b/applyconfigurations/rbac/v1/subject.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// SubjectApplyConfiguration represents an declarative configuration of the Subject type for use +// SubjectApplyConfiguration represents a declarative configuration of the Subject type for use // with apply. type SubjectApplyConfiguration struct { Kind *string `json:"kind,omitempty"` @@ -27,7 +27,7 @@ type SubjectApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` } -// SubjectApplyConfiguration constructs an declarative configuration of the Subject type for use with +// SubjectApplyConfiguration constructs a declarative configuration of the Subject type for use with // apply. func Subject() *SubjectApplyConfiguration { return &SubjectApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1alpha1/aggregationrule.go b/applyconfigurations/rbac/v1alpha1/aggregationrule.go index 63cdc3fcca..ff4aeb59e5 100644 --- a/applyconfigurations/rbac/v1alpha1/aggregationrule.go +++ b/applyconfigurations/rbac/v1alpha1/aggregationrule.go @@ -22,13 +22,13 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// AggregationRuleApplyConfiguration represents an declarative configuration of the AggregationRule type for use +// AggregationRuleApplyConfiguration represents a declarative configuration of the AggregationRule type for use // with apply. type AggregationRuleApplyConfiguration struct { ClusterRoleSelectors []v1.LabelSelectorApplyConfiguration `json:"clusterRoleSelectors,omitempty"` } -// AggregationRuleApplyConfiguration constructs an declarative configuration of the AggregationRule type for use with +// AggregationRuleApplyConfiguration constructs a declarative configuration of the AggregationRule type for use with // apply. func AggregationRule() *AggregationRuleApplyConfiguration { return &AggregationRuleApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1alpha1/clusterrole.go b/applyconfigurations/rbac/v1alpha1/clusterrole.go index eeb954466e..dc0e34e53b 100644 --- a/applyconfigurations/rbac/v1alpha1/clusterrole.go +++ b/applyconfigurations/rbac/v1alpha1/clusterrole.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ClusterRoleApplyConfiguration represents an declarative configuration of the ClusterRole type for use +// ClusterRoleApplyConfiguration represents a declarative configuration of the ClusterRole type for use // with apply. type ClusterRoleApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type ClusterRoleApplyConfiguration struct { AggregationRule *AggregationRuleApplyConfiguration `json:"aggregationRule,omitempty"` } -// ClusterRole constructs an declarative configuration of the ClusterRole type for use with +// ClusterRole constructs a declarative configuration of the ClusterRole type for use with // apply. func ClusterRole(name string) *ClusterRoleApplyConfiguration { b := &ClusterRoleApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1alpha1/clusterrolebinding.go b/applyconfigurations/rbac/v1alpha1/clusterrolebinding.go index aa0b66073f..d3c12ec508 100644 --- a/applyconfigurations/rbac/v1alpha1/clusterrolebinding.go +++ b/applyconfigurations/rbac/v1alpha1/clusterrolebinding.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ClusterRoleBindingApplyConfiguration represents an declarative configuration of the ClusterRoleBinding type for use +// ClusterRoleBindingApplyConfiguration represents a declarative configuration of the ClusterRoleBinding type for use // with apply. type ClusterRoleBindingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type ClusterRoleBindingApplyConfiguration struct { RoleRef *RoleRefApplyConfiguration `json:"roleRef,omitempty"` } -// ClusterRoleBinding constructs an declarative configuration of the ClusterRoleBinding type for use with +// ClusterRoleBinding constructs a declarative configuration of the ClusterRoleBinding type for use with // apply. func ClusterRoleBinding(name string) *ClusterRoleBindingApplyConfiguration { b := &ClusterRoleBindingApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1alpha1/policyrule.go b/applyconfigurations/rbac/v1alpha1/policyrule.go index 12143af130..89d7a2914f 100644 --- a/applyconfigurations/rbac/v1alpha1/policyrule.go +++ b/applyconfigurations/rbac/v1alpha1/policyrule.go @@ -18,7 +18,7 @@ limitations under the License. package v1alpha1 -// PolicyRuleApplyConfiguration represents an declarative configuration of the PolicyRule type for use +// PolicyRuleApplyConfiguration represents a declarative configuration of the PolicyRule type for use // with apply. type PolicyRuleApplyConfiguration struct { Verbs []string `json:"verbs,omitempty"` @@ -28,7 +28,7 @@ type PolicyRuleApplyConfiguration struct { NonResourceURLs []string `json:"nonResourceURLs,omitempty"` } -// PolicyRuleApplyConfiguration constructs an declarative configuration of the PolicyRule type for use with +// PolicyRuleApplyConfiguration constructs a declarative configuration of the PolicyRule type for use with // apply. func PolicyRule() *PolicyRuleApplyConfiguration { return &PolicyRuleApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1alpha1/role.go b/applyconfigurations/rbac/v1alpha1/role.go index 8080a43a0d..db0a4f7169 100644 --- a/applyconfigurations/rbac/v1alpha1/role.go +++ b/applyconfigurations/rbac/v1alpha1/role.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// RoleApplyConfiguration represents an declarative configuration of the Role type for use +// RoleApplyConfiguration represents a declarative configuration of the Role type for use // with apply. type RoleApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type RoleApplyConfiguration struct { Rules []PolicyRuleApplyConfiguration `json:"rules,omitempty"` } -// Role constructs an declarative configuration of the Role type for use with +// Role constructs a declarative configuration of the Role type for use with // apply. func Role(name, namespace string) *RoleApplyConfiguration { b := &RoleApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1alpha1/rolebinding.go b/applyconfigurations/rbac/v1alpha1/rolebinding.go index 740a8f5bb2..8efcddd69d 100644 --- a/applyconfigurations/rbac/v1alpha1/rolebinding.go +++ b/applyconfigurations/rbac/v1alpha1/rolebinding.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// RoleBindingApplyConfiguration represents an declarative configuration of the RoleBinding type for use +// RoleBindingApplyConfiguration represents a declarative configuration of the RoleBinding type for use // with apply. type RoleBindingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type RoleBindingApplyConfiguration struct { RoleRef *RoleRefApplyConfiguration `json:"roleRef,omitempty"` } -// RoleBinding constructs an declarative configuration of the RoleBinding type for use with +// RoleBinding constructs a declarative configuration of the RoleBinding type for use with // apply. func RoleBinding(name, namespace string) *RoleBindingApplyConfiguration { b := &RoleBindingApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1alpha1/roleref.go b/applyconfigurations/rbac/v1alpha1/roleref.go index 40dbc33073..4b2553117d 100644 --- a/applyconfigurations/rbac/v1alpha1/roleref.go +++ b/applyconfigurations/rbac/v1alpha1/roleref.go @@ -18,7 +18,7 @@ limitations under the License. package v1alpha1 -// RoleRefApplyConfiguration represents an declarative configuration of the RoleRef type for use +// RoleRefApplyConfiguration represents a declarative configuration of the RoleRef type for use // with apply. type RoleRefApplyConfiguration struct { APIGroup *string `json:"apiGroup,omitempty"` @@ -26,7 +26,7 @@ type RoleRefApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// RoleRefApplyConfiguration constructs an declarative configuration of the RoleRef type for use with +// RoleRefApplyConfiguration constructs a declarative configuration of the RoleRef type for use with // apply. func RoleRef() *RoleRefApplyConfiguration { return &RoleRefApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1alpha1/subject.go b/applyconfigurations/rbac/v1alpha1/subject.go index 46640dbbe9..665b42af50 100644 --- a/applyconfigurations/rbac/v1alpha1/subject.go +++ b/applyconfigurations/rbac/v1alpha1/subject.go @@ -18,7 +18,7 @@ limitations under the License. package v1alpha1 -// SubjectApplyConfiguration represents an declarative configuration of the Subject type for use +// SubjectApplyConfiguration represents a declarative configuration of the Subject type for use // with apply. type SubjectApplyConfiguration struct { Kind *string `json:"kind,omitempty"` @@ -27,7 +27,7 @@ type SubjectApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` } -// SubjectApplyConfiguration constructs an declarative configuration of the Subject type for use with +// SubjectApplyConfiguration constructs a declarative configuration of the Subject type for use with // apply. func Subject() *SubjectApplyConfiguration { return &SubjectApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1beta1/aggregationrule.go b/applyconfigurations/rbac/v1beta1/aggregationrule.go index d52ac3db9b..e9bb68dcb6 100644 --- a/applyconfigurations/rbac/v1beta1/aggregationrule.go +++ b/applyconfigurations/rbac/v1beta1/aggregationrule.go @@ -22,13 +22,13 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// AggregationRuleApplyConfiguration represents an declarative configuration of the AggregationRule type for use +// AggregationRuleApplyConfiguration represents a declarative configuration of the AggregationRule type for use // with apply. type AggregationRuleApplyConfiguration struct { ClusterRoleSelectors []v1.LabelSelectorApplyConfiguration `json:"clusterRoleSelectors,omitempty"` } -// AggregationRuleApplyConfiguration constructs an declarative configuration of the AggregationRule type for use with +// AggregationRuleApplyConfiguration constructs a declarative configuration of the AggregationRule type for use with // apply. func AggregationRule() *AggregationRuleApplyConfiguration { return &AggregationRuleApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1beta1/clusterrole.go b/applyconfigurations/rbac/v1beta1/clusterrole.go index 9a5fb58e10..5e9c238540 100644 --- a/applyconfigurations/rbac/v1beta1/clusterrole.go +++ b/applyconfigurations/rbac/v1beta1/clusterrole.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ClusterRoleApplyConfiguration represents an declarative configuration of the ClusterRole type for use +// ClusterRoleApplyConfiguration represents a declarative configuration of the ClusterRole type for use // with apply. type ClusterRoleApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type ClusterRoleApplyConfiguration struct { AggregationRule *AggregationRuleApplyConfiguration `json:"aggregationRule,omitempty"` } -// ClusterRole constructs an declarative configuration of the ClusterRole type for use with +// ClusterRole constructs a declarative configuration of the ClusterRole type for use with // apply. func ClusterRole(name string) *ClusterRoleApplyConfiguration { b := &ClusterRoleApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1beta1/clusterrolebinding.go b/applyconfigurations/rbac/v1beta1/clusterrolebinding.go index db14668502..2f088b93e5 100644 --- a/applyconfigurations/rbac/v1beta1/clusterrolebinding.go +++ b/applyconfigurations/rbac/v1beta1/clusterrolebinding.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ClusterRoleBindingApplyConfiguration represents an declarative configuration of the ClusterRoleBinding type for use +// ClusterRoleBindingApplyConfiguration represents a declarative configuration of the ClusterRoleBinding type for use // with apply. type ClusterRoleBindingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type ClusterRoleBindingApplyConfiguration struct { RoleRef *RoleRefApplyConfiguration `json:"roleRef,omitempty"` } -// ClusterRoleBinding constructs an declarative configuration of the ClusterRoleBinding type for use with +// ClusterRoleBinding constructs a declarative configuration of the ClusterRoleBinding type for use with // apply. func ClusterRoleBinding(name string) *ClusterRoleBindingApplyConfiguration { b := &ClusterRoleBindingApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1beta1/policyrule.go b/applyconfigurations/rbac/v1beta1/policyrule.go index c63dc68c6b..dc630df206 100644 --- a/applyconfigurations/rbac/v1beta1/policyrule.go +++ b/applyconfigurations/rbac/v1beta1/policyrule.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// PolicyRuleApplyConfiguration represents an declarative configuration of the PolicyRule type for use +// PolicyRuleApplyConfiguration represents a declarative configuration of the PolicyRule type for use // with apply. type PolicyRuleApplyConfiguration struct { Verbs []string `json:"verbs,omitempty"` @@ -28,7 +28,7 @@ type PolicyRuleApplyConfiguration struct { NonResourceURLs []string `json:"nonResourceURLs,omitempty"` } -// PolicyRuleApplyConfiguration constructs an declarative configuration of the PolicyRule type for use with +// PolicyRuleApplyConfiguration constructs a declarative configuration of the PolicyRule type for use with // apply. func PolicyRule() *PolicyRuleApplyConfiguration { return &PolicyRuleApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1beta1/role.go b/applyconfigurations/rbac/v1beta1/role.go index 1e322141b9..4b1b6112bd 100644 --- a/applyconfigurations/rbac/v1beta1/role.go +++ b/applyconfigurations/rbac/v1beta1/role.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// RoleApplyConfiguration represents an declarative configuration of the Role type for use +// RoleApplyConfiguration represents a declarative configuration of the Role type for use // with apply. type RoleApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type RoleApplyConfiguration struct { Rules []PolicyRuleApplyConfiguration `json:"rules,omitempty"` } -// Role constructs an declarative configuration of the Role type for use with +// Role constructs a declarative configuration of the Role type for use with // apply. func Role(name, namespace string) *RoleApplyConfiguration { b := &RoleApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1beta1/rolebinding.go b/applyconfigurations/rbac/v1beta1/rolebinding.go index c5c4fb9cc4..246928553f 100644 --- a/applyconfigurations/rbac/v1beta1/rolebinding.go +++ b/applyconfigurations/rbac/v1beta1/rolebinding.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// RoleBindingApplyConfiguration represents an declarative configuration of the RoleBinding type for use +// RoleBindingApplyConfiguration represents a declarative configuration of the RoleBinding type for use // with apply. type RoleBindingApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type RoleBindingApplyConfiguration struct { RoleRef *RoleRefApplyConfiguration `json:"roleRef,omitempty"` } -// RoleBinding constructs an declarative configuration of the RoleBinding type for use with +// RoleBinding constructs a declarative configuration of the RoleBinding type for use with // apply. func RoleBinding(name, namespace string) *RoleBindingApplyConfiguration { b := &RoleBindingApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1beta1/roleref.go b/applyconfigurations/rbac/v1beta1/roleref.go index e6a02dc602..19d0420a81 100644 --- a/applyconfigurations/rbac/v1beta1/roleref.go +++ b/applyconfigurations/rbac/v1beta1/roleref.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// RoleRefApplyConfiguration represents an declarative configuration of the RoleRef type for use +// RoleRefApplyConfiguration represents a declarative configuration of the RoleRef type for use // with apply. type RoleRefApplyConfiguration struct { APIGroup *string `json:"apiGroup,omitempty"` @@ -26,7 +26,7 @@ type RoleRefApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// RoleRefApplyConfiguration constructs an declarative configuration of the RoleRef type for use with +// RoleRefApplyConfiguration constructs a declarative configuration of the RoleRef type for use with // apply. func RoleRef() *RoleRefApplyConfiguration { return &RoleRefApplyConfiguration{} diff --git a/applyconfigurations/rbac/v1beta1/subject.go b/applyconfigurations/rbac/v1beta1/subject.go index b616da8b13..f7c1a21a9c 100644 --- a/applyconfigurations/rbac/v1beta1/subject.go +++ b/applyconfigurations/rbac/v1beta1/subject.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// SubjectApplyConfiguration represents an declarative configuration of the Subject type for use +// SubjectApplyConfiguration represents a declarative configuration of the Subject type for use // with apply. type SubjectApplyConfiguration struct { Kind *string `json:"kind,omitempty"` @@ -27,7 +27,7 @@ type SubjectApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` } -// SubjectApplyConfiguration constructs an declarative configuration of the Subject type for use with +// SubjectApplyConfiguration constructs a declarative configuration of the Subject type for use with // apply. func Subject() *SubjectApplyConfiguration { return &SubjectApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/allocationresult.go b/applyconfigurations/resource/v1alpha2/allocationresult.go index bc6078aa94..7eef384597 100644 --- a/applyconfigurations/resource/v1alpha2/allocationresult.go +++ b/applyconfigurations/resource/v1alpha2/allocationresult.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" ) -// AllocationResultApplyConfiguration represents an declarative configuration of the AllocationResult type for use +// AllocationResultApplyConfiguration represents a declarative configuration of the AllocationResult type for use // with apply. type AllocationResultApplyConfiguration struct { ResourceHandles []ResourceHandleApplyConfiguration `json:"resourceHandles,omitempty"` @@ -30,7 +30,7 @@ type AllocationResultApplyConfiguration struct { Shareable *bool `json:"shareable,omitempty"` } -// AllocationResultApplyConfiguration constructs an declarative configuration of the AllocationResult type for use with +// AllocationResultApplyConfiguration constructs a declarative configuration of the AllocationResult type for use with // apply. func AllocationResult() *AllocationResultApplyConfiguration { return &AllocationResultApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/allocationresultmodel.go b/applyconfigurations/resource/v1alpha2/allocationresultmodel.go index 0c8be0e6aa..3250fd5d11 100644 --- a/applyconfigurations/resource/v1alpha2/allocationresultmodel.go +++ b/applyconfigurations/resource/v1alpha2/allocationresultmodel.go @@ -18,13 +18,13 @@ limitations under the License. package v1alpha2 -// AllocationResultModelApplyConfiguration represents an declarative configuration of the AllocationResultModel type for use +// AllocationResultModelApplyConfiguration represents a declarative configuration of the AllocationResultModel type for use // with apply. type AllocationResultModelApplyConfiguration struct { NamedResources *NamedResourcesAllocationResultApplyConfiguration `json:"namedResources,omitempty"` } -// AllocationResultModelApplyConfiguration constructs an declarative configuration of the AllocationResultModel type for use with +// AllocationResultModelApplyConfiguration constructs a declarative configuration of the AllocationResultModel type for use with // apply. func AllocationResultModel() *AllocationResultModelApplyConfiguration { return &AllocationResultModelApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/driverallocationresult.go b/applyconfigurations/resource/v1alpha2/driverallocationresult.go index a1f082fad7..f44db7921c 100644 --- a/applyconfigurations/resource/v1alpha2/driverallocationresult.go +++ b/applyconfigurations/resource/v1alpha2/driverallocationresult.go @@ -22,14 +22,14 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) -// DriverAllocationResultApplyConfiguration represents an declarative configuration of the DriverAllocationResult type for use +// DriverAllocationResultApplyConfiguration represents a declarative configuration of the DriverAllocationResult type for use // with apply. type DriverAllocationResultApplyConfiguration struct { VendorRequestParameters *runtime.RawExtension `json:"vendorRequestParameters,omitempty"` AllocationResultModelApplyConfiguration `json:",inline"` } -// DriverAllocationResultApplyConfiguration constructs an declarative configuration of the DriverAllocationResult type for use with +// DriverAllocationResultApplyConfiguration constructs a declarative configuration of the DriverAllocationResult type for use with // apply. func DriverAllocationResult() *DriverAllocationResultApplyConfiguration { return &DriverAllocationResultApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/driverrequests.go b/applyconfigurations/resource/v1alpha2/driverrequests.go index 8052915784..79cc04c245 100644 --- a/applyconfigurations/resource/v1alpha2/driverrequests.go +++ b/applyconfigurations/resource/v1alpha2/driverrequests.go @@ -22,7 +22,7 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) -// DriverRequestsApplyConfiguration represents an declarative configuration of the DriverRequests type for use +// DriverRequestsApplyConfiguration represents a declarative configuration of the DriverRequests type for use // with apply. type DriverRequestsApplyConfiguration struct { DriverName *string `json:"driverName,omitempty"` @@ -30,7 +30,7 @@ type DriverRequestsApplyConfiguration struct { Requests []ResourceRequestApplyConfiguration `json:"requests,omitempty"` } -// DriverRequestsApplyConfiguration constructs an declarative configuration of the DriverRequests type for use with +// DriverRequestsApplyConfiguration constructs a declarative configuration of the DriverRequests type for use with // apply. func DriverRequests() *DriverRequestsApplyConfiguration { return &DriverRequestsApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesallocationresult.go b/applyconfigurations/resource/v1alpha2/namedresourcesallocationresult.go index 311edbac80..7baf9558de 100644 --- a/applyconfigurations/resource/v1alpha2/namedresourcesallocationresult.go +++ b/applyconfigurations/resource/v1alpha2/namedresourcesallocationresult.go @@ -18,13 +18,13 @@ limitations under the License. package v1alpha2 -// NamedResourcesAllocationResultApplyConfiguration represents an declarative configuration of the NamedResourcesAllocationResult type for use +// NamedResourcesAllocationResultApplyConfiguration represents a declarative configuration of the NamedResourcesAllocationResult type for use // with apply. type NamedResourcesAllocationResultApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// NamedResourcesAllocationResultApplyConfiguration constructs an declarative configuration of the NamedResourcesAllocationResult type for use with +// NamedResourcesAllocationResultApplyConfiguration constructs a declarative configuration of the NamedResourcesAllocationResult type for use with // apply. func NamedResourcesAllocationResult() *NamedResourcesAllocationResultApplyConfiguration { return &NamedResourcesAllocationResultApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesattribute.go b/applyconfigurations/resource/v1alpha2/namedresourcesattribute.go index d9545d054f..38df3195b1 100644 --- a/applyconfigurations/resource/v1alpha2/namedresourcesattribute.go +++ b/applyconfigurations/resource/v1alpha2/namedresourcesattribute.go @@ -22,14 +22,14 @@ import ( resource "k8s.io/apimachinery/pkg/api/resource" ) -// NamedResourcesAttributeApplyConfiguration represents an declarative configuration of the NamedResourcesAttribute type for use +// NamedResourcesAttributeApplyConfiguration represents a declarative configuration of the NamedResourcesAttribute type for use // with apply. type NamedResourcesAttributeApplyConfiguration struct { Name *string `json:"name,omitempty"` NamedResourcesAttributeValueApplyConfiguration `json:",inline"` } -// NamedResourcesAttributeApplyConfiguration constructs an declarative configuration of the NamedResourcesAttribute type for use with +// NamedResourcesAttributeApplyConfiguration constructs a declarative configuration of the NamedResourcesAttribute type for use with // apply. func NamedResourcesAttribute() *NamedResourcesAttributeApplyConfiguration { return &NamedResourcesAttributeApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesattributevalue.go b/applyconfigurations/resource/v1alpha2/namedresourcesattributevalue.go index e0b19650a9..d9ef2682e3 100644 --- a/applyconfigurations/resource/v1alpha2/namedresourcesattributevalue.go +++ b/applyconfigurations/resource/v1alpha2/namedresourcesattributevalue.go @@ -22,7 +22,7 @@ import ( resource "k8s.io/apimachinery/pkg/api/resource" ) -// NamedResourcesAttributeValueApplyConfiguration represents an declarative configuration of the NamedResourcesAttributeValue type for use +// NamedResourcesAttributeValueApplyConfiguration represents a declarative configuration of the NamedResourcesAttributeValue type for use // with apply. type NamedResourcesAttributeValueApplyConfiguration struct { QuantityValue *resource.Quantity `json:"quantity,omitempty"` @@ -34,7 +34,7 @@ type NamedResourcesAttributeValueApplyConfiguration struct { VersionValue *string `json:"version,omitempty"` } -// NamedResourcesAttributeValueApplyConfiguration constructs an declarative configuration of the NamedResourcesAttributeValue type for use with +// NamedResourcesAttributeValueApplyConfiguration constructs a declarative configuration of the NamedResourcesAttributeValue type for use with // apply. func NamedResourcesAttributeValue() *NamedResourcesAttributeValueApplyConfiguration { return &NamedResourcesAttributeValueApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesfilter.go b/applyconfigurations/resource/v1alpha2/namedresourcesfilter.go index e483d8622f..439eb06635 100644 --- a/applyconfigurations/resource/v1alpha2/namedresourcesfilter.go +++ b/applyconfigurations/resource/v1alpha2/namedresourcesfilter.go @@ -18,13 +18,13 @@ limitations under the License. package v1alpha2 -// NamedResourcesFilterApplyConfiguration represents an declarative configuration of the NamedResourcesFilter type for use +// NamedResourcesFilterApplyConfiguration represents a declarative configuration of the NamedResourcesFilter type for use // with apply. type NamedResourcesFilterApplyConfiguration struct { Selector *string `json:"selector,omitempty"` } -// NamedResourcesFilterApplyConfiguration constructs an declarative configuration of the NamedResourcesFilter type for use with +// NamedResourcesFilterApplyConfiguration constructs a declarative configuration of the NamedResourcesFilter type for use with // apply. func NamedResourcesFilter() *NamedResourcesFilterApplyConfiguration { return &NamedResourcesFilterApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesinstance.go b/applyconfigurations/resource/v1alpha2/namedresourcesinstance.go index 4f01372e4c..4ec6fd7ab6 100644 --- a/applyconfigurations/resource/v1alpha2/namedresourcesinstance.go +++ b/applyconfigurations/resource/v1alpha2/namedresourcesinstance.go @@ -18,14 +18,14 @@ limitations under the License. package v1alpha2 -// NamedResourcesInstanceApplyConfiguration represents an declarative configuration of the NamedResourcesInstance type for use +// NamedResourcesInstanceApplyConfiguration represents a declarative configuration of the NamedResourcesInstance type for use // with apply. type NamedResourcesInstanceApplyConfiguration struct { Name *string `json:"name,omitempty"` Attributes []NamedResourcesAttributeApplyConfiguration `json:"attributes,omitempty"` } -// NamedResourcesInstanceApplyConfiguration constructs an declarative configuration of the NamedResourcesInstance type for use with +// NamedResourcesInstanceApplyConfiguration constructs a declarative configuration of the NamedResourcesInstance type for use with // apply. func NamedResourcesInstance() *NamedResourcesInstanceApplyConfiguration { return &NamedResourcesInstanceApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesintslice.go b/applyconfigurations/resource/v1alpha2/namedresourcesintslice.go index ea00bffe51..f3d74e7b9c 100644 --- a/applyconfigurations/resource/v1alpha2/namedresourcesintslice.go +++ b/applyconfigurations/resource/v1alpha2/namedresourcesintslice.go @@ -18,13 +18,13 @@ limitations under the License. package v1alpha2 -// NamedResourcesIntSliceApplyConfiguration represents an declarative configuration of the NamedResourcesIntSlice type for use +// NamedResourcesIntSliceApplyConfiguration represents a declarative configuration of the NamedResourcesIntSlice type for use // with apply. type NamedResourcesIntSliceApplyConfiguration struct { Ints []int64 `json:"ints,omitempty"` } -// NamedResourcesIntSliceApplyConfiguration constructs an declarative configuration of the NamedResourcesIntSlice type for use with +// NamedResourcesIntSliceApplyConfiguration constructs a declarative configuration of the NamedResourcesIntSlice type for use with // apply. func NamedResourcesIntSlice() *NamedResourcesIntSliceApplyConfiguration { return &NamedResourcesIntSliceApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesrequest.go b/applyconfigurations/resource/v1alpha2/namedresourcesrequest.go index 5adfd84ee5..b0722df48c 100644 --- a/applyconfigurations/resource/v1alpha2/namedresourcesrequest.go +++ b/applyconfigurations/resource/v1alpha2/namedresourcesrequest.go @@ -18,13 +18,13 @@ limitations under the License. package v1alpha2 -// NamedResourcesRequestApplyConfiguration represents an declarative configuration of the NamedResourcesRequest type for use +// NamedResourcesRequestApplyConfiguration represents a declarative configuration of the NamedResourcesRequest type for use // with apply. type NamedResourcesRequestApplyConfiguration struct { Selector *string `json:"selector,omitempty"` } -// NamedResourcesRequestApplyConfiguration constructs an declarative configuration of the NamedResourcesRequest type for use with +// NamedResourcesRequestApplyConfiguration constructs a declarative configuration of the NamedResourcesRequest type for use with // apply. func NamedResourcesRequest() *NamedResourcesRequestApplyConfiguration { return &NamedResourcesRequestApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesresources.go b/applyconfigurations/resource/v1alpha2/namedresourcesresources.go index f01ff8699a..0ef0565552 100644 --- a/applyconfigurations/resource/v1alpha2/namedresourcesresources.go +++ b/applyconfigurations/resource/v1alpha2/namedresourcesresources.go @@ -18,13 +18,13 @@ limitations under the License. package v1alpha2 -// NamedResourcesResourcesApplyConfiguration represents an declarative configuration of the NamedResourcesResources type for use +// NamedResourcesResourcesApplyConfiguration represents a declarative configuration of the NamedResourcesResources type for use // with apply. type NamedResourcesResourcesApplyConfiguration struct { Instances []NamedResourcesInstanceApplyConfiguration `json:"instances,omitempty"` } -// NamedResourcesResourcesApplyConfiguration constructs an declarative configuration of the NamedResourcesResources type for use with +// NamedResourcesResourcesApplyConfiguration constructs a declarative configuration of the NamedResourcesResources type for use with // apply. func NamedResourcesResources() *NamedResourcesResourcesApplyConfiguration { return &NamedResourcesResourcesApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesstringslice.go b/applyconfigurations/resource/v1alpha2/namedresourcesstringslice.go index 1e93873546..27295b8964 100644 --- a/applyconfigurations/resource/v1alpha2/namedresourcesstringslice.go +++ b/applyconfigurations/resource/v1alpha2/namedresourcesstringslice.go @@ -18,13 +18,13 @@ limitations under the License. package v1alpha2 -// NamedResourcesStringSliceApplyConfiguration represents an declarative configuration of the NamedResourcesStringSlice type for use +// NamedResourcesStringSliceApplyConfiguration represents a declarative configuration of the NamedResourcesStringSlice type for use // with apply. type NamedResourcesStringSliceApplyConfiguration struct { Strings []string `json:"strings,omitempty"` } -// NamedResourcesStringSliceApplyConfiguration constructs an declarative configuration of the NamedResourcesStringSlice type for use with +// NamedResourcesStringSliceApplyConfiguration constructs a declarative configuration of the NamedResourcesStringSlice type for use with // apply. func NamedResourcesStringSlice() *NamedResourcesStringSliceApplyConfiguration { return &NamedResourcesStringSliceApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/podschedulingcontext.go b/applyconfigurations/resource/v1alpha2/podschedulingcontext.go index 05fcd42c76..1eae9582dd 100644 --- a/applyconfigurations/resource/v1alpha2/podschedulingcontext.go +++ b/applyconfigurations/resource/v1alpha2/podschedulingcontext.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PodSchedulingContextApplyConfiguration represents an declarative configuration of the PodSchedulingContext type for use +// PodSchedulingContextApplyConfiguration represents a declarative configuration of the PodSchedulingContext type for use // with apply. type PodSchedulingContextApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type PodSchedulingContextApplyConfiguration struct { Status *PodSchedulingContextStatusApplyConfiguration `json:"status,omitempty"` } -// PodSchedulingContext constructs an declarative configuration of the PodSchedulingContext type for use with +// PodSchedulingContext constructs a declarative configuration of the PodSchedulingContext type for use with // apply. func PodSchedulingContext(name, namespace string) *PodSchedulingContextApplyConfiguration { b := &PodSchedulingContextApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/podschedulingcontextspec.go b/applyconfigurations/resource/v1alpha2/podschedulingcontextspec.go index c95d3295e8..7cee78ec85 100644 --- a/applyconfigurations/resource/v1alpha2/podschedulingcontextspec.go +++ b/applyconfigurations/resource/v1alpha2/podschedulingcontextspec.go @@ -18,14 +18,14 @@ limitations under the License. package v1alpha2 -// PodSchedulingContextSpecApplyConfiguration represents an declarative configuration of the PodSchedulingContextSpec type for use +// PodSchedulingContextSpecApplyConfiguration represents a declarative configuration of the PodSchedulingContextSpec type for use // with apply. type PodSchedulingContextSpecApplyConfiguration struct { SelectedNode *string `json:"selectedNode,omitempty"` PotentialNodes []string `json:"potentialNodes,omitempty"` } -// PodSchedulingContextSpecApplyConfiguration constructs an declarative configuration of the PodSchedulingContextSpec type for use with +// PodSchedulingContextSpecApplyConfiguration constructs a declarative configuration of the PodSchedulingContextSpec type for use with // apply. func PodSchedulingContextSpec() *PodSchedulingContextSpecApplyConfiguration { return &PodSchedulingContextSpecApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/podschedulingcontextstatus.go b/applyconfigurations/resource/v1alpha2/podschedulingcontextstatus.go index a8b10b9a0e..4a8f00ffc0 100644 --- a/applyconfigurations/resource/v1alpha2/podschedulingcontextstatus.go +++ b/applyconfigurations/resource/v1alpha2/podschedulingcontextstatus.go @@ -18,13 +18,13 @@ limitations under the License. package v1alpha2 -// PodSchedulingContextStatusApplyConfiguration represents an declarative configuration of the PodSchedulingContextStatus type for use +// PodSchedulingContextStatusApplyConfiguration represents a declarative configuration of the PodSchedulingContextStatus type for use // with apply. type PodSchedulingContextStatusApplyConfiguration struct { ResourceClaims []ResourceClaimSchedulingStatusApplyConfiguration `json:"resourceClaims,omitempty"` } -// PodSchedulingContextStatusApplyConfiguration constructs an declarative configuration of the PodSchedulingContextStatus type for use with +// PodSchedulingContextStatusApplyConfiguration constructs a declarative configuration of the PodSchedulingContextStatus type for use with // apply. func PodSchedulingContextStatus() *PodSchedulingContextStatusApplyConfiguration { return &PodSchedulingContextStatusApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/resourceclaim.go b/applyconfigurations/resource/v1alpha2/resourceclaim.go index a076ed1101..8ad61dfbd4 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclaim.go +++ b/applyconfigurations/resource/v1alpha2/resourceclaim.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ResourceClaimApplyConfiguration represents an declarative configuration of the ResourceClaim type for use +// ResourceClaimApplyConfiguration represents a declarative configuration of the ResourceClaim type for use // with apply. type ResourceClaimApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type ResourceClaimApplyConfiguration struct { Status *ResourceClaimStatusApplyConfiguration `json:"status,omitempty"` } -// ResourceClaim constructs an declarative configuration of the ResourceClaim type for use with +// ResourceClaim constructs a declarative configuration of the ResourceClaim type for use with // apply. func ResourceClaim(name, namespace string) *ResourceClaimApplyConfiguration { b := &ResourceClaimApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/resourceclaimconsumerreference.go b/applyconfigurations/resource/v1alpha2/resourceclaimconsumerreference.go index 41bb9e9a14..a383f461d7 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclaimconsumerreference.go +++ b/applyconfigurations/resource/v1alpha2/resourceclaimconsumerreference.go @@ -22,7 +22,7 @@ import ( types "k8s.io/apimachinery/pkg/types" ) -// ResourceClaimConsumerReferenceApplyConfiguration represents an declarative configuration of the ResourceClaimConsumerReference type for use +// ResourceClaimConsumerReferenceApplyConfiguration represents a declarative configuration of the ResourceClaimConsumerReference type for use // with apply. type ResourceClaimConsumerReferenceApplyConfiguration struct { APIGroup *string `json:"apiGroup,omitempty"` @@ -31,7 +31,7 @@ type ResourceClaimConsumerReferenceApplyConfiguration struct { UID *types.UID `json:"uid,omitempty"` } -// ResourceClaimConsumerReferenceApplyConfiguration constructs an declarative configuration of the ResourceClaimConsumerReference type for use with +// ResourceClaimConsumerReferenceApplyConfiguration constructs a declarative configuration of the ResourceClaimConsumerReference type for use with // apply. func ResourceClaimConsumerReference() *ResourceClaimConsumerReferenceApplyConfiguration { return &ResourceClaimConsumerReferenceApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/resourceclaimparameters.go b/applyconfigurations/resource/v1alpha2/resourceclaimparameters.go index 61f8bac075..b3a2be9c84 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclaimparameters.go +++ b/applyconfigurations/resource/v1alpha2/resourceclaimparameters.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ResourceClaimParametersApplyConfiguration represents an declarative configuration of the ResourceClaimParameters type for use +// ResourceClaimParametersApplyConfiguration represents a declarative configuration of the ResourceClaimParameters type for use // with apply. type ResourceClaimParametersApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +37,7 @@ type ResourceClaimParametersApplyConfiguration struct { DriverRequests []DriverRequestsApplyConfiguration `json:"driverRequests,omitempty"` } -// ResourceClaimParameters constructs an declarative configuration of the ResourceClaimParameters type for use with +// ResourceClaimParameters constructs a declarative configuration of the ResourceClaimParameters type for use with // apply. func ResourceClaimParameters(name, namespace string) *ResourceClaimParametersApplyConfiguration { b := &ResourceClaimParametersApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/resourceclaimparametersreference.go b/applyconfigurations/resource/v1alpha2/resourceclaimparametersreference.go index 27820ede60..7900152ca2 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclaimparametersreference.go +++ b/applyconfigurations/resource/v1alpha2/resourceclaimparametersreference.go @@ -18,7 +18,7 @@ limitations under the License. package v1alpha2 -// ResourceClaimParametersReferenceApplyConfiguration represents an declarative configuration of the ResourceClaimParametersReference type for use +// ResourceClaimParametersReferenceApplyConfiguration represents a declarative configuration of the ResourceClaimParametersReference type for use // with apply. type ResourceClaimParametersReferenceApplyConfiguration struct { APIGroup *string `json:"apiGroup,omitempty"` @@ -26,7 +26,7 @@ type ResourceClaimParametersReferenceApplyConfiguration struct { Name *string `json:"name,omitempty"` } -// ResourceClaimParametersReferenceApplyConfiguration constructs an declarative configuration of the ResourceClaimParametersReference type for use with +// ResourceClaimParametersReferenceApplyConfiguration constructs a declarative configuration of the ResourceClaimParametersReference type for use with // apply. func ResourceClaimParametersReference() *ResourceClaimParametersReferenceApplyConfiguration { return &ResourceClaimParametersReferenceApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/resourceclaimschedulingstatus.go b/applyconfigurations/resource/v1alpha2/resourceclaimschedulingstatus.go index e74679aed3..f9e07b7467 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclaimschedulingstatus.go +++ b/applyconfigurations/resource/v1alpha2/resourceclaimschedulingstatus.go @@ -18,14 +18,14 @@ limitations under the License. package v1alpha2 -// ResourceClaimSchedulingStatusApplyConfiguration represents an declarative configuration of the ResourceClaimSchedulingStatus type for use +// ResourceClaimSchedulingStatusApplyConfiguration represents a declarative configuration of the ResourceClaimSchedulingStatus type for use // with apply. type ResourceClaimSchedulingStatusApplyConfiguration struct { Name *string `json:"name,omitempty"` UnsuitableNodes []string `json:"unsuitableNodes,omitempty"` } -// ResourceClaimSchedulingStatusApplyConfiguration constructs an declarative configuration of the ResourceClaimSchedulingStatus type for use with +// ResourceClaimSchedulingStatusApplyConfiguration constructs a declarative configuration of the ResourceClaimSchedulingStatus type for use with // apply. func ResourceClaimSchedulingStatus() *ResourceClaimSchedulingStatusApplyConfiguration { return &ResourceClaimSchedulingStatusApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/resourceclaimspec.go b/applyconfigurations/resource/v1alpha2/resourceclaimspec.go index 0c73e64e9e..2ecd95ec82 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclaimspec.go +++ b/applyconfigurations/resource/v1alpha2/resourceclaimspec.go @@ -22,7 +22,7 @@ import ( resourcev1alpha2 "k8s.io/api/resource/v1alpha2" ) -// ResourceClaimSpecApplyConfiguration represents an declarative configuration of the ResourceClaimSpec type for use +// ResourceClaimSpecApplyConfiguration represents a declarative configuration of the ResourceClaimSpec type for use // with apply. type ResourceClaimSpecApplyConfiguration struct { ResourceClassName *string `json:"resourceClassName,omitempty"` @@ -30,7 +30,7 @@ type ResourceClaimSpecApplyConfiguration struct { AllocationMode *resourcev1alpha2.AllocationMode `json:"allocationMode,omitempty"` } -// ResourceClaimSpecApplyConfiguration constructs an declarative configuration of the ResourceClaimSpec type for use with +// ResourceClaimSpecApplyConfiguration constructs a declarative configuration of the ResourceClaimSpec type for use with // apply. func ResourceClaimSpec() *ResourceClaimSpecApplyConfiguration { return &ResourceClaimSpecApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/resourceclaimstatus.go b/applyconfigurations/resource/v1alpha2/resourceclaimstatus.go index c6fa610906..635a4c4dc2 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclaimstatus.go +++ b/applyconfigurations/resource/v1alpha2/resourceclaimstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v1alpha2 -// ResourceClaimStatusApplyConfiguration represents an declarative configuration of the ResourceClaimStatus type for use +// ResourceClaimStatusApplyConfiguration represents a declarative configuration of the ResourceClaimStatus type for use // with apply. type ResourceClaimStatusApplyConfiguration struct { DriverName *string `json:"driverName,omitempty"` @@ -27,7 +27,7 @@ type ResourceClaimStatusApplyConfiguration struct { DeallocationRequested *bool `json:"deallocationRequested,omitempty"` } -// ResourceClaimStatusApplyConfiguration constructs an declarative configuration of the ResourceClaimStatus type for use with +// ResourceClaimStatusApplyConfiguration constructs a declarative configuration of the ResourceClaimStatus type for use with // apply. func ResourceClaimStatus() *ResourceClaimStatusApplyConfiguration { return &ResourceClaimStatusApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/resourceclaimtemplate.go b/applyconfigurations/resource/v1alpha2/resourceclaimtemplate.go index 213b6cf01b..0ee0ae36e0 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclaimtemplate.go +++ b/applyconfigurations/resource/v1alpha2/resourceclaimtemplate.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ResourceClaimTemplateApplyConfiguration represents an declarative configuration of the ResourceClaimTemplate type for use +// ResourceClaimTemplateApplyConfiguration represents a declarative configuration of the ResourceClaimTemplate type for use // with apply. type ResourceClaimTemplateApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type ResourceClaimTemplateApplyConfiguration struct { Spec *ResourceClaimTemplateSpecApplyConfiguration `json:"spec,omitempty"` } -// ResourceClaimTemplate constructs an declarative configuration of the ResourceClaimTemplate type for use with +// ResourceClaimTemplate constructs a declarative configuration of the ResourceClaimTemplate type for use with // apply. func ResourceClaimTemplate(name, namespace string) *ResourceClaimTemplateApplyConfiguration { b := &ResourceClaimTemplateApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/resourceclaimtemplatespec.go b/applyconfigurations/resource/v1alpha2/resourceclaimtemplatespec.go index 90efefc203..334de324e2 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclaimtemplatespec.go +++ b/applyconfigurations/resource/v1alpha2/resourceclaimtemplatespec.go @@ -24,14 +24,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ResourceClaimTemplateSpecApplyConfiguration represents an declarative configuration of the ResourceClaimTemplateSpec type for use +// ResourceClaimTemplateSpecApplyConfiguration represents a declarative configuration of the ResourceClaimTemplateSpec type for use // with apply. type ResourceClaimTemplateSpecApplyConfiguration struct { *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` Spec *ResourceClaimSpecApplyConfiguration `json:"spec,omitempty"` } -// ResourceClaimTemplateSpecApplyConfiguration constructs an declarative configuration of the ResourceClaimTemplateSpec type for use with +// ResourceClaimTemplateSpecApplyConfiguration constructs a declarative configuration of the ResourceClaimTemplateSpec type for use with // apply. func ResourceClaimTemplateSpec() *ResourceClaimTemplateSpecApplyConfiguration { return &ResourceClaimTemplateSpecApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/resourceclass.go b/applyconfigurations/resource/v1alpha2/resourceclass.go index 7cab033c0f..cf559cfb22 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclass.go +++ b/applyconfigurations/resource/v1alpha2/resourceclass.go @@ -28,7 +28,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ResourceClassApplyConfiguration represents an declarative configuration of the ResourceClass type for use +// ResourceClassApplyConfiguration represents a declarative configuration of the ResourceClass type for use // with apply. type ResourceClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -39,7 +39,7 @@ type ResourceClassApplyConfiguration struct { StructuredParameters *bool `json:"structuredParameters,omitempty"` } -// ResourceClass constructs an declarative configuration of the ResourceClass type for use with +// ResourceClass constructs a declarative configuration of the ResourceClass type for use with // apply. func ResourceClass(name string) *ResourceClassApplyConfiguration { b := &ResourceClassApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/resourceclassparameters.go b/applyconfigurations/resource/v1alpha2/resourceclassparameters.go index 2eda764343..e09b1ed4e0 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclassparameters.go +++ b/applyconfigurations/resource/v1alpha2/resourceclassparameters.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ResourceClassParametersApplyConfiguration represents an declarative configuration of the ResourceClassParameters type for use +// ResourceClassParametersApplyConfiguration represents a declarative configuration of the ResourceClassParameters type for use // with apply. type ResourceClassParametersApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +37,7 @@ type ResourceClassParametersApplyConfiguration struct { Filters []ResourceFilterApplyConfiguration `json:"filters,omitempty"` } -// ResourceClassParameters constructs an declarative configuration of the ResourceClassParameters type for use with +// ResourceClassParameters constructs a declarative configuration of the ResourceClassParameters type for use with // apply. func ResourceClassParameters(name, namespace string) *ResourceClassParametersApplyConfiguration { b := &ResourceClassParametersApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/resourceclassparametersreference.go b/applyconfigurations/resource/v1alpha2/resourceclassparametersreference.go index d67e4d3977..052d7365e0 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclassparametersreference.go +++ b/applyconfigurations/resource/v1alpha2/resourceclassparametersreference.go @@ -18,7 +18,7 @@ limitations under the License. package v1alpha2 -// ResourceClassParametersReferenceApplyConfiguration represents an declarative configuration of the ResourceClassParametersReference type for use +// ResourceClassParametersReferenceApplyConfiguration represents a declarative configuration of the ResourceClassParametersReference type for use // with apply. type ResourceClassParametersReferenceApplyConfiguration struct { APIGroup *string `json:"apiGroup,omitempty"` @@ -27,7 +27,7 @@ type ResourceClassParametersReferenceApplyConfiguration struct { Namespace *string `json:"namespace,omitempty"` } -// ResourceClassParametersReferenceApplyConfiguration constructs an declarative configuration of the ResourceClassParametersReference type for use with +// ResourceClassParametersReferenceApplyConfiguration constructs a declarative configuration of the ResourceClassParametersReference type for use with // apply. func ResourceClassParametersReference() *ResourceClassParametersReferenceApplyConfiguration { return &ResourceClassParametersReferenceApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/resourcefilter.go b/applyconfigurations/resource/v1alpha2/resourcefilter.go index 15371b44a9..1617275f0e 100644 --- a/applyconfigurations/resource/v1alpha2/resourcefilter.go +++ b/applyconfigurations/resource/v1alpha2/resourcefilter.go @@ -18,14 +18,14 @@ limitations under the License. package v1alpha2 -// ResourceFilterApplyConfiguration represents an declarative configuration of the ResourceFilter type for use +// ResourceFilterApplyConfiguration represents a declarative configuration of the ResourceFilter type for use // with apply. type ResourceFilterApplyConfiguration struct { DriverName *string `json:"driverName,omitempty"` ResourceFilterModelApplyConfiguration `json:",inline"` } -// ResourceFilterApplyConfiguration constructs an declarative configuration of the ResourceFilter type for use with +// ResourceFilterApplyConfiguration constructs a declarative configuration of the ResourceFilter type for use with // apply. func ResourceFilter() *ResourceFilterApplyConfiguration { return &ResourceFilterApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/resourcefiltermodel.go b/applyconfigurations/resource/v1alpha2/resourcefiltermodel.go index 4f8d138f71..648d319d46 100644 --- a/applyconfigurations/resource/v1alpha2/resourcefiltermodel.go +++ b/applyconfigurations/resource/v1alpha2/resourcefiltermodel.go @@ -18,13 +18,13 @@ limitations under the License. package v1alpha2 -// ResourceFilterModelApplyConfiguration represents an declarative configuration of the ResourceFilterModel type for use +// ResourceFilterModelApplyConfiguration represents a declarative configuration of the ResourceFilterModel type for use // with apply. type ResourceFilterModelApplyConfiguration struct { NamedResources *NamedResourcesFilterApplyConfiguration `json:"namedResources,omitempty"` } -// ResourceFilterModelApplyConfiguration constructs an declarative configuration of the ResourceFilterModel type for use with +// ResourceFilterModelApplyConfiguration constructs a declarative configuration of the ResourceFilterModel type for use with // apply. func ResourceFilterModel() *ResourceFilterModelApplyConfiguration { return &ResourceFilterModelApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/resourcehandle.go b/applyconfigurations/resource/v1alpha2/resourcehandle.go index b4f3da735d..9a8410d9ed 100644 --- a/applyconfigurations/resource/v1alpha2/resourcehandle.go +++ b/applyconfigurations/resource/v1alpha2/resourcehandle.go @@ -18,7 +18,7 @@ limitations under the License. package v1alpha2 -// ResourceHandleApplyConfiguration represents an declarative configuration of the ResourceHandle type for use +// ResourceHandleApplyConfiguration represents a declarative configuration of the ResourceHandle type for use // with apply. type ResourceHandleApplyConfiguration struct { DriverName *string `json:"driverName,omitempty"` @@ -26,7 +26,7 @@ type ResourceHandleApplyConfiguration struct { StructuredData *StructuredResourceHandleApplyConfiguration `json:"structuredData,omitempty"` } -// ResourceHandleApplyConfiguration constructs an declarative configuration of the ResourceHandle type for use with +// ResourceHandleApplyConfiguration constructs a declarative configuration of the ResourceHandle type for use with // apply. func ResourceHandle() *ResourceHandleApplyConfiguration { return &ResourceHandleApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/resourcemodel.go b/applyconfigurations/resource/v1alpha2/resourcemodel.go index 8ad7bdf230..b3c8540d4f 100644 --- a/applyconfigurations/resource/v1alpha2/resourcemodel.go +++ b/applyconfigurations/resource/v1alpha2/resourcemodel.go @@ -18,13 +18,13 @@ limitations under the License. package v1alpha2 -// ResourceModelApplyConfiguration represents an declarative configuration of the ResourceModel type for use +// ResourceModelApplyConfiguration represents a declarative configuration of the ResourceModel type for use // with apply. type ResourceModelApplyConfiguration struct { NamedResources *NamedResourcesResourcesApplyConfiguration `json:"namedResources,omitempty"` } -// ResourceModelApplyConfiguration constructs an declarative configuration of the ResourceModel type for use with +// ResourceModelApplyConfiguration constructs a declarative configuration of the ResourceModel type for use with // apply. func ResourceModel() *ResourceModelApplyConfiguration { return &ResourceModelApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/resourcerequest.go b/applyconfigurations/resource/v1alpha2/resourcerequest.go index 0243d06f89..b93ed85402 100644 --- a/applyconfigurations/resource/v1alpha2/resourcerequest.go +++ b/applyconfigurations/resource/v1alpha2/resourcerequest.go @@ -22,14 +22,14 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) -// ResourceRequestApplyConfiguration represents an declarative configuration of the ResourceRequest type for use +// ResourceRequestApplyConfiguration represents a declarative configuration of the ResourceRequest type for use // with apply. type ResourceRequestApplyConfiguration struct { VendorParameters *runtime.RawExtension `json:"vendorParameters,omitempty"` ResourceRequestModelApplyConfiguration `json:",inline"` } -// ResourceRequestApplyConfiguration constructs an declarative configuration of the ResourceRequest type for use with +// ResourceRequestApplyConfiguration constructs a declarative configuration of the ResourceRequest type for use with // apply. func ResourceRequest() *ResourceRequestApplyConfiguration { return &ResourceRequestApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/resourcerequestmodel.go b/applyconfigurations/resource/v1alpha2/resourcerequestmodel.go index 35bd1d88fe..b0e86483eb 100644 --- a/applyconfigurations/resource/v1alpha2/resourcerequestmodel.go +++ b/applyconfigurations/resource/v1alpha2/resourcerequestmodel.go @@ -18,13 +18,13 @@ limitations under the License. package v1alpha2 -// ResourceRequestModelApplyConfiguration represents an declarative configuration of the ResourceRequestModel type for use +// ResourceRequestModelApplyConfiguration represents a declarative configuration of the ResourceRequestModel type for use // with apply. type ResourceRequestModelApplyConfiguration struct { NamedResources *NamedResourcesRequestApplyConfiguration `json:"namedResources,omitempty"` } -// ResourceRequestModelApplyConfiguration constructs an declarative configuration of the ResourceRequestModel type for use with +// ResourceRequestModelApplyConfiguration constructs a declarative configuration of the ResourceRequestModel type for use with // apply. func ResourceRequestModel() *ResourceRequestModelApplyConfiguration { return &ResourceRequestModelApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/resourceslice.go b/applyconfigurations/resource/v1alpha2/resourceslice.go index 447afe2dfc..90cde67d7b 100644 --- a/applyconfigurations/resource/v1alpha2/resourceslice.go +++ b/applyconfigurations/resource/v1alpha2/resourceslice.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ResourceSliceApplyConfiguration represents an declarative configuration of the ResourceSlice type for use +// ResourceSliceApplyConfiguration represents a declarative configuration of the ResourceSlice type for use // with apply. type ResourceSliceApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -37,7 +37,7 @@ type ResourceSliceApplyConfiguration struct { ResourceModelApplyConfiguration `json:",inline"` } -// ResourceSlice constructs an declarative configuration of the ResourceSlice type for use with +// ResourceSlice constructs a declarative configuration of the ResourceSlice type for use with // apply. func ResourceSlice(name string) *ResourceSliceApplyConfiguration { b := &ResourceSliceApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/structuredresourcehandle.go b/applyconfigurations/resource/v1alpha2/structuredresourcehandle.go index e6efcbfef3..10794f81f2 100644 --- a/applyconfigurations/resource/v1alpha2/structuredresourcehandle.go +++ b/applyconfigurations/resource/v1alpha2/structuredresourcehandle.go @@ -22,7 +22,7 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) -// StructuredResourceHandleApplyConfiguration represents an declarative configuration of the StructuredResourceHandle type for use +// StructuredResourceHandleApplyConfiguration represents a declarative configuration of the StructuredResourceHandle type for use // with apply. type StructuredResourceHandleApplyConfiguration struct { VendorClassParameters *runtime.RawExtension `json:"vendorClassParameters,omitempty"` @@ -31,7 +31,7 @@ type StructuredResourceHandleApplyConfiguration struct { Results []DriverAllocationResultApplyConfiguration `json:"results,omitempty"` } -// StructuredResourceHandleApplyConfiguration constructs an declarative configuration of the StructuredResourceHandle type for use with +// StructuredResourceHandleApplyConfiguration constructs a declarative configuration of the StructuredResourceHandle type for use with // apply. func StructuredResourceHandle() *StructuredResourceHandleApplyConfiguration { return &StructuredResourceHandleApplyConfiguration{} diff --git a/applyconfigurations/resource/v1alpha2/vendorparameters.go b/applyconfigurations/resource/v1alpha2/vendorparameters.go index f7a8ff9ece..851c7cdfba 100644 --- a/applyconfigurations/resource/v1alpha2/vendorparameters.go +++ b/applyconfigurations/resource/v1alpha2/vendorparameters.go @@ -22,14 +22,14 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) -// VendorParametersApplyConfiguration represents an declarative configuration of the VendorParameters type for use +// VendorParametersApplyConfiguration represents a declarative configuration of the VendorParameters type for use // with apply. type VendorParametersApplyConfiguration struct { DriverName *string `json:"driverName,omitempty"` Parameters *runtime.RawExtension `json:"parameters,omitempty"` } -// VendorParametersApplyConfiguration constructs an declarative configuration of the VendorParameters type for use with +// VendorParametersApplyConfiguration constructs a declarative configuration of the VendorParameters type for use with // apply. func VendorParameters() *VendorParametersApplyConfiguration { return &VendorParametersApplyConfiguration{} diff --git a/applyconfigurations/scheduling/v1/priorityclass.go b/applyconfigurations/scheduling/v1/priorityclass.go index 62f144a4ff..f2f135abc6 100644 --- a/applyconfigurations/scheduling/v1/priorityclass.go +++ b/applyconfigurations/scheduling/v1/priorityclass.go @@ -28,7 +28,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PriorityClassApplyConfiguration represents an declarative configuration of the PriorityClass type for use +// PriorityClassApplyConfiguration represents a declarative configuration of the PriorityClass type for use // with apply. type PriorityClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -39,7 +39,7 @@ type PriorityClassApplyConfiguration struct { PreemptionPolicy *corev1.PreemptionPolicy `json:"preemptionPolicy,omitempty"` } -// PriorityClass constructs an declarative configuration of the PriorityClass type for use with +// PriorityClass constructs a declarative configuration of the PriorityClass type for use with // apply. func PriorityClass(name string) *PriorityClassApplyConfiguration { b := &PriorityClassApplyConfiguration{} diff --git a/applyconfigurations/scheduling/v1alpha1/priorityclass.go b/applyconfigurations/scheduling/v1alpha1/priorityclass.go index dbf207de93..098517675e 100644 --- a/applyconfigurations/scheduling/v1alpha1/priorityclass.go +++ b/applyconfigurations/scheduling/v1alpha1/priorityclass.go @@ -28,7 +28,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PriorityClassApplyConfiguration represents an declarative configuration of the PriorityClass type for use +// PriorityClassApplyConfiguration represents a declarative configuration of the PriorityClass type for use // with apply. type PriorityClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -39,7 +39,7 @@ type PriorityClassApplyConfiguration struct { PreemptionPolicy *corev1.PreemptionPolicy `json:"preemptionPolicy,omitempty"` } -// PriorityClass constructs an declarative configuration of the PriorityClass type for use with +// PriorityClass constructs a declarative configuration of the PriorityClass type for use with // apply. func PriorityClass(name string) *PriorityClassApplyConfiguration { b := &PriorityClassApplyConfiguration{} diff --git a/applyconfigurations/scheduling/v1beta1/priorityclass.go b/applyconfigurations/scheduling/v1beta1/priorityclass.go index 9696f44bf1..075862fe3e 100644 --- a/applyconfigurations/scheduling/v1beta1/priorityclass.go +++ b/applyconfigurations/scheduling/v1beta1/priorityclass.go @@ -28,7 +28,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// PriorityClassApplyConfiguration represents an declarative configuration of the PriorityClass type for use +// PriorityClassApplyConfiguration represents a declarative configuration of the PriorityClass type for use // with apply. type PriorityClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -39,7 +39,7 @@ type PriorityClassApplyConfiguration struct { PreemptionPolicy *corev1.PreemptionPolicy `json:"preemptionPolicy,omitempty"` } -// PriorityClass constructs an declarative configuration of the PriorityClass type for use with +// PriorityClass constructs a declarative configuration of the PriorityClass type for use with // apply. func PriorityClass(name string) *PriorityClassApplyConfiguration { b := &PriorityClassApplyConfiguration{} diff --git a/applyconfigurations/storage/v1/csidriver.go b/applyconfigurations/storage/v1/csidriver.go index a00157a1dc..39d8357029 100644 --- a/applyconfigurations/storage/v1/csidriver.go +++ b/applyconfigurations/storage/v1/csidriver.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// CSIDriverApplyConfiguration represents an declarative configuration of the CSIDriver type for use +// CSIDriverApplyConfiguration represents a declarative configuration of the CSIDriver type for use // with apply. type CSIDriverApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type CSIDriverApplyConfiguration struct { Spec *CSIDriverSpecApplyConfiguration `json:"spec,omitempty"` } -// CSIDriver constructs an declarative configuration of the CSIDriver type for use with +// CSIDriver constructs a declarative configuration of the CSIDriver type for use with // apply. func CSIDriver(name string) *CSIDriverApplyConfiguration { b := &CSIDriverApplyConfiguration{} diff --git a/applyconfigurations/storage/v1/csidriverspec.go b/applyconfigurations/storage/v1/csidriverspec.go index a1ef00656b..b2dcb0feea 100644 --- a/applyconfigurations/storage/v1/csidriverspec.go +++ b/applyconfigurations/storage/v1/csidriverspec.go @@ -22,7 +22,7 @@ import ( v1 "k8s.io/api/storage/v1" ) -// CSIDriverSpecApplyConfiguration represents an declarative configuration of the CSIDriverSpec type for use +// CSIDriverSpecApplyConfiguration represents a declarative configuration of the CSIDriverSpec type for use // with apply. type CSIDriverSpecApplyConfiguration struct { AttachRequired *bool `json:"attachRequired,omitempty"` @@ -35,7 +35,7 @@ type CSIDriverSpecApplyConfiguration struct { SELinuxMount *bool `json:"seLinuxMount,omitempty"` } -// CSIDriverSpecApplyConfiguration constructs an declarative configuration of the CSIDriverSpec type for use with +// CSIDriverSpecApplyConfiguration constructs a declarative configuration of the CSIDriverSpec type for use with // apply. func CSIDriverSpec() *CSIDriverSpecApplyConfiguration { return &CSIDriverSpecApplyConfiguration{} diff --git a/applyconfigurations/storage/v1/csinode.go b/applyconfigurations/storage/v1/csinode.go index 22755e529d..8a53e7984e 100644 --- a/applyconfigurations/storage/v1/csinode.go +++ b/applyconfigurations/storage/v1/csinode.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// CSINodeApplyConfiguration represents an declarative configuration of the CSINode type for use +// CSINodeApplyConfiguration represents a declarative configuration of the CSINode type for use // with apply. type CSINodeApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type CSINodeApplyConfiguration struct { Spec *CSINodeSpecApplyConfiguration `json:"spec,omitempty"` } -// CSINode constructs an declarative configuration of the CSINode type for use with +// CSINode constructs a declarative configuration of the CSINode type for use with // apply. func CSINode(name string) *CSINodeApplyConfiguration { b := &CSINodeApplyConfiguration{} diff --git a/applyconfigurations/storage/v1/csinodedriver.go b/applyconfigurations/storage/v1/csinodedriver.go index 6219ef1151..8c69e435e7 100644 --- a/applyconfigurations/storage/v1/csinodedriver.go +++ b/applyconfigurations/storage/v1/csinodedriver.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// CSINodeDriverApplyConfiguration represents an declarative configuration of the CSINodeDriver type for use +// CSINodeDriverApplyConfiguration represents a declarative configuration of the CSINodeDriver type for use // with apply. type CSINodeDriverApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -27,7 +27,7 @@ type CSINodeDriverApplyConfiguration struct { Allocatable *VolumeNodeResourcesApplyConfiguration `json:"allocatable,omitempty"` } -// CSINodeDriverApplyConfiguration constructs an declarative configuration of the CSINodeDriver type for use with +// CSINodeDriverApplyConfiguration constructs a declarative configuration of the CSINodeDriver type for use with // apply. func CSINodeDriver() *CSINodeDriverApplyConfiguration { return &CSINodeDriverApplyConfiguration{} diff --git a/applyconfigurations/storage/v1/csinodespec.go b/applyconfigurations/storage/v1/csinodespec.go index 30d1d4546b..21d3ba7ccc 100644 --- a/applyconfigurations/storage/v1/csinodespec.go +++ b/applyconfigurations/storage/v1/csinodespec.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// CSINodeSpecApplyConfiguration represents an declarative configuration of the CSINodeSpec type for use +// CSINodeSpecApplyConfiguration represents a declarative configuration of the CSINodeSpec type for use // with apply. type CSINodeSpecApplyConfiguration struct { Drivers []CSINodeDriverApplyConfiguration `json:"drivers,omitempty"` } -// CSINodeSpecApplyConfiguration constructs an declarative configuration of the CSINodeSpec type for use with +// CSINodeSpecApplyConfiguration constructs a declarative configuration of the CSINodeSpec type for use with // apply. func CSINodeSpec() *CSINodeSpecApplyConfiguration { return &CSINodeSpecApplyConfiguration{} diff --git a/applyconfigurations/storage/v1/csistoragecapacity.go b/applyconfigurations/storage/v1/csistoragecapacity.go index 34ebcd796f..0e293248d9 100644 --- a/applyconfigurations/storage/v1/csistoragecapacity.go +++ b/applyconfigurations/storage/v1/csistoragecapacity.go @@ -28,7 +28,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// CSIStorageCapacityApplyConfiguration represents an declarative configuration of the CSIStorageCapacity type for use +// CSIStorageCapacityApplyConfiguration represents a declarative configuration of the CSIStorageCapacity type for use // with apply. type CSIStorageCapacityApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -39,7 +39,7 @@ type CSIStorageCapacityApplyConfiguration struct { MaximumVolumeSize *resource.Quantity `json:"maximumVolumeSize,omitempty"` } -// CSIStorageCapacity constructs an declarative configuration of the CSIStorageCapacity type for use with +// CSIStorageCapacity constructs a declarative configuration of the CSIStorageCapacity type for use with // apply. func CSIStorageCapacity(name, namespace string) *CSIStorageCapacityApplyConfiguration { b := &CSIStorageCapacityApplyConfiguration{} diff --git a/applyconfigurations/storage/v1/storageclass.go b/applyconfigurations/storage/v1/storageclass.go index 8c2abac2ea..26d70bc8b0 100644 --- a/applyconfigurations/storage/v1/storageclass.go +++ b/applyconfigurations/storage/v1/storageclass.go @@ -29,7 +29,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// StorageClassApplyConfiguration represents an declarative configuration of the StorageClass type for use +// StorageClassApplyConfiguration represents a declarative configuration of the StorageClass type for use // with apply. type StorageClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -43,7 +43,7 @@ type StorageClassApplyConfiguration struct { AllowedTopologies []applyconfigurationscorev1.TopologySelectorTermApplyConfiguration `json:"allowedTopologies,omitempty"` } -// StorageClass constructs an declarative configuration of the StorageClass type for use with +// StorageClass constructs a declarative configuration of the StorageClass type for use with // apply. func StorageClass(name string) *StorageClassApplyConfiguration { b := &StorageClassApplyConfiguration{} diff --git a/applyconfigurations/storage/v1/tokenrequest.go b/applyconfigurations/storage/v1/tokenrequest.go index 6665a1ff2e..77b96db2f0 100644 --- a/applyconfigurations/storage/v1/tokenrequest.go +++ b/applyconfigurations/storage/v1/tokenrequest.go @@ -18,14 +18,14 @@ limitations under the License. package v1 -// TokenRequestApplyConfiguration represents an declarative configuration of the TokenRequest type for use +// TokenRequestApplyConfiguration represents a declarative configuration of the TokenRequest type for use // with apply. type TokenRequestApplyConfiguration struct { Audience *string `json:"audience,omitempty"` ExpirationSeconds *int64 `json:"expirationSeconds,omitempty"` } -// TokenRequestApplyConfiguration constructs an declarative configuration of the TokenRequest type for use with +// TokenRequestApplyConfiguration constructs a declarative configuration of the TokenRequest type for use with // apply. func TokenRequest() *TokenRequestApplyConfiguration { return &TokenRequestApplyConfiguration{} diff --git a/applyconfigurations/storage/v1/volumeattachment.go b/applyconfigurations/storage/v1/volumeattachment.go index 483cf595b4..72c351208c 100644 --- a/applyconfigurations/storage/v1/volumeattachment.go +++ b/applyconfigurations/storage/v1/volumeattachment.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// VolumeAttachmentApplyConfiguration represents an declarative configuration of the VolumeAttachment type for use +// VolumeAttachmentApplyConfiguration represents a declarative configuration of the VolumeAttachment type for use // with apply. type VolumeAttachmentApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type VolumeAttachmentApplyConfiguration struct { Status *VolumeAttachmentStatusApplyConfiguration `json:"status,omitempty"` } -// VolumeAttachment constructs an declarative configuration of the VolumeAttachment type for use with +// VolumeAttachment constructs a declarative configuration of the VolumeAttachment type for use with // apply. func VolumeAttachment(name string) *VolumeAttachmentApplyConfiguration { b := &VolumeAttachmentApplyConfiguration{} diff --git a/applyconfigurations/storage/v1/volumeattachmentsource.go b/applyconfigurations/storage/v1/volumeattachmentsource.go index 2bf3f7720d..4778553986 100644 --- a/applyconfigurations/storage/v1/volumeattachmentsource.go +++ b/applyconfigurations/storage/v1/volumeattachmentsource.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" ) -// VolumeAttachmentSourceApplyConfiguration represents an declarative configuration of the VolumeAttachmentSource type for use +// VolumeAttachmentSourceApplyConfiguration represents a declarative configuration of the VolumeAttachmentSource type for use // with apply. type VolumeAttachmentSourceApplyConfiguration struct { PersistentVolumeName *string `json:"persistentVolumeName,omitempty"` InlineVolumeSpec *v1.PersistentVolumeSpecApplyConfiguration `json:"inlineVolumeSpec,omitempty"` } -// VolumeAttachmentSourceApplyConfiguration constructs an declarative configuration of the VolumeAttachmentSource type for use with +// VolumeAttachmentSourceApplyConfiguration constructs a declarative configuration of the VolumeAttachmentSource type for use with // apply. func VolumeAttachmentSource() *VolumeAttachmentSourceApplyConfiguration { return &VolumeAttachmentSourceApplyConfiguration{} diff --git a/applyconfigurations/storage/v1/volumeattachmentspec.go b/applyconfigurations/storage/v1/volumeattachmentspec.go index a55f7c8ea1..8965392352 100644 --- a/applyconfigurations/storage/v1/volumeattachmentspec.go +++ b/applyconfigurations/storage/v1/volumeattachmentspec.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// VolumeAttachmentSpecApplyConfiguration represents an declarative configuration of the VolumeAttachmentSpec type for use +// VolumeAttachmentSpecApplyConfiguration represents a declarative configuration of the VolumeAttachmentSpec type for use // with apply. type VolumeAttachmentSpecApplyConfiguration struct { Attacher *string `json:"attacher,omitempty"` @@ -26,7 +26,7 @@ type VolumeAttachmentSpecApplyConfiguration struct { NodeName *string `json:"nodeName,omitempty"` } -// VolumeAttachmentSpecApplyConfiguration constructs an declarative configuration of the VolumeAttachmentSpec type for use with +// VolumeAttachmentSpecApplyConfiguration constructs a declarative configuration of the VolumeAttachmentSpec type for use with // apply. func VolumeAttachmentSpec() *VolumeAttachmentSpecApplyConfiguration { return &VolumeAttachmentSpecApplyConfiguration{} diff --git a/applyconfigurations/storage/v1/volumeattachmentstatus.go b/applyconfigurations/storage/v1/volumeattachmentstatus.go index 015b08e6eb..14293376d0 100644 --- a/applyconfigurations/storage/v1/volumeattachmentstatus.go +++ b/applyconfigurations/storage/v1/volumeattachmentstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v1 -// VolumeAttachmentStatusApplyConfiguration represents an declarative configuration of the VolumeAttachmentStatus type for use +// VolumeAttachmentStatusApplyConfiguration represents a declarative configuration of the VolumeAttachmentStatus type for use // with apply. type VolumeAttachmentStatusApplyConfiguration struct { Attached *bool `json:"attached,omitempty"` @@ -27,7 +27,7 @@ type VolumeAttachmentStatusApplyConfiguration struct { DetachError *VolumeErrorApplyConfiguration `json:"detachError,omitempty"` } -// VolumeAttachmentStatusApplyConfiguration constructs an declarative configuration of the VolumeAttachmentStatus type for use with +// VolumeAttachmentStatusApplyConfiguration constructs a declarative configuration of the VolumeAttachmentStatus type for use with // apply. func VolumeAttachmentStatus() *VolumeAttachmentStatusApplyConfiguration { return &VolumeAttachmentStatusApplyConfiguration{} diff --git a/applyconfigurations/storage/v1/volumeerror.go b/applyconfigurations/storage/v1/volumeerror.go index 4bf829f8a9..039e5f32bf 100644 --- a/applyconfigurations/storage/v1/volumeerror.go +++ b/applyconfigurations/storage/v1/volumeerror.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// VolumeErrorApplyConfiguration represents an declarative configuration of the VolumeError type for use +// VolumeErrorApplyConfiguration represents a declarative configuration of the VolumeError type for use // with apply. type VolumeErrorApplyConfiguration struct { Time *v1.Time `json:"time,omitempty"` Message *string `json:"message,omitempty"` } -// VolumeErrorApplyConfiguration constructs an declarative configuration of the VolumeError type for use with +// VolumeErrorApplyConfiguration constructs a declarative configuration of the VolumeError type for use with // apply. func VolumeError() *VolumeErrorApplyConfiguration { return &VolumeErrorApplyConfiguration{} diff --git a/applyconfigurations/storage/v1/volumenoderesources.go b/applyconfigurations/storage/v1/volumenoderesources.go index 3c5fd3dc29..735853c48b 100644 --- a/applyconfigurations/storage/v1/volumenoderesources.go +++ b/applyconfigurations/storage/v1/volumenoderesources.go @@ -18,13 +18,13 @@ limitations under the License. package v1 -// VolumeNodeResourcesApplyConfiguration represents an declarative configuration of the VolumeNodeResources type for use +// VolumeNodeResourcesApplyConfiguration represents a declarative configuration of the VolumeNodeResources type for use // with apply. type VolumeNodeResourcesApplyConfiguration struct { Count *int32 `json:"count,omitempty"` } -// VolumeNodeResourcesApplyConfiguration constructs an declarative configuration of the VolumeNodeResources type for use with +// VolumeNodeResourcesApplyConfiguration constructs a declarative configuration of the VolumeNodeResources type for use with // apply. func VolumeNodeResources() *VolumeNodeResourcesApplyConfiguration { return &VolumeNodeResourcesApplyConfiguration{} diff --git a/applyconfigurations/storage/v1alpha1/csistoragecapacity.go b/applyconfigurations/storage/v1alpha1/csistoragecapacity.go index 6a28d857ac..aa949e28c7 100644 --- a/applyconfigurations/storage/v1alpha1/csistoragecapacity.go +++ b/applyconfigurations/storage/v1alpha1/csistoragecapacity.go @@ -28,7 +28,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// CSIStorageCapacityApplyConfiguration represents an declarative configuration of the CSIStorageCapacity type for use +// CSIStorageCapacityApplyConfiguration represents a declarative configuration of the CSIStorageCapacity type for use // with apply. type CSIStorageCapacityApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -39,7 +39,7 @@ type CSIStorageCapacityApplyConfiguration struct { MaximumVolumeSize *resource.Quantity `json:"maximumVolumeSize,omitempty"` } -// CSIStorageCapacity constructs an declarative configuration of the CSIStorageCapacity type for use with +// CSIStorageCapacity constructs a declarative configuration of the CSIStorageCapacity type for use with // apply. func CSIStorageCapacity(name, namespace string) *CSIStorageCapacityApplyConfiguration { b := &CSIStorageCapacityApplyConfiguration{} diff --git a/applyconfigurations/storage/v1alpha1/volumeattachment.go b/applyconfigurations/storage/v1alpha1/volumeattachment.go index 770d1e166f..9648621ac3 100644 --- a/applyconfigurations/storage/v1alpha1/volumeattachment.go +++ b/applyconfigurations/storage/v1alpha1/volumeattachment.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// VolumeAttachmentApplyConfiguration represents an declarative configuration of the VolumeAttachment type for use +// VolumeAttachmentApplyConfiguration represents a declarative configuration of the VolumeAttachment type for use // with apply. type VolumeAttachmentApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type VolumeAttachmentApplyConfiguration struct { Status *VolumeAttachmentStatusApplyConfiguration `json:"status,omitempty"` } -// VolumeAttachment constructs an declarative configuration of the VolumeAttachment type for use with +// VolumeAttachment constructs a declarative configuration of the VolumeAttachment type for use with // apply. func VolumeAttachment(name string) *VolumeAttachmentApplyConfiguration { b := &VolumeAttachmentApplyConfiguration{} diff --git a/applyconfigurations/storage/v1alpha1/volumeattachmentsource.go b/applyconfigurations/storage/v1alpha1/volumeattachmentsource.go index 82872cc355..be7da5dd15 100644 --- a/applyconfigurations/storage/v1alpha1/volumeattachmentsource.go +++ b/applyconfigurations/storage/v1alpha1/volumeattachmentsource.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" ) -// VolumeAttachmentSourceApplyConfiguration represents an declarative configuration of the VolumeAttachmentSource type for use +// VolumeAttachmentSourceApplyConfiguration represents a declarative configuration of the VolumeAttachmentSource type for use // with apply. type VolumeAttachmentSourceApplyConfiguration struct { PersistentVolumeName *string `json:"persistentVolumeName,omitempty"` InlineVolumeSpec *v1.PersistentVolumeSpecApplyConfiguration `json:"inlineVolumeSpec,omitempty"` } -// VolumeAttachmentSourceApplyConfiguration constructs an declarative configuration of the VolumeAttachmentSource type for use with +// VolumeAttachmentSourceApplyConfiguration constructs a declarative configuration of the VolumeAttachmentSource type for use with // apply. func VolumeAttachmentSource() *VolumeAttachmentSourceApplyConfiguration { return &VolumeAttachmentSourceApplyConfiguration{} diff --git a/applyconfigurations/storage/v1alpha1/volumeattachmentspec.go b/applyconfigurations/storage/v1alpha1/volumeattachmentspec.go index 2710ff8864..e97487a645 100644 --- a/applyconfigurations/storage/v1alpha1/volumeattachmentspec.go +++ b/applyconfigurations/storage/v1alpha1/volumeattachmentspec.go @@ -18,7 +18,7 @@ limitations under the License. package v1alpha1 -// VolumeAttachmentSpecApplyConfiguration represents an declarative configuration of the VolumeAttachmentSpec type for use +// VolumeAttachmentSpecApplyConfiguration represents a declarative configuration of the VolumeAttachmentSpec type for use // with apply. type VolumeAttachmentSpecApplyConfiguration struct { Attacher *string `json:"attacher,omitempty"` @@ -26,7 +26,7 @@ type VolumeAttachmentSpecApplyConfiguration struct { NodeName *string `json:"nodeName,omitempty"` } -// VolumeAttachmentSpecApplyConfiguration constructs an declarative configuration of the VolumeAttachmentSpec type for use with +// VolumeAttachmentSpecApplyConfiguration constructs a declarative configuration of the VolumeAttachmentSpec type for use with // apply. func VolumeAttachmentSpec() *VolumeAttachmentSpecApplyConfiguration { return &VolumeAttachmentSpecApplyConfiguration{} diff --git a/applyconfigurations/storage/v1alpha1/volumeattachmentstatus.go b/applyconfigurations/storage/v1alpha1/volumeattachmentstatus.go index 43803496e8..a287fc6b28 100644 --- a/applyconfigurations/storage/v1alpha1/volumeattachmentstatus.go +++ b/applyconfigurations/storage/v1alpha1/volumeattachmentstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v1alpha1 -// VolumeAttachmentStatusApplyConfiguration represents an declarative configuration of the VolumeAttachmentStatus type for use +// VolumeAttachmentStatusApplyConfiguration represents a declarative configuration of the VolumeAttachmentStatus type for use // with apply. type VolumeAttachmentStatusApplyConfiguration struct { Attached *bool `json:"attached,omitempty"` @@ -27,7 +27,7 @@ type VolumeAttachmentStatusApplyConfiguration struct { DetachError *VolumeErrorApplyConfiguration `json:"detachError,omitempty"` } -// VolumeAttachmentStatusApplyConfiguration constructs an declarative configuration of the VolumeAttachmentStatus type for use with +// VolumeAttachmentStatusApplyConfiguration constructs a declarative configuration of the VolumeAttachmentStatus type for use with // apply. func VolumeAttachmentStatus() *VolumeAttachmentStatusApplyConfiguration { return &VolumeAttachmentStatusApplyConfiguration{} diff --git a/applyconfigurations/storage/v1alpha1/volumeattributesclass.go b/applyconfigurations/storage/v1alpha1/volumeattributesclass.go index 566bca3288..f95bc55477 100644 --- a/applyconfigurations/storage/v1alpha1/volumeattributesclass.go +++ b/applyconfigurations/storage/v1alpha1/volumeattributesclass.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// VolumeAttributesClassApplyConfiguration represents an declarative configuration of the VolumeAttributesClass type for use +// VolumeAttributesClassApplyConfiguration represents a declarative configuration of the VolumeAttributesClass type for use // with apply. type VolumeAttributesClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type VolumeAttributesClassApplyConfiguration struct { Parameters map[string]string `json:"parameters,omitempty"` } -// VolumeAttributesClass constructs an declarative configuration of the VolumeAttributesClass type for use with +// VolumeAttributesClass constructs a declarative configuration of the VolumeAttributesClass type for use with // apply. func VolumeAttributesClass(name string) *VolumeAttributesClassApplyConfiguration { b := &VolumeAttributesClassApplyConfiguration{} diff --git a/applyconfigurations/storage/v1alpha1/volumeerror.go b/applyconfigurations/storage/v1alpha1/volumeerror.go index cbff16fd0c..ef8f6bbe64 100644 --- a/applyconfigurations/storage/v1alpha1/volumeerror.go +++ b/applyconfigurations/storage/v1alpha1/volumeerror.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// VolumeErrorApplyConfiguration represents an declarative configuration of the VolumeError type for use +// VolumeErrorApplyConfiguration represents a declarative configuration of the VolumeError type for use // with apply. type VolumeErrorApplyConfiguration struct { Time *v1.Time `json:"time,omitempty"` Message *string `json:"message,omitempty"` } -// VolumeErrorApplyConfiguration constructs an declarative configuration of the VolumeError type for use with +// VolumeErrorApplyConfiguration constructs a declarative configuration of the VolumeError type for use with // apply. func VolumeError() *VolumeErrorApplyConfiguration { return &VolumeErrorApplyConfiguration{} diff --git a/applyconfigurations/storage/v1beta1/csidriver.go b/applyconfigurations/storage/v1beta1/csidriver.go index 28393e8ed4..b9a807bd8a 100644 --- a/applyconfigurations/storage/v1beta1/csidriver.go +++ b/applyconfigurations/storage/v1beta1/csidriver.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// CSIDriverApplyConfiguration represents an declarative configuration of the CSIDriver type for use +// CSIDriverApplyConfiguration represents a declarative configuration of the CSIDriver type for use // with apply. type CSIDriverApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type CSIDriverApplyConfiguration struct { Spec *CSIDriverSpecApplyConfiguration `json:"spec,omitempty"` } -// CSIDriver constructs an declarative configuration of the CSIDriver type for use with +// CSIDriver constructs a declarative configuration of the CSIDriver type for use with // apply. func CSIDriver(name string) *CSIDriverApplyConfiguration { b := &CSIDriverApplyConfiguration{} diff --git a/applyconfigurations/storage/v1beta1/csidriverspec.go b/applyconfigurations/storage/v1beta1/csidriverspec.go index 6097a615be..5f4e068f0c 100644 --- a/applyconfigurations/storage/v1beta1/csidriverspec.go +++ b/applyconfigurations/storage/v1beta1/csidriverspec.go @@ -22,7 +22,7 @@ import ( v1beta1 "k8s.io/api/storage/v1beta1" ) -// CSIDriverSpecApplyConfiguration represents an declarative configuration of the CSIDriverSpec type for use +// CSIDriverSpecApplyConfiguration represents a declarative configuration of the CSIDriverSpec type for use // with apply. type CSIDriverSpecApplyConfiguration struct { AttachRequired *bool `json:"attachRequired,omitempty"` @@ -35,7 +35,7 @@ type CSIDriverSpecApplyConfiguration struct { SELinuxMount *bool `json:"seLinuxMount,omitempty"` } -// CSIDriverSpecApplyConfiguration constructs an declarative configuration of the CSIDriverSpec type for use with +// CSIDriverSpecApplyConfiguration constructs a declarative configuration of the CSIDriverSpec type for use with // apply. func CSIDriverSpec() *CSIDriverSpecApplyConfiguration { return &CSIDriverSpecApplyConfiguration{} diff --git a/applyconfigurations/storage/v1beta1/csinode.go b/applyconfigurations/storage/v1beta1/csinode.go index fb9f85bea3..af0f41cf0a 100644 --- a/applyconfigurations/storage/v1beta1/csinode.go +++ b/applyconfigurations/storage/v1beta1/csinode.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// CSINodeApplyConfiguration represents an declarative configuration of the CSINode type for use +// CSINodeApplyConfiguration represents a declarative configuration of the CSINode type for use // with apply. type CSINodeApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -35,7 +35,7 @@ type CSINodeApplyConfiguration struct { Spec *CSINodeSpecApplyConfiguration `json:"spec,omitempty"` } -// CSINode constructs an declarative configuration of the CSINode type for use with +// CSINode constructs a declarative configuration of the CSINode type for use with // apply. func CSINode(name string) *CSINodeApplyConfiguration { b := &CSINodeApplyConfiguration{} diff --git a/applyconfigurations/storage/v1beta1/csinodedriver.go b/applyconfigurations/storage/v1beta1/csinodedriver.go index 2c7de497b2..65ad771bb2 100644 --- a/applyconfigurations/storage/v1beta1/csinodedriver.go +++ b/applyconfigurations/storage/v1beta1/csinodedriver.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// CSINodeDriverApplyConfiguration represents an declarative configuration of the CSINodeDriver type for use +// CSINodeDriverApplyConfiguration represents a declarative configuration of the CSINodeDriver type for use // with apply. type CSINodeDriverApplyConfiguration struct { Name *string `json:"name,omitempty"` @@ -27,7 +27,7 @@ type CSINodeDriverApplyConfiguration struct { Allocatable *VolumeNodeResourcesApplyConfiguration `json:"allocatable,omitempty"` } -// CSINodeDriverApplyConfiguration constructs an declarative configuration of the CSINodeDriver type for use with +// CSINodeDriverApplyConfiguration constructs a declarative configuration of the CSINodeDriver type for use with // apply. func CSINodeDriver() *CSINodeDriverApplyConfiguration { return &CSINodeDriverApplyConfiguration{} diff --git a/applyconfigurations/storage/v1beta1/csinodespec.go b/applyconfigurations/storage/v1beta1/csinodespec.go index 94ff1b4611..c9cbea1d9c 100644 --- a/applyconfigurations/storage/v1beta1/csinodespec.go +++ b/applyconfigurations/storage/v1beta1/csinodespec.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta1 -// CSINodeSpecApplyConfiguration represents an declarative configuration of the CSINodeSpec type for use +// CSINodeSpecApplyConfiguration represents a declarative configuration of the CSINodeSpec type for use // with apply. type CSINodeSpecApplyConfiguration struct { Drivers []CSINodeDriverApplyConfiguration `json:"drivers,omitempty"` } -// CSINodeSpecApplyConfiguration constructs an declarative configuration of the CSINodeSpec type for use with +// CSINodeSpecApplyConfiguration constructs a declarative configuration of the CSINodeSpec type for use with // apply. func CSINodeSpec() *CSINodeSpecApplyConfiguration { return &CSINodeSpecApplyConfiguration{} diff --git a/applyconfigurations/storage/v1beta1/csistoragecapacity.go b/applyconfigurations/storage/v1beta1/csistoragecapacity.go index 2e0c6f35c1..19350e5a6f 100644 --- a/applyconfigurations/storage/v1beta1/csistoragecapacity.go +++ b/applyconfigurations/storage/v1beta1/csistoragecapacity.go @@ -28,7 +28,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// CSIStorageCapacityApplyConfiguration represents an declarative configuration of the CSIStorageCapacity type for use +// CSIStorageCapacityApplyConfiguration represents a declarative configuration of the CSIStorageCapacity type for use // with apply. type CSIStorageCapacityApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -39,7 +39,7 @@ type CSIStorageCapacityApplyConfiguration struct { MaximumVolumeSize *resource.Quantity `json:"maximumVolumeSize,omitempty"` } -// CSIStorageCapacity constructs an declarative configuration of the CSIStorageCapacity type for use with +// CSIStorageCapacity constructs a declarative configuration of the CSIStorageCapacity type for use with // apply. func CSIStorageCapacity(name, namespace string) *CSIStorageCapacityApplyConfiguration { b := &CSIStorageCapacityApplyConfiguration{} diff --git a/applyconfigurations/storage/v1beta1/storageclass.go b/applyconfigurations/storage/v1beta1/storageclass.go index 1e727cc95f..fa504a44ec 100644 --- a/applyconfigurations/storage/v1beta1/storageclass.go +++ b/applyconfigurations/storage/v1beta1/storageclass.go @@ -29,7 +29,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// StorageClassApplyConfiguration represents an declarative configuration of the StorageClass type for use +// StorageClassApplyConfiguration represents a declarative configuration of the StorageClass type for use // with apply. type StorageClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -43,7 +43,7 @@ type StorageClassApplyConfiguration struct { AllowedTopologies []applyconfigurationscorev1.TopologySelectorTermApplyConfiguration `json:"allowedTopologies,omitempty"` } -// StorageClass constructs an declarative configuration of the StorageClass type for use with +// StorageClass constructs a declarative configuration of the StorageClass type for use with // apply. func StorageClass(name string) *StorageClassApplyConfiguration { b := &StorageClassApplyConfiguration{} diff --git a/applyconfigurations/storage/v1beta1/tokenrequest.go b/applyconfigurations/storage/v1beta1/tokenrequest.go index 89c99d5602..e0f2df28e0 100644 --- a/applyconfigurations/storage/v1beta1/tokenrequest.go +++ b/applyconfigurations/storage/v1beta1/tokenrequest.go @@ -18,14 +18,14 @@ limitations under the License. package v1beta1 -// TokenRequestApplyConfiguration represents an declarative configuration of the TokenRequest type for use +// TokenRequestApplyConfiguration represents a declarative configuration of the TokenRequest type for use // with apply. type TokenRequestApplyConfiguration struct { Audience *string `json:"audience,omitempty"` ExpirationSeconds *int64 `json:"expirationSeconds,omitempty"` } -// TokenRequestApplyConfiguration constructs an declarative configuration of the TokenRequest type for use with +// TokenRequestApplyConfiguration constructs a declarative configuration of the TokenRequest type for use with // apply. func TokenRequest() *TokenRequestApplyConfiguration { return &TokenRequestApplyConfiguration{} diff --git a/applyconfigurations/storage/v1beta1/volumeattachment.go b/applyconfigurations/storage/v1beta1/volumeattachment.go index ed44241bb4..b0711d7314 100644 --- a/applyconfigurations/storage/v1beta1/volumeattachment.go +++ b/applyconfigurations/storage/v1beta1/volumeattachment.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// VolumeAttachmentApplyConfiguration represents an declarative configuration of the VolumeAttachment type for use +// VolumeAttachmentApplyConfiguration represents a declarative configuration of the VolumeAttachment type for use // with apply. type VolumeAttachmentApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type VolumeAttachmentApplyConfiguration struct { Status *VolumeAttachmentStatusApplyConfiguration `json:"status,omitempty"` } -// VolumeAttachment constructs an declarative configuration of the VolumeAttachment type for use with +// VolumeAttachment constructs a declarative configuration of the VolumeAttachment type for use with // apply. func VolumeAttachment(name string) *VolumeAttachmentApplyConfiguration { b := &VolumeAttachmentApplyConfiguration{} diff --git a/applyconfigurations/storage/v1beta1/volumeattachmentsource.go b/applyconfigurations/storage/v1beta1/volumeattachmentsource.go index 9700b38ee2..b08dd3148b 100644 --- a/applyconfigurations/storage/v1beta1/volumeattachmentsource.go +++ b/applyconfigurations/storage/v1beta1/volumeattachmentsource.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" ) -// VolumeAttachmentSourceApplyConfiguration represents an declarative configuration of the VolumeAttachmentSource type for use +// VolumeAttachmentSourceApplyConfiguration represents a declarative configuration of the VolumeAttachmentSource type for use // with apply. type VolumeAttachmentSourceApplyConfiguration struct { PersistentVolumeName *string `json:"persistentVolumeName,omitempty"` InlineVolumeSpec *v1.PersistentVolumeSpecApplyConfiguration `json:"inlineVolumeSpec,omitempty"` } -// VolumeAttachmentSourceApplyConfiguration constructs an declarative configuration of the VolumeAttachmentSource type for use with +// VolumeAttachmentSourceApplyConfiguration constructs a declarative configuration of the VolumeAttachmentSource type for use with // apply. func VolumeAttachmentSource() *VolumeAttachmentSourceApplyConfiguration { return &VolumeAttachmentSourceApplyConfiguration{} diff --git a/applyconfigurations/storage/v1beta1/volumeattachmentspec.go b/applyconfigurations/storage/v1beta1/volumeattachmentspec.go index 1d5e304bb5..3bdaeb45d7 100644 --- a/applyconfigurations/storage/v1beta1/volumeattachmentspec.go +++ b/applyconfigurations/storage/v1beta1/volumeattachmentspec.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// VolumeAttachmentSpecApplyConfiguration represents an declarative configuration of the VolumeAttachmentSpec type for use +// VolumeAttachmentSpecApplyConfiguration represents a declarative configuration of the VolumeAttachmentSpec type for use // with apply. type VolumeAttachmentSpecApplyConfiguration struct { Attacher *string `json:"attacher,omitempty"` @@ -26,7 +26,7 @@ type VolumeAttachmentSpecApplyConfiguration struct { NodeName *string `json:"nodeName,omitempty"` } -// VolumeAttachmentSpecApplyConfiguration constructs an declarative configuration of the VolumeAttachmentSpec type for use with +// VolumeAttachmentSpecApplyConfiguration constructs a declarative configuration of the VolumeAttachmentSpec type for use with // apply. func VolumeAttachmentSpec() *VolumeAttachmentSpecApplyConfiguration { return &VolumeAttachmentSpecApplyConfiguration{} diff --git a/applyconfigurations/storage/v1beta1/volumeattachmentstatus.go b/applyconfigurations/storage/v1beta1/volumeattachmentstatus.go index fa1855a241..f7046cdb35 100644 --- a/applyconfigurations/storage/v1beta1/volumeattachmentstatus.go +++ b/applyconfigurations/storage/v1beta1/volumeattachmentstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 -// VolumeAttachmentStatusApplyConfiguration represents an declarative configuration of the VolumeAttachmentStatus type for use +// VolumeAttachmentStatusApplyConfiguration represents a declarative configuration of the VolumeAttachmentStatus type for use // with apply. type VolumeAttachmentStatusApplyConfiguration struct { Attached *bool `json:"attached,omitempty"` @@ -27,7 +27,7 @@ type VolumeAttachmentStatusApplyConfiguration struct { DetachError *VolumeErrorApplyConfiguration `json:"detachError,omitempty"` } -// VolumeAttachmentStatusApplyConfiguration constructs an declarative configuration of the VolumeAttachmentStatus type for use with +// VolumeAttachmentStatusApplyConfiguration constructs a declarative configuration of the VolumeAttachmentStatus type for use with // apply. func VolumeAttachmentStatus() *VolumeAttachmentStatusApplyConfiguration { return &VolumeAttachmentStatusApplyConfiguration{} diff --git a/applyconfigurations/storage/v1beta1/volumeerror.go b/applyconfigurations/storage/v1beta1/volumeerror.go index 3f255fce75..fec1c9ade3 100644 --- a/applyconfigurations/storage/v1beta1/volumeerror.go +++ b/applyconfigurations/storage/v1beta1/volumeerror.go @@ -22,14 +22,14 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// VolumeErrorApplyConfiguration represents an declarative configuration of the VolumeError type for use +// VolumeErrorApplyConfiguration represents a declarative configuration of the VolumeError type for use // with apply. type VolumeErrorApplyConfiguration struct { Time *v1.Time `json:"time,omitempty"` Message *string `json:"message,omitempty"` } -// VolumeErrorApplyConfiguration constructs an declarative configuration of the VolumeError type for use with +// VolumeErrorApplyConfiguration constructs a declarative configuration of the VolumeError type for use with // apply. func VolumeError() *VolumeErrorApplyConfiguration { return &VolumeErrorApplyConfiguration{} diff --git a/applyconfigurations/storage/v1beta1/volumenoderesources.go b/applyconfigurations/storage/v1beta1/volumenoderesources.go index 4b69b64c9b..b42c9decc0 100644 --- a/applyconfigurations/storage/v1beta1/volumenoderesources.go +++ b/applyconfigurations/storage/v1beta1/volumenoderesources.go @@ -18,13 +18,13 @@ limitations under the License. package v1beta1 -// VolumeNodeResourcesApplyConfiguration represents an declarative configuration of the VolumeNodeResources type for use +// VolumeNodeResourcesApplyConfiguration represents a declarative configuration of the VolumeNodeResources type for use // with apply. type VolumeNodeResourcesApplyConfiguration struct { Count *int32 `json:"count,omitempty"` } -// VolumeNodeResourcesApplyConfiguration constructs an declarative configuration of the VolumeNodeResources type for use with +// VolumeNodeResourcesApplyConfiguration constructs a declarative configuration of the VolumeNodeResources type for use with // apply. func VolumeNodeResources() *VolumeNodeResourcesApplyConfiguration { return &VolumeNodeResourcesApplyConfiguration{} diff --git a/applyconfigurations/storagemigration/v1alpha1/groupversionresource.go b/applyconfigurations/storagemigration/v1alpha1/groupversionresource.go index c733ac5c04..c8f9f009a5 100644 --- a/applyconfigurations/storagemigration/v1alpha1/groupversionresource.go +++ b/applyconfigurations/storagemigration/v1alpha1/groupversionresource.go @@ -18,7 +18,7 @@ limitations under the License. package v1alpha1 -// GroupVersionResourceApplyConfiguration represents an declarative configuration of the GroupVersionResource type for use +// GroupVersionResourceApplyConfiguration represents a declarative configuration of the GroupVersionResource type for use // with apply. type GroupVersionResourceApplyConfiguration struct { Group *string `json:"group,omitempty"` @@ -26,7 +26,7 @@ type GroupVersionResourceApplyConfiguration struct { Resource *string `json:"resource,omitempty"` } -// GroupVersionResourceApplyConfiguration constructs an declarative configuration of the GroupVersionResource type for use with +// GroupVersionResourceApplyConfiguration constructs a declarative configuration of the GroupVersionResource type for use with // apply. func GroupVersionResource() *GroupVersionResourceApplyConfiguration { return &GroupVersionResourceApplyConfiguration{} diff --git a/applyconfigurations/storagemigration/v1alpha1/migrationcondition.go b/applyconfigurations/storagemigration/v1alpha1/migrationcondition.go index d0f863446e..dcdbc60c7c 100644 --- a/applyconfigurations/storagemigration/v1alpha1/migrationcondition.go +++ b/applyconfigurations/storagemigration/v1alpha1/migrationcondition.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// MigrationConditionApplyConfiguration represents an declarative configuration of the MigrationCondition type for use +// MigrationConditionApplyConfiguration represents a declarative configuration of the MigrationCondition type for use // with apply. type MigrationConditionApplyConfiguration struct { Type *v1alpha1.MigrationConditionType `json:"type,omitempty"` @@ -34,7 +34,7 @@ type MigrationConditionApplyConfiguration struct { Message *string `json:"message,omitempty"` } -// MigrationConditionApplyConfiguration constructs an declarative configuration of the MigrationCondition type for use with +// MigrationConditionApplyConfiguration constructs a declarative configuration of the MigrationCondition type for use with // apply. func MigrationCondition() *MigrationConditionApplyConfiguration { return &MigrationConditionApplyConfiguration{} diff --git a/applyconfigurations/storagemigration/v1alpha1/storageversionmigration.go b/applyconfigurations/storagemigration/v1alpha1/storageversionmigration.go index b76769f5c5..7e6452a777 100644 --- a/applyconfigurations/storagemigration/v1alpha1/storageversionmigration.go +++ b/applyconfigurations/storagemigration/v1alpha1/storageversionmigration.go @@ -27,7 +27,7 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// StorageVersionMigrationApplyConfiguration represents an declarative configuration of the StorageVersionMigration type for use +// StorageVersionMigrationApplyConfiguration represents a declarative configuration of the StorageVersionMigration type for use // with apply. type StorageVersionMigrationApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` @@ -36,7 +36,7 @@ type StorageVersionMigrationApplyConfiguration struct { Status *StorageVersionMigrationStatusApplyConfiguration `json:"status,omitempty"` } -// StorageVersionMigration constructs an declarative configuration of the StorageVersionMigration type for use with +// StorageVersionMigration constructs a declarative configuration of the StorageVersionMigration type for use with // apply. func StorageVersionMigration(name string) *StorageVersionMigrationApplyConfiguration { b := &StorageVersionMigrationApplyConfiguration{} diff --git a/applyconfigurations/storagemigration/v1alpha1/storageversionmigrationspec.go b/applyconfigurations/storagemigration/v1alpha1/storageversionmigrationspec.go index 6c7c5b2645..02ddb540f8 100644 --- a/applyconfigurations/storagemigration/v1alpha1/storageversionmigrationspec.go +++ b/applyconfigurations/storagemigration/v1alpha1/storageversionmigrationspec.go @@ -18,14 +18,14 @@ limitations under the License. package v1alpha1 -// StorageVersionMigrationSpecApplyConfiguration represents an declarative configuration of the StorageVersionMigrationSpec type for use +// StorageVersionMigrationSpecApplyConfiguration represents a declarative configuration of the StorageVersionMigrationSpec type for use // with apply. type StorageVersionMigrationSpecApplyConfiguration struct { Resource *GroupVersionResourceApplyConfiguration `json:"resource,omitempty"` ContinueToken *string `json:"continueToken,omitempty"` } -// StorageVersionMigrationSpecApplyConfiguration constructs an declarative configuration of the StorageVersionMigrationSpec type for use with +// StorageVersionMigrationSpecApplyConfiguration constructs a declarative configuration of the StorageVersionMigrationSpec type for use with // apply. func StorageVersionMigrationSpec() *StorageVersionMigrationSpecApplyConfiguration { return &StorageVersionMigrationSpecApplyConfiguration{} diff --git a/applyconfigurations/storagemigration/v1alpha1/storageversionmigrationstatus.go b/applyconfigurations/storagemigration/v1alpha1/storageversionmigrationstatus.go index b8d397548a..fc957cb15c 100644 --- a/applyconfigurations/storagemigration/v1alpha1/storageversionmigrationstatus.go +++ b/applyconfigurations/storagemigration/v1alpha1/storageversionmigrationstatus.go @@ -18,14 +18,14 @@ limitations under the License. package v1alpha1 -// StorageVersionMigrationStatusApplyConfiguration represents an declarative configuration of the StorageVersionMigrationStatus type for use +// StorageVersionMigrationStatusApplyConfiguration represents a declarative configuration of the StorageVersionMigrationStatus type for use // with apply. type StorageVersionMigrationStatusApplyConfiguration struct { Conditions []MigrationConditionApplyConfiguration `json:"conditions,omitempty"` ResourceVersion *string `json:"resourceVersion,omitempty"` } -// StorageVersionMigrationStatusApplyConfiguration constructs an declarative configuration of the StorageVersionMigrationStatus type for use with +// StorageVersionMigrationStatusApplyConfiguration constructs a declarative configuration of the StorageVersionMigrationStatus type for use with // apply. func StorageVersionMigrationStatus() *StorageVersionMigrationStatusApplyConfiguration { return &StorageVersionMigrationStatusApplyConfiguration{} From c834bcc257469b615a7c1df0914b5321de7be09a Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Fri, 13 Oct 2023 09:56:04 +0200 Subject: [PATCH 090/159] Generify client-go This adds a generic implementation of a clientset, and uses it to replace the template code in generated clientsets for the default methods. The templates are preserved as-is (or as close as they can be) for use in extensions, whether for resources or subresources. Clientsets with no extensions are reduced to their main getter, their interface, their specific struct, and their constructor. All method implementations are provided by the generic implementation. The dedicated interface is preserved so that each clientset can have its own set of methods, and the dedicated struct is preserved to allow extensions and expansions to be defined where necessary. Instead of handling the variants (with/without namespace, list, apply) with a complex sequence of if statements, build up an index into an array containing the various declarations. The namespaced/non-namespaced distinction matters in the code templates, but not in the methods themselves, so drop all the non-namespaced variants and pass in "" explicitly. Signed-off-by: Stephen Kitt Kubernetes-commit: 3734f5bf9b6ce1e9cf2385f4e4453b32d8f35ab1 --- gentype/type.go | 360 ++++++++++++++++++ .../certificatesigningrequest_expansion.go | 2 +- kubernetes/typed/core/v1/event_expansion.go | 22 +- .../typed/core/v1/namespace_expansion.go | 2 +- kubernetes/typed/core/v1/node_expansion.go | 2 +- kubernetes/typed/core/v1/pod_expansion.go | 14 +- kubernetes/typed/core/v1/service_expansion.go | 4 +- .../typed/events/v1beta1/event_expansion.go | 18 +- .../v1beta1/deployment_expansion.go | 2 +- .../typed/policy/v1/eviction_expansion.go | 2 +- .../policy/v1beta1/eviction_expansion.go | 2 +- 11 files changed, 395 insertions(+), 35 deletions(-) create mode 100644 gentype/type.go diff --git a/gentype/type.go b/gentype/type.go new file mode 100644 index 0000000000..b5be84318d --- /dev/null +++ b/gentype/type.go @@ -0,0 +1,360 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package gentype + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + "k8s.io/client-go/util/consistencydetector" + "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" +) + +// objectWithMeta matches objects implementing both runtime.Object and metav1.Object. +type objectWithMeta interface { + runtime.Object + metav1.Object +} + +// namedObject matches comparable objects implementing GetName(); it is intended for use with apply declarative configurations. +type namedObject interface { + comparable + GetName() *string +} + +// Client represents a client, optionally namespaced, with no support for lists or apply declarative configurations. +type Client[T objectWithMeta] struct { + resource string + client rest.Interface + namespace string // "" for non-namespaced clients + newObject func() T + parameterCodec runtime.ParameterCodec +} + +// ClientWithList represents a client with support for lists. +type ClientWithList[T objectWithMeta, L runtime.Object] struct { + *Client[T] + alsoLister[T, L] +} + +// ClientWithApply represents a client with support for apply declarative configurations. +type ClientWithApply[T objectWithMeta, C namedObject] struct { + *Client[T] + alsoApplier[T, C] +} + +// ClientWithListAndApply represents a client with support for lists and apply declarative configurations. +type ClientWithListAndApply[T objectWithMeta, L runtime.Object, C namedObject] struct { + *Client[T] + alsoLister[T, L] + alsoApplier[T, C] +} + +// Helper types for composition +type alsoLister[T objectWithMeta, L runtime.Object] struct { + client *Client[T] + newList func() L +} + +type alsoApplier[T objectWithMeta, C namedObject] struct { + client *Client[T] +} + +// NewClient constructs a client, namespaced or not, with no support for lists or apply. +// Non-namespaced clients are constructed by passing an empty namespace (""). +func NewClient[T objectWithMeta]( + resource string, client rest.Interface, parameterCodec runtime.ParameterCodec, namespace string, emptyObjectCreator func() T, +) *Client[T] { + return &Client[T]{ + resource: resource, + client: client, + parameterCodec: parameterCodec, + namespace: namespace, + newObject: emptyObjectCreator, + } +} + +// NewClientWithList constructs a namespaced client with support for lists. +func NewClientWithList[T objectWithMeta, L runtime.Object]( + resource string, client rest.Interface, parameterCodec runtime.ParameterCodec, namespace string, emptyObjectCreator func() T, + emptyListCreator func() L, +) *ClientWithList[T, L] { + typeClient := NewClient[T](resource, client, parameterCodec, namespace, emptyObjectCreator) + return &ClientWithList[T, L]{ + typeClient, + alsoLister[T, L]{typeClient, emptyListCreator}, + } +} + +// NewClientWithApply constructs a namespaced client with support for apply declarative configurations. +func NewClientWithApply[T objectWithMeta, C namedObject]( + resource string, client rest.Interface, parameterCodec runtime.ParameterCodec, namespace string, emptyObjectCreator func() T, +) *ClientWithApply[T, C] { + typeClient := NewClient[T](resource, client, parameterCodec, namespace, emptyObjectCreator) + return &ClientWithApply[T, C]{ + typeClient, + alsoApplier[T, C]{typeClient}, + } +} + +// NewClientWithListAndApply constructs a client with support for lists and applying declarative configurations. +func NewClientWithListAndApply[T objectWithMeta, L runtime.Object, C namedObject]( + resource string, client rest.Interface, parameterCodec runtime.ParameterCodec, namespace string, emptyObjectCreator func() T, + emptyListCreator func() L, +) *ClientWithListAndApply[T, L, C] { + typeClient := NewClient[T](resource, client, parameterCodec, namespace, emptyObjectCreator) + return &ClientWithListAndApply[T, L, C]{ + typeClient, + alsoLister[T, L]{typeClient, emptyListCreator}, + alsoApplier[T, C]{typeClient}, + } +} + +// GetClient returns the REST interface. +func (c *Client[T]) GetClient() rest.Interface { + return c.client +} + +// GetNamespace returns the client's namespace, if any. +func (c *Client[T]) GetNamespace() string { + return c.namespace +} + +// Get takes name of the resource, and returns the corresponding object, and an error if there is any. +func (c *Client[T]) Get(ctx context.Context, name string, options metav1.GetOptions) (T, error) { + result := c.newObject() + err := c.client.Get(). + NamespaceIfScoped(c.namespace, c.namespace != ""). + Resource(c.resource). + Name(name). + VersionedParams(&options, c.parameterCodec). + Do(ctx). + Into(result) + return result, err +} + +// List takes label and field selectors, and returns the list of resources that match those selectors. +func (l *alsoLister[T, L]) List(ctx context.Context, opts metav1.ListOptions) (L, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for $.type|resource$, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := l.watchList(ctx, watchListOptions) + if err == nil { + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for "+l.client.resource, l.list, opts, result) + return result, nil + } + klog.Warningf("The watchlist request for %s ended with an error, falling back to the standard LIST semantics, err = %v", l.client.resource, err) + } + result, err := l.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for "+l.client.resource, l.list, opts, result) + } + return result, err +} + +func (l *alsoLister[T, L]) list(ctx context.Context, opts metav1.ListOptions) (L, error) { + list := l.newList() + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + err := l.client.client.Get(). + NamespaceIfScoped(l.client.namespace, l.client.namespace != ""). + Resource(l.client.resource). + VersionedParams(&opts, l.client.parameterCodec). + Timeout(timeout). + Do(ctx). + Into(list) + return list, err +} + +// watchList establishes a watch stream with the server and returns the list of resources. +func (l *alsoLister[T, L]) watchList(ctx context.Context, opts metav1.ListOptions) (result L, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = l.newList() + err = l.client.client.Get(). + NamespaceIfScoped(l.client.namespace, l.client.namespace != ""). + Resource(l.client.resource). + VersionedParams(&opts, l.client.parameterCodec). + Timeout(timeout). + WatchList(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested resources. +func (c *Client[T]) Watch(ctx context.Context, opts metav1.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(). + NamespaceIfScoped(c.namespace, c.namespace != ""). + Resource(c.resource). + VersionedParams(&opts, c.parameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a resource and creates it. Returns the server's representation of the resource, and an error, if there is any. +func (c *Client[T]) Create(ctx context.Context, obj T, opts metav1.CreateOptions) (T, error) { + result := c.newObject() + err := c.client.Post(). + NamespaceIfScoped(c.namespace, c.namespace != ""). + Resource(c.resource). + VersionedParams(&opts, c.parameterCodec). + Body(obj). + Do(ctx). + Into(result) + return result, err +} + +// Update takes the representation of a resource and updates it. Returns the server's representation of the resource, and an error, if there is any. +func (c *Client[T]) Update(ctx context.Context, obj T, opts metav1.UpdateOptions) (T, error) { + result := c.newObject() + err := c.client.Put(). + NamespaceIfScoped(c.namespace, c.namespace != ""). + Resource(c.resource). + Name(obj.GetName()). + VersionedParams(&opts, c.parameterCodec). + Body(obj). + Do(ctx). + Into(result) + return result, err +} + +// UpdateStatus updates the status subresource of a resource. Returns the server's representation of the resource, and an error, if there is any. +func (c *Client[T]) UpdateStatus(ctx context.Context, obj T, opts metav1.UpdateOptions) (T, error) { + result := c.newObject() + err := c.client.Put(). + NamespaceIfScoped(c.namespace, c.namespace != ""). + Resource(c.resource). + Name(obj.GetName()). + SubResource("status"). + VersionedParams(&opts, c.parameterCodec). + Body(obj). + Do(ctx). + Into(result) + return result, err +} + +// Delete takes name of the resource and deletes it. Returns an error if one occurs. +func (c *Client[T]) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + NamespaceIfScoped(c.namespace, c.namespace != ""). + Resource(c.resource). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (l *alsoLister[T, L]) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return l.client.client.Delete(). + NamespaceIfScoped(l.client.namespace, l.client.namespace != ""). + Resource(l.client.resource). + VersionedParams(&listOpts, l.client.parameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched resource. +func (c *Client[T]) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (T, error) { + result := c.newObject() + err := c.client.Patch(pt). + NamespaceIfScoped(c.namespace, c.namespace != ""). + Resource(c.resource). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, c.parameterCodec). + Body(data). + Do(ctx). + Into(result) + return result, err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied resource. +func (a *alsoApplier[T, C]) Apply(ctx context.Context, obj C, opts metav1.ApplyOptions) (T, error) { + result := a.client.newObject() + if obj == *new(C) { + return *new(T), fmt.Errorf("object provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(obj) + if err != nil { + return *new(T), err + } + if obj.GetName() == nil { + return *new(T), fmt.Errorf("obj.Name must be provided to Apply") + } + err = a.client.client.Patch(types.ApplyPatchType). + NamespaceIfScoped(a.client.namespace, a.client.namespace != ""). + Resource(a.client.resource). + Name(*obj.GetName()). + VersionedParams(&patchOpts, a.client.parameterCodec). + Body(data). + Do(ctx). + Into(result) + return result, err +} + +// Apply takes the given apply declarative configuration, applies it to the status subresource and returns the applied resource. +func (a *alsoApplier[T, C]) ApplyStatus(ctx context.Context, obj C, opts metav1.ApplyOptions) (T, error) { + if obj == *new(C) { + return *new(T), fmt.Errorf("object provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(obj) + if err != nil { + return *new(T), err + } + + if obj.GetName() == nil { + return *new(T), fmt.Errorf("obj.Name must be provided to Apply") + } + + result := a.client.newObject() + err = a.client.client.Patch(types.ApplyPatchType). + NamespaceIfScoped(a.client.namespace, a.client.namespace != ""). + Resource(a.client.resource). + Name(*obj.GetName()). + SubResource("status"). + VersionedParams(&patchOpts, a.client.parameterCodec). + Body(data). + Do(ctx). + Into(result) + return result, err +} diff --git a/kubernetes/typed/certificates/v1beta1/certificatesigningrequest_expansion.go b/kubernetes/typed/certificates/v1beta1/certificatesigningrequest_expansion.go index 4737891411..4e631b0a40 100644 --- a/kubernetes/typed/certificates/v1beta1/certificatesigningrequest_expansion.go +++ b/kubernetes/typed/certificates/v1beta1/certificatesigningrequest_expansion.go @@ -30,7 +30,7 @@ type CertificateSigningRequestExpansion interface { func (c *certificateSigningRequests) UpdateApproval(ctx context.Context, certificateSigningRequest *certificates.CertificateSigningRequest, opts metav1.UpdateOptions) (result *certificates.CertificateSigningRequest, err error) { result = &certificates.CertificateSigningRequest{} - err = c.client.Put(). + err = c.GetClient().Put(). Resource("certificatesigningrequests"). Name(certificateSigningRequest.Name). VersionedParams(&opts, scheme.ParameterCodec). diff --git a/kubernetes/typed/core/v1/event_expansion.go b/kubernetes/typed/core/v1/event_expansion.go index a3fdf57a98..4243572328 100644 --- a/kubernetes/typed/core/v1/event_expansion.go +++ b/kubernetes/typed/core/v1/event_expansion.go @@ -48,11 +48,11 @@ type EventExpansion interface { // event; it must either match this event client's namespace, or this event // client must have been created with the "" namespace. func (e *events) CreateWithEventNamespace(event *v1.Event) (*v1.Event, error) { - if e.ns != "" && event.Namespace != e.ns { - return nil, fmt.Errorf("can't create an event with namespace '%v' in namespace '%v'", event.Namespace, e.ns) + if e.GetNamespace() != "" && event.Namespace != e.GetNamespace() { + return nil, fmt.Errorf("can't create an event with namespace '%v' in namespace '%v'", event.Namespace, e.GetNamespace()) } result := &v1.Event{} - err := e.client.Post(). + err := e.GetClient().Post(). NamespaceIfScoped(event.Namespace, len(event.Namespace) > 0). Resource("events"). Body(event). @@ -67,11 +67,11 @@ func (e *events) CreateWithEventNamespace(event *v1.Event) (*v1.Event, error) { // created with the "" namespace. Update also requires the ResourceVersion to be set in the event // object. func (e *events) UpdateWithEventNamespace(event *v1.Event) (*v1.Event, error) { - if e.ns != "" && event.Namespace != e.ns { - return nil, fmt.Errorf("can't update an event with namespace '%v' in namespace '%v'", event.Namespace, e.ns) + if e.GetNamespace() != "" && event.Namespace != e.GetNamespace() { + return nil, fmt.Errorf("can't update an event with namespace '%v' in namespace '%v'", event.Namespace, e.GetNamespace()) } result := &v1.Event{} - err := e.client.Put(). + err := e.GetClient().Put(). NamespaceIfScoped(event.Namespace, len(event.Namespace) > 0). Resource("events"). Name(event.Name). @@ -87,11 +87,11 @@ func (e *events) UpdateWithEventNamespace(event *v1.Event) (*v1.Event, error) { // match this event client's namespace, or this event client must have been // created with the "" namespace. func (e *events) PatchWithEventNamespace(incompleteEvent *v1.Event, data []byte) (*v1.Event, error) { - if e.ns != "" && incompleteEvent.Namespace != e.ns { - return nil, fmt.Errorf("can't patch an event with namespace '%v' in namespace '%v'", incompleteEvent.Namespace, e.ns) + if e.GetNamespace() != "" && incompleteEvent.Namespace != e.GetNamespace() { + return nil, fmt.Errorf("can't patch an event with namespace '%v' in namespace '%v'", incompleteEvent.Namespace, e.GetNamespace()) } result := &v1.Event{} - err := e.client.Patch(types.StrategicMergePatchType). + err := e.GetClient().Patch(types.StrategicMergePatchType). NamespaceIfScoped(incompleteEvent.Namespace, len(incompleteEvent.Namespace) > 0). Resource("events"). Name(incompleteEvent.Name). @@ -109,8 +109,8 @@ func (e *events) Search(scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.Ev if err != nil { return nil, err } - if len(e.ns) > 0 && ref.Namespace != e.ns { - return nil, fmt.Errorf("won't be able to find any events of namespace '%v' in namespace '%v'", ref.Namespace, e.ns) + if len(e.GetNamespace()) > 0 && ref.Namespace != e.GetNamespace() { + return nil, fmt.Errorf("won't be able to find any events of namespace '%v' in namespace '%v'", ref.Namespace, e.GetNamespace()) } stringRefKind := string(ref.Kind) var refKind *string diff --git a/kubernetes/typed/core/v1/namespace_expansion.go b/kubernetes/typed/core/v1/namespace_expansion.go index be1116db15..4f720fb92e 100644 --- a/kubernetes/typed/core/v1/namespace_expansion.go +++ b/kubernetes/typed/core/v1/namespace_expansion.go @@ -32,6 +32,6 @@ type NamespaceExpansion interface { // Finalize takes the representation of a namespace to update. Returns the server's representation of the namespace, and an error, if it occurs. func (c *namespaces) Finalize(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (result *v1.Namespace, err error) { result = &v1.Namespace{} - err = c.client.Put().Resource("namespaces").Name(namespace.Name).VersionedParams(&opts, scheme.ParameterCodec).SubResource("finalize").Body(namespace).Do(ctx).Into(result) + err = c.GetClient().Put().Resource("namespaces").Name(namespace.Name).VersionedParams(&opts, scheme.ParameterCodec).SubResource("finalize").Body(namespace).Do(ctx).Into(result) return } diff --git a/kubernetes/typed/core/v1/node_expansion.go b/kubernetes/typed/core/v1/node_expansion.go index bdf7bfed8d..df86253b0e 100644 --- a/kubernetes/typed/core/v1/node_expansion.go +++ b/kubernetes/typed/core/v1/node_expansion.go @@ -34,7 +34,7 @@ type NodeExpansion interface { // the node that the server returns, or an error. func (c *nodes) PatchStatus(ctx context.Context, nodeName string, data []byte) (*v1.Node, error) { result := &v1.Node{} - err := c.client.Patch(types.StrategicMergePatchType). + err := c.GetClient().Patch(types.StrategicMergePatchType). Resource("nodes"). Name(nodeName). SubResource("status"). diff --git a/kubernetes/typed/core/v1/pod_expansion.go b/kubernetes/typed/core/v1/pod_expansion.go index 8b6e0e932f..a2d4d70d46 100644 --- a/kubernetes/typed/core/v1/pod_expansion.go +++ b/kubernetes/typed/core/v1/pod_expansion.go @@ -47,33 +47,33 @@ type PodExpansion interface { // Bind applies the provided binding to the named pod in the current namespace (binding.Namespace is ignored). func (c *pods) Bind(ctx context.Context, binding *v1.Binding, opts metav1.CreateOptions) error { - return c.client.Post().Namespace(c.ns).Resource("pods").Name(binding.Name).VersionedParams(&opts, scheme.ParameterCodec).SubResource("binding").Body(binding).Do(ctx).Error() + return c.GetClient().Post().Namespace(c.GetNamespace()).Resource("pods").Name(binding.Name).VersionedParams(&opts, scheme.ParameterCodec).SubResource("binding").Body(binding).Do(ctx).Error() } // Evict submits a policy/v1beta1 Eviction request to the pod's eviction subresource. // Equivalent to calling EvictV1beta1. // Deprecated: Use EvictV1() (supported in 1.22+) or EvictV1beta1(). func (c *pods) Evict(ctx context.Context, eviction *policyv1beta1.Eviction) error { - return c.client.Post().Namespace(c.ns).Resource("pods").Name(eviction.Name).SubResource("eviction").Body(eviction).Do(ctx).Error() + return c.GetClient().Post().Namespace(c.GetNamespace()).Resource("pods").Name(eviction.Name).SubResource("eviction").Body(eviction).Do(ctx).Error() } func (c *pods) EvictV1beta1(ctx context.Context, eviction *policyv1beta1.Eviction) error { - return c.client.Post().Namespace(c.ns).Resource("pods").Name(eviction.Name).SubResource("eviction").Body(eviction).Do(ctx).Error() + return c.GetClient().Post().Namespace(c.GetNamespace()).Resource("pods").Name(eviction.Name).SubResource("eviction").Body(eviction).Do(ctx).Error() } func (c *pods) EvictV1(ctx context.Context, eviction *policyv1.Eviction) error { - return c.client.Post().Namespace(c.ns).Resource("pods").Name(eviction.Name).SubResource("eviction").Body(eviction).Do(ctx).Error() + return c.GetClient().Post().Namespace(c.GetNamespace()).Resource("pods").Name(eviction.Name).SubResource("eviction").Body(eviction).Do(ctx).Error() } // Get constructs a request for getting the logs for a pod func (c *pods) GetLogs(name string, opts *v1.PodLogOptions) *restclient.Request { - return c.client.Get().Namespace(c.ns).Name(name).Resource("pods").SubResource("log").VersionedParams(opts, scheme.ParameterCodec) + return c.GetClient().Get().Namespace(c.GetNamespace()).Name(name).Resource("pods").SubResource("log").VersionedParams(opts, scheme.ParameterCodec) } // ProxyGet returns a response of the pod by calling it through the proxy. func (c *pods) ProxyGet(scheme, name, port, path string, params map[string]string) restclient.ResponseWrapper { - request := c.client.Get(). - Namespace(c.ns). + request := c.GetClient().Get(). + Namespace(c.GetNamespace()). Resource("pods"). SubResource("proxy"). Name(net.JoinSchemeNamePort(scheme, name, port)). diff --git a/kubernetes/typed/core/v1/service_expansion.go b/kubernetes/typed/core/v1/service_expansion.go index 4937fd1a39..9a6f781387 100644 --- a/kubernetes/typed/core/v1/service_expansion.go +++ b/kubernetes/typed/core/v1/service_expansion.go @@ -28,8 +28,8 @@ type ServiceExpansion interface { // ProxyGet returns a response of the service by calling it through the proxy. func (c *services) ProxyGet(scheme, name, port, path string, params map[string]string) restclient.ResponseWrapper { - request := c.client.Get(). - Namespace(c.ns). + request := c.GetClient().Get(). + Namespace(c.GetNamespace()). Resource("services"). SubResource("proxy"). Name(net.JoinSchemeNamePort(scheme, name, port)). diff --git a/kubernetes/typed/events/v1beta1/event_expansion.go b/kubernetes/typed/events/v1beta1/event_expansion.go index 562f8d5e45..4ddbaa31af 100644 --- a/kubernetes/typed/events/v1beta1/event_expansion.go +++ b/kubernetes/typed/events/v1beta1/event_expansion.go @@ -44,11 +44,11 @@ type EventExpansion interface { // it must either match this event client's namespace, or this event client must // have been created with the "" namespace. func (e *events) CreateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event, error) { - if e.ns != "" && event.Namespace != e.ns { - return nil, fmt.Errorf("can't create an event with namespace '%v' in namespace '%v'", event.Namespace, e.ns) + if e.GetNamespace() != "" && event.Namespace != e.GetNamespace() { + return nil, fmt.Errorf("can't create an event with namespace '%v' in namespace '%v'", event.Namespace, e.GetNamespace()) } result := &v1beta1.Event{} - err := e.client.Post(). + err := e.GetClient().Post(). NamespaceIfScoped(event.Namespace, len(event.Namespace) > 0). Resource("events"). Body(event). @@ -64,11 +64,11 @@ func (e *events) CreateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event, // created with the "" namespace. // Update also requires the ResourceVersion to be set in the event object. func (e *events) UpdateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event, error) { - if e.ns != "" && event.Namespace != e.ns { - return nil, fmt.Errorf("can't update an event with namespace '%v' in namespace '%v'", event.Namespace, e.ns) + if e.GetNamespace() != "" && event.Namespace != e.GetNamespace() { + return nil, fmt.Errorf("can't update an event with namespace '%v' in namespace '%v'", event.Namespace, e.GetNamespace()) } result := &v1beta1.Event{} - err := e.client.Put(). + err := e.GetClient().Put(). NamespaceIfScoped(event.Namespace, len(event.Namespace) > 0). Resource("events"). Name(event.Name). @@ -84,11 +84,11 @@ func (e *events) UpdateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event, // The namespace must either match this event client's namespace, or this event client must // have been created with the "" namespace. func (e *events) PatchWithEventNamespace(event *v1beta1.Event, data []byte) (*v1beta1.Event, error) { - if e.ns != "" && event.Namespace != e.ns { - return nil, fmt.Errorf("can't patch an event with namespace '%v' in namespace '%v'", event.Namespace, e.ns) + if e.GetNamespace() != "" && event.Namespace != e.GetNamespace() { + return nil, fmt.Errorf("can't patch an event with namespace '%v' in namespace '%v'", event.Namespace, e.GetNamespace()) } result := &v1beta1.Event{} - err := e.client.Patch(types.StrategicMergePatchType). + err := e.GetClient().Patch(types.StrategicMergePatchType). NamespaceIfScoped(event.Namespace, len(event.Namespace) > 0). Resource("events"). Name(event.Name). diff --git a/kubernetes/typed/extensions/v1beta1/deployment_expansion.go b/kubernetes/typed/extensions/v1beta1/deployment_expansion.go index 5c409ac996..bd75b8a38e 100644 --- a/kubernetes/typed/extensions/v1beta1/deployment_expansion.go +++ b/kubernetes/typed/extensions/v1beta1/deployment_expansion.go @@ -31,5 +31,5 @@ type DeploymentExpansion interface { // Rollback applied the provided DeploymentRollback to the named deployment in the current namespace. func (c *deployments) Rollback(ctx context.Context, deploymentRollback *v1beta1.DeploymentRollback, opts metav1.CreateOptions) error { - return c.client.Post().Namespace(c.ns).Resource("deployments").Name(deploymentRollback.Name).VersionedParams(&opts, scheme.ParameterCodec).SubResource("rollback").Body(deploymentRollback).Do(ctx).Error() + return c.GetClient().Post().Namespace(c.GetNamespace()).Resource("deployments").Name(deploymentRollback.Name).VersionedParams(&opts, scheme.ParameterCodec).SubResource("rollback").Body(deploymentRollback).Do(ctx).Error() } diff --git a/kubernetes/typed/policy/v1/eviction_expansion.go b/kubernetes/typed/policy/v1/eviction_expansion.go index 853187feb5..2c7e95b720 100644 --- a/kubernetes/typed/policy/v1/eviction_expansion.go +++ b/kubernetes/typed/policy/v1/eviction_expansion.go @@ -28,7 +28,7 @@ type EvictionExpansion interface { } func (c *evictions) Evict(ctx context.Context, eviction *policy.Eviction) error { - return c.client.Post(). + return c.GetClient().Post(). AbsPath("/api/v1"). Namespace(eviction.Namespace). Resource("pods"). diff --git a/kubernetes/typed/policy/v1beta1/eviction_expansion.go b/kubernetes/typed/policy/v1beta1/eviction_expansion.go index c003671f5d..d7c28987cf 100644 --- a/kubernetes/typed/policy/v1beta1/eviction_expansion.go +++ b/kubernetes/typed/policy/v1beta1/eviction_expansion.go @@ -28,7 +28,7 @@ type EvictionExpansion interface { } func (c *evictions) Evict(ctx context.Context, eviction *policy.Eviction) error { - return c.client.Post(). + return c.GetClient().Post(). AbsPath("/api/v1"). Namespace(eviction.Namespace). Resource("pods"). From b31bc29ea1408dbf2172ca717a932a6c19c6b648 Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Fri, 10 May 2024 16:56:52 +0200 Subject: [PATCH 091/159] Run codegen Signed-off-by: Stephen Kitt Kubernetes-commit: 08dfd59305dbd1032b1afb49738259d688dda5e3 --- .../v1/mutatingwebhookconfiguration.go | 184 +------------ .../v1/validatingadmissionpolicy.go | 230 +--------------- .../v1/validatingadmissionpolicybinding.go | 184 +------------ .../v1/validatingwebhookconfiguration.go | 184 +------------ .../v1alpha1/validatingadmissionpolicy.go | 230 +--------------- .../validatingadmissionpolicybinding.go | 186 +------------ .../v1beta1/mutatingwebhookconfiguration.go | 184 +------------ .../v1beta1/validatingadmissionpolicy.go | 230 +--------------- .../validatingadmissionpolicybinding.go | 186 +------------ .../v1beta1/validatingwebhookconfiguration.go | 186 +------------ .../v1alpha1/storageversion.go | 230 +--------------- .../typed/apps/v1/controllerrevision.go | 196 +------------- kubernetes/typed/apps/v1/daemonset.go | 244 +---------------- kubernetes/typed/apps/v1/deployment.go | 254 ++---------------- kubernetes/typed/apps/v1/replicaset.go | 254 ++---------------- kubernetes/typed/apps/v1/statefulset.go | 254 ++---------------- .../typed/apps/v1beta1/controllerrevision.go | 196 +------------- kubernetes/typed/apps/v1beta1/deployment.go | 244 +---------------- kubernetes/typed/apps/v1beta1/statefulset.go | 244 +---------------- .../typed/apps/v1beta2/controllerrevision.go | 196 +------------- kubernetes/typed/apps/v1beta2/daemonset.go | 244 +---------------- kubernetes/typed/apps/v1beta2/deployment.go | 244 +---------------- kubernetes/typed/apps/v1beta2/replicaset.go | 244 +---------------- kubernetes/typed/apps/v1beta2/statefulset.go | 254 ++---------------- .../authentication/v1/selfsubjectreview.go | 23 +- .../typed/authentication/v1/tokenreview.go | 23 +- .../v1alpha1/selfsubjectreview.go | 23 +- .../v1beta1/selfsubjectreview.go | 23 +- .../authentication/v1beta1/tokenreview.go | 23 +- .../v1/localsubjectaccessreview.go | 26 +- .../v1/selfsubjectaccessreview.go | 23 +- .../v1/selfsubjectrulesreview.go | 23 +- .../authorization/v1/subjectaccessreview.go | 23 +- .../v1beta1/localsubjectaccessreview.go | 26 +- .../v1beta1/selfsubjectaccessreview.go | 23 +- .../v1beta1/selfsubjectrulesreview.go | 23 +- .../v1beta1/subjectaccessreview.go | 23 +- .../autoscaling/v1/horizontalpodautoscaler.go | 244 +---------------- .../autoscaling/v2/horizontalpodautoscaler.go | 244 +---------------- .../v2beta1/horizontalpodautoscaler.go | 244 +---------------- .../v2beta2/horizontalpodautoscaler.go | 244 +---------------- kubernetes/typed/batch/v1/cronjob.go | 244 +---------------- kubernetes/typed/batch/v1/job.go | 244 +---------------- kubernetes/typed/batch/v1beta1/cronjob.go | 244 +---------------- .../v1/certificatesigningrequest.go | 232 +--------------- .../v1alpha1/clustertrustbundle.go | 184 +------------ .../v1beta1/certificatesigningrequest.go | 230 +--------------- kubernetes/typed/coordination/v1/lease.go | 196 +------------- .../typed/coordination/v1beta1/lease.go | 196 +------------- kubernetes/typed/core/v1/componentstatus.go | 184 +------------ kubernetes/typed/core/v1/configmap.go | 196 +------------- kubernetes/typed/core/v1/endpoints.go | 196 +------------- kubernetes/typed/core/v1/event.go | 196 +------------- kubernetes/typed/core/v1/limitrange.go | 196 +------------- kubernetes/typed/core/v1/namespace.go | 215 +-------------- kubernetes/typed/core/v1/node.go | 230 +--------------- kubernetes/typed/core/v1/persistentvolume.go | 230 +--------------- .../typed/core/v1/persistentvolumeclaim.go | 244 +---------------- kubernetes/typed/core/v1/pod.go | 248 +---------------- kubernetes/typed/core/v1/podtemplate.go | 196 +------------- .../typed/core/v1/replicationcontroller.go | 252 ++--------------- kubernetes/typed/core/v1/resourcequota.go | 244 +---------------- kubernetes/typed/core/v1/secret.go | 196 +------------- kubernetes/typed/core/v1/service.go | 228 +--------------- kubernetes/typed/core/v1/serviceaccount.go | 200 +------------- .../typed/discovery/v1/endpointslice.go | 196 +------------- .../typed/discovery/v1beta1/endpointslice.go | 196 +------------- kubernetes/typed/events/v1/event.go | 196 +------------- kubernetes/typed/events/v1beta1/event.go | 196 +------------- .../typed/extensions/v1beta1/daemonset.go | 244 +---------------- .../typed/extensions/v1beta1/deployment.go | 254 ++---------------- .../typed/extensions/v1beta1/ingress.go | 244 +---------------- .../typed/extensions/v1beta1/networkpolicy.go | 196 +------------- .../typed/extensions/v1beta1/replicaset.go | 254 ++---------------- kubernetes/typed/flowcontrol/v1/flowschema.go | 230 +--------------- .../v1/prioritylevelconfiguration.go | 230 +--------------- .../typed/flowcontrol/v1beta1/flowschema.go | 230 +--------------- .../v1beta1/prioritylevelconfiguration.go | 230 +--------------- .../typed/flowcontrol/v1beta2/flowschema.go | 230 +--------------- .../v1beta2/prioritylevelconfiguration.go | 230 +--------------- .../typed/flowcontrol/v1beta3/flowschema.go | 230 +--------------- .../v1beta3/prioritylevelconfiguration.go | 230 +--------------- kubernetes/typed/networking/v1/ingress.go | 244 +---------------- .../typed/networking/v1/ingressclass.go | 184 +------------ .../typed/networking/v1/networkpolicy.go | 196 +------------- .../typed/networking/v1alpha1/ipaddress.go | 184 +------------ .../typed/networking/v1alpha1/servicecidr.go | 230 +--------------- .../typed/networking/v1beta1/ingress.go | 244 +---------------- .../typed/networking/v1beta1/ingressclass.go | 184 +------------ kubernetes/typed/node/v1/runtimeclass.go | 184 +------------ .../typed/node/v1alpha1/runtimeclass.go | 184 +------------ kubernetes/typed/node/v1beta1/runtimeclass.go | 184 +------------ kubernetes/typed/policy/v1/eviction.go | 15 +- .../typed/policy/v1/poddisruptionbudget.go | 244 +---------------- kubernetes/typed/policy/v1beta1/eviction.go | 15 +- .../policy/v1beta1/poddisruptionbudget.go | 244 +---------------- kubernetes/typed/rbac/v1/clusterrole.go | 184 +------------ .../typed/rbac/v1/clusterrolebinding.go | 184 +------------ kubernetes/typed/rbac/v1/role.go | 196 +------------- kubernetes/typed/rbac/v1/rolebinding.go | 196 +------------- kubernetes/typed/rbac/v1alpha1/clusterrole.go | 184 +------------ .../typed/rbac/v1alpha1/clusterrolebinding.go | 184 +------------ kubernetes/typed/rbac/v1alpha1/role.go | 196 +------------- kubernetes/typed/rbac/v1alpha1/rolebinding.go | 196 +------------- kubernetes/typed/rbac/v1beta1/clusterrole.go | 184 +------------ .../typed/rbac/v1beta1/clusterrolebinding.go | 184 +------------ kubernetes/typed/rbac/v1beta1/role.go | 196 +------------- kubernetes/typed/rbac/v1beta1/rolebinding.go | 196 +------------- .../resource/v1alpha2/podschedulingcontext.go | 244 +---------------- .../typed/resource/v1alpha2/resourceclaim.go | 244 +---------------- .../v1alpha2/resourceclaimparameters.go | 196 +------------- .../v1alpha2/resourceclaimtemplate.go | 196 +------------- .../typed/resource/v1alpha2/resourceclass.go | 184 +------------ .../v1alpha2/resourceclassparameters.go | 196 +------------- .../typed/resource/v1alpha2/resourceslice.go | 184 +------------ .../typed/scheduling/v1/priorityclass.go | 184 +------------ .../scheduling/v1alpha1/priorityclass.go | 184 +------------ .../typed/scheduling/v1beta1/priorityclass.go | 184 +------------ kubernetes/typed/storage/v1/csidriver.go | 184 +------------ kubernetes/typed/storage/v1/csinode.go | 184 +------------ .../typed/storage/v1/csistoragecapacity.go | 196 +------------- kubernetes/typed/storage/v1/storageclass.go | 184 +------------ .../typed/storage/v1/volumeattachment.go | 230 +--------------- .../storage/v1alpha1/csistoragecapacity.go | 196 +------------- .../storage/v1alpha1/volumeattachment.go | 230 +--------------- .../storage/v1alpha1/volumeattributesclass.go | 184 +------------ kubernetes/typed/storage/v1beta1/csidriver.go | 184 +------------ kubernetes/typed/storage/v1beta1/csinode.go | 184 +------------ .../storage/v1beta1/csistoragecapacity.go | 196 +------------- .../typed/storage/v1beta1/storageclass.go | 184 +------------ .../typed/storage/v1beta1/volumeattachment.go | 230 +--------------- .../v1alpha1/storageversionmigration.go | 230 +--------------- 132 files changed, 1336 insertions(+), 23872 deletions(-) diff --git a/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go index 4a50306848..e863766c60 100644 --- a/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // MutatingWebhookConfigurationsGetter has a method to return a MutatingWebhookConfigurationInterface. @@ -58,178 +52,18 @@ type MutatingWebhookConfigurationInterface interface { // mutatingWebhookConfigurations implements MutatingWebhookConfigurationInterface type mutatingWebhookConfigurations struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1.MutatingWebhookConfiguration, *v1.MutatingWebhookConfigurationList, *admissionregistrationv1.MutatingWebhookConfigurationApplyConfiguration] } // newMutatingWebhookConfigurations returns a MutatingWebhookConfigurations func newMutatingWebhookConfigurations(c *AdmissionregistrationV1Client) *mutatingWebhookConfigurations { return &mutatingWebhookConfigurations{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1.MutatingWebhookConfiguration, *v1.MutatingWebhookConfigurationList, *admissionregistrationv1.MutatingWebhookConfigurationApplyConfiguration]( + "mutatingwebhookconfigurations", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.MutatingWebhookConfiguration { return &v1.MutatingWebhookConfiguration{} }, + func() *v1.MutatingWebhookConfigurationList { return &v1.MutatingWebhookConfigurationList{} }), } } - -// Get takes name of the mutatingWebhookConfiguration, and returns the corresponding mutatingWebhookConfiguration object, and an error if there is any. -func (c *mutatingWebhookConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.MutatingWebhookConfiguration, err error) { - result = &v1.MutatingWebhookConfiguration{} - err = c.client.Get(). - Resource("mutatingwebhookconfigurations"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. -func (c *mutatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (*v1.MutatingWebhookConfigurationList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for mutatingwebhookconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for mutatingwebhookconfigurations", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for mutatingwebhookconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for mutatingwebhookconfigurations", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. -func (c *mutatingWebhookConfigurations) list(ctx context.Context, opts metav1.ListOptions) (result *v1.MutatingWebhookConfigurationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.MutatingWebhookConfigurationList{} - err = c.client.Get(). - Resource("mutatingwebhookconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of MutatingWebhookConfigurations -func (c *mutatingWebhookConfigurations) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.MutatingWebhookConfigurationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.MutatingWebhookConfigurationList{} - err = c.client.Get(). - Resource("mutatingwebhookconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations. -func (c *mutatingWebhookConfigurations) Watch(ctx context.Context, opts metav1.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("mutatingwebhookconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. -func (c *mutatingWebhookConfigurations) Create(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.CreateOptions) (result *v1.MutatingWebhookConfiguration, err error) { - result = &v1.MutatingWebhookConfiguration{} - err = c.client.Post(). - Resource("mutatingwebhookconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(mutatingWebhookConfiguration). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a mutatingWebhookConfiguration and updates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. -func (c *mutatingWebhookConfigurations) Update(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.UpdateOptions) (result *v1.MutatingWebhookConfiguration, err error) { - result = &v1.MutatingWebhookConfiguration{} - err = c.client.Put(). - Resource("mutatingwebhookconfigurations"). - Name(mutatingWebhookConfiguration.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(mutatingWebhookConfiguration). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs. -func (c *mutatingWebhookConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("mutatingwebhookconfigurations"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *mutatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("mutatingwebhookconfigurations"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched mutatingWebhookConfiguration. -func (c *mutatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.MutatingWebhookConfiguration, err error) { - result = &v1.MutatingWebhookConfiguration{} - err = c.client.Patch(pt). - Resource("mutatingwebhookconfigurations"). - 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 mutatingWebhookConfiguration. -func (c *mutatingWebhookConfigurations) Apply(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1.MutatingWebhookConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.MutatingWebhookConfiguration, err error) { - if mutatingWebhookConfiguration == nil { - return nil, fmt.Errorf("mutatingWebhookConfiguration provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(mutatingWebhookConfiguration) - if err != nil { - return nil, err - } - name := mutatingWebhookConfiguration.Name - if name == nil { - return nil, fmt.Errorf("mutatingWebhookConfiguration.Name must be provided to Apply") - } - result = &v1.MutatingWebhookConfiguration{} - err = c.client.Patch(types.ApplyPatchType). - Resource("mutatingwebhookconfigurations"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go b/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go index 33260641ac..1b20e69606 100644 --- a/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go +++ b/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicy.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ValidatingAdmissionPoliciesGetter has a method to return a ValidatingAdmissionPolicyInterface. @@ -46,6 +40,7 @@ type ValidatingAdmissionPoliciesGetter interface { type ValidatingAdmissionPolicyInterface interface { Create(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.CreateOptions) (*v1.ValidatingAdmissionPolicy, error) Update(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.UpdateOptions) (*v1.ValidatingAdmissionPolicy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.UpdateOptions) (*v1.ValidatingAdmissionPolicy, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -54,228 +49,25 @@ type ValidatingAdmissionPolicyInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingAdmissionPolicy, err error) Apply(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingAdmissionPolicy, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingAdmissionPolicy, err error) ValidatingAdmissionPolicyExpansion } // validatingAdmissionPolicies implements ValidatingAdmissionPolicyInterface type validatingAdmissionPolicies struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1.ValidatingAdmissionPolicy, *v1.ValidatingAdmissionPolicyList, *admissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration] } // newValidatingAdmissionPolicies returns a ValidatingAdmissionPolicies func newValidatingAdmissionPolicies(c *AdmissionregistrationV1Client) *validatingAdmissionPolicies { return &validatingAdmissionPolicies{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1.ValidatingAdmissionPolicy, *v1.ValidatingAdmissionPolicyList, *admissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration]( + "validatingadmissionpolicies", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.ValidatingAdmissionPolicy { return &v1.ValidatingAdmissionPolicy{} }, + func() *v1.ValidatingAdmissionPolicyList { return &v1.ValidatingAdmissionPolicyList{} }), } } - -// Get takes name of the validatingAdmissionPolicy, and returns the corresponding validatingAdmissionPolicy object, and an error if there is any. -func (c *validatingAdmissionPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ValidatingAdmissionPolicy, err error) { - result = &v1.ValidatingAdmissionPolicy{} - err = c.client.Get(). - Resource("validatingadmissionpolicies"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. -func (c *validatingAdmissionPolicies) List(ctx context.Context, opts metav1.ListOptions) (*v1.ValidatingAdmissionPolicyList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicies, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicies", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for validatingadmissionpolicies ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicies", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. -func (c *validatingAdmissionPolicies) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ValidatingAdmissionPolicyList{} - err = c.client.Get(). - Resource("validatingadmissionpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicies -func (c *validatingAdmissionPolicies) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ValidatingAdmissionPolicyList{} - err = c.client.Get(). - Resource("validatingadmissionpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies. -func (c *validatingAdmissionPolicies) Watch(ctx context.Context, opts metav1.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("validatingadmissionpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. -func (c *validatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.CreateOptions) (result *v1.ValidatingAdmissionPolicy, err error) { - result = &v1.ValidatingAdmissionPolicy{} - err = c.client.Post(). - Resource("validatingadmissionpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingAdmissionPolicy). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a validatingAdmissionPolicy and updates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. -func (c *validatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.UpdateOptions) (result *v1.ValidatingAdmissionPolicy, err error) { - result = &v1.ValidatingAdmissionPolicy{} - err = c.client.Put(). - Resource("validatingadmissionpolicies"). - Name(validatingAdmissionPolicy.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingAdmissionPolicy). - 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 *validatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.UpdateOptions) (result *v1.ValidatingAdmissionPolicy, err error) { - result = &v1.ValidatingAdmissionPolicy{} - err = c.client.Put(). - Resource("validatingadmissionpolicies"). - Name(validatingAdmissionPolicy.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingAdmissionPolicy). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the validatingAdmissionPolicy and deletes it. Returns an error if one occurs. -func (c *validatingAdmissionPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("validatingadmissionpolicies"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *validatingAdmissionPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("validatingadmissionpolicies"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched validatingAdmissionPolicy. -func (c *validatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingAdmissionPolicy, err error) { - result = &v1.ValidatingAdmissionPolicy{} - err = c.client.Patch(pt). - Resource("validatingadmissionpolicies"). - 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 validatingAdmissionPolicy. -func (c *validatingAdmissionPolicies) Apply(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingAdmissionPolicy, err error) { - if validatingAdmissionPolicy == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(validatingAdmissionPolicy) - if err != nil { - return nil, err - } - name := validatingAdmissionPolicy.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") - } - result = &v1.ValidatingAdmissionPolicy{} - err = c.client.Patch(types.ApplyPatchType). - Resource("validatingadmissionpolicies"). - 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 *validatingAdmissionPolicies) ApplyStatus(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingAdmissionPolicy, err error) { - if validatingAdmissionPolicy == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(validatingAdmissionPolicy) - if err != nil { - return nil, err - } - - name := validatingAdmissionPolicy.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") - } - - result = &v1.ValidatingAdmissionPolicy{} - err = c.client.Patch(types.ApplyPatchType). - Resource("validatingadmissionpolicies"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicybinding.go b/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicybinding.go index eac9f604e2..44694b2329 100644 --- a/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicybinding.go +++ b/kubernetes/typed/admissionregistration/v1/validatingadmissionpolicybinding.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ValidatingAdmissionPolicyBindingsGetter has a method to return a ValidatingAdmissionPolicyBindingInterface. @@ -58,178 +52,18 @@ type ValidatingAdmissionPolicyBindingInterface interface { // validatingAdmissionPolicyBindings implements ValidatingAdmissionPolicyBindingInterface type validatingAdmissionPolicyBindings struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1.ValidatingAdmissionPolicyBinding, *v1.ValidatingAdmissionPolicyBindingList, *admissionregistrationv1.ValidatingAdmissionPolicyBindingApplyConfiguration] } // newValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindings func newValidatingAdmissionPolicyBindings(c *AdmissionregistrationV1Client) *validatingAdmissionPolicyBindings { return &validatingAdmissionPolicyBindings{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1.ValidatingAdmissionPolicyBinding, *v1.ValidatingAdmissionPolicyBindingList, *admissionregistrationv1.ValidatingAdmissionPolicyBindingApplyConfiguration]( + "validatingadmissionpolicybindings", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.ValidatingAdmissionPolicyBinding { return &v1.ValidatingAdmissionPolicyBinding{} }, + func() *v1.ValidatingAdmissionPolicyBindingList { return &v1.ValidatingAdmissionPolicyBindingList{} }), } } - -// Get takes name of the validatingAdmissionPolicyBinding, and returns the corresponding validatingAdmissionPolicyBinding object, and an error if there is any. -func (c *validatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) { - result = &v1.ValidatingAdmissionPolicyBinding{} - err = c.client.Get(). - Resource("validatingadmissionpolicybindings"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. -func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts metav1.ListOptions) (*v1.ValidatingAdmissionPolicyBindingList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicybindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicybindings", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for validatingadmissionpolicybindings ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicybindings", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. -func (c *validatingAdmissionPolicyBindings) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ValidatingAdmissionPolicyBindingList{} - err = c.client.Get(). - Resource("validatingadmissionpolicybindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicyBindings -func (c *validatingAdmissionPolicyBindings) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ValidatingAdmissionPolicyBindingList{} - err = c.client.Get(). - Resource("validatingadmissionpolicybindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings. -func (c *validatingAdmissionPolicyBindings) Watch(ctx context.Context, opts metav1.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("validatingadmissionpolicybindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. -func (c *validatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1.ValidatingAdmissionPolicyBinding, opts metav1.CreateOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) { - result = &v1.ValidatingAdmissionPolicyBinding{} - err = c.client.Post(). - Resource("validatingadmissionpolicybindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingAdmissionPolicyBinding). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a validatingAdmissionPolicyBinding and updates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. -func (c *validatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1.ValidatingAdmissionPolicyBinding, opts metav1.UpdateOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) { - result = &v1.ValidatingAdmissionPolicyBinding{} - err = c.client.Put(). - Resource("validatingadmissionpolicybindings"). - Name(validatingAdmissionPolicyBinding.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingAdmissionPolicyBinding). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the validatingAdmissionPolicyBinding and deletes it. Returns an error if one occurs. -func (c *validatingAdmissionPolicyBindings) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("validatingadmissionpolicybindings"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *validatingAdmissionPolicyBindings) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("validatingadmissionpolicybindings"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched validatingAdmissionPolicyBinding. -func (c *validatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingAdmissionPolicyBinding, err error) { - result = &v1.ValidatingAdmissionPolicyBinding{} - err = c.client.Patch(pt). - Resource("validatingadmissionpolicybindings"). - 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 validatingAdmissionPolicyBinding. -func (c *validatingAdmissionPolicyBindings) Apply(ctx context.Context, validatingAdmissionPolicyBinding *admissionregistrationv1.ValidatingAdmissionPolicyBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) { - if validatingAdmissionPolicyBinding == nil { - return nil, fmt.Errorf("validatingAdmissionPolicyBinding provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(validatingAdmissionPolicyBinding) - if err != nil { - return nil, err - } - name := validatingAdmissionPolicyBinding.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicyBinding.Name must be provided to Apply") - } - result = &v1.ValidatingAdmissionPolicyBinding{} - err = c.client.Patch(types.ApplyPatchType). - Resource("validatingadmissionpolicybindings"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go index eb7df7efec..11b4ac0591 100644 --- a/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ValidatingWebhookConfigurationsGetter has a method to return a ValidatingWebhookConfigurationInterface. @@ -58,178 +52,18 @@ type ValidatingWebhookConfigurationInterface interface { // validatingWebhookConfigurations implements ValidatingWebhookConfigurationInterface type validatingWebhookConfigurations struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1.ValidatingWebhookConfiguration, *v1.ValidatingWebhookConfigurationList, *admissionregistrationv1.ValidatingWebhookConfigurationApplyConfiguration] } // newValidatingWebhookConfigurations returns a ValidatingWebhookConfigurations func newValidatingWebhookConfigurations(c *AdmissionregistrationV1Client) *validatingWebhookConfigurations { return &validatingWebhookConfigurations{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1.ValidatingWebhookConfiguration, *v1.ValidatingWebhookConfigurationList, *admissionregistrationv1.ValidatingWebhookConfigurationApplyConfiguration]( + "validatingwebhookconfigurations", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.ValidatingWebhookConfiguration { return &v1.ValidatingWebhookConfiguration{} }, + func() *v1.ValidatingWebhookConfigurationList { return &v1.ValidatingWebhookConfigurationList{} }), } } - -// Get takes name of the validatingWebhookConfiguration, and returns the corresponding validatingWebhookConfiguration object, and an error if there is any. -func (c *validatingWebhookConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ValidatingWebhookConfiguration, err error) { - result = &v1.ValidatingWebhookConfiguration{} - err = c.client.Get(). - Resource("validatingwebhookconfigurations"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. -func (c *validatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (*v1.ValidatingWebhookConfigurationList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for validatingwebhookconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingwebhookconfigurations", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for validatingwebhookconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingwebhookconfigurations", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. -func (c *validatingWebhookConfigurations) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingWebhookConfigurationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ValidatingWebhookConfigurationList{} - err = c.client.Get(). - Resource("validatingwebhookconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ValidatingWebhookConfigurations -func (c *validatingWebhookConfigurations) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingWebhookConfigurationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ValidatingWebhookConfigurationList{} - err = c.client.Get(). - Resource("validatingwebhookconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations. -func (c *validatingWebhookConfigurations) Watch(ctx context.Context, opts metav1.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("validatingwebhookconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. -func (c *validatingWebhookConfigurations) Create(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.CreateOptions) (result *v1.ValidatingWebhookConfiguration, err error) { - result = &v1.ValidatingWebhookConfiguration{} - err = c.client.Post(). - Resource("validatingwebhookconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingWebhookConfiguration). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a validatingWebhookConfiguration and updates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. -func (c *validatingWebhookConfigurations) Update(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.UpdateOptions) (result *v1.ValidatingWebhookConfiguration, err error) { - result = &v1.ValidatingWebhookConfiguration{} - err = c.client.Put(). - Resource("validatingwebhookconfigurations"). - Name(validatingWebhookConfiguration.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingWebhookConfiguration). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs. -func (c *validatingWebhookConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("validatingwebhookconfigurations"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *validatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("validatingwebhookconfigurations"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched validatingWebhookConfiguration. -func (c *validatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingWebhookConfiguration, err error) { - result = &v1.ValidatingWebhookConfiguration{} - err = c.client.Patch(pt). - Resource("validatingwebhookconfigurations"). - 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 validatingWebhookConfiguration. -func (c *validatingWebhookConfigurations) Apply(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1.ValidatingWebhookConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingWebhookConfiguration, err error) { - if validatingWebhookConfiguration == nil { - return nil, fmt.Errorf("validatingWebhookConfiguration provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(validatingWebhookConfiguration) - if err != nil { - return nil, err - } - name := validatingWebhookConfiguration.Name - if name == nil { - return nil, fmt.Errorf("validatingWebhookConfiguration.Name must be provided to Apply") - } - result = &v1.ValidatingWebhookConfiguration{} - err = c.client.Patch(types.ApplyPatchType). - Resource("validatingwebhookconfigurations"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicy.go b/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicy.go index 7c2e9fd218..c2b7c825cb 100644 --- a/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicy.go +++ b/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicy.go @@ -20,20 +20,14 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1alpha1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ValidatingAdmissionPoliciesGetter has a method to return a ValidatingAdmissionPolicyInterface. @@ -46,6 +40,7 @@ type ValidatingAdmissionPoliciesGetter interface { type ValidatingAdmissionPolicyInterface interface { Create(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.CreateOptions) (*v1alpha1.ValidatingAdmissionPolicy, error) Update(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (*v1alpha1.ValidatingAdmissionPolicy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (*v1alpha1.ValidatingAdmissionPolicy, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,228 +49,25 @@ type ValidatingAdmissionPolicyInterface 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.ValidatingAdmissionPolicy, err error) Apply(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1alpha1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1alpha1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) ValidatingAdmissionPolicyExpansion } // validatingAdmissionPolicies implements ValidatingAdmissionPolicyInterface type validatingAdmissionPolicies struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.ValidatingAdmissionPolicy, *v1alpha1.ValidatingAdmissionPolicyList, *admissionregistrationv1alpha1.ValidatingAdmissionPolicyApplyConfiguration] } // newValidatingAdmissionPolicies returns a ValidatingAdmissionPolicies func newValidatingAdmissionPolicies(c *AdmissionregistrationV1alpha1Client) *validatingAdmissionPolicies { return &validatingAdmissionPolicies{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.ValidatingAdmissionPolicy, *v1alpha1.ValidatingAdmissionPolicyList, *admissionregistrationv1alpha1.ValidatingAdmissionPolicyApplyConfiguration]( + "validatingadmissionpolicies", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.ValidatingAdmissionPolicy { return &v1alpha1.ValidatingAdmissionPolicy{} }, + func() *v1alpha1.ValidatingAdmissionPolicyList { return &v1alpha1.ValidatingAdmissionPolicyList{} }), } } - -// Get takes name of the validatingAdmissionPolicy, and returns the corresponding validatingAdmissionPolicy object, and an error if there is any. -func (c *validatingAdmissionPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { - result = &v1alpha1.ValidatingAdmissionPolicy{} - err = c.client.Get(). - Resource("validatingadmissionpolicies"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. -func (c *validatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ValidatingAdmissionPolicyList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicies, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicies", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for validatingadmissionpolicies ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicies", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. -func (c *validatingAdmissionPolicies) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ValidatingAdmissionPolicyList{} - err = c.client.Get(). - Resource("validatingadmissionpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicies -func (c *validatingAdmissionPolicies) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ValidatingAdmissionPolicyList{} - err = c.client.Get(). - Resource("validatingadmissionpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies. -func (c *validatingAdmissionPolicies) 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("validatingadmissionpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. -func (c *validatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.CreateOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { - result = &v1alpha1.ValidatingAdmissionPolicy{} - err = c.client.Post(). - Resource("validatingadmissionpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingAdmissionPolicy). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a validatingAdmissionPolicy and updates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. -func (c *validatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { - result = &v1alpha1.ValidatingAdmissionPolicy{} - err = c.client.Put(). - Resource("validatingadmissionpolicies"). - Name(validatingAdmissionPolicy.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingAdmissionPolicy). - 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 *validatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { - result = &v1alpha1.ValidatingAdmissionPolicy{} - err = c.client.Put(). - Resource("validatingadmissionpolicies"). - Name(validatingAdmissionPolicy.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingAdmissionPolicy). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the validatingAdmissionPolicy and deletes it. Returns an error if one occurs. -func (c *validatingAdmissionPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("validatingadmissionpolicies"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *validatingAdmissionPolicies) 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("validatingadmissionpolicies"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched validatingAdmissionPolicy. -func (c *validatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { - result = &v1alpha1.ValidatingAdmissionPolicy{} - err = c.client.Patch(pt). - Resource("validatingadmissionpolicies"). - 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 validatingAdmissionPolicy. -func (c *validatingAdmissionPolicies) Apply(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1alpha1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { - if validatingAdmissionPolicy == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(validatingAdmissionPolicy) - if err != nil { - return nil, err - } - name := validatingAdmissionPolicy.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") - } - result = &v1alpha1.ValidatingAdmissionPolicy{} - err = c.client.Patch(types.ApplyPatchType). - Resource("validatingadmissionpolicies"). - 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 *validatingAdmissionPolicies) ApplyStatus(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1alpha1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { - if validatingAdmissionPolicy == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(validatingAdmissionPolicy) - if err != nil { - return nil, err - } - - name := validatingAdmissionPolicy.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") - } - - result = &v1alpha1.ValidatingAdmissionPolicy{} - err = c.client.Patch(types.ApplyPatchType). - Resource("validatingadmissionpolicies"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go b/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go index d4e4b83374..d8d0796ead 100644 --- a/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go +++ b/kubernetes/typed/admissionregistration/v1alpha1/validatingadmissionpolicybinding.go @@ -20,20 +20,14 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1alpha1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ValidatingAdmissionPolicyBindingsGetter has a method to return a ValidatingAdmissionPolicyBindingInterface. @@ -58,178 +52,20 @@ type ValidatingAdmissionPolicyBindingInterface interface { // validatingAdmissionPolicyBindings implements ValidatingAdmissionPolicyBindingInterface type validatingAdmissionPolicyBindings struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.ValidatingAdmissionPolicyBinding, *v1alpha1.ValidatingAdmissionPolicyBindingList, *admissionregistrationv1alpha1.ValidatingAdmissionPolicyBindingApplyConfiguration] } // newValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindings func newValidatingAdmissionPolicyBindings(c *AdmissionregistrationV1alpha1Client) *validatingAdmissionPolicyBindings { return &validatingAdmissionPolicyBindings{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.ValidatingAdmissionPolicyBinding, *v1alpha1.ValidatingAdmissionPolicyBindingList, *admissionregistrationv1alpha1.ValidatingAdmissionPolicyBindingApplyConfiguration]( + "validatingadmissionpolicybindings", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.ValidatingAdmissionPolicyBinding { return &v1alpha1.ValidatingAdmissionPolicyBinding{} }, + func() *v1alpha1.ValidatingAdmissionPolicyBindingList { + return &v1alpha1.ValidatingAdmissionPolicyBindingList{} + }), } } - -// Get takes name of the validatingAdmissionPolicyBinding, and returns the corresponding validatingAdmissionPolicyBinding object, and an error if there is any. -func (c *validatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { - result = &v1alpha1.ValidatingAdmissionPolicyBinding{} - err = c.client.Get(). - Resource("validatingadmissionpolicybindings"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. -func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ValidatingAdmissionPolicyBindingList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicybindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicybindings", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for validatingadmissionpolicybindings ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicybindings", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. -func (c *validatingAdmissionPolicyBindings) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ValidatingAdmissionPolicyBindingList{} - err = c.client.Get(). - Resource("validatingadmissionpolicybindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicyBindings -func (c *validatingAdmissionPolicyBindings) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ValidatingAdmissionPolicyBindingList{} - err = c.client.Get(). - Resource("validatingadmissionpolicybindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings. -func (c *validatingAdmissionPolicyBindings) 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("validatingadmissionpolicybindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. -func (c *validatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1alpha1.ValidatingAdmissionPolicyBinding, opts v1.CreateOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { - result = &v1alpha1.ValidatingAdmissionPolicyBinding{} - err = c.client.Post(). - Resource("validatingadmissionpolicybindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingAdmissionPolicyBinding). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a validatingAdmissionPolicyBinding and updates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. -func (c *validatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1alpha1.ValidatingAdmissionPolicyBinding, opts v1.UpdateOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { - result = &v1alpha1.ValidatingAdmissionPolicyBinding{} - err = c.client.Put(). - Resource("validatingadmissionpolicybindings"). - Name(validatingAdmissionPolicyBinding.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingAdmissionPolicyBinding). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the validatingAdmissionPolicyBinding and deletes it. Returns an error if one occurs. -func (c *validatingAdmissionPolicyBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("validatingadmissionpolicybindings"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *validatingAdmissionPolicyBindings) 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("validatingadmissionpolicybindings"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched validatingAdmissionPolicyBinding. -func (c *validatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { - result = &v1alpha1.ValidatingAdmissionPolicyBinding{} - err = c.client.Patch(pt). - Resource("validatingadmissionpolicybindings"). - 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 validatingAdmissionPolicyBinding. -func (c *validatingAdmissionPolicyBindings) Apply(ctx context.Context, validatingAdmissionPolicyBinding *admissionregistrationv1alpha1.ValidatingAdmissionPolicyBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { - if validatingAdmissionPolicyBinding == nil { - return nil, fmt.Errorf("validatingAdmissionPolicyBinding provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(validatingAdmissionPolicyBinding) - if err != nil { - return nil, err - } - name := validatingAdmissionPolicyBinding.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicyBinding.Name must be provided to Apply") - } - result = &v1alpha1.ValidatingAdmissionPolicyBinding{} - err = c.client.Patch(types.ApplyPatchType). - Resource("validatingadmissionpolicybindings"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index 9ca778b6f7..7a5bc8b9b3 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // MutatingWebhookConfigurationsGetter has a method to return a MutatingWebhookConfigurationInterface. @@ -58,178 +52,18 @@ type MutatingWebhookConfigurationInterface interface { // mutatingWebhookConfigurations implements MutatingWebhookConfigurationInterface type mutatingWebhookConfigurations struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1beta1.MutatingWebhookConfiguration, *v1beta1.MutatingWebhookConfigurationList, *admissionregistrationv1beta1.MutatingWebhookConfigurationApplyConfiguration] } // newMutatingWebhookConfigurations returns a MutatingWebhookConfigurations func newMutatingWebhookConfigurations(c *AdmissionregistrationV1beta1Client) *mutatingWebhookConfigurations { return &mutatingWebhookConfigurations{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1beta1.MutatingWebhookConfiguration, *v1beta1.MutatingWebhookConfigurationList, *admissionregistrationv1beta1.MutatingWebhookConfigurationApplyConfiguration]( + "mutatingwebhookconfigurations", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.MutatingWebhookConfiguration { return &v1beta1.MutatingWebhookConfiguration{} }, + func() *v1beta1.MutatingWebhookConfigurationList { return &v1beta1.MutatingWebhookConfigurationList{} }), } } - -// Get takes name of the mutatingWebhookConfiguration, and returns the corresponding mutatingWebhookConfiguration object, and an error if there is any. -func (c *mutatingWebhookConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { - result = &v1beta1.MutatingWebhookConfiguration{} - err = c.client.Get(). - Resource("mutatingwebhookconfigurations"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. -func (c *mutatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.MutatingWebhookConfigurationList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for mutatingwebhookconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for mutatingwebhookconfigurations", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for mutatingwebhookconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for mutatingwebhookconfigurations", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. -func (c *mutatingWebhookConfigurations) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MutatingWebhookConfigurationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.MutatingWebhookConfigurationList{} - err = c.client.Get(). - Resource("mutatingwebhookconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of MutatingWebhookConfigurations -func (c *mutatingWebhookConfigurations) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MutatingWebhookConfigurationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.MutatingWebhookConfigurationList{} - err = c.client.Get(). - Resource("mutatingwebhookconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations. -func (c *mutatingWebhookConfigurations) 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("mutatingwebhookconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. -func (c *mutatingWebhookConfigurations) Create(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.CreateOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { - result = &v1beta1.MutatingWebhookConfiguration{} - err = c.client.Post(). - Resource("mutatingwebhookconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(mutatingWebhookConfiguration). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a mutatingWebhookConfiguration and updates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. -func (c *mutatingWebhookConfigurations) Update(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.UpdateOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { - result = &v1beta1.MutatingWebhookConfiguration{} - err = c.client.Put(). - Resource("mutatingwebhookconfigurations"). - Name(mutatingWebhookConfiguration.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(mutatingWebhookConfiguration). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs. -func (c *mutatingWebhookConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("mutatingwebhookconfigurations"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *mutatingWebhookConfigurations) 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("mutatingwebhookconfigurations"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched mutatingWebhookConfiguration. -func (c *mutatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MutatingWebhookConfiguration, err error) { - result = &v1beta1.MutatingWebhookConfiguration{} - err = c.client.Patch(pt). - Resource("mutatingwebhookconfigurations"). - 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 mutatingWebhookConfiguration. -func (c *mutatingWebhookConfigurations) Apply(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1beta1.MutatingWebhookConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { - if mutatingWebhookConfiguration == nil { - return nil, fmt.Errorf("mutatingWebhookConfiguration provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(mutatingWebhookConfiguration) - if err != nil { - return nil, err - } - name := mutatingWebhookConfiguration.Name - if name == nil { - return nil, fmt.Errorf("mutatingWebhookConfiguration.Name must be provided to Apply") - } - result = &v1beta1.MutatingWebhookConfiguration{} - err = c.client.Patch(types.ApplyPatchType). - Resource("mutatingwebhookconfigurations"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicy.go b/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicy.go index 563e887b26..0023d8837c 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicy.go +++ b/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicy.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ValidatingAdmissionPoliciesGetter has a method to return a ValidatingAdmissionPolicyInterface. @@ -46,6 +40,7 @@ type ValidatingAdmissionPoliciesGetter interface { type ValidatingAdmissionPolicyInterface interface { Create(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.CreateOptions) (*v1beta1.ValidatingAdmissionPolicy, error) Update(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (*v1beta1.ValidatingAdmissionPolicy, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (*v1beta1.ValidatingAdmissionPolicy, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,228 +49,25 @@ type ValidatingAdmissionPolicyInterface 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 *v1beta1.ValidatingAdmissionPolicy, err error) Apply(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) ValidatingAdmissionPolicyExpansion } // validatingAdmissionPolicies implements ValidatingAdmissionPolicyInterface type validatingAdmissionPolicies struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1beta1.ValidatingAdmissionPolicy, *v1beta1.ValidatingAdmissionPolicyList, *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration] } // newValidatingAdmissionPolicies returns a ValidatingAdmissionPolicies func newValidatingAdmissionPolicies(c *AdmissionregistrationV1beta1Client) *validatingAdmissionPolicies { return &validatingAdmissionPolicies{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1beta1.ValidatingAdmissionPolicy, *v1beta1.ValidatingAdmissionPolicyList, *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration]( + "validatingadmissionpolicies", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.ValidatingAdmissionPolicy { return &v1beta1.ValidatingAdmissionPolicy{} }, + func() *v1beta1.ValidatingAdmissionPolicyList { return &v1beta1.ValidatingAdmissionPolicyList{} }), } } - -// Get takes name of the validatingAdmissionPolicy, and returns the corresponding validatingAdmissionPolicy object, and an error if there is any. -func (c *validatingAdmissionPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - result = &v1beta1.ValidatingAdmissionPolicy{} - err = c.client.Get(). - Resource("validatingadmissionpolicies"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. -func (c *validatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ValidatingAdmissionPolicyList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicies, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicies", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for validatingadmissionpolicies ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicies", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors. -func (c *validatingAdmissionPolicies) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ValidatingAdmissionPolicyList{} - err = c.client.Get(). - Resource("validatingadmissionpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicies -func (c *validatingAdmissionPolicies) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ValidatingAdmissionPolicyList{} - err = c.client.Get(). - Resource("validatingadmissionpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies. -func (c *validatingAdmissionPolicies) 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("validatingadmissionpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. -func (c *validatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.CreateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - result = &v1beta1.ValidatingAdmissionPolicy{} - err = c.client.Post(). - Resource("validatingadmissionpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingAdmissionPolicy). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a validatingAdmissionPolicy and updates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. -func (c *validatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - result = &v1beta1.ValidatingAdmissionPolicy{} - err = c.client.Put(). - Resource("validatingadmissionpolicies"). - Name(validatingAdmissionPolicy.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingAdmissionPolicy). - 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 *validatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - result = &v1beta1.ValidatingAdmissionPolicy{} - err = c.client.Put(). - Resource("validatingadmissionpolicies"). - Name(validatingAdmissionPolicy.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingAdmissionPolicy). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the validatingAdmissionPolicy and deletes it. Returns an error if one occurs. -func (c *validatingAdmissionPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("validatingadmissionpolicies"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *validatingAdmissionPolicies) 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("validatingadmissionpolicies"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched validatingAdmissionPolicy. -func (c *validatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - result = &v1beta1.ValidatingAdmissionPolicy{} - err = c.client.Patch(pt). - Resource("validatingadmissionpolicies"). - 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 validatingAdmissionPolicy. -func (c *validatingAdmissionPolicies) Apply(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - if validatingAdmissionPolicy == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(validatingAdmissionPolicy) - if err != nil { - return nil, err - } - name := validatingAdmissionPolicy.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") - } - result = &v1beta1.ValidatingAdmissionPolicy{} - err = c.client.Patch(types.ApplyPatchType). - Resource("validatingadmissionpolicies"). - 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 *validatingAdmissionPolicies) ApplyStatus(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { - if validatingAdmissionPolicy == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(validatingAdmissionPolicy) - if err != nil { - return nil, err - } - - name := validatingAdmissionPolicy.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply") - } - - result = &v1beta1.ValidatingAdmissionPolicy{} - err = c.client.Patch(types.ApplyPatchType). - Resource("validatingadmissionpolicies"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicybinding.go b/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicybinding.go index f7f06218f4..8168d8cbcd 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicybinding.go +++ b/kubernetes/typed/admissionregistration/v1beta1/validatingadmissionpolicybinding.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ValidatingAdmissionPolicyBindingsGetter has a method to return a ValidatingAdmissionPolicyBindingInterface. @@ -58,178 +52,20 @@ type ValidatingAdmissionPolicyBindingInterface interface { // validatingAdmissionPolicyBindings implements ValidatingAdmissionPolicyBindingInterface type validatingAdmissionPolicyBindings struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1beta1.ValidatingAdmissionPolicyBinding, *v1beta1.ValidatingAdmissionPolicyBindingList, *admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingApplyConfiguration] } // newValidatingAdmissionPolicyBindings returns a ValidatingAdmissionPolicyBindings func newValidatingAdmissionPolicyBindings(c *AdmissionregistrationV1beta1Client) *validatingAdmissionPolicyBindings { return &validatingAdmissionPolicyBindings{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1beta1.ValidatingAdmissionPolicyBinding, *v1beta1.ValidatingAdmissionPolicyBindingList, *admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingApplyConfiguration]( + "validatingadmissionpolicybindings", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.ValidatingAdmissionPolicyBinding { return &v1beta1.ValidatingAdmissionPolicyBinding{} }, + func() *v1beta1.ValidatingAdmissionPolicyBindingList { + return &v1beta1.ValidatingAdmissionPolicyBindingList{} + }), } } - -// Get takes name of the validatingAdmissionPolicyBinding, and returns the corresponding validatingAdmissionPolicyBinding object, and an error if there is any. -func (c *validatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { - result = &v1beta1.ValidatingAdmissionPolicyBinding{} - err = c.client.Get(). - Resource("validatingadmissionpolicybindings"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. -func (c *validatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ValidatingAdmissionPolicyBindingList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for validatingadmissionpolicybindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingadmissionpolicybindings", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for validatingadmissionpolicybindings ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingadmissionpolicybindings", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors. -func (c *validatingAdmissionPolicyBindings) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ValidatingAdmissionPolicyBindingList{} - err = c.client.Get(). - Resource("validatingadmissionpolicybindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ValidatingAdmissionPolicyBindings -func (c *validatingAdmissionPolicyBindings) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ValidatingAdmissionPolicyBindingList{} - err = c.client.Get(). - Resource("validatingadmissionpolicybindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings. -func (c *validatingAdmissionPolicyBindings) 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("validatingadmissionpolicybindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. -func (c *validatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1beta1.ValidatingAdmissionPolicyBinding, opts v1.CreateOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { - result = &v1beta1.ValidatingAdmissionPolicyBinding{} - err = c.client.Post(). - Resource("validatingadmissionpolicybindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingAdmissionPolicyBinding). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a validatingAdmissionPolicyBinding and updates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. -func (c *validatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1beta1.ValidatingAdmissionPolicyBinding, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { - result = &v1beta1.ValidatingAdmissionPolicyBinding{} - err = c.client.Put(). - Resource("validatingadmissionpolicybindings"). - Name(validatingAdmissionPolicyBinding.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingAdmissionPolicyBinding). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the validatingAdmissionPolicyBinding and deletes it. Returns an error if one occurs. -func (c *validatingAdmissionPolicyBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("validatingadmissionpolicybindings"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *validatingAdmissionPolicyBindings) 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("validatingadmissionpolicybindings"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched validatingAdmissionPolicyBinding. -func (c *validatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { - result = &v1beta1.ValidatingAdmissionPolicyBinding{} - err = c.client.Patch(pt). - Resource("validatingadmissionpolicybindings"). - 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 validatingAdmissionPolicyBinding. -func (c *validatingAdmissionPolicyBindings) Apply(ctx context.Context, validatingAdmissionPolicyBinding *admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { - if validatingAdmissionPolicyBinding == nil { - return nil, fmt.Errorf("validatingAdmissionPolicyBinding provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(validatingAdmissionPolicyBinding) - if err != nil { - return nil, err - } - name := validatingAdmissionPolicyBinding.Name - if name == nil { - return nil, fmt.Errorf("validatingAdmissionPolicyBinding.Name must be provided to Apply") - } - result = &v1beta1.ValidatingAdmissionPolicyBinding{} - err = c.client.Patch(types.ApplyPatchType). - Resource("validatingadmissionpolicybindings"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go index d20801a1ff..5abd96823d 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/admissionregistration/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ValidatingWebhookConfigurationsGetter has a method to return a ValidatingWebhookConfigurationInterface. @@ -58,178 +52,20 @@ type ValidatingWebhookConfigurationInterface interface { // validatingWebhookConfigurations implements ValidatingWebhookConfigurationInterface type validatingWebhookConfigurations struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1beta1.ValidatingWebhookConfiguration, *v1beta1.ValidatingWebhookConfigurationList, *admissionregistrationv1beta1.ValidatingWebhookConfigurationApplyConfiguration] } // newValidatingWebhookConfigurations returns a ValidatingWebhookConfigurations func newValidatingWebhookConfigurations(c *AdmissionregistrationV1beta1Client) *validatingWebhookConfigurations { return &validatingWebhookConfigurations{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1beta1.ValidatingWebhookConfiguration, *v1beta1.ValidatingWebhookConfigurationList, *admissionregistrationv1beta1.ValidatingWebhookConfigurationApplyConfiguration]( + "validatingwebhookconfigurations", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.ValidatingWebhookConfiguration { return &v1beta1.ValidatingWebhookConfiguration{} }, + func() *v1beta1.ValidatingWebhookConfigurationList { + return &v1beta1.ValidatingWebhookConfigurationList{} + }), } } - -// Get takes name of the validatingWebhookConfiguration, and returns the corresponding validatingWebhookConfiguration object, and an error if there is any. -func (c *validatingWebhookConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { - result = &v1beta1.ValidatingWebhookConfiguration{} - err = c.client.Get(). - Resource("validatingwebhookconfigurations"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. -func (c *validatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ValidatingWebhookConfigurationList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for validatingwebhookconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for validatingwebhookconfigurations", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for validatingwebhookconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for validatingwebhookconfigurations", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. -func (c *validatingWebhookConfigurations) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingWebhookConfigurationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ValidatingWebhookConfigurationList{} - err = c.client.Get(). - Resource("validatingwebhookconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ValidatingWebhookConfigurations -func (c *validatingWebhookConfigurations) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingWebhookConfigurationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ValidatingWebhookConfigurationList{} - err = c.client.Get(). - Resource("validatingwebhookconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations. -func (c *validatingWebhookConfigurations) 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("validatingwebhookconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. -func (c *validatingWebhookConfigurations) Create(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.CreateOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { - result = &v1beta1.ValidatingWebhookConfiguration{} - err = c.client.Post(). - Resource("validatingwebhookconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingWebhookConfiguration). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a validatingWebhookConfiguration and updates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. -func (c *validatingWebhookConfigurations) Update(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.UpdateOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { - result = &v1beta1.ValidatingWebhookConfiguration{} - err = c.client.Put(). - Resource("validatingwebhookconfigurations"). - Name(validatingWebhookConfiguration.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(validatingWebhookConfiguration). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs. -func (c *validatingWebhookConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("validatingwebhookconfigurations"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *validatingWebhookConfigurations) 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("validatingwebhookconfigurations"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched validatingWebhookConfiguration. -func (c *validatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingWebhookConfiguration, err error) { - result = &v1beta1.ValidatingWebhookConfiguration{} - err = c.client.Patch(pt). - Resource("validatingwebhookconfigurations"). - 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 validatingWebhookConfiguration. -func (c *validatingWebhookConfigurations) Apply(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1beta1.ValidatingWebhookConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { - if validatingWebhookConfiguration == nil { - return nil, fmt.Errorf("validatingWebhookConfiguration provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(validatingWebhookConfiguration) - if err != nil { - return nil, err - } - name := validatingWebhookConfiguration.Name - if name == nil { - return nil, fmt.Errorf("validatingWebhookConfiguration.Name must be provided to Apply") - } - result = &v1beta1.ValidatingWebhookConfiguration{} - err = c.client.Patch(types.ApplyPatchType). - Resource("validatingwebhookconfigurations"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/apiserverinternal/v1alpha1/storageversion.go b/kubernetes/typed/apiserverinternal/v1alpha1/storageversion.go index 100f486a29..436593f7fa 100644 --- a/kubernetes/typed/apiserverinternal/v1alpha1/storageversion.go +++ b/kubernetes/typed/apiserverinternal/v1alpha1/storageversion.go @@ -20,20 +20,14 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" apiserverinternalv1alpha1 "k8s.io/client-go/applyconfigurations/apiserverinternal/v1alpha1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // StorageVersionsGetter has a method to return a StorageVersionInterface. @@ -46,6 +40,7 @@ type StorageVersionsGetter interface { type StorageVersionInterface interface { Create(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.CreateOptions) (*v1alpha1.StorageVersion, error) Update(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.UpdateOptions) (*v1alpha1.StorageVersion, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.UpdateOptions) (*v1alpha1.StorageVersion, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,228 +49,25 @@ type StorageVersionInterface 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.StorageVersion, err error) Apply(ctx context.Context, storageVersion *apiserverinternalv1alpha1.StorageVersionApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersion, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, storageVersion *apiserverinternalv1alpha1.StorageVersionApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersion, err error) StorageVersionExpansion } // storageVersions implements StorageVersionInterface type storageVersions struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.StorageVersion, *v1alpha1.StorageVersionList, *apiserverinternalv1alpha1.StorageVersionApplyConfiguration] } // newStorageVersions returns a StorageVersions func newStorageVersions(c *InternalV1alpha1Client) *storageVersions { return &storageVersions{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.StorageVersion, *v1alpha1.StorageVersionList, *apiserverinternalv1alpha1.StorageVersionApplyConfiguration]( + "storageversions", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.StorageVersion { return &v1alpha1.StorageVersion{} }, + func() *v1alpha1.StorageVersionList { return &v1alpha1.StorageVersionList{} }), } } - -// Get takes name of the storageVersion, and returns the corresponding storageVersion object, and an error if there is any. -func (c *storageVersions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.StorageVersion, err error) { - result = &v1alpha1.StorageVersion{} - err = c.client.Get(). - Resource("storageversions"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of StorageVersions that match those selectors. -func (c *storageVersions) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.StorageVersionList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for storageversions, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for storageversions", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for storageversions ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for storageversions", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of StorageVersions that match those selectors. -func (c *storageVersions) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.StorageVersionList{} - err = c.client.Get(). - Resource("storageversions"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of StorageVersions -func (c *storageVersions) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.StorageVersionList{} - err = c.client.Get(). - Resource("storageversions"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested storageVersions. -func (c *storageVersions) 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("storageversions"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a storageVersion and creates it. Returns the server's representation of the storageVersion, and an error, if there is any. -func (c *storageVersions) Create(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.CreateOptions) (result *v1alpha1.StorageVersion, err error) { - result = &v1alpha1.StorageVersion{} - err = c.client.Post(). - Resource("storageversions"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(storageVersion). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a storageVersion and updates it. Returns the server's representation of the storageVersion, and an error, if there is any. -func (c *storageVersions) Update(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.UpdateOptions) (result *v1alpha1.StorageVersion, err error) { - result = &v1alpha1.StorageVersion{} - err = c.client.Put(). - Resource("storageversions"). - Name(storageVersion.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(storageVersion). - 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 *storageVersions) UpdateStatus(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.UpdateOptions) (result *v1alpha1.StorageVersion, err error) { - result = &v1alpha1.StorageVersion{} - err = c.client.Put(). - Resource("storageversions"). - Name(storageVersion.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(storageVersion). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the storageVersion and deletes it. Returns an error if one occurs. -func (c *storageVersions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("storageversions"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *storageVersions) 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("storageversions"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched storageVersion. -func (c *storageVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.StorageVersion, err error) { - result = &v1alpha1.StorageVersion{} - err = c.client.Patch(pt). - Resource("storageversions"). - 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 storageVersion. -func (c *storageVersions) Apply(ctx context.Context, storageVersion *apiserverinternalv1alpha1.StorageVersionApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersion, err error) { - if storageVersion == nil { - return nil, fmt.Errorf("storageVersion provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(storageVersion) - if err != nil { - return nil, err - } - name := storageVersion.Name - if name == nil { - return nil, fmt.Errorf("storageVersion.Name must be provided to Apply") - } - result = &v1alpha1.StorageVersion{} - err = c.client.Patch(types.ApplyPatchType). - Resource("storageversions"). - 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 *storageVersions) ApplyStatus(ctx context.Context, storageVersion *apiserverinternalv1alpha1.StorageVersionApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersion, err error) { - if storageVersion == nil { - return nil, fmt.Errorf("storageVersion provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(storageVersion) - if err != nil { - return nil, err - } - - name := storageVersion.Name - if name == nil { - return nil, fmt.Errorf("storageVersion.Name must be provided to Apply") - } - - result = &v1alpha1.StorageVersion{} - err = c.client.Patch(types.ApplyPatchType). - Resource("storageversions"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/apps/v1/controllerrevision.go b/kubernetes/typed/apps/v1/controllerrevision.go index acf50b58c4..252f47ba29 100644 --- a/kubernetes/typed/apps/v1/controllerrevision.go +++ b/kubernetes/typed/apps/v1/controllerrevision.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ControllerRevisionsGetter has a method to return a ControllerRevisionInterface. @@ -58,190 +52,18 @@ type ControllerRevisionInterface interface { // controllerRevisions implements ControllerRevisionInterface type controllerRevisions struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.ControllerRevision, *v1.ControllerRevisionList, *appsv1.ControllerRevisionApplyConfiguration] } // newControllerRevisions returns a ControllerRevisions func newControllerRevisions(c *AppsV1Client, namespace string) *controllerRevisions { return &controllerRevisions{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.ControllerRevision, *v1.ControllerRevisionList, *appsv1.ControllerRevisionApplyConfiguration]( + "controllerrevisions", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.ControllerRevision { return &v1.ControllerRevision{} }, + func() *v1.ControllerRevisionList { return &v1.ControllerRevisionList{} }), } } - -// Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any. -func (c *controllerRevisions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ControllerRevision, err error) { - result = &v1.ControllerRevision{} - err = c.client.Get(). - Namespace(c.ns). - Resource("controllerrevisions"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. -func (c *controllerRevisions) List(ctx context.Context, opts metav1.ListOptions) (*v1.ControllerRevisionList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for controllerrevisions, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for controllerrevisions", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for controllerrevisions ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for controllerrevisions", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. -func (c *controllerRevisions) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ControllerRevisionList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ControllerRevisionList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("controllerrevisions"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ControllerRevisions -func (c *controllerRevisions) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ControllerRevisionList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ControllerRevisionList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("controllerrevisions"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested controllerRevisions. -func (c *controllerRevisions) Watch(ctx context.Context, opts metav1.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("controllerrevisions"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any. -func (c *controllerRevisions) Create(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.CreateOptions) (result *v1.ControllerRevision, err error) { - result = &v1.ControllerRevision{} - err = c.client.Post(). - Namespace(c.ns). - Resource("controllerrevisions"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(controllerRevision). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any. -func (c *controllerRevisions) Update(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.UpdateOptions) (result *v1.ControllerRevision, err error) { - result = &v1.ControllerRevision{} - err = c.client.Put(). - Namespace(c.ns). - Resource("controllerrevisions"). - Name(controllerRevision.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(controllerRevision). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs. -func (c *controllerRevisions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("controllerrevisions"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *controllerRevisions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("controllerrevisions"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched controllerRevision. -func (c *controllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ControllerRevision, err error) { - result = &v1.ControllerRevision{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("controllerrevisions"). - 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 controllerRevision. -func (c *controllerRevisions) Apply(ctx context.Context, controllerRevision *appsv1.ControllerRevisionApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ControllerRevision, err error) { - if controllerRevision == nil { - return nil, fmt.Errorf("controllerRevision provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(controllerRevision) - if err != nil { - return nil, err - } - name := controllerRevision.Name - if name == nil { - return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply") - } - result = &v1.ControllerRevision{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("controllerrevisions"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/apps/v1/daemonset.go b/kubernetes/typed/apps/v1/daemonset.go index 60741f088d..28917a7960 100644 --- a/kubernetes/typed/apps/v1/daemonset.go +++ b/kubernetes/typed/apps/v1/daemonset.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // DaemonSetsGetter has a method to return a DaemonSetInterface. @@ -46,6 +40,7 @@ type DaemonSetsGetter interface { type DaemonSetInterface interface { Create(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.CreateOptions) (*v1.DaemonSet, error) Update(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (*v1.DaemonSet, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (*v1.DaemonSet, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -54,242 +49,25 @@ type DaemonSetInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DaemonSet, err error) Apply(ctx context.Context, daemonSet *appsv1.DaemonSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DaemonSet, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, daemonSet *appsv1.DaemonSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DaemonSet, err error) DaemonSetExpansion } // daemonSets implements DaemonSetInterface type daemonSets struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.DaemonSet, *v1.DaemonSetList, *appsv1.DaemonSetApplyConfiguration] } // newDaemonSets returns a DaemonSets func newDaemonSets(c *AppsV1Client, namespace string) *daemonSets { return &daemonSets{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.DaemonSet, *v1.DaemonSetList, *appsv1.DaemonSetApplyConfiguration]( + "daemonsets", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.DaemonSet { return &v1.DaemonSet{} }, + func() *v1.DaemonSetList { return &v1.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 metav1.GetOptions) (result *v1.DaemonSet, err error) { - result = &v1.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 metav1.ListOptions) (*v1.DaemonSetList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for daemonsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for daemonsets", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for daemonsets ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for daemonsets", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of DaemonSets that match those selectors. -func (c *daemonSets) list(ctx context.Context, opts metav1.ListOptions) (result *v1.DaemonSetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.DaemonSetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("daemonsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of DaemonSets -func (c *daemonSets) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.DaemonSetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.DaemonSetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("daemonsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested daemonSets. -func (c *daemonSets) Watch(ctx context.Context, opts metav1.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 *v1.DaemonSet, opts metav1.CreateOptions) (result *v1.DaemonSet, err error) { - result = &v1.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 *v1.DaemonSet, opts metav1.UpdateOptions) (result *v1.DaemonSet, err error) { - result = &v1.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 *v1.DaemonSet, opts metav1.UpdateOptions) (result *v1.DaemonSet, err error) { - result = &v1.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 metav1.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 metav1.DeleteOptions, listOpts metav1.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 metav1.PatchOptions, subresources ...string) (result *v1.DaemonSet, err error) { - result = &v1.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 *appsv1.DaemonSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.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 = &v1.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 *appsv1.DaemonSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.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 = &v1.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/kubernetes/typed/apps/v1/deployment.go b/kubernetes/typed/apps/v1/deployment.go index 256dd69bb0..871d51cfe2 100644 --- a/kubernetes/typed/apps/v1/deployment.go +++ b/kubernetes/typed/apps/v1/deployment.go @@ -22,7 +22,6 @@ import ( "context" json "encoding/json" "fmt" - "time" v1 "k8s.io/api/apps/v1" autoscalingv1 "k8s.io/api/autoscaling/v1" @@ -31,11 +30,8 @@ import ( watch "k8s.io/apimachinery/pkg/watch" appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // DeploymentsGetter has a method to return a DeploymentInterface. @@ -48,6 +44,7 @@ type DeploymentsGetter interface { type DeploymentInterface interface { Create(ctx context.Context, deployment *v1.Deployment, opts metav1.CreateOptions) (*v1.Deployment, error) Update(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (*v1.Deployment, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (*v1.Deployment, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -56,6 +53,7 @@ type DeploymentInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Deployment, err error) Apply(ctx context.Context, deployment *appsv1.DeploymentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Deployment, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, deployment *appsv1.DeploymentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Deployment, err error) GetScale(ctx context.Context, deploymentName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) UpdateScale(ctx context.Context, deploymentName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) @@ -66,245 +64,27 @@ type DeploymentInterface interface { // deployments implements DeploymentInterface type deployments struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.Deployment, *v1.DeploymentList, *appsv1.DeploymentApplyConfiguration] } // newDeployments returns a Deployments func newDeployments(c *AppsV1Client, namespace string) *deployments { return &deployments{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.Deployment, *v1.DeploymentList, *appsv1.DeploymentApplyConfiguration]( + "deployments", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.Deployment { return &v1.Deployment{} }, + func() *v1.DeploymentList { return &v1.DeploymentList{} }), } } -// Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. -func (c *deployments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Deployment, err error) { - result = &v1.Deployment{} - err = c.client.Get(). - Namespace(c.ns). - Resource("deployments"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Deployments that match those selectors. -func (c *deployments) List(ctx context.Context, opts metav1.ListOptions) (*v1.DeploymentList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for deployments, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for deployments", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for deployments ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of Deployments that match those selectors. -func (c *deployments) list(ctx context.Context, opts metav1.ListOptions) (result *v1.DeploymentList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.DeploymentList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("deployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of Deployments -func (c *deployments) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.DeploymentList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.DeploymentList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("deployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested deployments. -func (c *deployments) Watch(ctx context.Context, opts metav1.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("deployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *deployments) Create(ctx context.Context, deployment *v1.Deployment, opts metav1.CreateOptions) (result *v1.Deployment, err error) { - result = &v1.Deployment{} - err = c.client.Post(). - Namespace(c.ns). - Resource("deployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(deployment). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *deployments) Update(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (result *v1.Deployment, err error) { - result = &v1.Deployment{} - err = c.client.Put(). - Namespace(c.ns). - Resource("deployments"). - Name(deployment.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(deployment). - 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 *deployments) UpdateStatus(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (result *v1.Deployment, err error) { - result = &v1.Deployment{} - err = c.client.Put(). - Namespace(c.ns). - Resource("deployments"). - Name(deployment.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(deployment). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the deployment and deletes it. Returns an error if one occurs. -func (c *deployments) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("deployments"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *deployments) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("deployments"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched deployment. -func (c *deployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Deployment, err error) { - result = &v1.Deployment{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("deployments"). - 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 deployment. -func (c *deployments) Apply(ctx context.Context, deployment *appsv1.DeploymentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Deployment, err error) { - if deployment == nil { - return nil, fmt.Errorf("deployment provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(deployment) - if err != nil { - return nil, err - } - name := deployment.Name - if name == nil { - return nil, fmt.Errorf("deployment.Name must be provided to Apply") - } - result = &v1.Deployment{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("deployments"). - 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 *deployments) ApplyStatus(ctx context.Context, deployment *appsv1.DeploymentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Deployment, err error) { - if deployment == nil { - return nil, fmt.Errorf("deployment provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(deployment) - if err != nil { - return nil, err - } - - name := deployment.Name - if name == nil { - return nil, fmt.Errorf("deployment.Name must be provided to Apply") - } - - result = &v1.Deployment{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("deployments"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - // GetScale takes name of the deployment, and returns the corresponding autoscalingv1.Scale object, and an error if there is any. func (c *deployments) GetScale(ctx context.Context, deploymentName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} - err = c.client.Get(). - Namespace(c.ns). + err = c.GetClient().Get(). + Namespace(c.GetNamespace()). Resource("deployments"). Name(deploymentName). SubResource("scale"). @@ -317,8 +97,8 @@ func (c *deployments) GetScale(ctx context.Context, deploymentName string, optio // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *deployments) UpdateScale(ctx context.Context, deploymentName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} - err = c.client.Put(). - Namespace(c.ns). + err = c.GetClient().Put(). + Namespace(c.GetNamespace()). Resource("deployments"). Name(deploymentName). SubResource("scale"). @@ -342,8 +122,8 @@ func (c *deployments) ApplyScale(ctx context.Context, deploymentName string, sca } result = &autoscalingv1.Scale{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). + err = c.GetClient().Patch(types.ApplyPatchType). + Namespace(c.GetNamespace()). Resource("deployments"). Name(deploymentName). SubResource("scale"). diff --git a/kubernetes/typed/apps/v1/replicaset.go b/kubernetes/typed/apps/v1/replicaset.go index f8c6ca8ecb..d6dec016bb 100644 --- a/kubernetes/typed/apps/v1/replicaset.go +++ b/kubernetes/typed/apps/v1/replicaset.go @@ -22,7 +22,6 @@ import ( "context" json "encoding/json" "fmt" - "time" v1 "k8s.io/api/apps/v1" autoscalingv1 "k8s.io/api/autoscaling/v1" @@ -31,11 +30,8 @@ import ( watch "k8s.io/apimachinery/pkg/watch" appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ReplicaSetsGetter has a method to return a ReplicaSetInterface. @@ -48,6 +44,7 @@ type ReplicaSetsGetter interface { type ReplicaSetInterface interface { Create(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.CreateOptions) (*v1.ReplicaSet, error) Update(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (*v1.ReplicaSet, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (*v1.ReplicaSet, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -56,6 +53,7 @@ type ReplicaSetInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ReplicaSet, err error) Apply(ctx context.Context, replicaSet *appsv1.ReplicaSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicaSet, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, replicaSet *appsv1.ReplicaSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicaSet, err error) GetScale(ctx context.Context, replicaSetName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) UpdateScale(ctx context.Context, replicaSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) @@ -66,245 +64,27 @@ type ReplicaSetInterface interface { // replicaSets implements ReplicaSetInterface type replicaSets struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.ReplicaSet, *v1.ReplicaSetList, *appsv1.ReplicaSetApplyConfiguration] } // newReplicaSets returns a ReplicaSets func newReplicaSets(c *AppsV1Client, namespace string) *replicaSets { return &replicaSets{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.ReplicaSet, *v1.ReplicaSetList, *appsv1.ReplicaSetApplyConfiguration]( + "replicasets", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.ReplicaSet { return &v1.ReplicaSet{} }, + func() *v1.ReplicaSetList { return &v1.ReplicaSetList{} }), } } -// Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any. -func (c *replicaSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ReplicaSet, err error) { - result = &v1.ReplicaSet{} - err = c.client.Get(). - Namespace(c.ns). - Resource("replicasets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. -func (c *replicaSets) List(ctx context.Context, opts metav1.ListOptions) (*v1.ReplicaSetList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for replicasets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for replicasets", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for replicasets ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicasets", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ReplicaSets that match those selectors. -func (c *replicaSets) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicaSetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ReplicaSetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("replicasets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ReplicaSets -func (c *replicaSets) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicaSetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ReplicaSetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("replicasets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested replicaSets. -func (c *replicaSets) Watch(ctx context.Context, opts metav1.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("replicasets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any. -func (c *replicaSets) Create(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.CreateOptions) (result *v1.ReplicaSet, err error) { - result = &v1.ReplicaSet{} - err = c.client.Post(). - Namespace(c.ns). - Resource("replicasets"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(replicaSet). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any. -func (c *replicaSets) Update(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (result *v1.ReplicaSet, err error) { - result = &v1.ReplicaSet{} - err = c.client.Put(). - Namespace(c.ns). - Resource("replicasets"). - Name(replicaSet.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(replicaSet). - 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 *replicaSets) UpdateStatus(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (result *v1.ReplicaSet, err error) { - result = &v1.ReplicaSet{} - err = c.client.Put(). - Namespace(c.ns). - Resource("replicasets"). - Name(replicaSet.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(replicaSet). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. -func (c *replicaSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("replicasets"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *replicaSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("replicasets"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched replicaSet. -func (c *replicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ReplicaSet, err error) { - result = &v1.ReplicaSet{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("replicasets"). - 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 replicaSet. -func (c *replicaSets) Apply(ctx context.Context, replicaSet *appsv1.ReplicaSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicaSet, err error) { - if replicaSet == nil { - return nil, fmt.Errorf("replicaSet provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(replicaSet) - if err != nil { - return nil, err - } - name := replicaSet.Name - if name == nil { - return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") - } - result = &v1.ReplicaSet{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("replicasets"). - 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 *replicaSets) ApplyStatus(ctx context.Context, replicaSet *appsv1.ReplicaSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicaSet, err error) { - if replicaSet == nil { - return nil, fmt.Errorf("replicaSet provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(replicaSet) - if err != nil { - return nil, err - } - - name := replicaSet.Name - if name == nil { - return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") - } - - result = &v1.ReplicaSet{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("replicasets"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - // GetScale takes name of the replicaSet, and returns the corresponding autoscalingv1.Scale object, and an error if there is any. func (c *replicaSets) GetScale(ctx context.Context, replicaSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} - err = c.client.Get(). - Namespace(c.ns). + err = c.GetClient().Get(). + Namespace(c.GetNamespace()). Resource("replicasets"). Name(replicaSetName). SubResource("scale"). @@ -317,8 +97,8 @@ func (c *replicaSets) GetScale(ctx context.Context, replicaSetName string, optio // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *replicaSets) UpdateScale(ctx context.Context, replicaSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} - err = c.client.Put(). - Namespace(c.ns). + err = c.GetClient().Put(). + Namespace(c.GetNamespace()). Resource("replicasets"). Name(replicaSetName). SubResource("scale"). @@ -342,8 +122,8 @@ func (c *replicaSets) ApplyScale(ctx context.Context, replicaSetName string, sca } result = &autoscalingv1.Scale{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). + err = c.GetClient().Patch(types.ApplyPatchType). + Namespace(c.GetNamespace()). Resource("replicasets"). Name(replicaSetName). SubResource("scale"). diff --git a/kubernetes/typed/apps/v1/statefulset.go b/kubernetes/typed/apps/v1/statefulset.go index ed667566b6..b25ed07238 100644 --- a/kubernetes/typed/apps/v1/statefulset.go +++ b/kubernetes/typed/apps/v1/statefulset.go @@ -22,7 +22,6 @@ import ( "context" json "encoding/json" "fmt" - "time" v1 "k8s.io/api/apps/v1" autoscalingv1 "k8s.io/api/autoscaling/v1" @@ -31,11 +30,8 @@ import ( watch "k8s.io/apimachinery/pkg/watch" appsv1 "k8s.io/client-go/applyconfigurations/apps/v1" applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // StatefulSetsGetter has a method to return a StatefulSetInterface. @@ -48,6 +44,7 @@ type StatefulSetsGetter interface { type StatefulSetInterface interface { Create(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.CreateOptions) (*v1.StatefulSet, error) Update(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (*v1.StatefulSet, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (*v1.StatefulSet, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -56,6 +53,7 @@ type StatefulSetInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.StatefulSet, err error) Apply(ctx context.Context, statefulSet *appsv1.StatefulSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.StatefulSet, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, statefulSet *appsv1.StatefulSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.StatefulSet, err error) GetScale(ctx context.Context, statefulSetName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) UpdateScale(ctx context.Context, statefulSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) @@ -66,245 +64,27 @@ type StatefulSetInterface interface { // statefulSets implements StatefulSetInterface type statefulSets struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.StatefulSet, *v1.StatefulSetList, *appsv1.StatefulSetApplyConfiguration] } // newStatefulSets returns a StatefulSets func newStatefulSets(c *AppsV1Client, namespace string) *statefulSets { return &statefulSets{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.StatefulSet, *v1.StatefulSetList, *appsv1.StatefulSetApplyConfiguration]( + "statefulsets", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.StatefulSet { return &v1.StatefulSet{} }, + func() *v1.StatefulSetList { return &v1.StatefulSetList{} }), } } -// Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any. -func (c *statefulSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.StatefulSet, err error) { - result = &v1.StatefulSet{} - err = c.client.Get(). - Namespace(c.ns). - Resource("statefulsets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of StatefulSets that match those selectors. -func (c *statefulSets) List(ctx context.Context, opts metav1.ListOptions) (*v1.StatefulSetList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for statefulsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for statefulsets", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for statefulsets ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for statefulsets", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of StatefulSets that match those selectors. -func (c *statefulSets) list(ctx context.Context, opts metav1.ListOptions) (result *v1.StatefulSetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.StatefulSetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("statefulsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of StatefulSets -func (c *statefulSets) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.StatefulSetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.StatefulSetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("statefulsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested statefulSets. -func (c *statefulSets) Watch(ctx context.Context, opts metav1.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("statefulsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any. -func (c *statefulSets) Create(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.CreateOptions) (result *v1.StatefulSet, err error) { - result = &v1.StatefulSet{} - err = c.client.Post(). - Namespace(c.ns). - Resource("statefulsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(statefulSet). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any. -func (c *statefulSets) Update(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (result *v1.StatefulSet, err error) { - result = &v1.StatefulSet{} - err = c.client.Put(). - Namespace(c.ns). - Resource("statefulsets"). - Name(statefulSet.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(statefulSet). - 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 *statefulSets) UpdateStatus(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (result *v1.StatefulSet, err error) { - result = &v1.StatefulSet{} - err = c.client.Put(). - Namespace(c.ns). - Resource("statefulsets"). - Name(statefulSet.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(statefulSet). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the statefulSet and deletes it. Returns an error if one occurs. -func (c *statefulSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("statefulsets"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *statefulSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("statefulsets"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched statefulSet. -func (c *statefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.StatefulSet, err error) { - result = &v1.StatefulSet{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("statefulsets"). - 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 statefulSet. -func (c *statefulSets) Apply(ctx context.Context, statefulSet *appsv1.StatefulSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.StatefulSet, err error) { - if statefulSet == nil { - return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(statefulSet) - if err != nil { - return nil, err - } - name := statefulSet.Name - if name == nil { - return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") - } - result = &v1.StatefulSet{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("statefulsets"). - 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 *statefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1.StatefulSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.StatefulSet, err error) { - if statefulSet == nil { - return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(statefulSet) - if err != nil { - return nil, err - } - - name := statefulSet.Name - if name == nil { - return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") - } - - result = &v1.StatefulSet{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("statefulsets"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - // GetScale takes name of the statefulSet, and returns the corresponding autoscalingv1.Scale object, and an error if there is any. func (c *statefulSets) GetScale(ctx context.Context, statefulSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} - err = c.client.Get(). - Namespace(c.ns). + err = c.GetClient().Get(). + Namespace(c.GetNamespace()). Resource("statefulsets"). Name(statefulSetName). SubResource("scale"). @@ -317,8 +97,8 @@ func (c *statefulSets) GetScale(ctx context.Context, statefulSetName string, opt // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *statefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} - err = c.client.Put(). - Namespace(c.ns). + err = c.GetClient().Put(). + Namespace(c.GetNamespace()). Resource("statefulsets"). Name(statefulSetName). SubResource("scale"). @@ -342,8 +122,8 @@ func (c *statefulSets) ApplyScale(ctx context.Context, statefulSetName string, s } result = &autoscalingv1.Scale{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). + err = c.GetClient().Patch(types.ApplyPatchType). + Namespace(c.GetNamespace()). Resource("statefulsets"). Name(statefulSetName). SubResource("scale"). diff --git a/kubernetes/typed/apps/v1beta1/controllerrevision.go b/kubernetes/typed/apps/v1beta1/controllerrevision.go index efa2e74db7..185f7cc4e0 100644 --- a/kubernetes/typed/apps/v1beta1/controllerrevision.go +++ b/kubernetes/typed/apps/v1beta1/controllerrevision.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ControllerRevisionsGetter has a method to return a ControllerRevisionInterface. @@ -58,190 +52,18 @@ type ControllerRevisionInterface interface { // controllerRevisions implements ControllerRevisionInterface type controllerRevisions struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta1.ControllerRevision, *v1beta1.ControllerRevisionList, *appsv1beta1.ControllerRevisionApplyConfiguration] } // newControllerRevisions returns a ControllerRevisions func newControllerRevisions(c *AppsV1beta1Client, namespace string) *controllerRevisions { return &controllerRevisions{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta1.ControllerRevision, *v1beta1.ControllerRevisionList, *appsv1beta1.ControllerRevisionApplyConfiguration]( + "controllerrevisions", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.ControllerRevision { return &v1beta1.ControllerRevision{} }, + func() *v1beta1.ControllerRevisionList { return &v1beta1.ControllerRevisionList{} }), } } - -// Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any. -func (c *controllerRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ControllerRevision, err error) { - result = &v1beta1.ControllerRevision{} - err = c.client.Get(). - Namespace(c.ns). - Resource("controllerrevisions"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. -func (c *controllerRevisions) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ControllerRevisionList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for controllerrevisions, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for controllerrevisions", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for controllerrevisions ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for controllerrevisions", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. -func (c *controllerRevisions) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ControllerRevisionList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ControllerRevisionList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("controllerrevisions"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ControllerRevisions -func (c *controllerRevisions) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ControllerRevisionList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ControllerRevisionList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("controllerrevisions"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested controllerRevisions. -func (c *controllerRevisions) 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("controllerrevisions"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any. -func (c *controllerRevisions) Create(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.CreateOptions) (result *v1beta1.ControllerRevision, err error) { - result = &v1beta1.ControllerRevision{} - err = c.client.Post(). - Namespace(c.ns). - Resource("controllerrevisions"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(controllerRevision). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any. -func (c *controllerRevisions) Update(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.UpdateOptions) (result *v1beta1.ControllerRevision, err error) { - result = &v1beta1.ControllerRevision{} - err = c.client.Put(). - Namespace(c.ns). - Resource("controllerrevisions"). - Name(controllerRevision.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(controllerRevision). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs. -func (c *controllerRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("controllerrevisions"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *controllerRevisions) 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("controllerrevisions"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched controllerRevision. -func (c *controllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ControllerRevision, err error) { - result = &v1beta1.ControllerRevision{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("controllerrevisions"). - 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 controllerRevision. -func (c *controllerRevisions) Apply(ctx context.Context, controllerRevision *appsv1beta1.ControllerRevisionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ControllerRevision, err error) { - if controllerRevision == nil { - return nil, fmt.Errorf("controllerRevision provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(controllerRevision) - if err != nil { - return nil, err - } - name := controllerRevision.Name - if name == nil { - return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply") - } - result = &v1beta1.ControllerRevision{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("controllerrevisions"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/apps/v1beta1/deployment.go b/kubernetes/typed/apps/v1beta1/deployment.go index c46987acc7..06e4b7bf93 100644 --- a/kubernetes/typed/apps/v1beta1/deployment.go +++ b/kubernetes/typed/apps/v1beta1/deployment.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // DeploymentsGetter has a method to return a DeploymentInterface. @@ -46,6 +40,7 @@ type DeploymentsGetter interface { type DeploymentInterface interface { Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (*v1beta1.Deployment, error) Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (*v1beta1.Deployment, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (*v1beta1.Deployment, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,242 +49,25 @@ type DeploymentInterface 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 *v1beta1.Deployment, err error) Apply(ctx context.Context, deployment *appsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, deployment *appsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) DeploymentExpansion } // deployments implements DeploymentInterface type deployments struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta1.Deployment, *v1beta1.DeploymentList, *appsv1beta1.DeploymentApplyConfiguration] } // newDeployments returns a Deployments func newDeployments(c *AppsV1beta1Client, namespace string) *deployments { return &deployments{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta1.Deployment, *v1beta1.DeploymentList, *appsv1beta1.DeploymentApplyConfiguration]( + "deployments", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.Deployment { return &v1beta1.Deployment{} }, + func() *v1beta1.DeploymentList { return &v1beta1.DeploymentList{} }), } } - -// Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. -func (c *deployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Deployment, err error) { - result = &v1beta1.Deployment{} - err = c.client.Get(). - Namespace(c.ns). - Resource("deployments"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Deployments that match those selectors. -func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DeploymentList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for deployments, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for deployments", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for deployments ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of Deployments that match those selectors. -func (c *deployments) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.DeploymentList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("deployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of Deployments -func (c *deployments) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.DeploymentList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("deployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested deployments. -func (c *deployments) 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("deployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *deployments) Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (result *v1beta1.Deployment, err error) { - result = &v1beta1.Deployment{} - err = c.client.Post(). - Namespace(c.ns). - Resource("deployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(deployment). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *deployments) Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { - result = &v1beta1.Deployment{} - err = c.client.Put(). - Namespace(c.ns). - Resource("deployments"). - Name(deployment.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(deployment). - 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 *deployments) UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { - result = &v1beta1.Deployment{} - err = c.client.Put(). - Namespace(c.ns). - Resource("deployments"). - Name(deployment.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(deployment). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the deployment and deletes it. Returns an error if one occurs. -func (c *deployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("deployments"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *deployments) 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("deployments"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched deployment. -func (c *deployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Deployment, err error) { - result = &v1beta1.Deployment{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("deployments"). - 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 deployment. -func (c *deployments) Apply(ctx context.Context, deployment *appsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) { - if deployment == nil { - return nil, fmt.Errorf("deployment provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(deployment) - if err != nil { - return nil, err - } - name := deployment.Name - if name == nil { - return nil, fmt.Errorf("deployment.Name must be provided to Apply") - } - result = &v1beta1.Deployment{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("deployments"). - 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 *deployments) ApplyStatus(ctx context.Context, deployment *appsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) { - if deployment == nil { - return nil, fmt.Errorf("deployment provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(deployment) - if err != nil { - return nil, err - } - - name := deployment.Name - if name == nil { - return nil, fmt.Errorf("deployment.Name must be provided to Apply") - } - - result = &v1beta1.Deployment{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("deployments"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/apps/v1beta1/statefulset.go b/kubernetes/typed/apps/v1beta1/statefulset.go index bdddacec47..1ff69eb993 100644 --- a/kubernetes/typed/apps/v1beta1/statefulset.go +++ b/kubernetes/typed/apps/v1beta1/statefulset.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // StatefulSetsGetter has a method to return a StatefulSetInterface. @@ -46,6 +40,7 @@ type StatefulSetsGetter interface { type StatefulSetInterface interface { Create(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.CreateOptions) (*v1beta1.StatefulSet, error) Update(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (*v1beta1.StatefulSet, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (*v1beta1.StatefulSet, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,242 +49,25 @@ type StatefulSetInterface 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 *v1beta1.StatefulSet, err error) Apply(ctx context.Context, statefulSet *appsv1beta1.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.StatefulSet, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, statefulSet *appsv1beta1.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.StatefulSet, err error) StatefulSetExpansion } // statefulSets implements StatefulSetInterface type statefulSets struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta1.StatefulSet, *v1beta1.StatefulSetList, *appsv1beta1.StatefulSetApplyConfiguration] } // newStatefulSets returns a StatefulSets func newStatefulSets(c *AppsV1beta1Client, namespace string) *statefulSets { return &statefulSets{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta1.StatefulSet, *v1beta1.StatefulSetList, *appsv1beta1.StatefulSetApplyConfiguration]( + "statefulsets", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.StatefulSet { return &v1beta1.StatefulSet{} }, + func() *v1beta1.StatefulSetList { return &v1beta1.StatefulSetList{} }), } } - -// Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any. -func (c *statefulSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.StatefulSet, err error) { - result = &v1beta1.StatefulSet{} - err = c.client.Get(). - Namespace(c.ns). - Resource("statefulsets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of StatefulSets that match those selectors. -func (c *statefulSets) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.StatefulSetList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for statefulsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for statefulsets", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for statefulsets ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for statefulsets", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of StatefulSets that match those selectors. -func (c *statefulSets) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.StatefulSetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("statefulsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of StatefulSets -func (c *statefulSets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.StatefulSetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("statefulsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested statefulSets. -func (c *statefulSets) 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("statefulsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any. -func (c *statefulSets) Create(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.CreateOptions) (result *v1beta1.StatefulSet, err error) { - result = &v1beta1.StatefulSet{} - err = c.client.Post(). - Namespace(c.ns). - Resource("statefulsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(statefulSet). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any. -func (c *statefulSets) Update(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (result *v1beta1.StatefulSet, err error) { - result = &v1beta1.StatefulSet{} - err = c.client.Put(). - Namespace(c.ns). - Resource("statefulsets"). - Name(statefulSet.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(statefulSet). - 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 *statefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (result *v1beta1.StatefulSet, err error) { - result = &v1beta1.StatefulSet{} - err = c.client.Put(). - Namespace(c.ns). - Resource("statefulsets"). - Name(statefulSet.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(statefulSet). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the statefulSet and deletes it. Returns an error if one occurs. -func (c *statefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("statefulsets"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *statefulSets) 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("statefulsets"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched statefulSet. -func (c *statefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StatefulSet, err error) { - result = &v1beta1.StatefulSet{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("statefulsets"). - 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 statefulSet. -func (c *statefulSets) Apply(ctx context.Context, statefulSet *appsv1beta1.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.StatefulSet, err error) { - if statefulSet == nil { - return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(statefulSet) - if err != nil { - return nil, err - } - name := statefulSet.Name - if name == nil { - return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") - } - result = &v1beta1.StatefulSet{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("statefulsets"). - 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 *statefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1beta1.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.StatefulSet, err error) { - if statefulSet == nil { - return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(statefulSet) - if err != nil { - return nil, err - } - - name := statefulSet.Name - if name == nil { - return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") - } - - result = &v1beta1.StatefulSet{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("statefulsets"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/apps/v1beta2/controllerrevision.go b/kubernetes/typed/apps/v1beta2/controllerrevision.go index 62c539efcd..6caee6a725 100644 --- a/kubernetes/typed/apps/v1beta2/controllerrevision.go +++ b/kubernetes/typed/apps/v1beta2/controllerrevision.go @@ -20,20 +20,14 @@ package v1beta2 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ControllerRevisionsGetter has a method to return a ControllerRevisionInterface. @@ -58,190 +52,18 @@ type ControllerRevisionInterface interface { // controllerRevisions implements ControllerRevisionInterface type controllerRevisions struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta2.ControllerRevision, *v1beta2.ControllerRevisionList, *appsv1beta2.ControllerRevisionApplyConfiguration] } // newControllerRevisions returns a ControllerRevisions func newControllerRevisions(c *AppsV1beta2Client, namespace string) *controllerRevisions { return &controllerRevisions{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta2.ControllerRevision, *v1beta2.ControllerRevisionList, *appsv1beta2.ControllerRevisionApplyConfiguration]( + "controllerrevisions", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta2.ControllerRevision { return &v1beta2.ControllerRevision{} }, + func() *v1beta2.ControllerRevisionList { return &v1beta2.ControllerRevisionList{} }), } } - -// Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any. -func (c *controllerRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ControllerRevision, err error) { - result = &v1beta2.ControllerRevision{} - err = c.client.Get(). - Namespace(c.ns). - Resource("controllerrevisions"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. -func (c *controllerRevisions) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.ControllerRevisionList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for controllerrevisions, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for controllerrevisions", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for controllerrevisions ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for controllerrevisions", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. -func (c *controllerRevisions) list(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta2.ControllerRevisionList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("controllerrevisions"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ControllerRevisions -func (c *controllerRevisions) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta2.ControllerRevisionList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("controllerrevisions"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested controllerRevisions. -func (c *controllerRevisions) 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("controllerrevisions"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any. -func (c *controllerRevisions) Create(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.CreateOptions) (result *v1beta2.ControllerRevision, err error) { - result = &v1beta2.ControllerRevision{} - err = c.client.Post(). - Namespace(c.ns). - Resource("controllerrevisions"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(controllerRevision). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any. -func (c *controllerRevisions) Update(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.UpdateOptions) (result *v1beta2.ControllerRevision, err error) { - result = &v1beta2.ControllerRevision{} - err = c.client.Put(). - Namespace(c.ns). - Resource("controllerrevisions"). - Name(controllerRevision.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(controllerRevision). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs. -func (c *controllerRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("controllerrevisions"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *controllerRevisions) 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("controllerrevisions"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched controllerRevision. -func (c *controllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ControllerRevision, err error) { - result = &v1beta2.ControllerRevision{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("controllerrevisions"). - 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 controllerRevision. -func (c *controllerRevisions) Apply(ctx context.Context, controllerRevision *appsv1beta2.ControllerRevisionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ControllerRevision, err error) { - if controllerRevision == nil { - return nil, fmt.Errorf("controllerRevision provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(controllerRevision) - if err != nil { - return nil, err - } - name := controllerRevision.Name - if name == nil { - return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply") - } - result = &v1beta2.ControllerRevision{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("controllerrevisions"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/apps/v1beta2/daemonset.go b/kubernetes/typed/apps/v1beta2/daemonset.go index e4006bc513..766dc6d433 100644 --- a/kubernetes/typed/apps/v1beta2/daemonset.go +++ b/kubernetes/typed/apps/v1beta2/daemonset.go @@ -20,20 +20,14 @@ package v1beta2 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // DaemonSetsGetter has a method to return a DaemonSetInterface. @@ -46,6 +40,7 @@ type DaemonSetsGetter interface { type DaemonSetInterface interface { Create(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.CreateOptions) (*v1beta2.DaemonSet, error) Update(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (*v1beta2.DaemonSet, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (*v1beta2.DaemonSet, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,242 +49,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 *v1beta2.DaemonSet, err error) Apply(ctx context.Context, daemonSet *appsv1beta2.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.DaemonSet, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, daemonSet *appsv1beta2.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.DaemonSet, err error) DaemonSetExpansion } // daemonSets implements DaemonSetInterface type daemonSets struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta2.DaemonSet, *v1beta2.DaemonSetList, *appsv1beta2.DaemonSetApplyConfiguration] } // newDaemonSets returns a DaemonSets func newDaemonSets(c *AppsV1beta2Client, namespace string) *daemonSets { return &daemonSets{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta2.DaemonSet, *v1beta2.DaemonSetList, *appsv1beta2.DaemonSetApplyConfiguration]( + "daemonsets", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta2.DaemonSet { return &v1beta2.DaemonSet{} }, + func() *v1beta2.DaemonSetList { return &v1beta2.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 *v1beta2.DaemonSet, err error) { - result = &v1beta2.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) (*v1beta2.DaemonSetList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for daemonsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for daemonsets", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for daemonsets ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for daemonsets", c.list, opts, result) - } - return result, err -} - -// 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 *v1beta2.DaemonSetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta2.DaemonSetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("daemonsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of DaemonSets -func (c *daemonSets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DaemonSetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta2.DaemonSetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("daemonsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(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 *v1beta2.DaemonSet, opts v1.CreateOptions) (result *v1beta2.DaemonSet, err error) { - result = &v1beta2.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 *v1beta2.DaemonSet, opts v1.UpdateOptions) (result *v1beta2.DaemonSet, err error) { - result = &v1beta2.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 *v1beta2.DaemonSet, opts v1.UpdateOptions) (result *v1beta2.DaemonSet, err error) { - result = &v1beta2.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 *v1beta2.DaemonSet, err error) { - result = &v1beta2.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 *appsv1beta2.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.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 = &v1beta2.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 *appsv1beta2.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.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 = &v1beta2.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/kubernetes/typed/apps/v1beta2/deployment.go b/kubernetes/typed/apps/v1beta2/deployment.go index 43e48cdb2e..6592ee8cd9 100644 --- a/kubernetes/typed/apps/v1beta2/deployment.go +++ b/kubernetes/typed/apps/v1beta2/deployment.go @@ -20,20 +20,14 @@ package v1beta2 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // DeploymentsGetter has a method to return a DeploymentInterface. @@ -46,6 +40,7 @@ type DeploymentsGetter interface { type DeploymentInterface interface { Create(ctx context.Context, deployment *v1beta2.Deployment, opts v1.CreateOptions) (*v1beta2.Deployment, error) Update(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (*v1beta2.Deployment, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (*v1beta2.Deployment, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,242 +49,25 @@ type DeploymentInterface 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 *v1beta2.Deployment, err error) Apply(ctx context.Context, deployment *appsv1beta2.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Deployment, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, deployment *appsv1beta2.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Deployment, err error) DeploymentExpansion } // deployments implements DeploymentInterface type deployments struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta2.Deployment, *v1beta2.DeploymentList, *appsv1beta2.DeploymentApplyConfiguration] } // newDeployments returns a Deployments func newDeployments(c *AppsV1beta2Client, namespace string) *deployments { return &deployments{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta2.Deployment, *v1beta2.DeploymentList, *appsv1beta2.DeploymentApplyConfiguration]( + "deployments", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta2.Deployment { return &v1beta2.Deployment{} }, + func() *v1beta2.DeploymentList { return &v1beta2.DeploymentList{} }), } } - -// Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. -func (c *deployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.Deployment, err error) { - result = &v1beta2.Deployment{} - err = c.client.Get(). - Namespace(c.ns). - Resource("deployments"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Deployments that match those selectors. -func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.DeploymentList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for deployments, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for deployments", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for deployments ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of Deployments that match those selectors. -func (c *deployments) list(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DeploymentList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta2.DeploymentList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("deployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of Deployments -func (c *deployments) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DeploymentList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta2.DeploymentList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("deployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested deployments. -func (c *deployments) 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("deployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *deployments) Create(ctx context.Context, deployment *v1beta2.Deployment, opts v1.CreateOptions) (result *v1beta2.Deployment, err error) { - result = &v1beta2.Deployment{} - err = c.client.Post(). - Namespace(c.ns). - Resource("deployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(deployment). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *deployments) Update(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (result *v1beta2.Deployment, err error) { - result = &v1beta2.Deployment{} - err = c.client.Put(). - Namespace(c.ns). - Resource("deployments"). - Name(deployment.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(deployment). - 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 *deployments) UpdateStatus(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (result *v1beta2.Deployment, err error) { - result = &v1beta2.Deployment{} - err = c.client.Put(). - Namespace(c.ns). - Resource("deployments"). - Name(deployment.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(deployment). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the deployment and deletes it. Returns an error if one occurs. -func (c *deployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("deployments"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *deployments) 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("deployments"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched deployment. -func (c *deployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Deployment, err error) { - result = &v1beta2.Deployment{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("deployments"). - 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 deployment. -func (c *deployments) Apply(ctx context.Context, deployment *appsv1beta2.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Deployment, err error) { - if deployment == nil { - return nil, fmt.Errorf("deployment provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(deployment) - if err != nil { - return nil, err - } - name := deployment.Name - if name == nil { - return nil, fmt.Errorf("deployment.Name must be provided to Apply") - } - result = &v1beta2.Deployment{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("deployments"). - 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 *deployments) ApplyStatus(ctx context.Context, deployment *appsv1beta2.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Deployment, err error) { - if deployment == nil { - return nil, fmt.Errorf("deployment provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(deployment) - if err != nil { - return nil, err - } - - name := deployment.Name - if name == nil { - return nil, fmt.Errorf("deployment.Name must be provided to Apply") - } - - result = &v1beta2.Deployment{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("deployments"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/apps/v1beta2/replicaset.go b/kubernetes/typed/apps/v1beta2/replicaset.go index 5d815771ce..90380ca980 100644 --- a/kubernetes/typed/apps/v1beta2/replicaset.go +++ b/kubernetes/typed/apps/v1beta2/replicaset.go @@ -20,20 +20,14 @@ package v1beta2 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ReplicaSetsGetter has a method to return a ReplicaSetInterface. @@ -46,6 +40,7 @@ type ReplicaSetsGetter interface { type ReplicaSetInterface interface { Create(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.CreateOptions) (*v1beta2.ReplicaSet, error) Update(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (*v1beta2.ReplicaSet, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (*v1beta2.ReplicaSet, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,242 +49,25 @@ type ReplicaSetInterface 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 *v1beta2.ReplicaSet, err error) Apply(ctx context.Context, replicaSet *appsv1beta2.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ReplicaSet, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, replicaSet *appsv1beta2.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ReplicaSet, err error) ReplicaSetExpansion } // replicaSets implements ReplicaSetInterface type replicaSets struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta2.ReplicaSet, *v1beta2.ReplicaSetList, *appsv1beta2.ReplicaSetApplyConfiguration] } // newReplicaSets returns a ReplicaSets func newReplicaSets(c *AppsV1beta2Client, namespace string) *replicaSets { return &replicaSets{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta2.ReplicaSet, *v1beta2.ReplicaSetList, *appsv1beta2.ReplicaSetApplyConfiguration]( + "replicasets", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta2.ReplicaSet { return &v1beta2.ReplicaSet{} }, + func() *v1beta2.ReplicaSetList { return &v1beta2.ReplicaSetList{} }), } } - -// Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any. -func (c *replicaSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ReplicaSet, err error) { - result = &v1beta2.ReplicaSet{} - err = c.client.Get(). - Namespace(c.ns). - Resource("replicasets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. -func (c *replicaSets) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.ReplicaSetList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for replicasets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for replicasets", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for replicasets ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicasets", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ReplicaSets that match those selectors. -func (c *replicaSets) list(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ReplicaSetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta2.ReplicaSetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("replicasets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ReplicaSets -func (c *replicaSets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ReplicaSetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta2.ReplicaSetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("replicasets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested replicaSets. -func (c *replicaSets) 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("replicasets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any. -func (c *replicaSets) Create(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.CreateOptions) (result *v1beta2.ReplicaSet, err error) { - result = &v1beta2.ReplicaSet{} - err = c.client.Post(). - Namespace(c.ns). - Resource("replicasets"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(replicaSet). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any. -func (c *replicaSets) Update(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (result *v1beta2.ReplicaSet, err error) { - result = &v1beta2.ReplicaSet{} - err = c.client.Put(). - Namespace(c.ns). - Resource("replicasets"). - Name(replicaSet.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(replicaSet). - 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 *replicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (result *v1beta2.ReplicaSet, err error) { - result = &v1beta2.ReplicaSet{} - err = c.client.Put(). - Namespace(c.ns). - Resource("replicasets"). - Name(replicaSet.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(replicaSet). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. -func (c *replicaSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("replicasets"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *replicaSets) 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("replicasets"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched replicaSet. -func (c *replicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ReplicaSet, err error) { - result = &v1beta2.ReplicaSet{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("replicasets"). - 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 replicaSet. -func (c *replicaSets) Apply(ctx context.Context, replicaSet *appsv1beta2.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ReplicaSet, err error) { - if replicaSet == nil { - return nil, fmt.Errorf("replicaSet provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(replicaSet) - if err != nil { - return nil, err - } - name := replicaSet.Name - if name == nil { - return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") - } - result = &v1beta2.ReplicaSet{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("replicasets"). - 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 *replicaSets) ApplyStatus(ctx context.Context, replicaSet *appsv1beta2.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ReplicaSet, err error) { - if replicaSet == nil { - return nil, fmt.Errorf("replicaSet provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(replicaSet) - if err != nil { - return nil, err - } - - name := replicaSet.Name - if name == nil { - return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") - } - - result = &v1beta2.ReplicaSet{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("replicasets"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/apps/v1beta2/statefulset.go b/kubernetes/typed/apps/v1beta2/statefulset.go index 923a10cb35..f2d673abb9 100644 --- a/kubernetes/typed/apps/v1beta2/statefulset.go +++ b/kubernetes/typed/apps/v1beta2/statefulset.go @@ -22,18 +22,14 @@ import ( "context" json "encoding/json" "fmt" - "time" v1beta2 "k8s.io/api/apps/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // StatefulSetsGetter has a method to return a StatefulSetInterface. @@ -46,6 +42,7 @@ type StatefulSetsGetter interface { type StatefulSetInterface interface { Create(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.CreateOptions) (*v1beta2.StatefulSet, error) Update(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (*v1beta2.StatefulSet, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (*v1beta2.StatefulSet, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,6 +51,7 @@ type StatefulSetInterface 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 *v1beta2.StatefulSet, err error) Apply(ctx context.Context, statefulSet *appsv1beta2.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.StatefulSet, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, statefulSet *appsv1beta2.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.StatefulSet, err error) GetScale(ctx context.Context, statefulSetName string, options v1.GetOptions) (*v1beta2.Scale, error) UpdateScale(ctx context.Context, statefulSetName string, scale *v1beta2.Scale, opts v1.UpdateOptions) (*v1beta2.Scale, error) @@ -64,245 +62,27 @@ type StatefulSetInterface interface { // statefulSets implements StatefulSetInterface type statefulSets struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta2.StatefulSet, *v1beta2.StatefulSetList, *appsv1beta2.StatefulSetApplyConfiguration] } // newStatefulSets returns a StatefulSets func newStatefulSets(c *AppsV1beta2Client, namespace string) *statefulSets { return &statefulSets{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta2.StatefulSet, *v1beta2.StatefulSetList, *appsv1beta2.StatefulSetApplyConfiguration]( + "statefulsets", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta2.StatefulSet { return &v1beta2.StatefulSet{} }, + func() *v1beta2.StatefulSetList { return &v1beta2.StatefulSetList{} }), } } -// Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any. -func (c *statefulSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.StatefulSet, err error) { - result = &v1beta2.StatefulSet{} - err = c.client.Get(). - Namespace(c.ns). - Resource("statefulsets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of StatefulSets that match those selectors. -func (c *statefulSets) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.StatefulSetList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for statefulsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for statefulsets", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for statefulsets ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for statefulsets", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of StatefulSets that match those selectors. -func (c *statefulSets) list(ctx context.Context, opts v1.ListOptions) (result *v1beta2.StatefulSetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta2.StatefulSetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("statefulsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of StatefulSets -func (c *statefulSets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.StatefulSetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta2.StatefulSetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("statefulsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested statefulSets. -func (c *statefulSets) 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("statefulsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any. -func (c *statefulSets) Create(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.CreateOptions) (result *v1beta2.StatefulSet, err error) { - result = &v1beta2.StatefulSet{} - err = c.client.Post(). - Namespace(c.ns). - Resource("statefulsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(statefulSet). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any. -func (c *statefulSets) Update(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (result *v1beta2.StatefulSet, err error) { - result = &v1beta2.StatefulSet{} - err = c.client.Put(). - Namespace(c.ns). - Resource("statefulsets"). - Name(statefulSet.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(statefulSet). - 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 *statefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (result *v1beta2.StatefulSet, err error) { - result = &v1beta2.StatefulSet{} - err = c.client.Put(). - Namespace(c.ns). - Resource("statefulsets"). - Name(statefulSet.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(statefulSet). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the statefulSet and deletes it. Returns an error if one occurs. -func (c *statefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("statefulsets"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *statefulSets) 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("statefulsets"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched statefulSet. -func (c *statefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.StatefulSet, err error) { - result = &v1beta2.StatefulSet{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("statefulsets"). - 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 statefulSet. -func (c *statefulSets) Apply(ctx context.Context, statefulSet *appsv1beta2.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.StatefulSet, err error) { - if statefulSet == nil { - return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(statefulSet) - if err != nil { - return nil, err - } - name := statefulSet.Name - if name == nil { - return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") - } - result = &v1beta2.StatefulSet{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("statefulsets"). - 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 *statefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1beta2.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.StatefulSet, err error) { - if statefulSet == nil { - return nil, fmt.Errorf("statefulSet provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(statefulSet) - if err != nil { - return nil, err - } - - name := statefulSet.Name - if name == nil { - return nil, fmt.Errorf("statefulSet.Name must be provided to Apply") - } - - result = &v1beta2.StatefulSet{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("statefulsets"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - // GetScale takes name of the statefulSet, and returns the corresponding v1beta2.Scale object, and an error if there is any. func (c *statefulSets) GetScale(ctx context.Context, statefulSetName string, options v1.GetOptions) (result *v1beta2.Scale, err error) { result = &v1beta2.Scale{} - err = c.client.Get(). - Namespace(c.ns). + err = c.GetClient().Get(). + Namespace(c.GetNamespace()). Resource("statefulsets"). Name(statefulSetName). SubResource("scale"). @@ -315,8 +95,8 @@ func (c *statefulSets) GetScale(ctx context.Context, statefulSetName string, opt // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *statefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *v1beta2.Scale, opts v1.UpdateOptions) (result *v1beta2.Scale, err error) { result = &v1beta2.Scale{} - err = c.client.Put(). - Namespace(c.ns). + err = c.GetClient().Put(). + Namespace(c.GetNamespace()). Resource("statefulsets"). Name(statefulSetName). SubResource("scale"). @@ -340,8 +120,8 @@ func (c *statefulSets) ApplyScale(ctx context.Context, statefulSetName string, s } result = &v1beta2.Scale{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). + err = c.GetClient().Patch(types.ApplyPatchType). + Namespace(c.GetNamespace()). Resource("statefulsets"). Name(statefulSetName). SubResource("scale"). diff --git a/kubernetes/typed/authentication/v1/selfsubjectreview.go b/kubernetes/typed/authentication/v1/selfsubjectreview.go index bfb9603d67..720dd9e7e9 100644 --- a/kubernetes/typed/authentication/v1/selfsubjectreview.go +++ b/kubernetes/typed/authentication/v1/selfsubjectreview.go @@ -23,8 +23,8 @@ import ( v1 "k8s.io/api/authentication/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" ) // SelfSubjectReviewsGetter has a method to return a SelfSubjectReviewInterface. @@ -41,24 +41,17 @@ type SelfSubjectReviewInterface interface { // selfSubjectReviews implements SelfSubjectReviewInterface type selfSubjectReviews struct { - client rest.Interface + *gentype.Client[*v1.SelfSubjectReview] } // newSelfSubjectReviews returns a SelfSubjectReviews func newSelfSubjectReviews(c *AuthenticationV1Client) *selfSubjectReviews { return &selfSubjectReviews{ - client: c.RESTClient(), + gentype.NewClient[*v1.SelfSubjectReview]( + "selfsubjectreviews", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.SelfSubjectReview { return &v1.SelfSubjectReview{} }), } } - -// Create takes the representation of a selfSubjectReview and creates it. Returns the server's representation of the selfSubjectReview, and an error, if there is any. -func (c *selfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1.SelfSubjectReview, opts metav1.CreateOptions) (result *v1.SelfSubjectReview, err error) { - result = &v1.SelfSubjectReview{} - err = c.client.Post(). - Resource("selfsubjectreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(selfSubjectReview). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/authentication/v1/tokenreview.go b/kubernetes/typed/authentication/v1/tokenreview.go index ca7cd47d26..52c55fab08 100644 --- a/kubernetes/typed/authentication/v1/tokenreview.go +++ b/kubernetes/typed/authentication/v1/tokenreview.go @@ -23,8 +23,8 @@ import ( v1 "k8s.io/api/authentication/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" ) // TokenReviewsGetter has a method to return a TokenReviewInterface. @@ -41,24 +41,17 @@ type TokenReviewInterface interface { // tokenReviews implements TokenReviewInterface type tokenReviews struct { - client rest.Interface + *gentype.Client[*v1.TokenReview] } // newTokenReviews returns a TokenReviews func newTokenReviews(c *AuthenticationV1Client) *tokenReviews { return &tokenReviews{ - client: c.RESTClient(), + gentype.NewClient[*v1.TokenReview]( + "tokenreviews", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.TokenReview { return &v1.TokenReview{} }), } } - -// Create takes the representation of a tokenReview and creates it. Returns the server's representation of the tokenReview, and an error, if there is any. -func (c *tokenReviews) Create(ctx context.Context, tokenReview *v1.TokenReview, opts metav1.CreateOptions) (result *v1.TokenReview, err error) { - result = &v1.TokenReview{} - err = c.client.Post(). - Resource("tokenreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(tokenReview). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/authentication/v1alpha1/selfsubjectreview.go b/kubernetes/typed/authentication/v1alpha1/selfsubjectreview.go index 7f8b12a46f..f034bcdbe3 100644 --- a/kubernetes/typed/authentication/v1alpha1/selfsubjectreview.go +++ b/kubernetes/typed/authentication/v1alpha1/selfsubjectreview.go @@ -23,8 +23,8 @@ import ( v1alpha1 "k8s.io/api/authentication/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" ) // SelfSubjectReviewsGetter has a method to return a SelfSubjectReviewInterface. @@ -41,24 +41,17 @@ type SelfSubjectReviewInterface interface { // selfSubjectReviews implements SelfSubjectReviewInterface type selfSubjectReviews struct { - client rest.Interface + *gentype.Client[*v1alpha1.SelfSubjectReview] } // newSelfSubjectReviews returns a SelfSubjectReviews func newSelfSubjectReviews(c *AuthenticationV1alpha1Client) *selfSubjectReviews { return &selfSubjectReviews{ - client: c.RESTClient(), + gentype.NewClient[*v1alpha1.SelfSubjectReview]( + "selfsubjectreviews", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.SelfSubjectReview { return &v1alpha1.SelfSubjectReview{} }), } } - -// Create takes the representation of a selfSubjectReview and creates it. Returns the server's representation of the selfSubjectReview, and an error, if there is any. -func (c *selfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1alpha1.SelfSubjectReview, opts v1.CreateOptions) (result *v1alpha1.SelfSubjectReview, err error) { - result = &v1alpha1.SelfSubjectReview{} - err = c.client.Post(). - Resource("selfsubjectreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(selfSubjectReview). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/authentication/v1beta1/selfsubjectreview.go b/kubernetes/typed/authentication/v1beta1/selfsubjectreview.go index 9d54826a31..d083ba8fa9 100644 --- a/kubernetes/typed/authentication/v1beta1/selfsubjectreview.go +++ b/kubernetes/typed/authentication/v1beta1/selfsubjectreview.go @@ -23,8 +23,8 @@ import ( v1beta1 "k8s.io/api/authentication/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" ) // SelfSubjectReviewsGetter has a method to return a SelfSubjectReviewInterface. @@ -41,24 +41,17 @@ type SelfSubjectReviewInterface interface { // selfSubjectReviews implements SelfSubjectReviewInterface type selfSubjectReviews struct { - client rest.Interface + *gentype.Client[*v1beta1.SelfSubjectReview] } // newSelfSubjectReviews returns a SelfSubjectReviews func newSelfSubjectReviews(c *AuthenticationV1beta1Client) *selfSubjectReviews { return &selfSubjectReviews{ - client: c.RESTClient(), + gentype.NewClient[*v1beta1.SelfSubjectReview]( + "selfsubjectreviews", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.SelfSubjectReview { return &v1beta1.SelfSubjectReview{} }), } } - -// Create takes the representation of a selfSubjectReview and creates it. Returns the server's representation of the selfSubjectReview, and an error, if there is any. -func (c *selfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1beta1.SelfSubjectReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectReview, err error) { - result = &v1beta1.SelfSubjectReview{} - err = c.client.Post(). - Resource("selfsubjectreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(selfSubjectReview). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/authentication/v1beta1/tokenreview.go b/kubernetes/typed/authentication/v1beta1/tokenreview.go index 5da1224337..982534935e 100644 --- a/kubernetes/typed/authentication/v1beta1/tokenreview.go +++ b/kubernetes/typed/authentication/v1beta1/tokenreview.go @@ -23,8 +23,8 @@ import ( v1beta1 "k8s.io/api/authentication/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" ) // TokenReviewsGetter has a method to return a TokenReviewInterface. @@ -41,24 +41,17 @@ type TokenReviewInterface interface { // tokenReviews implements TokenReviewInterface type tokenReviews struct { - client rest.Interface + *gentype.Client[*v1beta1.TokenReview] } // newTokenReviews returns a TokenReviews func newTokenReviews(c *AuthenticationV1beta1Client) *tokenReviews { return &tokenReviews{ - client: c.RESTClient(), + gentype.NewClient[*v1beta1.TokenReview]( + "tokenreviews", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.TokenReview { return &v1beta1.TokenReview{} }), } } - -// Create takes the representation of a tokenReview and creates it. Returns the server's representation of the tokenReview, and an error, if there is any. -func (c *tokenReviews) Create(ctx context.Context, tokenReview *v1beta1.TokenReview, opts v1.CreateOptions) (result *v1beta1.TokenReview, err error) { - result = &v1beta1.TokenReview{} - err = c.client.Post(). - Resource("tokenreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(tokenReview). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/authorization/v1/localsubjectaccessreview.go b/kubernetes/typed/authorization/v1/localsubjectaccessreview.go index 84b2efe166..3d058941a2 100644 --- a/kubernetes/typed/authorization/v1/localsubjectaccessreview.go +++ b/kubernetes/typed/authorization/v1/localsubjectaccessreview.go @@ -23,8 +23,8 @@ import ( v1 "k8s.io/api/authorization/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" ) // LocalSubjectAccessReviewsGetter has a method to return a LocalSubjectAccessReviewInterface. @@ -41,27 +41,17 @@ type LocalSubjectAccessReviewInterface interface { // localSubjectAccessReviews implements LocalSubjectAccessReviewInterface type localSubjectAccessReviews struct { - client rest.Interface - ns string + *gentype.Client[*v1.LocalSubjectAccessReview] } // newLocalSubjectAccessReviews returns a LocalSubjectAccessReviews func newLocalSubjectAccessReviews(c *AuthorizationV1Client, namespace string) *localSubjectAccessReviews { return &localSubjectAccessReviews{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClient[*v1.LocalSubjectAccessReview]( + "localsubjectaccessreviews", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.LocalSubjectAccessReview { return &v1.LocalSubjectAccessReview{} }), } } - -// Create takes the representation of a localSubjectAccessReview and creates it. Returns the server's representation of the localSubjectAccessReview, and an error, if there is any. -func (c *localSubjectAccessReviews) Create(ctx context.Context, localSubjectAccessReview *v1.LocalSubjectAccessReview, opts metav1.CreateOptions) (result *v1.LocalSubjectAccessReview, err error) { - result = &v1.LocalSubjectAccessReview{} - err = c.client.Post(). - Namespace(c.ns). - Resource("localsubjectaccessreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(localSubjectAccessReview). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/authorization/v1/selfsubjectaccessreview.go b/kubernetes/typed/authorization/v1/selfsubjectaccessreview.go index 2006196c11..9e874bee5a 100644 --- a/kubernetes/typed/authorization/v1/selfsubjectaccessreview.go +++ b/kubernetes/typed/authorization/v1/selfsubjectaccessreview.go @@ -23,8 +23,8 @@ import ( v1 "k8s.io/api/authorization/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" ) // SelfSubjectAccessReviewsGetter has a method to return a SelfSubjectAccessReviewInterface. @@ -41,24 +41,17 @@ type SelfSubjectAccessReviewInterface interface { // selfSubjectAccessReviews implements SelfSubjectAccessReviewInterface type selfSubjectAccessReviews struct { - client rest.Interface + *gentype.Client[*v1.SelfSubjectAccessReview] } // newSelfSubjectAccessReviews returns a SelfSubjectAccessReviews func newSelfSubjectAccessReviews(c *AuthorizationV1Client) *selfSubjectAccessReviews { return &selfSubjectAccessReviews{ - client: c.RESTClient(), + gentype.NewClient[*v1.SelfSubjectAccessReview]( + "selfsubjectaccessreviews", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.SelfSubjectAccessReview { return &v1.SelfSubjectAccessReview{} }), } } - -// Create takes the representation of a selfSubjectAccessReview and creates it. Returns the server's representation of the selfSubjectAccessReview, and an error, if there is any. -func (c *selfSubjectAccessReviews) Create(ctx context.Context, selfSubjectAccessReview *v1.SelfSubjectAccessReview, opts metav1.CreateOptions) (result *v1.SelfSubjectAccessReview, err error) { - result = &v1.SelfSubjectAccessReview{} - err = c.client.Post(). - Resource("selfsubjectaccessreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(selfSubjectAccessReview). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/authorization/v1/selfsubjectrulesreview.go b/kubernetes/typed/authorization/v1/selfsubjectrulesreview.go index 25d99f7b52..567b63ec4c 100644 --- a/kubernetes/typed/authorization/v1/selfsubjectrulesreview.go +++ b/kubernetes/typed/authorization/v1/selfsubjectrulesreview.go @@ -23,8 +23,8 @@ import ( v1 "k8s.io/api/authorization/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" ) // SelfSubjectRulesReviewsGetter has a method to return a SelfSubjectRulesReviewInterface. @@ -41,24 +41,17 @@ type SelfSubjectRulesReviewInterface interface { // selfSubjectRulesReviews implements SelfSubjectRulesReviewInterface type selfSubjectRulesReviews struct { - client rest.Interface + *gentype.Client[*v1.SelfSubjectRulesReview] } // newSelfSubjectRulesReviews returns a SelfSubjectRulesReviews func newSelfSubjectRulesReviews(c *AuthorizationV1Client) *selfSubjectRulesReviews { return &selfSubjectRulesReviews{ - client: c.RESTClient(), + gentype.NewClient[*v1.SelfSubjectRulesReview]( + "selfsubjectrulesreviews", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.SelfSubjectRulesReview { return &v1.SelfSubjectRulesReview{} }), } } - -// Create takes the representation of a selfSubjectRulesReview and creates it. Returns the server's representation of the selfSubjectRulesReview, and an error, if there is any. -func (c *selfSubjectRulesReviews) Create(ctx context.Context, selfSubjectRulesReview *v1.SelfSubjectRulesReview, opts metav1.CreateOptions) (result *v1.SelfSubjectRulesReview, err error) { - result = &v1.SelfSubjectRulesReview{} - err = c.client.Post(). - Resource("selfsubjectrulesreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(selfSubjectRulesReview). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/authorization/v1/subjectaccessreview.go b/kubernetes/typed/authorization/v1/subjectaccessreview.go index 8ac0566a2e..52e8d74e57 100644 --- a/kubernetes/typed/authorization/v1/subjectaccessreview.go +++ b/kubernetes/typed/authorization/v1/subjectaccessreview.go @@ -23,8 +23,8 @@ import ( v1 "k8s.io/api/authorization/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" ) // SubjectAccessReviewsGetter has a method to return a SubjectAccessReviewInterface. @@ -41,24 +41,17 @@ type SubjectAccessReviewInterface interface { // subjectAccessReviews implements SubjectAccessReviewInterface type subjectAccessReviews struct { - client rest.Interface + *gentype.Client[*v1.SubjectAccessReview] } // newSubjectAccessReviews returns a SubjectAccessReviews func newSubjectAccessReviews(c *AuthorizationV1Client) *subjectAccessReviews { return &subjectAccessReviews{ - client: c.RESTClient(), + gentype.NewClient[*v1.SubjectAccessReview]( + "subjectaccessreviews", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.SubjectAccessReview { return &v1.SubjectAccessReview{} }), } } - -// Create takes the representation of a subjectAccessReview and creates it. Returns the server's representation of the subjectAccessReview, and an error, if there is any. -func (c *subjectAccessReviews) Create(ctx context.Context, subjectAccessReview *v1.SubjectAccessReview, opts metav1.CreateOptions) (result *v1.SubjectAccessReview, err error) { - result = &v1.SubjectAccessReview{} - err = c.client.Post(). - Resource("subjectaccessreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(subjectAccessReview). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go b/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go index 78584ba945..302c094b39 100644 --- a/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go +++ b/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go @@ -23,8 +23,8 @@ import ( v1beta1 "k8s.io/api/authorization/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" ) // LocalSubjectAccessReviewsGetter has a method to return a LocalSubjectAccessReviewInterface. @@ -41,27 +41,17 @@ type LocalSubjectAccessReviewInterface interface { // localSubjectAccessReviews implements LocalSubjectAccessReviewInterface type localSubjectAccessReviews struct { - client rest.Interface - ns string + *gentype.Client[*v1beta1.LocalSubjectAccessReview] } // newLocalSubjectAccessReviews returns a LocalSubjectAccessReviews func newLocalSubjectAccessReviews(c *AuthorizationV1beta1Client, namespace string) *localSubjectAccessReviews { return &localSubjectAccessReviews{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClient[*v1beta1.LocalSubjectAccessReview]( + "localsubjectaccessreviews", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.LocalSubjectAccessReview { return &v1beta1.LocalSubjectAccessReview{} }), } } - -// Create takes the representation of a localSubjectAccessReview and creates it. Returns the server's representation of the localSubjectAccessReview, and an error, if there is any. -func (c *localSubjectAccessReviews) Create(ctx context.Context, localSubjectAccessReview *v1beta1.LocalSubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.LocalSubjectAccessReview, err error) { - result = &v1beta1.LocalSubjectAccessReview{} - err = c.client.Post(). - Namespace(c.ns). - Resource("localsubjectaccessreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(localSubjectAccessReview). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go b/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go index 0286c93fe6..4b413dc4f0 100644 --- a/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go +++ b/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go @@ -23,8 +23,8 @@ import ( v1beta1 "k8s.io/api/authorization/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" ) // SelfSubjectAccessReviewsGetter has a method to return a SelfSubjectAccessReviewInterface. @@ -41,24 +41,17 @@ type SelfSubjectAccessReviewInterface interface { // selfSubjectAccessReviews implements SelfSubjectAccessReviewInterface type selfSubjectAccessReviews struct { - client rest.Interface + *gentype.Client[*v1beta1.SelfSubjectAccessReview] } // newSelfSubjectAccessReviews returns a SelfSubjectAccessReviews func newSelfSubjectAccessReviews(c *AuthorizationV1beta1Client) *selfSubjectAccessReviews { return &selfSubjectAccessReviews{ - client: c.RESTClient(), + gentype.NewClient[*v1beta1.SelfSubjectAccessReview]( + "selfsubjectaccessreviews", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.SelfSubjectAccessReview { return &v1beta1.SelfSubjectAccessReview{} }), } } - -// Create takes the representation of a selfSubjectAccessReview and creates it. Returns the server's representation of the selfSubjectAccessReview, and an error, if there is any. -func (c *selfSubjectAccessReviews) Create(ctx context.Context, selfSubjectAccessReview *v1beta1.SelfSubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectAccessReview, err error) { - result = &v1beta1.SelfSubjectAccessReview{} - err = c.client.Post(). - Resource("selfsubjectaccessreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(selfSubjectAccessReview). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview.go b/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview.go index d772973ec6..b64cec3015 100644 --- a/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview.go +++ b/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview.go @@ -23,8 +23,8 @@ import ( v1beta1 "k8s.io/api/authorization/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" ) // SelfSubjectRulesReviewsGetter has a method to return a SelfSubjectRulesReviewInterface. @@ -41,24 +41,17 @@ type SelfSubjectRulesReviewInterface interface { // selfSubjectRulesReviews implements SelfSubjectRulesReviewInterface type selfSubjectRulesReviews struct { - client rest.Interface + *gentype.Client[*v1beta1.SelfSubjectRulesReview] } // newSelfSubjectRulesReviews returns a SelfSubjectRulesReviews func newSelfSubjectRulesReviews(c *AuthorizationV1beta1Client) *selfSubjectRulesReviews { return &selfSubjectRulesReviews{ - client: c.RESTClient(), + gentype.NewClient[*v1beta1.SelfSubjectRulesReview]( + "selfsubjectrulesreviews", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.SelfSubjectRulesReview { return &v1beta1.SelfSubjectRulesReview{} }), } } - -// Create takes the representation of a selfSubjectRulesReview and creates it. Returns the server's representation of the selfSubjectRulesReview, and an error, if there is any. -func (c *selfSubjectRulesReviews) Create(ctx context.Context, selfSubjectRulesReview *v1beta1.SelfSubjectRulesReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectRulesReview, err error) { - result = &v1beta1.SelfSubjectRulesReview{} - err = c.client.Post(). - Resource("selfsubjectrulesreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(selfSubjectRulesReview). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go b/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go index aebe8398c0..3fca833a1b 100644 --- a/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go +++ b/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go @@ -23,8 +23,8 @@ import ( v1beta1 "k8s.io/api/authorization/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" ) // SubjectAccessReviewsGetter has a method to return a SubjectAccessReviewInterface. @@ -41,24 +41,17 @@ type SubjectAccessReviewInterface interface { // subjectAccessReviews implements SubjectAccessReviewInterface type subjectAccessReviews struct { - client rest.Interface + *gentype.Client[*v1beta1.SubjectAccessReview] } // newSubjectAccessReviews returns a SubjectAccessReviews func newSubjectAccessReviews(c *AuthorizationV1beta1Client) *subjectAccessReviews { return &subjectAccessReviews{ - client: c.RESTClient(), + gentype.NewClient[*v1beta1.SubjectAccessReview]( + "subjectaccessreviews", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.SubjectAccessReview { return &v1beta1.SubjectAccessReview{} }), } } - -// Create takes the representation of a subjectAccessReview and creates it. Returns the server's representation of the subjectAccessReview, and an error, if there is any. -func (c *subjectAccessReviews) Create(ctx context.Context, subjectAccessReview *v1beta1.SubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.SubjectAccessReview, err error) { - result = &v1beta1.SubjectAccessReview{} - err = c.client.Post(). - Resource("subjectaccessreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(subjectAccessReview). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go index 66a3d79245..4d29ac5227 100644 --- a/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" autoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface. @@ -46,6 +40,7 @@ type HorizontalPodAutoscalersGetter interface { type HorizontalPodAutoscalerInterface interface { Create(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.CreateOptions) (*v1.HorizontalPodAutoscaler, error) Update(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*v1.HorizontalPodAutoscaler, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*v1.HorizontalPodAutoscaler, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -54,242 +49,25 @@ type HorizontalPodAutoscalerInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv1.HorizontalPodAutoscalerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HorizontalPodAutoscaler, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv1.HorizontalPodAutoscalerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HorizontalPodAutoscaler, err error) HorizontalPodAutoscalerExpansion } // horizontalPodAutoscalers implements HorizontalPodAutoscalerInterface type horizontalPodAutoscalers struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.HorizontalPodAutoscaler, *v1.HorizontalPodAutoscalerList, *autoscalingv1.HorizontalPodAutoscalerApplyConfiguration] } // newHorizontalPodAutoscalers returns a HorizontalPodAutoscalers func newHorizontalPodAutoscalers(c *AutoscalingV1Client, namespace string) *horizontalPodAutoscalers { return &horizontalPodAutoscalers{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.HorizontalPodAutoscaler, *v1.HorizontalPodAutoscalerList, *autoscalingv1.HorizontalPodAutoscalerApplyConfiguration]( + "horizontalpodautoscalers", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.HorizontalPodAutoscaler { return &v1.HorizontalPodAutoscaler{} }, + func() *v1.HorizontalPodAutoscalerList { return &v1.HorizontalPodAutoscalerList{} }), } } - -// Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. -func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HorizontalPodAutoscaler, err error) { - result = &v1.HorizontalPodAutoscaler{} - err = c.client.Get(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. -func (c *horizontalPodAutoscalers) List(ctx context.Context, opts metav1.ListOptions) (*v1.HorizontalPodAutoscalerList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for horizontalpodautoscalers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for horizontalpodautoscalers", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for horizontalpodautoscalers ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. -func (c *horizontalPodAutoscalers) list(ctx context.Context, opts metav1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.HorizontalPodAutoscalerList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of HorizontalPodAutoscalers -func (c *horizontalPodAutoscalers) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.HorizontalPodAutoscalerList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. -func (c *horizontalPodAutoscalers) Watch(ctx context.Context, opts metav1.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("horizontalpodautoscalers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *horizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.CreateOptions) (result *v1.HorizontalPodAutoscaler, err error) { - result = &v1.HorizontalPodAutoscaler{} - err = c.client.Post(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(horizontalPodAutoscaler). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *horizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (result *v1.HorizontalPodAutoscaler, err error) { - result = &v1.HorizontalPodAutoscaler{} - err = c.client.Put(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(horizontalPodAutoscaler.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(horizontalPodAutoscaler). - 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 *horizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (result *v1.HorizontalPodAutoscaler, err error) { - result = &v1.HorizontalPodAutoscaler{} - err = c.client.Put(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(horizontalPodAutoscaler.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(horizontalPodAutoscaler). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. -func (c *horizontalPodAutoscalers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *horizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("horizontalpodautoscalers"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched horizontalPodAutoscaler. -func (c *horizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) { - result = &v1.HorizontalPodAutoscaler{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - 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 horizontalPodAutoscaler. -func (c *horizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv1.HorizontalPodAutoscalerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HorizontalPodAutoscaler, err error) { - if horizontalPodAutoscaler == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(horizontalPodAutoscaler) - if err != nil { - return nil, err - } - name := horizontalPodAutoscaler.Name - if name == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") - } - result = &v1.HorizontalPodAutoscaler{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - 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 *horizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv1.HorizontalPodAutoscalerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HorizontalPodAutoscaler, err error) { - if horizontalPodAutoscaler == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(horizontalPodAutoscaler) - if err != nil { - return nil, err - } - - name := horizontalPodAutoscaler.Name - if name == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") - } - - result = &v1.HorizontalPodAutoscaler{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/autoscaling/v2/horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v2/horizontalpodautoscaler.go index 278614af8e..dbce8d1020 100644 --- a/kubernetes/typed/autoscaling/v2/horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v2/horizontalpodautoscaler.go @@ -20,20 +20,14 @@ package v2 import ( "context" - json "encoding/json" - "fmt" - "time" v2 "k8s.io/api/autoscaling/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" autoscalingv2 "k8s.io/client-go/applyconfigurations/autoscaling/v2" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface. @@ -46,6 +40,7 @@ type HorizontalPodAutoscalersGetter interface { type HorizontalPodAutoscalerInterface interface { Create(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.CreateOptions) (*v2.HorizontalPodAutoscaler, error) Update(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2.HorizontalPodAutoscaler, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2.HorizontalPodAutoscaler, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,242 +49,25 @@ type HorizontalPodAutoscalerInterface 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 *v2.HorizontalPodAutoscaler, err error) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2.HorizontalPodAutoscaler, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2.HorizontalPodAutoscaler, err error) HorizontalPodAutoscalerExpansion } // horizontalPodAutoscalers implements HorizontalPodAutoscalerInterface type horizontalPodAutoscalers struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v2.HorizontalPodAutoscaler, *v2.HorizontalPodAutoscalerList, *autoscalingv2.HorizontalPodAutoscalerApplyConfiguration] } // newHorizontalPodAutoscalers returns a HorizontalPodAutoscalers func newHorizontalPodAutoscalers(c *AutoscalingV2Client, namespace string) *horizontalPodAutoscalers { return &horizontalPodAutoscalers{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v2.HorizontalPodAutoscaler, *v2.HorizontalPodAutoscalerList, *autoscalingv2.HorizontalPodAutoscalerApplyConfiguration]( + "horizontalpodautoscalers", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v2.HorizontalPodAutoscaler { return &v2.HorizontalPodAutoscaler{} }, + func() *v2.HorizontalPodAutoscalerList { return &v2.HorizontalPodAutoscalerList{} }), } } - -// Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. -func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.HorizontalPodAutoscaler, err error) { - result = &v2.HorizontalPodAutoscaler{} - err = c.client.Get(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. -func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (*v2.HorizontalPodAutoscalerList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for horizontalpodautoscalers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for horizontalpodautoscalers", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for horizontalpodautoscalers ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. -func (c *horizontalPodAutoscalers) list(ctx context.Context, opts v1.ListOptions) (result *v2.HorizontalPodAutoscalerList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v2.HorizontalPodAutoscalerList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of HorizontalPodAutoscalers -func (c *horizontalPodAutoscalers) watchList(ctx context.Context, opts v1.ListOptions) (result *v2.HorizontalPodAutoscalerList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v2.HorizontalPodAutoscalerList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. -func (c *horizontalPodAutoscalers) 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("horizontalpodautoscalers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *horizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *v2.HorizontalPodAutoscaler, err error) { - result = &v2.HorizontalPodAutoscaler{} - err = c.client.Post(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(horizontalPodAutoscaler). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *horizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2.HorizontalPodAutoscaler, err error) { - result = &v2.HorizontalPodAutoscaler{} - err = c.client.Put(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(horizontalPodAutoscaler.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(horizontalPodAutoscaler). - 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 *horizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2.HorizontalPodAutoscaler, err error) { - result = &v2.HorizontalPodAutoscaler{} - err = c.client.Put(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(horizontalPodAutoscaler.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(horizontalPodAutoscaler). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. -func (c *horizontalPodAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *horizontalPodAutoscalers) 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("horizontalpodautoscalers"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched horizontalPodAutoscaler. -func (c *horizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.HorizontalPodAutoscaler, err error) { - result = &v2.HorizontalPodAutoscaler{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - 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 horizontalPodAutoscaler. -func (c *horizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2.HorizontalPodAutoscaler, err error) { - if horizontalPodAutoscaler == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(horizontalPodAutoscaler) - if err != nil { - return nil, err - } - name := horizontalPodAutoscaler.Name - if name == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") - } - result = &v2.HorizontalPodAutoscaler{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - 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 *horizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2.HorizontalPodAutoscaler, err error) { - if horizontalPodAutoscaler == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(horizontalPodAutoscaler) - if err != nil { - return nil, err - } - - name := horizontalPodAutoscaler.Name - if name == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") - } - - result = &v2.HorizontalPodAutoscaler{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go index 76c9ce3f5c..6bc1b77766 100644 --- a/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go @@ -20,20 +20,14 @@ package v2beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v2beta1 "k8s.io/api/autoscaling/v2beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" autoscalingv2beta1 "k8s.io/client-go/applyconfigurations/autoscaling/v2beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface. @@ -46,6 +40,7 @@ type HorizontalPodAutoscalersGetter interface { type HorizontalPodAutoscalerInterface interface { Create(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.CreateOptions) (*v2beta1.HorizontalPodAutoscaler, error) Update(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta1.HorizontalPodAutoscaler, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta1.HorizontalPodAutoscaler, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,242 +49,25 @@ type HorizontalPodAutoscalerInterface 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 *v2beta1.HorizontalPodAutoscaler, err error) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) HorizontalPodAutoscalerExpansion } // horizontalPodAutoscalers implements HorizontalPodAutoscalerInterface type horizontalPodAutoscalers struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v2beta1.HorizontalPodAutoscaler, *v2beta1.HorizontalPodAutoscalerList, *autoscalingv2beta1.HorizontalPodAutoscalerApplyConfiguration] } // newHorizontalPodAutoscalers returns a HorizontalPodAutoscalers func newHorizontalPodAutoscalers(c *AutoscalingV2beta1Client, namespace string) *horizontalPodAutoscalers { return &horizontalPodAutoscalers{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v2beta1.HorizontalPodAutoscaler, *v2beta1.HorizontalPodAutoscalerList, *autoscalingv2beta1.HorizontalPodAutoscalerApplyConfiguration]( + "horizontalpodautoscalers", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v2beta1.HorizontalPodAutoscaler { return &v2beta1.HorizontalPodAutoscaler{} }, + func() *v2beta1.HorizontalPodAutoscalerList { return &v2beta1.HorizontalPodAutoscalerList{} }), } } - -// Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. -func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { - result = &v2beta1.HorizontalPodAutoscaler{} - err = c.client.Get(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. -func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (*v2beta1.HorizontalPodAutoscalerList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for horizontalpodautoscalers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for horizontalpodautoscalers", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for horizontalpodautoscalers ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. -func (c *horizontalPodAutoscalers) list(ctx context.Context, opts v1.ListOptions) (result *v2beta1.HorizontalPodAutoscalerList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v2beta1.HorizontalPodAutoscalerList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of HorizontalPodAutoscalers -func (c *horizontalPodAutoscalers) watchList(ctx context.Context, opts v1.ListOptions) (result *v2beta1.HorizontalPodAutoscalerList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v2beta1.HorizontalPodAutoscalerList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. -func (c *horizontalPodAutoscalers) 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("horizontalpodautoscalers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *horizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { - result = &v2beta1.HorizontalPodAutoscaler{} - err = c.client.Post(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(horizontalPodAutoscaler). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *horizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { - result = &v2beta1.HorizontalPodAutoscaler{} - err = c.client.Put(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(horizontalPodAutoscaler.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(horizontalPodAutoscaler). - 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 *horizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { - result = &v2beta1.HorizontalPodAutoscaler{} - err = c.client.Put(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(horizontalPodAutoscaler.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(horizontalPodAutoscaler). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. -func (c *horizontalPodAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *horizontalPodAutoscalers) 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("horizontalpodautoscalers"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched horizontalPodAutoscaler. -func (c *horizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta1.HorizontalPodAutoscaler, err error) { - result = &v2beta1.HorizontalPodAutoscaler{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - 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 horizontalPodAutoscaler. -func (c *horizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { - if horizontalPodAutoscaler == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(horizontalPodAutoscaler) - if err != nil { - return nil, err - } - name := horizontalPodAutoscaler.Name - if name == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") - } - result = &v2beta1.HorizontalPodAutoscaler{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - 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 *horizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { - if horizontalPodAutoscaler == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(horizontalPodAutoscaler) - if err != nil { - return nil, err - } - - name := horizontalPodAutoscaler.Name - if name == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") - } - - result = &v2beta1.HorizontalPodAutoscaler{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go index 3da8fa9280..6f464661a9 100644 --- a/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go @@ -20,20 +20,14 @@ package v2beta2 import ( "context" - json "encoding/json" - "fmt" - "time" v2beta2 "k8s.io/api/autoscaling/v2beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" autoscalingv2beta2 "k8s.io/client-go/applyconfigurations/autoscaling/v2beta2" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // HorizontalPodAutoscalersGetter has a method to return a HorizontalPodAutoscalerInterface. @@ -46,6 +40,7 @@ type HorizontalPodAutoscalersGetter interface { type HorizontalPodAutoscalerInterface interface { Create(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.CreateOptions) (*v2beta2.HorizontalPodAutoscaler, error) Update(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta2.HorizontalPodAutoscaler, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta2.HorizontalPodAutoscaler, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,242 +49,25 @@ type HorizontalPodAutoscalerInterface 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 *v2beta2.HorizontalPodAutoscaler, err error) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) HorizontalPodAutoscalerExpansion } // horizontalPodAutoscalers implements HorizontalPodAutoscalerInterface type horizontalPodAutoscalers struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v2beta2.HorizontalPodAutoscaler, *v2beta2.HorizontalPodAutoscalerList, *autoscalingv2beta2.HorizontalPodAutoscalerApplyConfiguration] } // newHorizontalPodAutoscalers returns a HorizontalPodAutoscalers func newHorizontalPodAutoscalers(c *AutoscalingV2beta2Client, namespace string) *horizontalPodAutoscalers { return &horizontalPodAutoscalers{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v2beta2.HorizontalPodAutoscaler, *v2beta2.HorizontalPodAutoscalerList, *autoscalingv2beta2.HorizontalPodAutoscalerApplyConfiguration]( + "horizontalpodautoscalers", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v2beta2.HorizontalPodAutoscaler { return &v2beta2.HorizontalPodAutoscaler{} }, + func() *v2beta2.HorizontalPodAutoscalerList { return &v2beta2.HorizontalPodAutoscalerList{} }), } } - -// Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. -func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { - result = &v2beta2.HorizontalPodAutoscaler{} - err = c.client.Get(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. -func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (*v2beta2.HorizontalPodAutoscalerList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for horizontalpodautoscalers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for horizontalpodautoscalers", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for horizontalpodautoscalers ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for horizontalpodautoscalers", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. -func (c *horizontalPodAutoscalers) list(ctx context.Context, opts v1.ListOptions) (result *v2beta2.HorizontalPodAutoscalerList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v2beta2.HorizontalPodAutoscalerList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of HorizontalPodAutoscalers -func (c *horizontalPodAutoscalers) watchList(ctx context.Context, opts v1.ListOptions) (result *v2beta2.HorizontalPodAutoscalerList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v2beta2.HorizontalPodAutoscalerList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. -func (c *horizontalPodAutoscalers) 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("horizontalpodautoscalers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *horizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { - result = &v2beta2.HorizontalPodAutoscaler{} - err = c.client.Post(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(horizontalPodAutoscaler). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *horizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { - result = &v2beta2.HorizontalPodAutoscaler{} - err = c.client.Put(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(horizontalPodAutoscaler.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(horizontalPodAutoscaler). - 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 *horizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { - result = &v2beta2.HorizontalPodAutoscaler{} - err = c.client.Put(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(horizontalPodAutoscaler.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(horizontalPodAutoscaler). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. -func (c *horizontalPodAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *horizontalPodAutoscalers) 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("horizontalpodautoscalers"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched horizontalPodAutoscaler. -func (c *horizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta2.HorizontalPodAutoscaler, err error) { - result = &v2beta2.HorizontalPodAutoscaler{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - 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 horizontalPodAutoscaler. -func (c *horizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { - if horizontalPodAutoscaler == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(horizontalPodAutoscaler) - if err != nil { - return nil, err - } - name := horizontalPodAutoscaler.Name - if name == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") - } - result = &v2beta2.HorizontalPodAutoscaler{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - 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 *horizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { - if horizontalPodAutoscaler == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(horizontalPodAutoscaler) - if err != nil { - return nil, err - } - - name := horizontalPodAutoscaler.Name - if name == nil { - return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply") - } - - result = &v2beta2.HorizontalPodAutoscaler{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("horizontalpodautoscalers"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/batch/v1/cronjob.go b/kubernetes/typed/batch/v1/cronjob.go index 763176c4c4..7907a5bf56 100644 --- a/kubernetes/typed/batch/v1/cronjob.go +++ b/kubernetes/typed/batch/v1/cronjob.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/batch/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" batchv1 "k8s.io/client-go/applyconfigurations/batch/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // CronJobsGetter has a method to return a CronJobInterface. @@ -46,6 +40,7 @@ type CronJobsGetter interface { type CronJobInterface interface { Create(ctx context.Context, cronJob *v1.CronJob, opts metav1.CreateOptions) (*v1.CronJob, error) Update(ctx context.Context, cronJob *v1.CronJob, opts metav1.UpdateOptions) (*v1.CronJob, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, cronJob *v1.CronJob, opts metav1.UpdateOptions) (*v1.CronJob, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -54,242 +49,25 @@ type CronJobInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CronJob, err error) Apply(ctx context.Context, cronJob *batchv1.CronJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CronJob, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, cronJob *batchv1.CronJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CronJob, err error) CronJobExpansion } // cronJobs implements CronJobInterface type cronJobs struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.CronJob, *v1.CronJobList, *batchv1.CronJobApplyConfiguration] } // newCronJobs returns a CronJobs func newCronJobs(c *BatchV1Client, namespace string) *cronJobs { return &cronJobs{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.CronJob, *v1.CronJobList, *batchv1.CronJobApplyConfiguration]( + "cronjobs", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.CronJob { return &v1.CronJob{} }, + func() *v1.CronJobList { return &v1.CronJobList{} }), } } - -// Get takes name of the cronJob, and returns the corresponding cronJob object, and an error if there is any. -func (c *cronJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CronJob, err error) { - result = &v1.CronJob{} - err = c.client.Get(). - Namespace(c.ns). - Resource("cronjobs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of CronJobs that match those selectors. -func (c *cronJobs) List(ctx context.Context, opts metav1.ListOptions) (*v1.CronJobList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for cronjobs, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for cronjobs", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for cronjobs ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for cronjobs", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of CronJobs that match those selectors. -func (c *cronJobs) list(ctx context.Context, opts metav1.ListOptions) (result *v1.CronJobList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.CronJobList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("cronjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of CronJobs -func (c *cronJobs) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.CronJobList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.CronJobList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("cronjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested cronJobs. -func (c *cronJobs) Watch(ctx context.Context, opts metav1.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("cronjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a cronJob and creates it. Returns the server's representation of the cronJob, and an error, if there is any. -func (c *cronJobs) Create(ctx context.Context, cronJob *v1.CronJob, opts metav1.CreateOptions) (result *v1.CronJob, err error) { - result = &v1.CronJob{} - err = c.client.Post(). - Namespace(c.ns). - Resource("cronjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cronJob). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a cronJob and updates it. Returns the server's representation of the cronJob, and an error, if there is any. -func (c *cronJobs) Update(ctx context.Context, cronJob *v1.CronJob, opts metav1.UpdateOptions) (result *v1.CronJob, err error) { - result = &v1.CronJob{} - err = c.client.Put(). - Namespace(c.ns). - Resource("cronjobs"). - Name(cronJob.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cronJob). - 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 *cronJobs) UpdateStatus(ctx context.Context, cronJob *v1.CronJob, opts metav1.UpdateOptions) (result *v1.CronJob, err error) { - result = &v1.CronJob{} - err = c.client.Put(). - Namespace(c.ns). - Resource("cronjobs"). - Name(cronJob.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cronJob). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the cronJob and deletes it. Returns an error if one occurs. -func (c *cronJobs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("cronjobs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *cronJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("cronjobs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched cronJob. -func (c *cronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CronJob, err error) { - result = &v1.CronJob{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("cronjobs"). - 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 cronJob. -func (c *cronJobs) Apply(ctx context.Context, cronJob *batchv1.CronJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CronJob, err error) { - if cronJob == nil { - return nil, fmt.Errorf("cronJob provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(cronJob) - if err != nil { - return nil, err - } - name := cronJob.Name - if name == nil { - return nil, fmt.Errorf("cronJob.Name must be provided to Apply") - } - result = &v1.CronJob{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("cronjobs"). - 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 *cronJobs) ApplyStatus(ctx context.Context, cronJob *batchv1.CronJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CronJob, err error) { - if cronJob == nil { - return nil, fmt.Errorf("cronJob provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(cronJob) - if err != nil { - return nil, err - } - - name := cronJob.Name - if name == nil { - return nil, fmt.Errorf("cronJob.Name must be provided to Apply") - } - - result = &v1.CronJob{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("cronjobs"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/batch/v1/job.go b/kubernetes/typed/batch/v1/job.go index 148b68aed0..83dbe6fa4f 100644 --- a/kubernetes/typed/batch/v1/job.go +++ b/kubernetes/typed/batch/v1/job.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/batch/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" batchv1 "k8s.io/client-go/applyconfigurations/batch/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // JobsGetter has a method to return a JobInterface. @@ -46,6 +40,7 @@ type JobsGetter interface { type JobInterface interface { Create(ctx context.Context, job *v1.Job, opts metav1.CreateOptions) (*v1.Job, error) Update(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (*v1.Job, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (*v1.Job, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -54,242 +49,25 @@ type JobInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Job, err error) Apply(ctx context.Context, job *batchv1.JobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Job, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, job *batchv1.JobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Job, err error) JobExpansion } // jobs implements JobInterface type jobs struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.Job, *v1.JobList, *batchv1.JobApplyConfiguration] } // newJobs returns a Jobs func newJobs(c *BatchV1Client, namespace string) *jobs { return &jobs{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.Job, *v1.JobList, *batchv1.JobApplyConfiguration]( + "jobs", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.Job { return &v1.Job{} }, + func() *v1.JobList { return &v1.JobList{} }), } } - -// Get takes name of the job, and returns the corresponding job object, and an error if there is any. -func (c *jobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Job, err error) { - result = &v1.Job{} - err = c.client.Get(). - Namespace(c.ns). - Resource("jobs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Jobs that match those selectors. -func (c *jobs) List(ctx context.Context, opts metav1.ListOptions) (*v1.JobList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for jobs, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for jobs", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for jobs ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for jobs", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of Jobs that match those selectors. -func (c *jobs) list(ctx context.Context, opts metav1.ListOptions) (result *v1.JobList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.JobList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("jobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of Jobs -func (c *jobs) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.JobList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.JobList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("jobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested jobs. -func (c *jobs) Watch(ctx context.Context, opts metav1.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("jobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a job and creates it. Returns the server's representation of the job, and an error, if there is any. -func (c *jobs) Create(ctx context.Context, job *v1.Job, opts metav1.CreateOptions) (result *v1.Job, err error) { - result = &v1.Job{} - err = c.client.Post(). - Namespace(c.ns). - Resource("jobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(job). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a job and updates it. Returns the server's representation of the job, and an error, if there is any. -func (c *jobs) Update(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (result *v1.Job, err error) { - result = &v1.Job{} - err = c.client.Put(). - Namespace(c.ns). - Resource("jobs"). - Name(job.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(job). - 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 *jobs) UpdateStatus(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (result *v1.Job, err error) { - result = &v1.Job{} - err = c.client.Put(). - Namespace(c.ns). - Resource("jobs"). - Name(job.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(job). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the job and deletes it. Returns an error if one occurs. -func (c *jobs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("jobs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *jobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("jobs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched job. -func (c *jobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Job, err error) { - result = &v1.Job{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("jobs"). - 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 job. -func (c *jobs) Apply(ctx context.Context, job *batchv1.JobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Job, err error) { - if job == nil { - return nil, fmt.Errorf("job provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(job) - if err != nil { - return nil, err - } - name := job.Name - if name == nil { - return nil, fmt.Errorf("job.Name must be provided to Apply") - } - result = &v1.Job{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("jobs"). - 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 *jobs) ApplyStatus(ctx context.Context, job *batchv1.JobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Job, err error) { - if job == nil { - return nil, fmt.Errorf("job provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(job) - if err != nil { - return nil, err - } - - name := job.Name - if name == nil { - return nil, fmt.Errorf("job.Name must be provided to Apply") - } - - result = &v1.Job{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("jobs"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/batch/v1beta1/cronjob.go b/kubernetes/typed/batch/v1beta1/cronjob.go index e6ee1fc143..a6f7399d84 100644 --- a/kubernetes/typed/batch/v1beta1/cronjob.go +++ b/kubernetes/typed/batch/v1beta1/cronjob.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/batch/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" batchv1beta1 "k8s.io/client-go/applyconfigurations/batch/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // CronJobsGetter has a method to return a CronJobInterface. @@ -46,6 +40,7 @@ type CronJobsGetter interface { type CronJobInterface interface { Create(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.CreateOptions) (*v1beta1.CronJob, error) Update(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (*v1beta1.CronJob, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (*v1beta1.CronJob, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,242 +49,25 @@ type CronJobInterface 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 *v1beta1.CronJob, err error) Apply(ctx context.Context, cronJob *batchv1beta1.CronJobApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CronJob, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, cronJob *batchv1beta1.CronJobApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CronJob, err error) CronJobExpansion } // cronJobs implements CronJobInterface type cronJobs struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta1.CronJob, *v1beta1.CronJobList, *batchv1beta1.CronJobApplyConfiguration] } // newCronJobs returns a CronJobs func newCronJobs(c *BatchV1beta1Client, namespace string) *cronJobs { return &cronJobs{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta1.CronJob, *v1beta1.CronJobList, *batchv1beta1.CronJobApplyConfiguration]( + "cronjobs", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.CronJob { return &v1beta1.CronJob{} }, + func() *v1beta1.CronJobList { return &v1beta1.CronJobList{} }), } } - -// Get takes name of the cronJob, and returns the corresponding cronJob object, and an error if there is any. -func (c *cronJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CronJob, err error) { - result = &v1beta1.CronJob{} - err = c.client.Get(). - Namespace(c.ns). - Resource("cronjobs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of CronJobs that match those selectors. -func (c *cronJobs) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CronJobList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for cronjobs, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for cronjobs", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for cronjobs ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for cronjobs", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of CronJobs that match those selectors. -func (c *cronJobs) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CronJobList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.CronJobList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("cronjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of CronJobs -func (c *cronJobs) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CronJobList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.CronJobList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("cronjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested cronJobs. -func (c *cronJobs) 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("cronjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a cronJob and creates it. Returns the server's representation of the cronJob, and an error, if there is any. -func (c *cronJobs) Create(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.CreateOptions) (result *v1beta1.CronJob, err error) { - result = &v1beta1.CronJob{} - err = c.client.Post(). - Namespace(c.ns). - Resource("cronjobs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cronJob). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a cronJob and updates it. Returns the server's representation of the cronJob, and an error, if there is any. -func (c *cronJobs) Update(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (result *v1beta1.CronJob, err error) { - result = &v1beta1.CronJob{} - err = c.client.Put(). - Namespace(c.ns). - Resource("cronjobs"). - Name(cronJob.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cronJob). - 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 *cronJobs) UpdateStatus(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (result *v1beta1.CronJob, err error) { - result = &v1beta1.CronJob{} - err = c.client.Put(). - Namespace(c.ns). - Resource("cronjobs"). - Name(cronJob.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cronJob). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the cronJob and deletes it. Returns an error if one occurs. -func (c *cronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("cronjobs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *cronJobs) 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("cronjobs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched cronJob. -func (c *cronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CronJob, err error) { - result = &v1beta1.CronJob{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("cronjobs"). - 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 cronJob. -func (c *cronJobs) Apply(ctx context.Context, cronJob *batchv1beta1.CronJobApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CronJob, err error) { - if cronJob == nil { - return nil, fmt.Errorf("cronJob provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(cronJob) - if err != nil { - return nil, err - } - name := cronJob.Name - if name == nil { - return nil, fmt.Errorf("cronJob.Name must be provided to Apply") - } - result = &v1beta1.CronJob{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("cronjobs"). - 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 *cronJobs) ApplyStatus(ctx context.Context, cronJob *batchv1beta1.CronJobApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CronJob, err error) { - if cronJob == nil { - return nil, fmt.Errorf("cronJob provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(cronJob) - if err != nil { - return nil, err - } - - name := cronJob.Name - if name == nil { - return nil, fmt.Errorf("cronJob.Name must be provided to Apply") - } - - result = &v1beta1.CronJob{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("cronjobs"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/certificates/v1/certificatesigningrequest.go b/kubernetes/typed/certificates/v1/certificatesigningrequest.go index bcc6841a1d..9fa3300e6c 100644 --- a/kubernetes/typed/certificates/v1/certificatesigningrequest.go +++ b/kubernetes/typed/certificates/v1/certificatesigningrequest.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/certificates/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" certificatesv1 "k8s.io/client-go/applyconfigurations/certificates/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // CertificateSigningRequestsGetter has a method to return a CertificateSigningRequestInterface. @@ -46,6 +40,7 @@ type CertificateSigningRequestsGetter interface { type CertificateSigningRequestInterface interface { Create(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.CreateOptions) (*v1.CertificateSigningRequest, error) Update(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (*v1.CertificateSigningRequest, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (*v1.CertificateSigningRequest, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -54,6 +49,7 @@ type CertificateSigningRequestInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CertificateSigningRequest, err error) Apply(ctx context.Context, certificateSigningRequest *certificatesv1.CertificateSigningRequestApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CertificateSigningRequest, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, certificateSigningRequest *certificatesv1.CertificateSigningRequestApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CertificateSigningRequest, err error) UpdateApproval(ctx context.Context, certificateSigningRequestName string, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (*v1.CertificateSigningRequest, error) @@ -62,230 +58,26 @@ type CertificateSigningRequestInterface interface { // certificateSigningRequests implements CertificateSigningRequestInterface type certificateSigningRequests struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1.CertificateSigningRequest, *v1.CertificateSigningRequestList, *certificatesv1.CertificateSigningRequestApplyConfiguration] } // newCertificateSigningRequests returns a CertificateSigningRequests func newCertificateSigningRequests(c *CertificatesV1Client) *certificateSigningRequests { return &certificateSigningRequests{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1.CertificateSigningRequest, *v1.CertificateSigningRequestList, *certificatesv1.CertificateSigningRequestApplyConfiguration]( + "certificatesigningrequests", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.CertificateSigningRequest { return &v1.CertificateSigningRequest{} }, + func() *v1.CertificateSigningRequestList { return &v1.CertificateSigningRequestList{} }), } } -// Get takes name of the certificateSigningRequest, and returns the corresponding certificateSigningRequest object, and an error if there is any. -func (c *certificateSigningRequests) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CertificateSigningRequest, err error) { - result = &v1.CertificateSigningRequest{} - err = c.client.Get(). - Resource("certificatesigningrequests"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. -func (c *certificateSigningRequests) List(ctx context.Context, opts metav1.ListOptions) (*v1.CertificateSigningRequestList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for certificatesigningrequests, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for certificatesigningrequests", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for certificatesigningrequests ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for certificatesigningrequests", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. -func (c *certificateSigningRequests) list(ctx context.Context, opts metav1.ListOptions) (result *v1.CertificateSigningRequestList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.CertificateSigningRequestList{} - err = c.client.Get(). - Resource("certificatesigningrequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of CertificateSigningRequests -func (c *certificateSigningRequests) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.CertificateSigningRequestList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.CertificateSigningRequestList{} - err = c.client.Get(). - Resource("certificatesigningrequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested certificateSigningRequests. -func (c *certificateSigningRequests) Watch(ctx context.Context, opts metav1.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("certificatesigningrequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a certificateSigningRequest and creates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. -func (c *certificateSigningRequests) Create(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.CreateOptions) (result *v1.CertificateSigningRequest, err error) { - result = &v1.CertificateSigningRequest{} - err = c.client.Post(). - Resource("certificatesigningrequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(certificateSigningRequest). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a certificateSigningRequest and updates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. -func (c *certificateSigningRequests) Update(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (result *v1.CertificateSigningRequest, err error) { - result = &v1.CertificateSigningRequest{} - err = c.client.Put(). - Resource("certificatesigningrequests"). - Name(certificateSigningRequest.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(certificateSigningRequest). - 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 *certificateSigningRequests) UpdateStatus(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (result *v1.CertificateSigningRequest, err error) { - result = &v1.CertificateSigningRequest{} - err = c.client.Put(). - Resource("certificatesigningrequests"). - Name(certificateSigningRequest.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(certificateSigningRequest). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the certificateSigningRequest and deletes it. Returns an error if one occurs. -func (c *certificateSigningRequests) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("certificatesigningrequests"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *certificateSigningRequests) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("certificatesigningrequests"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched certificateSigningRequest. -func (c *certificateSigningRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CertificateSigningRequest, err error) { - result = &v1.CertificateSigningRequest{} - err = c.client.Patch(pt). - Resource("certificatesigningrequests"). - 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 certificateSigningRequest. -func (c *certificateSigningRequests) Apply(ctx context.Context, certificateSigningRequest *certificatesv1.CertificateSigningRequestApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CertificateSigningRequest, err error) { - if certificateSigningRequest == nil { - return nil, fmt.Errorf("certificateSigningRequest provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(certificateSigningRequest) - if err != nil { - return nil, err - } - name := certificateSigningRequest.Name - if name == nil { - return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply") - } - result = &v1.CertificateSigningRequest{} - err = c.client.Patch(types.ApplyPatchType). - Resource("certificatesigningrequests"). - 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 *certificateSigningRequests) ApplyStatus(ctx context.Context, certificateSigningRequest *certificatesv1.CertificateSigningRequestApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CertificateSigningRequest, err error) { - if certificateSigningRequest == nil { - return nil, fmt.Errorf("certificateSigningRequest provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(certificateSigningRequest) - if err != nil { - return nil, err - } - - name := certificateSigningRequest.Name - if name == nil { - return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply") - } - - result = &v1.CertificateSigningRequest{} - err = c.client.Patch(types.ApplyPatchType). - Resource("certificatesigningrequests"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - // UpdateApproval takes the top resource name and the representation of a certificateSigningRequest and updates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. func (c *certificateSigningRequests) UpdateApproval(ctx context.Context, certificateSigningRequestName string, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (result *v1.CertificateSigningRequest, err error) { result = &v1.CertificateSigningRequest{} - err = c.client.Put(). + err = c.GetClient().Put(). Resource("certificatesigningrequests"). Name(certificateSigningRequestName). SubResource("approval"). diff --git a/kubernetes/typed/certificates/v1alpha1/clustertrustbundle.go b/kubernetes/typed/certificates/v1alpha1/clustertrustbundle.go index bfb1659b27..74fe9fa14c 100644 --- a/kubernetes/typed/certificates/v1alpha1/clustertrustbundle.go +++ b/kubernetes/typed/certificates/v1alpha1/clustertrustbundle.go @@ -20,20 +20,14 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "k8s.io/api/certificates/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" certificatesv1alpha1 "k8s.io/client-go/applyconfigurations/certificates/v1alpha1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ClusterTrustBundlesGetter has a method to return a ClusterTrustBundleInterface. @@ -58,178 +52,18 @@ type ClusterTrustBundleInterface interface { // clusterTrustBundles implements ClusterTrustBundleInterface type clusterTrustBundles struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.ClusterTrustBundle, *v1alpha1.ClusterTrustBundleList, *certificatesv1alpha1.ClusterTrustBundleApplyConfiguration] } // newClusterTrustBundles returns a ClusterTrustBundles func newClusterTrustBundles(c *CertificatesV1alpha1Client) *clusterTrustBundles { return &clusterTrustBundles{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.ClusterTrustBundle, *v1alpha1.ClusterTrustBundleList, *certificatesv1alpha1.ClusterTrustBundleApplyConfiguration]( + "clustertrustbundles", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.ClusterTrustBundle { return &v1alpha1.ClusterTrustBundle{} }, + func() *v1alpha1.ClusterTrustBundleList { return &v1alpha1.ClusterTrustBundleList{} }), } } - -// Get takes name of the clusterTrustBundle, and returns the corresponding clusterTrustBundle object, and an error if there is any. -func (c *clusterTrustBundles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterTrustBundle, err error) { - result = &v1alpha1.ClusterTrustBundle{} - err = c.client.Get(). - Resource("clustertrustbundles"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterTrustBundles that match those selectors. -func (c *clusterTrustBundles) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterTrustBundleList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for clustertrustbundles, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for clustertrustbundles", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for clustertrustbundles ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clustertrustbundles", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ClusterTrustBundles that match those selectors. -func (c *clusterTrustBundles) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterTrustBundleList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ClusterTrustBundleList{} - err = c.client.Get(). - Resource("clustertrustbundles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ClusterTrustBundles -func (c *clusterTrustBundles) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterTrustBundleList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ClusterTrustBundleList{} - err = c.client.Get(). - Resource("clustertrustbundles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterTrustBundles. -func (c *clusterTrustBundles) 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("clustertrustbundles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a clusterTrustBundle and creates it. Returns the server's representation of the clusterTrustBundle, and an error, if there is any. -func (c *clusterTrustBundles) Create(ctx context.Context, clusterTrustBundle *v1alpha1.ClusterTrustBundle, opts v1.CreateOptions) (result *v1alpha1.ClusterTrustBundle, err error) { - result = &v1alpha1.ClusterTrustBundle{} - err = c.client.Post(). - Resource("clustertrustbundles"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterTrustBundle). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a clusterTrustBundle and updates it. Returns the server's representation of the clusterTrustBundle, and an error, if there is any. -func (c *clusterTrustBundles) Update(ctx context.Context, clusterTrustBundle *v1alpha1.ClusterTrustBundle, opts v1.UpdateOptions) (result *v1alpha1.ClusterTrustBundle, err error) { - result = &v1alpha1.ClusterTrustBundle{} - err = c.client.Put(). - Resource("clustertrustbundles"). - Name(clusterTrustBundle.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterTrustBundle). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the clusterTrustBundle and deletes it. Returns an error if one occurs. -func (c *clusterTrustBundles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("clustertrustbundles"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterTrustBundles) 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("clustertrustbundles"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched clusterTrustBundle. -func (c *clusterTrustBundles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterTrustBundle, err error) { - result = &v1alpha1.ClusterTrustBundle{} - err = c.client.Patch(pt). - Resource("clustertrustbundles"). - 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 clusterTrustBundle. -func (c *clusterTrustBundles) Apply(ctx context.Context, clusterTrustBundle *certificatesv1alpha1.ClusterTrustBundleApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterTrustBundle, err error) { - if clusterTrustBundle == nil { - return nil, fmt.Errorf("clusterTrustBundle provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(clusterTrustBundle) - if err != nil { - return nil, err - } - name := clusterTrustBundle.Name - if name == nil { - return nil, fmt.Errorf("clusterTrustBundle.Name must be provided to Apply") - } - result = &v1alpha1.ClusterTrustBundle{} - err = c.client.Patch(types.ApplyPatchType). - Resource("clustertrustbundles"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go b/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go index 3abb541f50..de9915c5d6 100644 --- a/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go +++ b/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/certificates/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" certificatesv1beta1 "k8s.io/client-go/applyconfigurations/certificates/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // CertificateSigningRequestsGetter has a method to return a CertificateSigningRequestInterface. @@ -46,6 +40,7 @@ type CertificateSigningRequestsGetter interface { type CertificateSigningRequestInterface interface { Create(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.CreateOptions) (*v1beta1.CertificateSigningRequest, error) Update(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (*v1beta1.CertificateSigningRequest, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (*v1beta1.CertificateSigningRequest, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,228 +49,25 @@ type CertificateSigningRequestInterface 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 *v1beta1.CertificateSigningRequest, err error) Apply(ctx context.Context, certificateSigningRequest *certificatesv1beta1.CertificateSigningRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequest, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, certificateSigningRequest *certificatesv1beta1.CertificateSigningRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequest, err error) CertificateSigningRequestExpansion } // certificateSigningRequests implements CertificateSigningRequestInterface type certificateSigningRequests struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1beta1.CertificateSigningRequest, *v1beta1.CertificateSigningRequestList, *certificatesv1beta1.CertificateSigningRequestApplyConfiguration] } // newCertificateSigningRequests returns a CertificateSigningRequests func newCertificateSigningRequests(c *CertificatesV1beta1Client) *certificateSigningRequests { return &certificateSigningRequests{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1beta1.CertificateSigningRequest, *v1beta1.CertificateSigningRequestList, *certificatesv1beta1.CertificateSigningRequestApplyConfiguration]( + "certificatesigningrequests", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.CertificateSigningRequest { return &v1beta1.CertificateSigningRequest{} }, + func() *v1beta1.CertificateSigningRequestList { return &v1beta1.CertificateSigningRequestList{} }), } } - -// Get takes name of the certificateSigningRequest, and returns the corresponding certificateSigningRequest object, and an error if there is any. -func (c *certificateSigningRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CertificateSigningRequest, err error) { - result = &v1beta1.CertificateSigningRequest{} - err = c.client.Get(). - Resource("certificatesigningrequests"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. -func (c *certificateSigningRequests) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CertificateSigningRequestList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for certificatesigningrequests, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for certificatesigningrequests", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for certificatesigningrequests ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for certificatesigningrequests", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. -func (c *certificateSigningRequests) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CertificateSigningRequestList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.CertificateSigningRequestList{} - err = c.client.Get(). - Resource("certificatesigningrequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of CertificateSigningRequests -func (c *certificateSigningRequests) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CertificateSigningRequestList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.CertificateSigningRequestList{} - err = c.client.Get(). - Resource("certificatesigningrequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested certificateSigningRequests. -func (c *certificateSigningRequests) 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("certificatesigningrequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a certificateSigningRequest and creates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. -func (c *certificateSigningRequests) Create(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.CreateOptions) (result *v1beta1.CertificateSigningRequest, err error) { - result = &v1beta1.CertificateSigningRequest{} - err = c.client.Post(). - Resource("certificatesigningrequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(certificateSigningRequest). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a certificateSigningRequest and updates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. -func (c *certificateSigningRequests) Update(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (result *v1beta1.CertificateSigningRequest, err error) { - result = &v1beta1.CertificateSigningRequest{} - err = c.client.Put(). - Resource("certificatesigningrequests"). - Name(certificateSigningRequest.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(certificateSigningRequest). - 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 *certificateSigningRequests) UpdateStatus(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (result *v1beta1.CertificateSigningRequest, err error) { - result = &v1beta1.CertificateSigningRequest{} - err = c.client.Put(). - Resource("certificatesigningrequests"). - Name(certificateSigningRequest.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(certificateSigningRequest). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the certificateSigningRequest and deletes it. Returns an error if one occurs. -func (c *certificateSigningRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("certificatesigningrequests"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *certificateSigningRequests) 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("certificatesigningrequests"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched certificateSigningRequest. -func (c *certificateSigningRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CertificateSigningRequest, err error) { - result = &v1beta1.CertificateSigningRequest{} - err = c.client.Patch(pt). - Resource("certificatesigningrequests"). - 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 certificateSigningRequest. -func (c *certificateSigningRequests) Apply(ctx context.Context, certificateSigningRequest *certificatesv1beta1.CertificateSigningRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequest, err error) { - if certificateSigningRequest == nil { - return nil, fmt.Errorf("certificateSigningRequest provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(certificateSigningRequest) - if err != nil { - return nil, err - } - name := certificateSigningRequest.Name - if name == nil { - return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply") - } - result = &v1beta1.CertificateSigningRequest{} - err = c.client.Patch(types.ApplyPatchType). - Resource("certificatesigningrequests"). - 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 *certificateSigningRequests) ApplyStatus(ctx context.Context, certificateSigningRequest *certificatesv1beta1.CertificateSigningRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequest, err error) { - if certificateSigningRequest == nil { - return nil, fmt.Errorf("certificateSigningRequest provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(certificateSigningRequest) - if err != nil { - return nil, err - } - - name := certificateSigningRequest.Name - if name == nil { - return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply") - } - - result = &v1beta1.CertificateSigningRequest{} - err = c.client.Patch(types.ApplyPatchType). - Resource("certificatesigningrequests"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/coordination/v1/lease.go b/kubernetes/typed/coordination/v1/lease.go index 669f8548cd..97834d6ac0 100644 --- a/kubernetes/typed/coordination/v1/lease.go +++ b/kubernetes/typed/coordination/v1/lease.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/coordination/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" coordinationv1 "k8s.io/client-go/applyconfigurations/coordination/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // LeasesGetter has a method to return a LeaseInterface. @@ -58,190 +52,18 @@ type LeaseInterface interface { // leases implements LeaseInterface type leases struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.Lease, *v1.LeaseList, *coordinationv1.LeaseApplyConfiguration] } // newLeases returns a Leases func newLeases(c *CoordinationV1Client, namespace string) *leases { return &leases{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.Lease, *v1.LeaseList, *coordinationv1.LeaseApplyConfiguration]( + "leases", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.Lease { return &v1.Lease{} }, + func() *v1.LeaseList { return &v1.LeaseList{} }), } } - -// Get takes name of the lease, and returns the corresponding lease object, and an error if there is any. -func (c *leases) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Lease, err error) { - result = &v1.Lease{} - err = c.client.Get(). - Namespace(c.ns). - Resource("leases"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Leases that match those selectors. -func (c *leases) List(ctx context.Context, opts metav1.ListOptions) (*v1.LeaseList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for leases, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for leases", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for leases ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for leases", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of Leases that match those selectors. -func (c *leases) list(ctx context.Context, opts metav1.ListOptions) (result *v1.LeaseList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.LeaseList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("leases"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of Leases -func (c *leases) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.LeaseList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.LeaseList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("leases"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested leases. -func (c *leases) Watch(ctx context.Context, opts metav1.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("leases"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a lease and creates it. Returns the server's representation of the lease, and an error, if there is any. -func (c *leases) Create(ctx context.Context, lease *v1.Lease, opts metav1.CreateOptions) (result *v1.Lease, err error) { - result = &v1.Lease{} - err = c.client.Post(). - Namespace(c.ns). - Resource("leases"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(lease). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a lease and updates it. Returns the server's representation of the lease, and an error, if there is any. -func (c *leases) Update(ctx context.Context, lease *v1.Lease, opts metav1.UpdateOptions) (result *v1.Lease, err error) { - result = &v1.Lease{} - err = c.client.Put(). - Namespace(c.ns). - Resource("leases"). - Name(lease.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(lease). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the lease and deletes it. Returns an error if one occurs. -func (c *leases) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("leases"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *leases) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("leases"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched lease. -func (c *leases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Lease, err error) { - result = &v1.Lease{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("leases"). - 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 lease. -func (c *leases) Apply(ctx context.Context, lease *coordinationv1.LeaseApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Lease, err error) { - if lease == nil { - return nil, fmt.Errorf("lease provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(lease) - if err != nil { - return nil, err - } - name := lease.Name - if name == nil { - return nil, fmt.Errorf("lease.Name must be provided to Apply") - } - result = &v1.Lease{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("leases"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/coordination/v1beta1/lease.go b/kubernetes/typed/coordination/v1beta1/lease.go index 4a990053b0..62341e53b6 100644 --- a/kubernetes/typed/coordination/v1beta1/lease.go +++ b/kubernetes/typed/coordination/v1beta1/lease.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/coordination/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" coordinationv1beta1 "k8s.io/client-go/applyconfigurations/coordination/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // LeasesGetter has a method to return a LeaseInterface. @@ -58,190 +52,18 @@ type LeaseInterface interface { // leases implements LeaseInterface type leases struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta1.Lease, *v1beta1.LeaseList, *coordinationv1beta1.LeaseApplyConfiguration] } // newLeases returns a Leases func newLeases(c *CoordinationV1beta1Client, namespace string) *leases { return &leases{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta1.Lease, *v1beta1.LeaseList, *coordinationv1beta1.LeaseApplyConfiguration]( + "leases", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.Lease { return &v1beta1.Lease{} }, + func() *v1beta1.LeaseList { return &v1beta1.LeaseList{} }), } } - -// Get takes name of the lease, and returns the corresponding lease object, and an error if there is any. -func (c *leases) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Lease, err error) { - result = &v1beta1.Lease{} - err = c.client.Get(). - Namespace(c.ns). - Resource("leases"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Leases that match those selectors. -func (c *leases) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.LeaseList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for leases, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for leases", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for leases ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for leases", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of Leases that match those selectors. -func (c *leases) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.LeaseList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.LeaseList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("leases"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of Leases -func (c *leases) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.LeaseList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.LeaseList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("leases"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested leases. -func (c *leases) 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("leases"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a lease and creates it. Returns the server's representation of the lease, and an error, if there is any. -func (c *leases) Create(ctx context.Context, lease *v1beta1.Lease, opts v1.CreateOptions) (result *v1beta1.Lease, err error) { - result = &v1beta1.Lease{} - err = c.client.Post(). - Namespace(c.ns). - Resource("leases"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(lease). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a lease and updates it. Returns the server's representation of the lease, and an error, if there is any. -func (c *leases) Update(ctx context.Context, lease *v1beta1.Lease, opts v1.UpdateOptions) (result *v1beta1.Lease, err error) { - result = &v1beta1.Lease{} - err = c.client.Put(). - Namespace(c.ns). - Resource("leases"). - Name(lease.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(lease). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the lease and deletes it. Returns an error if one occurs. -func (c *leases) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("leases"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *leases) 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("leases"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched lease. -func (c *leases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Lease, err error) { - result = &v1beta1.Lease{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("leases"). - 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 lease. -func (c *leases) Apply(ctx context.Context, lease *coordinationv1beta1.LeaseApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Lease, err error) { - if lease == nil { - return nil, fmt.Errorf("lease provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(lease) - if err != nil { - return nil, err - } - name := lease.Name - if name == nil { - return nil, fmt.Errorf("lease.Name must be provided to Apply") - } - result = &v1beta1.Lease{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("leases"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/core/v1/componentstatus.go b/kubernetes/typed/core/v1/componentstatus.go index de958c6e91..ab9458a5c9 100644 --- a/kubernetes/typed/core/v1/componentstatus.go +++ b/kubernetes/typed/core/v1/componentstatus.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ComponentStatusesGetter has a method to return a ComponentStatusInterface. @@ -58,178 +52,18 @@ type ComponentStatusInterface interface { // componentStatuses implements ComponentStatusInterface type componentStatuses struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1.ComponentStatus, *v1.ComponentStatusList, *corev1.ComponentStatusApplyConfiguration] } // newComponentStatuses returns a ComponentStatuses func newComponentStatuses(c *CoreV1Client) *componentStatuses { return &componentStatuses{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1.ComponentStatus, *v1.ComponentStatusList, *corev1.ComponentStatusApplyConfiguration]( + "componentstatuses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.ComponentStatus { return &v1.ComponentStatus{} }, + func() *v1.ComponentStatusList { return &v1.ComponentStatusList{} }), } } - -// Get takes name of the componentStatus, and returns the corresponding componentStatus object, and an error if there is any. -func (c *componentStatuses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ComponentStatus, err error) { - result = &v1.ComponentStatus{} - err = c.client.Get(). - Resource("componentstatuses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ComponentStatuses that match those selectors. -func (c *componentStatuses) List(ctx context.Context, opts metav1.ListOptions) (*v1.ComponentStatusList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for componentstatuses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for componentstatuses", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for componentstatuses ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for componentstatuses", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ComponentStatuses that match those selectors. -func (c *componentStatuses) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ComponentStatusList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ComponentStatusList{} - err = c.client.Get(). - Resource("componentstatuses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ComponentStatuses -func (c *componentStatuses) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ComponentStatusList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ComponentStatusList{} - err = c.client.Get(). - Resource("componentstatuses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested componentStatuses. -func (c *componentStatuses) Watch(ctx context.Context, opts metav1.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("componentstatuses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a componentStatus and creates it. Returns the server's representation of the componentStatus, and an error, if there is any. -func (c *componentStatuses) Create(ctx context.Context, componentStatus *v1.ComponentStatus, opts metav1.CreateOptions) (result *v1.ComponentStatus, err error) { - result = &v1.ComponentStatus{} - err = c.client.Post(). - Resource("componentstatuses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(componentStatus). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a componentStatus and updates it. Returns the server's representation of the componentStatus, and an error, if there is any. -func (c *componentStatuses) Update(ctx context.Context, componentStatus *v1.ComponentStatus, opts metav1.UpdateOptions) (result *v1.ComponentStatus, err error) { - result = &v1.ComponentStatus{} - err = c.client.Put(). - Resource("componentstatuses"). - Name(componentStatus.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(componentStatus). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the componentStatus and deletes it. Returns an error if one occurs. -func (c *componentStatuses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("componentstatuses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *componentStatuses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("componentstatuses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched componentStatus. -func (c *componentStatuses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ComponentStatus, err error) { - result = &v1.ComponentStatus{} - err = c.client.Patch(pt). - Resource("componentstatuses"). - 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 componentStatus. -func (c *componentStatuses) Apply(ctx context.Context, componentStatus *corev1.ComponentStatusApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ComponentStatus, err error) { - if componentStatus == nil { - return nil, fmt.Errorf("componentStatus provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(componentStatus) - if err != nil { - return nil, err - } - name := componentStatus.Name - if name == nil { - return nil, fmt.Errorf("componentStatus.Name must be provided to Apply") - } - result = &v1.ComponentStatus{} - err = c.client.Patch(types.ApplyPatchType). - Resource("componentstatuses"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/core/v1/configmap.go b/kubernetes/typed/core/v1/configmap.go index 916786d539..72aa2361f0 100644 --- a/kubernetes/typed/core/v1/configmap.go +++ b/kubernetes/typed/core/v1/configmap.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ConfigMapsGetter has a method to return a ConfigMapInterface. @@ -58,190 +52,18 @@ type ConfigMapInterface interface { // configMaps implements ConfigMapInterface type configMaps struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.ConfigMap, *v1.ConfigMapList, *corev1.ConfigMapApplyConfiguration] } // newConfigMaps returns a ConfigMaps func newConfigMaps(c *CoreV1Client, namespace string) *configMaps { return &configMaps{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.ConfigMap, *v1.ConfigMapList, *corev1.ConfigMapApplyConfiguration]( + "configmaps", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.ConfigMap { return &v1.ConfigMap{} }, + func() *v1.ConfigMapList { return &v1.ConfigMapList{} }), } } - -// Get takes name of the configMap, and returns the corresponding configMap object, and an error if there is any. -func (c *configMaps) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ConfigMap, err error) { - result = &v1.ConfigMap{} - err = c.client.Get(). - Namespace(c.ns). - Resource("configmaps"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ConfigMaps that match those selectors. -func (c *configMaps) List(ctx context.Context, opts metav1.ListOptions) (*v1.ConfigMapList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for configmaps, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for configmaps", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for configmaps ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for configmaps", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ConfigMaps that match those selectors. -func (c *configMaps) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ConfigMapList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ConfigMapList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("configmaps"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ConfigMaps -func (c *configMaps) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ConfigMapList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ConfigMapList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("configmaps"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested configMaps. -func (c *configMaps) Watch(ctx context.Context, opts metav1.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("configmaps"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a configMap and creates it. Returns the server's representation of the configMap, and an error, if there is any. -func (c *configMaps) Create(ctx context.Context, configMap *v1.ConfigMap, opts metav1.CreateOptions) (result *v1.ConfigMap, err error) { - result = &v1.ConfigMap{} - err = c.client.Post(). - Namespace(c.ns). - Resource("configmaps"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(configMap). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a configMap and updates it. Returns the server's representation of the configMap, and an error, if there is any. -func (c *configMaps) Update(ctx context.Context, configMap *v1.ConfigMap, opts metav1.UpdateOptions) (result *v1.ConfigMap, err error) { - result = &v1.ConfigMap{} - err = c.client.Put(). - Namespace(c.ns). - Resource("configmaps"). - Name(configMap.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(configMap). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the configMap and deletes it. Returns an error if one occurs. -func (c *configMaps) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("configmaps"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *configMaps) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("configmaps"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched configMap. -func (c *configMaps) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ConfigMap, err error) { - result = &v1.ConfigMap{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("configmaps"). - 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 configMap. -func (c *configMaps) Apply(ctx context.Context, configMap *corev1.ConfigMapApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ConfigMap, err error) { - if configMap == nil { - return nil, fmt.Errorf("configMap provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(configMap) - if err != nil { - return nil, err - } - name := configMap.Name - if name == nil { - return nil, fmt.Errorf("configMap.Name must be provided to Apply") - } - result = &v1.ConfigMap{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("configmaps"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/core/v1/endpoints.go b/kubernetes/typed/core/v1/endpoints.go index 02a87b5320..9b9fc5fc1e 100644 --- a/kubernetes/typed/core/v1/endpoints.go +++ b/kubernetes/typed/core/v1/endpoints.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // EndpointsGetter has a method to return a EndpointsInterface. @@ -58,190 +52,18 @@ type EndpointsInterface interface { // endpoints implements EndpointsInterface type endpoints struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.Endpoints, *v1.EndpointsList, *corev1.EndpointsApplyConfiguration] } // newEndpoints returns a Endpoints func newEndpoints(c *CoreV1Client, namespace string) *endpoints { return &endpoints{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.Endpoints, *v1.EndpointsList, *corev1.EndpointsApplyConfiguration]( + "endpoints", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.Endpoints { return &v1.Endpoints{} }, + func() *v1.EndpointsList { return &v1.EndpointsList{} }), } } - -// Get takes name of the endpoints, and returns the corresponding endpoints object, and an error if there is any. -func (c *endpoints) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Endpoints, err error) { - result = &v1.Endpoints{} - err = c.client.Get(). - Namespace(c.ns). - Resource("endpoints"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Endpoints that match those selectors. -func (c *endpoints) List(ctx context.Context, opts metav1.ListOptions) (*v1.EndpointsList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for endpoints, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for endpoints", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for endpoints ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for endpoints", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of Endpoints that match those selectors. -func (c *endpoints) list(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointsList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.EndpointsList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("endpoints"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of Endpoints -func (c *endpoints) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointsList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.EndpointsList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("endpoints"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested endpoints. -func (c *endpoints) Watch(ctx context.Context, opts metav1.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("endpoints"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a endpoints and creates it. Returns the server's representation of the endpoints, and an error, if there is any. -func (c *endpoints) Create(ctx context.Context, endpoints *v1.Endpoints, opts metav1.CreateOptions) (result *v1.Endpoints, err error) { - result = &v1.Endpoints{} - err = c.client.Post(). - Namespace(c.ns). - Resource("endpoints"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(endpoints). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a endpoints and updates it. Returns the server's representation of the endpoints, and an error, if there is any. -func (c *endpoints) Update(ctx context.Context, endpoints *v1.Endpoints, opts metav1.UpdateOptions) (result *v1.Endpoints, err error) { - result = &v1.Endpoints{} - err = c.client.Put(). - Namespace(c.ns). - Resource("endpoints"). - Name(endpoints.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(endpoints). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the endpoints and deletes it. Returns an error if one occurs. -func (c *endpoints) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("endpoints"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *endpoints) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("endpoints"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched endpoints. -func (c *endpoints) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Endpoints, err error) { - result = &v1.Endpoints{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("endpoints"). - 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 endpoints. -func (c *endpoints) Apply(ctx context.Context, endpoints *corev1.EndpointsApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Endpoints, err error) { - if endpoints == nil { - return nil, fmt.Errorf("endpoints provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(endpoints) - if err != nil { - return nil, err - } - name := endpoints.Name - if name == nil { - return nil, fmt.Errorf("endpoints.Name must be provided to Apply") - } - result = &v1.Endpoints{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("endpoints"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/core/v1/event.go b/kubernetes/typed/core/v1/event.go index d045c99f32..5ff0f06906 100644 --- a/kubernetes/typed/core/v1/event.go +++ b/kubernetes/typed/core/v1/event.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // EventsGetter has a method to return a EventInterface. @@ -58,190 +52,18 @@ type EventInterface interface { // events implements EventInterface type events struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.Event, *v1.EventList, *corev1.EventApplyConfiguration] } // newEvents returns a Events func newEvents(c *CoreV1Client, namespace string) *events { return &events{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.Event, *v1.EventList, *corev1.EventApplyConfiguration]( + "events", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.Event { return &v1.Event{} }, + func() *v1.EventList { return &v1.EventList{} }), } } - -// Get takes name of the event, and returns the corresponding event object, and an error if there is any. -func (c *events) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Event, err error) { - result = &v1.Event{} - err = c.client.Get(). - Namespace(c.ns). - Resource("events"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Events that match those selectors. -func (c *events) List(ctx context.Context, opts metav1.ListOptions) (*v1.EventList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for events, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for events", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for events ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for events", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of Events that match those selectors. -func (c *events) list(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.EventList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("events"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of Events -func (c *events) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.EventList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("events"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested events. -func (c *events) Watch(ctx context.Context, opts metav1.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("events"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any. -func (c *events) Create(ctx context.Context, event *v1.Event, opts metav1.CreateOptions) (result *v1.Event, err error) { - result = &v1.Event{} - err = c.client.Post(). - Namespace(c.ns). - Resource("events"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(event). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a event and updates it. Returns the server's representation of the event, and an error, if there is any. -func (c *events) Update(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (result *v1.Event, err error) { - result = &v1.Event{} - err = c.client.Put(). - Namespace(c.ns). - Resource("events"). - Name(event.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(event). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the event and deletes it. Returns an error if one occurs. -func (c *events) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("events"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *events) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("events"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched event. -func (c *events) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Event, err error) { - result = &v1.Event{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("events"). - 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 event. -func (c *events) Apply(ctx context.Context, event *corev1.EventApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Event, err error) { - if event == nil { - return nil, fmt.Errorf("event provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(event) - if err != nil { - return nil, err - } - name := event.Name - if name == nil { - return nil, fmt.Errorf("event.Name must be provided to Apply") - } - result = &v1.Event{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("events"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/core/v1/limitrange.go b/kubernetes/typed/core/v1/limitrange.go index e5f54e1f66..f8e4048f98 100644 --- a/kubernetes/typed/core/v1/limitrange.go +++ b/kubernetes/typed/core/v1/limitrange.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // LimitRangesGetter has a method to return a LimitRangeInterface. @@ -58,190 +52,18 @@ type LimitRangeInterface interface { // limitRanges implements LimitRangeInterface type limitRanges struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.LimitRange, *v1.LimitRangeList, *corev1.LimitRangeApplyConfiguration] } // newLimitRanges returns a LimitRanges func newLimitRanges(c *CoreV1Client, namespace string) *limitRanges { return &limitRanges{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.LimitRange, *v1.LimitRangeList, *corev1.LimitRangeApplyConfiguration]( + "limitranges", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.LimitRange { return &v1.LimitRange{} }, + func() *v1.LimitRangeList { return &v1.LimitRangeList{} }), } } - -// Get takes name of the limitRange, and returns the corresponding limitRange object, and an error if there is any. -func (c *limitRanges) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.LimitRange, err error) { - result = &v1.LimitRange{} - err = c.client.Get(). - Namespace(c.ns). - Resource("limitranges"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of LimitRanges that match those selectors. -func (c *limitRanges) List(ctx context.Context, opts metav1.ListOptions) (*v1.LimitRangeList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for limitranges, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for limitranges", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for limitranges ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for limitranges", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of LimitRanges that match those selectors. -func (c *limitRanges) list(ctx context.Context, opts metav1.ListOptions) (result *v1.LimitRangeList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.LimitRangeList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("limitranges"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of LimitRanges -func (c *limitRanges) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.LimitRangeList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.LimitRangeList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("limitranges"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested limitRanges. -func (c *limitRanges) Watch(ctx context.Context, opts metav1.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("limitranges"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a limitRange and creates it. Returns the server's representation of the limitRange, and an error, if there is any. -func (c *limitRanges) Create(ctx context.Context, limitRange *v1.LimitRange, opts metav1.CreateOptions) (result *v1.LimitRange, err error) { - result = &v1.LimitRange{} - err = c.client.Post(). - Namespace(c.ns). - Resource("limitranges"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(limitRange). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a limitRange and updates it. Returns the server's representation of the limitRange, and an error, if there is any. -func (c *limitRanges) Update(ctx context.Context, limitRange *v1.LimitRange, opts metav1.UpdateOptions) (result *v1.LimitRange, err error) { - result = &v1.LimitRange{} - err = c.client.Put(). - Namespace(c.ns). - Resource("limitranges"). - Name(limitRange.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(limitRange). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the limitRange and deletes it. Returns an error if one occurs. -func (c *limitRanges) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("limitranges"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *limitRanges) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("limitranges"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched limitRange. -func (c *limitRanges) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LimitRange, err error) { - result = &v1.LimitRange{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("limitranges"). - 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 limitRange. -func (c *limitRanges) Apply(ctx context.Context, limitRange *corev1.LimitRangeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.LimitRange, err error) { - if limitRange == nil { - return nil, fmt.Errorf("limitRange provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(limitRange) - if err != nil { - return nil, err - } - name := limitRange.Name - if name == nil { - return nil, fmt.Errorf("limitRange.Name must be provided to Apply") - } - result = &v1.LimitRange{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("limitranges"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/core/v1/namespace.go b/kubernetes/typed/core/v1/namespace.go index 6d430cf99a..75d20648f5 100644 --- a/kubernetes/typed/core/v1/namespace.go +++ b/kubernetes/typed/core/v1/namespace.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // NamespacesGetter has a method to return a NamespaceInterface. @@ -46,6 +40,7 @@ type NamespacesGetter interface { type NamespaceInterface interface { Create(ctx context.Context, namespace *v1.Namespace, opts metav1.CreateOptions) (*v1.Namespace, error) Update(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (*v1.Namespace, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (*v1.Namespace, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Namespace, error) @@ -53,213 +48,25 @@ type NamespaceInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Namespace, err error) Apply(ctx context.Context, namespace *corev1.NamespaceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Namespace, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, namespace *corev1.NamespaceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Namespace, err error) NamespaceExpansion } // namespaces implements NamespaceInterface type namespaces struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1.Namespace, *v1.NamespaceList, *corev1.NamespaceApplyConfiguration] } // newNamespaces returns a Namespaces func newNamespaces(c *CoreV1Client) *namespaces { return &namespaces{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1.Namespace, *v1.NamespaceList, *corev1.NamespaceApplyConfiguration]( + "namespaces", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.Namespace { return &v1.Namespace{} }, + func() *v1.NamespaceList { return &v1.NamespaceList{} }), } } - -// Get takes name of the namespace, and returns the corresponding namespace object, and an error if there is any. -func (c *namespaces) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Namespace, err error) { - result = &v1.Namespace{} - err = c.client.Get(). - Resource("namespaces"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Namespaces that match those selectors. -func (c *namespaces) List(ctx context.Context, opts metav1.ListOptions) (*v1.NamespaceList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for namespaces, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for namespaces", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for namespaces ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for namespaces", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of Namespaces that match those selectors. -func (c *namespaces) list(ctx context.Context, opts metav1.ListOptions) (result *v1.NamespaceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.NamespaceList{} - err = c.client.Get(). - Resource("namespaces"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of Namespaces -func (c *namespaces) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.NamespaceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.NamespaceList{} - err = c.client.Get(). - Resource("namespaces"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested namespaces. -func (c *namespaces) Watch(ctx context.Context, opts metav1.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("namespaces"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a namespace and creates it. Returns the server's representation of the namespace, and an error, if there is any. -func (c *namespaces) Create(ctx context.Context, namespace *v1.Namespace, opts metav1.CreateOptions) (result *v1.Namespace, err error) { - result = &v1.Namespace{} - err = c.client.Post(). - Resource("namespaces"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(namespace). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a namespace and updates it. Returns the server's representation of the namespace, and an error, if there is any. -func (c *namespaces) Update(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (result *v1.Namespace, err error) { - result = &v1.Namespace{} - err = c.client.Put(). - Resource("namespaces"). - Name(namespace.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(namespace). - 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 *namespaces) UpdateStatus(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (result *v1.Namespace, err error) { - result = &v1.Namespace{} - err = c.client.Put(). - Resource("namespaces"). - Name(namespace.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(namespace). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the namespace and deletes it. Returns an error if one occurs. -func (c *namespaces) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("namespaces"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched namespace. -func (c *namespaces) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Namespace, err error) { - result = &v1.Namespace{} - err = c.client.Patch(pt). - Resource("namespaces"). - 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 namespace. -func (c *namespaces) Apply(ctx context.Context, namespace *corev1.NamespaceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Namespace, err error) { - if namespace == nil { - return nil, fmt.Errorf("namespace provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(namespace) - if err != nil { - return nil, err - } - name := namespace.Name - if name == nil { - return nil, fmt.Errorf("namespace.Name must be provided to Apply") - } - result = &v1.Namespace{} - err = c.client.Patch(types.ApplyPatchType). - Resource("namespaces"). - 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 *namespaces) ApplyStatus(ctx context.Context, namespace *corev1.NamespaceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Namespace, err error) { - if namespace == nil { - return nil, fmt.Errorf("namespace provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(namespace) - if err != nil { - return nil, err - } - - name := namespace.Name - if name == nil { - return nil, fmt.Errorf("namespace.Name must be provided to Apply") - } - - result = &v1.Namespace{} - err = c.client.Patch(types.ApplyPatchType). - Resource("namespaces"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/core/v1/node.go b/kubernetes/typed/core/v1/node.go index a3ea2a8a93..df1a7817f9 100644 --- a/kubernetes/typed/core/v1/node.go +++ b/kubernetes/typed/core/v1/node.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // NodesGetter has a method to return a NodeInterface. @@ -46,6 +40,7 @@ type NodesGetter interface { type NodeInterface interface { Create(ctx context.Context, node *v1.Node, opts metav1.CreateOptions) (*v1.Node, error) Update(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (*v1.Node, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (*v1.Node, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -54,228 +49,25 @@ type NodeInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Node, err error) Apply(ctx context.Context, node *corev1.NodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Node, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, node *corev1.NodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Node, err error) NodeExpansion } // nodes implements NodeInterface type nodes struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1.Node, *v1.NodeList, *corev1.NodeApplyConfiguration] } // newNodes returns a Nodes func newNodes(c *CoreV1Client) *nodes { return &nodes{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1.Node, *v1.NodeList, *corev1.NodeApplyConfiguration]( + "nodes", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.Node { return &v1.Node{} }, + func() *v1.NodeList { return &v1.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 metav1.GetOptions) (result *v1.Node, err error) { - result = &v1.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 metav1.ListOptions) (*v1.NodeList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for nodes, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for nodes", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for nodes ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for nodes", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of Nodes that match those selectors. -func (c *nodes) list(ctx context.Context, opts metav1.ListOptions) (result *v1.NodeList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.NodeList{} - err = c.client.Get(). - Resource("nodes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of Nodes -func (c *nodes) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.NodeList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.NodeList{} - err = c.client.Get(). - Resource("nodes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested nodes. -func (c *nodes) Watch(ctx context.Context, opts metav1.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 *v1.Node, opts metav1.CreateOptions) (result *v1.Node, err error) { - result = &v1.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 *v1.Node, opts metav1.UpdateOptions) (result *v1.Node, err error) { - result = &v1.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 *v1.Node, opts metav1.UpdateOptions) (result *v1.Node, err error) { - result = &v1.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 metav1.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 metav1.DeleteOptions, listOpts metav1.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 metav1.PatchOptions, subresources ...string) (result *v1.Node, err error) { - result = &v1.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 *corev1.NodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.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 = &v1.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 *corev1.NodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.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 = &v1.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/kubernetes/typed/core/v1/persistentvolume.go b/kubernetes/typed/core/v1/persistentvolume.go index c252330543..8be40f8665 100644 --- a/kubernetes/typed/core/v1/persistentvolume.go +++ b/kubernetes/typed/core/v1/persistentvolume.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // PersistentVolumesGetter has a method to return a PersistentVolumeInterface. @@ -46,6 +40,7 @@ type PersistentVolumesGetter interface { type PersistentVolumeInterface interface { Create(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.CreateOptions) (*v1.PersistentVolume, error) Update(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.UpdateOptions) (*v1.PersistentVolume, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.UpdateOptions) (*v1.PersistentVolume, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -54,228 +49,25 @@ type PersistentVolumeInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PersistentVolume, err error) Apply(ctx context.Context, persistentVolume *corev1.PersistentVolumeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolume, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, persistentVolume *corev1.PersistentVolumeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolume, err error) PersistentVolumeExpansion } // persistentVolumes implements PersistentVolumeInterface type persistentVolumes struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1.PersistentVolume, *v1.PersistentVolumeList, *corev1.PersistentVolumeApplyConfiguration] } // newPersistentVolumes returns a PersistentVolumes func newPersistentVolumes(c *CoreV1Client) *persistentVolumes { return &persistentVolumes{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1.PersistentVolume, *v1.PersistentVolumeList, *corev1.PersistentVolumeApplyConfiguration]( + "persistentvolumes", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.PersistentVolume { return &v1.PersistentVolume{} }, + func() *v1.PersistentVolumeList { return &v1.PersistentVolumeList{} }), } } - -// Get takes name of the persistentVolume, and returns the corresponding persistentVolume object, and an error if there is any. -func (c *persistentVolumes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PersistentVolume, err error) { - result = &v1.PersistentVolume{} - err = c.client.Get(). - Resource("persistentvolumes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PersistentVolumes that match those selectors. -func (c *persistentVolumes) List(ctx context.Context, opts metav1.ListOptions) (*v1.PersistentVolumeList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for persistentvolumes, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for persistentvolumes", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for persistentvolumes ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for persistentvolumes", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of PersistentVolumes that match those selectors. -func (c *persistentVolumes) list(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.PersistentVolumeList{} - err = c.client.Get(). - Resource("persistentvolumes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of PersistentVolumes -func (c *persistentVolumes) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.PersistentVolumeList{} - err = c.client.Get(). - Resource("persistentvolumes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested persistentVolumes. -func (c *persistentVolumes) Watch(ctx context.Context, opts metav1.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("persistentvolumes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a persistentVolume and creates it. Returns the server's representation of the persistentVolume, and an error, if there is any. -func (c *persistentVolumes) Create(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.CreateOptions) (result *v1.PersistentVolume, err error) { - result = &v1.PersistentVolume{} - err = c.client.Post(). - Resource("persistentvolumes"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(persistentVolume). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a persistentVolume and updates it. Returns the server's representation of the persistentVolume, and an error, if there is any. -func (c *persistentVolumes) Update(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.UpdateOptions) (result *v1.PersistentVolume, err error) { - result = &v1.PersistentVolume{} - err = c.client.Put(). - Resource("persistentvolumes"). - Name(persistentVolume.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(persistentVolume). - 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 *persistentVolumes) UpdateStatus(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.UpdateOptions) (result *v1.PersistentVolume, err error) { - result = &v1.PersistentVolume{} - err = c.client.Put(). - Resource("persistentvolumes"). - Name(persistentVolume.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(persistentVolume). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the persistentVolume and deletes it. Returns an error if one occurs. -func (c *persistentVolumes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("persistentvolumes"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *persistentVolumes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("persistentvolumes"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched persistentVolume. -func (c *persistentVolumes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PersistentVolume, err error) { - result = &v1.PersistentVolume{} - err = c.client.Patch(pt). - Resource("persistentvolumes"). - 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 persistentVolume. -func (c *persistentVolumes) Apply(ctx context.Context, persistentVolume *corev1.PersistentVolumeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolume, err error) { - if persistentVolume == nil { - return nil, fmt.Errorf("persistentVolume provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(persistentVolume) - if err != nil { - return nil, err - } - name := persistentVolume.Name - if name == nil { - return nil, fmt.Errorf("persistentVolume.Name must be provided to Apply") - } - result = &v1.PersistentVolume{} - err = c.client.Patch(types.ApplyPatchType). - Resource("persistentvolumes"). - 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 *persistentVolumes) ApplyStatus(ctx context.Context, persistentVolume *corev1.PersistentVolumeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolume, err error) { - if persistentVolume == nil { - return nil, fmt.Errorf("persistentVolume provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(persistentVolume) - if err != nil { - return nil, err - } - - name := persistentVolume.Name - if name == nil { - return nil, fmt.Errorf("persistentVolume.Name must be provided to Apply") - } - - result = &v1.PersistentVolume{} - err = c.client.Patch(types.ApplyPatchType). - Resource("persistentvolumes"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/core/v1/persistentvolumeclaim.go b/kubernetes/typed/core/v1/persistentvolumeclaim.go index a318240642..7721b00923 100644 --- a/kubernetes/typed/core/v1/persistentvolumeclaim.go +++ b/kubernetes/typed/core/v1/persistentvolumeclaim.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // PersistentVolumeClaimsGetter has a method to return a PersistentVolumeClaimInterface. @@ -46,6 +40,7 @@ type PersistentVolumeClaimsGetter interface { type PersistentVolumeClaimInterface interface { Create(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.CreateOptions) (*v1.PersistentVolumeClaim, error) Update(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.UpdateOptions) (*v1.PersistentVolumeClaim, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.UpdateOptions) (*v1.PersistentVolumeClaim, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -54,242 +49,25 @@ type PersistentVolumeClaimInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PersistentVolumeClaim, err error) Apply(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaimApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolumeClaim, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaimApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolumeClaim, err error) PersistentVolumeClaimExpansion } // persistentVolumeClaims implements PersistentVolumeClaimInterface type persistentVolumeClaims struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.PersistentVolumeClaim, *v1.PersistentVolumeClaimList, *corev1.PersistentVolumeClaimApplyConfiguration] } // newPersistentVolumeClaims returns a PersistentVolumeClaims func newPersistentVolumeClaims(c *CoreV1Client, namespace string) *persistentVolumeClaims { return &persistentVolumeClaims{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.PersistentVolumeClaim, *v1.PersistentVolumeClaimList, *corev1.PersistentVolumeClaimApplyConfiguration]( + "persistentvolumeclaims", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.PersistentVolumeClaim { return &v1.PersistentVolumeClaim{} }, + func() *v1.PersistentVolumeClaimList { return &v1.PersistentVolumeClaimList{} }), } } - -// Get takes name of the persistentVolumeClaim, and returns the corresponding persistentVolumeClaim object, and an error if there is any. -func (c *persistentVolumeClaims) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PersistentVolumeClaim, err error) { - result = &v1.PersistentVolumeClaim{} - err = c.client.Get(). - Namespace(c.ns). - Resource("persistentvolumeclaims"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PersistentVolumeClaims that match those selectors. -func (c *persistentVolumeClaims) List(ctx context.Context, opts metav1.ListOptions) (*v1.PersistentVolumeClaimList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for persistentvolumeclaims, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for persistentvolumeclaims", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for persistentvolumeclaims ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for persistentvolumeclaims", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of PersistentVolumeClaims that match those selectors. -func (c *persistentVolumeClaims) list(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeClaimList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.PersistentVolumeClaimList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("persistentvolumeclaims"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of PersistentVolumeClaims -func (c *persistentVolumeClaims) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeClaimList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.PersistentVolumeClaimList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("persistentvolumeclaims"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested persistentVolumeClaims. -func (c *persistentVolumeClaims) Watch(ctx context.Context, opts metav1.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("persistentvolumeclaims"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a persistentVolumeClaim and creates it. Returns the server's representation of the persistentVolumeClaim, and an error, if there is any. -func (c *persistentVolumeClaims) Create(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.CreateOptions) (result *v1.PersistentVolumeClaim, err error) { - result = &v1.PersistentVolumeClaim{} - err = c.client.Post(). - Namespace(c.ns). - Resource("persistentvolumeclaims"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(persistentVolumeClaim). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a persistentVolumeClaim and updates it. Returns the server's representation of the persistentVolumeClaim, and an error, if there is any. -func (c *persistentVolumeClaims) Update(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.UpdateOptions) (result *v1.PersistentVolumeClaim, err error) { - result = &v1.PersistentVolumeClaim{} - err = c.client.Put(). - Namespace(c.ns). - Resource("persistentvolumeclaims"). - Name(persistentVolumeClaim.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(persistentVolumeClaim). - 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 *persistentVolumeClaims) UpdateStatus(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.UpdateOptions) (result *v1.PersistentVolumeClaim, err error) { - result = &v1.PersistentVolumeClaim{} - err = c.client.Put(). - Namespace(c.ns). - Resource("persistentvolumeclaims"). - Name(persistentVolumeClaim.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(persistentVolumeClaim). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the persistentVolumeClaim and deletes it. Returns an error if one occurs. -func (c *persistentVolumeClaims) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("persistentvolumeclaims"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *persistentVolumeClaims) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("persistentvolumeclaims"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched persistentVolumeClaim. -func (c *persistentVolumeClaims) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PersistentVolumeClaim, err error) { - result = &v1.PersistentVolumeClaim{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("persistentvolumeclaims"). - 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 persistentVolumeClaim. -func (c *persistentVolumeClaims) Apply(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaimApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolumeClaim, err error) { - if persistentVolumeClaim == nil { - return nil, fmt.Errorf("persistentVolumeClaim provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(persistentVolumeClaim) - if err != nil { - return nil, err - } - name := persistentVolumeClaim.Name - if name == nil { - return nil, fmt.Errorf("persistentVolumeClaim.Name must be provided to Apply") - } - result = &v1.PersistentVolumeClaim{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("persistentvolumeclaims"). - 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 *persistentVolumeClaims) ApplyStatus(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaimApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolumeClaim, err error) { - if persistentVolumeClaim == nil { - return nil, fmt.Errorf("persistentVolumeClaim provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(persistentVolumeClaim) - if err != nil { - return nil, err - } - - name := persistentVolumeClaim.Name - if name == nil { - return nil, fmt.Errorf("persistentVolumeClaim.Name must be provided to Apply") - } - - result = &v1.PersistentVolumeClaim{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("persistentvolumeclaims"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/core/v1/pod.go b/kubernetes/typed/core/v1/pod.go index 23f80160a0..470b7de7bc 100644 --- a/kubernetes/typed/core/v1/pod.go +++ b/kubernetes/typed/core/v1/pod.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // PodsGetter has a method to return a PodInterface. @@ -46,6 +40,7 @@ type PodsGetter interface { type PodInterface interface { Create(ctx context.Context, pod *v1.Pod, opts metav1.CreateOptions) (*v1.Pod, error) Update(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (*v1.Pod, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (*v1.Pod, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -54,6 +49,7 @@ type PodInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Pod, err error) Apply(ctx context.Context, pod *corev1.PodApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Pod, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, pod *corev1.PodApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Pod, err error) UpdateEphemeralContainers(ctx context.Context, podName string, pod *v1.Pod, opts metav1.UpdateOptions) (*v1.Pod, error) @@ -62,245 +58,27 @@ type PodInterface interface { // pods implements PodInterface type pods struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.Pod, *v1.PodList, *corev1.PodApplyConfiguration] } // newPods returns a Pods func newPods(c *CoreV1Client, namespace string) *pods { return &pods{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.Pod, *v1.PodList, *corev1.PodApplyConfiguration]( + "pods", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.Pod { return &v1.Pod{} }, + func() *v1.PodList { return &v1.PodList{} }), } } -// Get takes name of the pod, and returns the corresponding pod object, and an error if there is any. -func (c *pods) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Pod, err error) { - result = &v1.Pod{} - err = c.client.Get(). - Namespace(c.ns). - Resource("pods"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Pods that match those selectors. -func (c *pods) List(ctx context.Context, opts metav1.ListOptions) (*v1.PodList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for pods, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for pods", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for pods ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for pods", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of Pods that match those selectors. -func (c *pods) list(ctx context.Context, opts metav1.ListOptions) (result *v1.PodList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.PodList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("pods"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of Pods -func (c *pods) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.PodList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.PodList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("pods"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested pods. -func (c *pods) Watch(ctx context.Context, opts metav1.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("pods"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a pod and creates it. Returns the server's representation of the pod, and an error, if there is any. -func (c *pods) Create(ctx context.Context, pod *v1.Pod, opts metav1.CreateOptions) (result *v1.Pod, err error) { - result = &v1.Pod{} - err = c.client.Post(). - Namespace(c.ns). - Resource("pods"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(pod). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a pod and updates it. Returns the server's representation of the pod, and an error, if there is any. -func (c *pods) Update(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) { - result = &v1.Pod{} - err = c.client.Put(). - Namespace(c.ns). - Resource("pods"). - Name(pod.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(pod). - 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 *pods) UpdateStatus(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) { - result = &v1.Pod{} - err = c.client.Put(). - Namespace(c.ns). - Resource("pods"). - Name(pod.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(pod). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the pod and deletes it. Returns an error if one occurs. -func (c *pods) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("pods"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *pods) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("pods"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched pod. -func (c *pods) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Pod, err error) { - result = &v1.Pod{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("pods"). - 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 pod. -func (c *pods) Apply(ctx context.Context, pod *corev1.PodApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Pod, err error) { - if pod == nil { - return nil, fmt.Errorf("pod provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(pod) - if err != nil { - return nil, err - } - name := pod.Name - if name == nil { - return nil, fmt.Errorf("pod.Name must be provided to Apply") - } - result = &v1.Pod{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("pods"). - 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 *pods) ApplyStatus(ctx context.Context, pod *corev1.PodApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Pod, err error) { - if pod == nil { - return nil, fmt.Errorf("pod provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(pod) - if err != nil { - return nil, err - } - - name := pod.Name - if name == nil { - return nil, fmt.Errorf("pod.Name must be provided to Apply") - } - - result = &v1.Pod{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("pods"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - // UpdateEphemeralContainers takes the top resource name and the representation of a pod and updates it. Returns the server's representation of the pod, and an error, if there is any. func (c *pods) UpdateEphemeralContainers(ctx context.Context, podName string, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) { result = &v1.Pod{} - err = c.client.Put(). - Namespace(c.ns). + err = c.GetClient().Put(). + Namespace(c.GetNamespace()). Resource("pods"). Name(podName). SubResource("ephemeralcontainers"). diff --git a/kubernetes/typed/core/v1/podtemplate.go b/kubernetes/typed/core/v1/podtemplate.go index 47f358809c..060a059093 100644 --- a/kubernetes/typed/core/v1/podtemplate.go +++ b/kubernetes/typed/core/v1/podtemplate.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // PodTemplatesGetter has a method to return a PodTemplateInterface. @@ -58,190 +52,18 @@ type PodTemplateInterface interface { // podTemplates implements PodTemplateInterface type podTemplates struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.PodTemplate, *v1.PodTemplateList, *corev1.PodTemplateApplyConfiguration] } // newPodTemplates returns a PodTemplates func newPodTemplates(c *CoreV1Client, namespace string) *podTemplates { return &podTemplates{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.PodTemplate, *v1.PodTemplateList, *corev1.PodTemplateApplyConfiguration]( + "podtemplates", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.PodTemplate { return &v1.PodTemplate{} }, + func() *v1.PodTemplateList { return &v1.PodTemplateList{} }), } } - -// Get takes name of the podTemplate, and returns the corresponding podTemplate object, and an error if there is any. -func (c *podTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PodTemplate, err error) { - result = &v1.PodTemplate{} - err = c.client.Get(). - Namespace(c.ns). - Resource("podtemplates"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PodTemplates that match those selectors. -func (c *podTemplates) List(ctx context.Context, opts metav1.ListOptions) (*v1.PodTemplateList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for podtemplates, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for podtemplates", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for podtemplates ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for podtemplates", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of PodTemplates that match those selectors. -func (c *podTemplates) list(ctx context.Context, opts metav1.ListOptions) (result *v1.PodTemplateList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.PodTemplateList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("podtemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of PodTemplates -func (c *podTemplates) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.PodTemplateList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.PodTemplateList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("podtemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested podTemplates. -func (c *podTemplates) Watch(ctx context.Context, opts metav1.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("podtemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a podTemplate and creates it. Returns the server's representation of the podTemplate, and an error, if there is any. -func (c *podTemplates) Create(ctx context.Context, podTemplate *v1.PodTemplate, opts metav1.CreateOptions) (result *v1.PodTemplate, err error) { - result = &v1.PodTemplate{} - err = c.client.Post(). - Namespace(c.ns). - Resource("podtemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(podTemplate). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a podTemplate and updates it. Returns the server's representation of the podTemplate, and an error, if there is any. -func (c *podTemplates) Update(ctx context.Context, podTemplate *v1.PodTemplate, opts metav1.UpdateOptions) (result *v1.PodTemplate, err error) { - result = &v1.PodTemplate{} - err = c.client.Put(). - Namespace(c.ns). - Resource("podtemplates"). - Name(podTemplate.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(podTemplate). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the podTemplate and deletes it. Returns an error if one occurs. -func (c *podTemplates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("podtemplates"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *podTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("podtemplates"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched podTemplate. -func (c *podTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodTemplate, err error) { - result = &v1.PodTemplate{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("podtemplates"). - 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 podTemplate. -func (c *podTemplates) Apply(ctx context.Context, podTemplate *corev1.PodTemplateApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodTemplate, err error) { - if podTemplate == nil { - return nil, fmt.Errorf("podTemplate provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(podTemplate) - if err != nil { - return nil, err - } - name := podTemplate.Name - if name == nil { - return nil, fmt.Errorf("podTemplate.Name must be provided to Apply") - } - result = &v1.PodTemplate{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("podtemplates"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/core/v1/replicationcontroller.go b/kubernetes/typed/core/v1/replicationcontroller.go index d7c4851375..9b275ed1ba 100644 --- a/kubernetes/typed/core/v1/replicationcontroller.go +++ b/kubernetes/typed/core/v1/replicationcontroller.go @@ -20,9 +20,6 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" autoscalingv1 "k8s.io/api/autoscaling/v1" v1 "k8s.io/api/core/v1" @@ -30,11 +27,8 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ReplicationControllersGetter has a method to return a ReplicationControllerInterface. @@ -47,6 +41,7 @@ type ReplicationControllersGetter interface { type ReplicationControllerInterface interface { Create(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.CreateOptions) (*v1.ReplicationController, error) Update(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.UpdateOptions) (*v1.ReplicationController, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.UpdateOptions) (*v1.ReplicationController, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -55,6 +50,7 @@ type ReplicationControllerInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ReplicationController, err error) Apply(ctx context.Context, replicationController *corev1.ReplicationControllerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicationController, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, replicationController *corev1.ReplicationControllerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicationController, err error) GetScale(ctx context.Context, replicationControllerName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) UpdateScale(ctx context.Context, replicationControllerName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) @@ -64,245 +60,27 @@ type ReplicationControllerInterface interface { // replicationControllers implements ReplicationControllerInterface type replicationControllers struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.ReplicationController, *v1.ReplicationControllerList, *corev1.ReplicationControllerApplyConfiguration] } // newReplicationControllers returns a ReplicationControllers func newReplicationControllers(c *CoreV1Client, namespace string) *replicationControllers { return &replicationControllers{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.ReplicationController, *v1.ReplicationControllerList, *corev1.ReplicationControllerApplyConfiguration]( + "replicationcontrollers", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.ReplicationController { return &v1.ReplicationController{} }, + func() *v1.ReplicationControllerList { return &v1.ReplicationControllerList{} }), } } -// Get takes name of the replicationController, and returns the corresponding replicationController object, and an error if there is any. -func (c *replicationControllers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ReplicationController, err error) { - result = &v1.ReplicationController{} - err = c.client.Get(). - Namespace(c.ns). - Resource("replicationcontrollers"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ReplicationControllers that match those selectors. -func (c *replicationControllers) List(ctx context.Context, opts metav1.ListOptions) (*v1.ReplicationControllerList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for replicationcontrollers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for replicationcontrollers", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for replicationcontrollers ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicationcontrollers", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ReplicationControllers that match those selectors. -func (c *replicationControllers) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicationControllerList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ReplicationControllerList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("replicationcontrollers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ReplicationControllers -func (c *replicationControllers) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicationControllerList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ReplicationControllerList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("replicationcontrollers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested replicationControllers. -func (c *replicationControllers) Watch(ctx context.Context, opts metav1.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("replicationcontrollers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a replicationController and creates it. Returns the server's representation of the replicationController, and an error, if there is any. -func (c *replicationControllers) Create(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.CreateOptions) (result *v1.ReplicationController, err error) { - result = &v1.ReplicationController{} - err = c.client.Post(). - Namespace(c.ns). - Resource("replicationcontrollers"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(replicationController). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a replicationController and updates it. Returns the server's representation of the replicationController, and an error, if there is any. -func (c *replicationControllers) Update(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.UpdateOptions) (result *v1.ReplicationController, err error) { - result = &v1.ReplicationController{} - err = c.client.Put(). - Namespace(c.ns). - Resource("replicationcontrollers"). - Name(replicationController.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(replicationController). - 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 *replicationControllers) UpdateStatus(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.UpdateOptions) (result *v1.ReplicationController, err error) { - result = &v1.ReplicationController{} - err = c.client.Put(). - Namespace(c.ns). - Resource("replicationcontrollers"). - Name(replicationController.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(replicationController). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the replicationController and deletes it. Returns an error if one occurs. -func (c *replicationControllers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("replicationcontrollers"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *replicationControllers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("replicationcontrollers"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched replicationController. -func (c *replicationControllers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ReplicationController, err error) { - result = &v1.ReplicationController{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("replicationcontrollers"). - 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 replicationController. -func (c *replicationControllers) Apply(ctx context.Context, replicationController *corev1.ReplicationControllerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicationController, err error) { - if replicationController == nil { - return nil, fmt.Errorf("replicationController provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(replicationController) - if err != nil { - return nil, err - } - name := replicationController.Name - if name == nil { - return nil, fmt.Errorf("replicationController.Name must be provided to Apply") - } - result = &v1.ReplicationController{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("replicationcontrollers"). - 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 *replicationControllers) ApplyStatus(ctx context.Context, replicationController *corev1.ReplicationControllerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicationController, err error) { - if replicationController == nil { - return nil, fmt.Errorf("replicationController provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(replicationController) - if err != nil { - return nil, err - } - - name := replicationController.Name - if name == nil { - return nil, fmt.Errorf("replicationController.Name must be provided to Apply") - } - - result = &v1.ReplicationController{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("replicationcontrollers"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - // GetScale takes name of the replicationController, and returns the corresponding autoscalingv1.Scale object, and an error if there is any. func (c *replicationControllers) GetScale(ctx context.Context, replicationControllerName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} - err = c.client.Get(). - Namespace(c.ns). + err = c.GetClient().Get(). + Namespace(c.GetNamespace()). Resource("replicationcontrollers"). Name(replicationControllerName). SubResource("scale"). @@ -315,8 +93,8 @@ func (c *replicationControllers) GetScale(ctx context.Context, replicationContro // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *replicationControllers) UpdateScale(ctx context.Context, replicationControllerName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} - err = c.client.Put(). - Namespace(c.ns). + err = c.GetClient().Put(). + Namespace(c.GetNamespace()). Resource("replicationcontrollers"). Name(replicationControllerName). SubResource("scale"). diff --git a/kubernetes/typed/core/v1/resourcequota.go b/kubernetes/typed/core/v1/resourcequota.go index 3e28a0b055..4b2dcd3b59 100644 --- a/kubernetes/typed/core/v1/resourcequota.go +++ b/kubernetes/typed/core/v1/resourcequota.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ResourceQuotasGetter has a method to return a ResourceQuotaInterface. @@ -46,6 +40,7 @@ type ResourceQuotasGetter interface { type ResourceQuotaInterface interface { Create(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.CreateOptions) (*v1.ResourceQuota, error) Update(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.UpdateOptions) (*v1.ResourceQuota, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.UpdateOptions) (*v1.ResourceQuota, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -54,242 +49,25 @@ type ResourceQuotaInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ResourceQuota, err error) Apply(ctx context.Context, resourceQuota *corev1.ResourceQuotaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ResourceQuota, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, resourceQuota *corev1.ResourceQuotaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ResourceQuota, err error) ResourceQuotaExpansion } // resourceQuotas implements ResourceQuotaInterface type resourceQuotas struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.ResourceQuota, *v1.ResourceQuotaList, *corev1.ResourceQuotaApplyConfiguration] } // newResourceQuotas returns a ResourceQuotas func newResourceQuotas(c *CoreV1Client, namespace string) *resourceQuotas { return &resourceQuotas{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.ResourceQuota, *v1.ResourceQuotaList, *corev1.ResourceQuotaApplyConfiguration]( + "resourcequotas", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.ResourceQuota { return &v1.ResourceQuota{} }, + func() *v1.ResourceQuotaList { return &v1.ResourceQuotaList{} }), } } - -// Get takes name of the resourceQuota, and returns the corresponding resourceQuota object, and an error if there is any. -func (c *resourceQuotas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ResourceQuota, err error) { - result = &v1.ResourceQuota{} - err = c.client.Get(). - Namespace(c.ns). - Resource("resourcequotas"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ResourceQuotas that match those selectors. -func (c *resourceQuotas) List(ctx context.Context, opts metav1.ListOptions) (*v1.ResourceQuotaList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for resourcequotas, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for resourcequotas", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for resourcequotas ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourcequotas", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ResourceQuotas that match those selectors. -func (c *resourceQuotas) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ResourceQuotaList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ResourceQuotaList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("resourcequotas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ResourceQuotas -func (c *resourceQuotas) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ResourceQuotaList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ResourceQuotaList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("resourcequotas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested resourceQuotas. -func (c *resourceQuotas) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("resourcequotas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a resourceQuota and creates it. Returns the server's representation of the resourceQuota, and an error, if there is any. -func (c *resourceQuotas) Create(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.CreateOptions) (result *v1.ResourceQuota, err error) { - result = &v1.ResourceQuota{} - err = c.client.Post(). - Namespace(c.ns). - Resource("resourcequotas"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceQuota). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a resourceQuota and updates it. Returns the server's representation of the resourceQuota, and an error, if there is any. -func (c *resourceQuotas) Update(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.UpdateOptions) (result *v1.ResourceQuota, err error) { - result = &v1.ResourceQuota{} - err = c.client.Put(). - Namespace(c.ns). - Resource("resourcequotas"). - Name(resourceQuota.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceQuota). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *resourceQuotas) UpdateStatus(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.UpdateOptions) (result *v1.ResourceQuota, err error) { - result = &v1.ResourceQuota{} - err = c.client.Put(). - Namespace(c.ns). - Resource("resourcequotas"). - Name(resourceQuota.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceQuota). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the resourceQuota and deletes it. Returns an error if one occurs. -func (c *resourceQuotas) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("resourcequotas"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *resourceQuotas) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("resourcequotas"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched resourceQuota. -func (c *resourceQuotas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ResourceQuota, err error) { - result = &v1.ResourceQuota{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("resourcequotas"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied resourceQuota. -func (c *resourceQuotas) Apply(ctx context.Context, resourceQuota *corev1.ResourceQuotaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ResourceQuota, err error) { - if resourceQuota == nil { - return nil, fmt.Errorf("resourceQuota provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(resourceQuota) - if err != nil { - return nil, err - } - name := resourceQuota.Name - if name == nil { - return nil, fmt.Errorf("resourceQuota.Name must be provided to Apply") - } - result = &v1.ResourceQuota{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("resourcequotas"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - -// ApplyStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *resourceQuotas) ApplyStatus(ctx context.Context, resourceQuota *corev1.ResourceQuotaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ResourceQuota, err error) { - if resourceQuota == nil { - return nil, fmt.Errorf("resourceQuota provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(resourceQuota) - if err != nil { - return nil, err - } - - name := resourceQuota.Name - if name == nil { - return nil, fmt.Errorf("resourceQuota.Name must be provided to Apply") - } - - result = &v1.ResourceQuota{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("resourcequotas"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/core/v1/secret.go b/kubernetes/typed/core/v1/secret.go index 61998f848a..12a8d1178f 100644 --- a/kubernetes/typed/core/v1/secret.go +++ b/kubernetes/typed/core/v1/secret.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // SecretsGetter has a method to return a SecretInterface. @@ -58,190 +52,18 @@ type SecretInterface interface { // secrets implements SecretInterface type secrets struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.Secret, *v1.SecretList, *corev1.SecretApplyConfiguration] } // newSecrets returns a Secrets func newSecrets(c *CoreV1Client, namespace string) *secrets { return &secrets{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.Secret, *v1.SecretList, *corev1.SecretApplyConfiguration]( + "secrets", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.Secret { return &v1.Secret{} }, + func() *v1.SecretList { return &v1.SecretList{} }), } } - -// Get takes name of the secret, and returns the corresponding secret object, and an error if there is any. -func (c *secrets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Secret, err error) { - result = &v1.Secret{} - err = c.client.Get(). - Namespace(c.ns). - Resource("secrets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Secrets that match those selectors. -func (c *secrets) List(ctx context.Context, opts metav1.ListOptions) (*v1.SecretList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for secrets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for secrets", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for secrets ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for secrets", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of Secrets that match those selectors. -func (c *secrets) list(ctx context.Context, opts metav1.ListOptions) (result *v1.SecretList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.SecretList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("secrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of Secrets -func (c *secrets) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.SecretList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.SecretList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("secrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested secrets. -func (c *secrets) Watch(ctx context.Context, opts metav1.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("secrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a secret and creates it. Returns the server's representation of the secret, and an error, if there is any. -func (c *secrets) Create(ctx context.Context, secret *v1.Secret, opts metav1.CreateOptions) (result *v1.Secret, err error) { - result = &v1.Secret{} - err = c.client.Post(). - Namespace(c.ns). - Resource("secrets"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(secret). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a secret and updates it. Returns the server's representation of the secret, and an error, if there is any. -func (c *secrets) Update(ctx context.Context, secret *v1.Secret, opts metav1.UpdateOptions) (result *v1.Secret, err error) { - result = &v1.Secret{} - err = c.client.Put(). - Namespace(c.ns). - Resource("secrets"). - Name(secret.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(secret). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the secret and deletes it. Returns an error if one occurs. -func (c *secrets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("secrets"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *secrets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("secrets"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched secret. -func (c *secrets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Secret, err error) { - result = &v1.Secret{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("secrets"). - 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 secret. -func (c *secrets) Apply(ctx context.Context, secret *corev1.SecretApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Secret, err error) { - if secret == nil { - return nil, fmt.Errorf("secret provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(secret) - if err != nil { - return nil, err - } - name := secret.Name - if name == nil { - return nil, fmt.Errorf("secret.Name must be provided to Apply") - } - result = &v1.Secret{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("secrets"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/core/v1/service.go b/kubernetes/typed/core/v1/service.go index 07c6a59da1..ec935a3247 100644 --- a/kubernetes/typed/core/v1/service.go +++ b/kubernetes/typed/core/v1/service.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ServicesGetter has a method to return a ServiceInterface. @@ -46,6 +40,7 @@ type ServicesGetter interface { type ServiceInterface interface { Create(ctx context.Context, service *v1.Service, opts metav1.CreateOptions) (*v1.Service, error) Update(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (*v1.Service, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (*v1.Service, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Service, error) @@ -53,226 +48,25 @@ type ServiceInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Service, err error) Apply(ctx context.Context, service *corev1.ServiceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Service, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, service *corev1.ServiceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Service, err error) ServiceExpansion } // services implements ServiceInterface type services struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.Service, *v1.ServiceList, *corev1.ServiceApplyConfiguration] } // newServices returns a Services func newServices(c *CoreV1Client, namespace string) *services { return &services{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.Service, *v1.ServiceList, *corev1.ServiceApplyConfiguration]( + "services", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.Service { return &v1.Service{} }, + func() *v1.ServiceList { return &v1.ServiceList{} }), } } - -// Get takes name of the service, and returns the corresponding service object, and an error if there is any. -func (c *services) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Service, err error) { - result = &v1.Service{} - err = c.client.Get(). - Namespace(c.ns). - Resource("services"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Services that match those selectors. -func (c *services) List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for services, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for services", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for services ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for services", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of Services that match those selectors. -func (c *services) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ServiceList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("services"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of Services -func (c *services) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ServiceList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("services"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested services. -func (c *services) Watch(ctx context.Context, opts metav1.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("services"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a service and creates it. Returns the server's representation of the service, and an error, if there is any. -func (c *services) Create(ctx context.Context, service *v1.Service, opts metav1.CreateOptions) (result *v1.Service, err error) { - result = &v1.Service{} - err = c.client.Post(). - Namespace(c.ns). - Resource("services"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(service). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a service and updates it. Returns the server's representation of the service, and an error, if there is any. -func (c *services) Update(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (result *v1.Service, err error) { - result = &v1.Service{} - err = c.client.Put(). - Namespace(c.ns). - Resource("services"). - Name(service.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(service). - 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 *services) UpdateStatus(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (result *v1.Service, err error) { - result = &v1.Service{} - err = c.client.Put(). - Namespace(c.ns). - Resource("services"). - Name(service.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(service). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the service and deletes it. Returns an error if one occurs. -func (c *services) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("services"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched service. -func (c *services) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Service, err error) { - result = &v1.Service{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("services"). - 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 service. -func (c *services) Apply(ctx context.Context, service *corev1.ServiceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Service, err error) { - if service == nil { - return nil, fmt.Errorf("service provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(service) - if err != nil { - return nil, err - } - name := service.Name - if name == nil { - return nil, fmt.Errorf("service.Name must be provided to Apply") - } - result = &v1.Service{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("services"). - 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 *services) ApplyStatus(ctx context.Context, service *corev1.ServiceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Service, err error) { - if service == nil { - return nil, fmt.Errorf("service provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(service) - if err != nil { - return nil, err - } - - name := service.Name - if name == nil { - return nil, fmt.Errorf("service.Name must be provided to Apply") - } - - result = &v1.Service{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("services"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/core/v1/serviceaccount.go b/kubernetes/typed/core/v1/serviceaccount.go index 956059161b..eb995d4548 100644 --- a/kubernetes/typed/core/v1/serviceaccount.go +++ b/kubernetes/typed/core/v1/serviceaccount.go @@ -20,9 +20,6 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" authenticationv1 "k8s.io/api/authentication/v1" v1 "k8s.io/api/core/v1" @@ -30,11 +27,8 @@ import ( types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" corev1 "k8s.io/client-go/applyconfigurations/core/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ServiceAccountsGetter has a method to return a ServiceAccountInterface. @@ -61,199 +55,27 @@ type ServiceAccountInterface interface { // serviceAccounts implements ServiceAccountInterface type serviceAccounts struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.ServiceAccount, *v1.ServiceAccountList, *corev1.ServiceAccountApplyConfiguration] } // newServiceAccounts returns a ServiceAccounts func newServiceAccounts(c *CoreV1Client, namespace string) *serviceAccounts { return &serviceAccounts{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.ServiceAccount, *v1.ServiceAccountList, *corev1.ServiceAccountApplyConfiguration]( + "serviceaccounts", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.ServiceAccount { return &v1.ServiceAccount{} }, + func() *v1.ServiceAccountList { return &v1.ServiceAccountList{} }), } } -// Get takes name of the serviceAccount, and returns the corresponding serviceAccount object, and an error if there is any. -func (c *serviceAccounts) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceAccount, err error) { - result = &v1.ServiceAccount{} - err = c.client.Get(). - Namespace(c.ns). - Resource("serviceaccounts"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ServiceAccounts that match those selectors. -func (c *serviceAccounts) List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceAccountList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for serviceaccounts, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for serviceaccounts", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for serviceaccounts ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for serviceaccounts", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ServiceAccounts that match those selectors. -func (c *serviceAccounts) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceAccountList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ServiceAccountList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("serviceaccounts"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ServiceAccounts -func (c *serviceAccounts) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceAccountList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ServiceAccountList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("serviceaccounts"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested serviceAccounts. -func (c *serviceAccounts) Watch(ctx context.Context, opts metav1.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("serviceaccounts"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a serviceAccount and creates it. Returns the server's representation of the serviceAccount, and an error, if there is any. -func (c *serviceAccounts) Create(ctx context.Context, serviceAccount *v1.ServiceAccount, opts metav1.CreateOptions) (result *v1.ServiceAccount, err error) { - result = &v1.ServiceAccount{} - err = c.client.Post(). - Namespace(c.ns). - Resource("serviceaccounts"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(serviceAccount). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a serviceAccount and updates it. Returns the server's representation of the serviceAccount, and an error, if there is any. -func (c *serviceAccounts) Update(ctx context.Context, serviceAccount *v1.ServiceAccount, opts metav1.UpdateOptions) (result *v1.ServiceAccount, err error) { - result = &v1.ServiceAccount{} - err = c.client.Put(). - Namespace(c.ns). - Resource("serviceaccounts"). - Name(serviceAccount.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(serviceAccount). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the serviceAccount and deletes it. Returns an error if one occurs. -func (c *serviceAccounts) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("serviceaccounts"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *serviceAccounts) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("serviceaccounts"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched serviceAccount. -func (c *serviceAccounts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceAccount, err error) { - result = &v1.ServiceAccount{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("serviceaccounts"). - 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 serviceAccount. -func (c *serviceAccounts) Apply(ctx context.Context, serviceAccount *corev1.ServiceAccountApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ServiceAccount, err error) { - if serviceAccount == nil { - return nil, fmt.Errorf("serviceAccount provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(serviceAccount) - if err != nil { - return nil, err - } - name := serviceAccount.Name - if name == nil { - return nil, fmt.Errorf("serviceAccount.Name must be provided to Apply") - } - result = &v1.ServiceAccount{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("serviceaccounts"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - // CreateToken takes the representation of a tokenRequest and creates it. Returns the server's representation of the tokenRequest, and an error, if there is any. func (c *serviceAccounts) CreateToken(ctx context.Context, serviceAccountName string, tokenRequest *authenticationv1.TokenRequest, opts metav1.CreateOptions) (result *authenticationv1.TokenRequest, err error) { result = &authenticationv1.TokenRequest{} - err = c.client.Post(). - Namespace(c.ns). + err = c.GetClient().Post(). + Namespace(c.GetNamespace()). Resource("serviceaccounts"). Name(serviceAccountName). SubResource("token"). diff --git a/kubernetes/typed/discovery/v1/endpointslice.go b/kubernetes/typed/discovery/v1/endpointslice.go index 1a364e384a..1f927055cc 100644 --- a/kubernetes/typed/discovery/v1/endpointslice.go +++ b/kubernetes/typed/discovery/v1/endpointslice.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/discovery/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" discoveryv1 "k8s.io/client-go/applyconfigurations/discovery/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // EndpointSlicesGetter has a method to return a EndpointSliceInterface. @@ -58,190 +52,18 @@ type EndpointSliceInterface interface { // endpointSlices implements EndpointSliceInterface type endpointSlices struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.EndpointSlice, *v1.EndpointSliceList, *discoveryv1.EndpointSliceApplyConfiguration] } // newEndpointSlices returns a EndpointSlices func newEndpointSlices(c *DiscoveryV1Client, namespace string) *endpointSlices { return &endpointSlices{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.EndpointSlice, *v1.EndpointSliceList, *discoveryv1.EndpointSliceApplyConfiguration]( + "endpointslices", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.EndpointSlice { return &v1.EndpointSlice{} }, + func() *v1.EndpointSliceList { return &v1.EndpointSliceList{} }), } } - -// Get takes name of the endpointSlice, and returns the corresponding endpointSlice object, and an error if there is any. -func (c *endpointSlices) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.EndpointSlice, err error) { - result = &v1.EndpointSlice{} - err = c.client.Get(). - Namespace(c.ns). - Resource("endpointslices"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of EndpointSlices that match those selectors. -func (c *endpointSlices) List(ctx context.Context, opts metav1.ListOptions) (*v1.EndpointSliceList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for endpointslices, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for endpointslices", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for endpointslices ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for endpointslices", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of EndpointSlices that match those selectors. -func (c *endpointSlices) list(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointSliceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.EndpointSliceList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("endpointslices"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of EndpointSlices -func (c *endpointSlices) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointSliceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.EndpointSliceList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("endpointslices"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested endpointSlices. -func (c *endpointSlices) Watch(ctx context.Context, opts metav1.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("endpointslices"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a endpointSlice and creates it. Returns the server's representation of the endpointSlice, and an error, if there is any. -func (c *endpointSlices) Create(ctx context.Context, endpointSlice *v1.EndpointSlice, opts metav1.CreateOptions) (result *v1.EndpointSlice, err error) { - result = &v1.EndpointSlice{} - err = c.client.Post(). - Namespace(c.ns). - Resource("endpointslices"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(endpointSlice). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a endpointSlice and updates it. Returns the server's representation of the endpointSlice, and an error, if there is any. -func (c *endpointSlices) Update(ctx context.Context, endpointSlice *v1.EndpointSlice, opts metav1.UpdateOptions) (result *v1.EndpointSlice, err error) { - result = &v1.EndpointSlice{} - err = c.client.Put(). - Namespace(c.ns). - Resource("endpointslices"). - Name(endpointSlice.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(endpointSlice). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the endpointSlice and deletes it. Returns an error if one occurs. -func (c *endpointSlices) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("endpointslices"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *endpointSlices) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("endpointslices"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched endpointSlice. -func (c *endpointSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.EndpointSlice, err error) { - result = &v1.EndpointSlice{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("endpointslices"). - 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 endpointSlice. -func (c *endpointSlices) Apply(ctx context.Context, endpointSlice *discoveryv1.EndpointSliceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.EndpointSlice, err error) { - if endpointSlice == nil { - return nil, fmt.Errorf("endpointSlice provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(endpointSlice) - if err != nil { - return nil, err - } - name := endpointSlice.Name - if name == nil { - return nil, fmt.Errorf("endpointSlice.Name must be provided to Apply") - } - result = &v1.EndpointSlice{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("endpointslices"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/discovery/v1beta1/endpointslice.go b/kubernetes/typed/discovery/v1beta1/endpointslice.go index 00966f8501..298cfbc879 100644 --- a/kubernetes/typed/discovery/v1beta1/endpointslice.go +++ b/kubernetes/typed/discovery/v1beta1/endpointslice.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/discovery/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" discoveryv1beta1 "k8s.io/client-go/applyconfigurations/discovery/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // EndpointSlicesGetter has a method to return a EndpointSliceInterface. @@ -58,190 +52,18 @@ type EndpointSliceInterface interface { // endpointSlices implements EndpointSliceInterface type endpointSlices struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta1.EndpointSlice, *v1beta1.EndpointSliceList, *discoveryv1beta1.EndpointSliceApplyConfiguration] } // newEndpointSlices returns a EndpointSlices func newEndpointSlices(c *DiscoveryV1beta1Client, namespace string) *endpointSlices { return &endpointSlices{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta1.EndpointSlice, *v1beta1.EndpointSliceList, *discoveryv1beta1.EndpointSliceApplyConfiguration]( + "endpointslices", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.EndpointSlice { return &v1beta1.EndpointSlice{} }, + func() *v1beta1.EndpointSliceList { return &v1beta1.EndpointSliceList{} }), } } - -// Get takes name of the endpointSlice, and returns the corresponding endpointSlice object, and an error if there is any. -func (c *endpointSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.EndpointSlice, err error) { - result = &v1beta1.EndpointSlice{} - err = c.client.Get(). - Namespace(c.ns). - Resource("endpointslices"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of EndpointSlices that match those selectors. -func (c *endpointSlices) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.EndpointSliceList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for endpointslices, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for endpointslices", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for endpointslices ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for endpointslices", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of EndpointSlices that match those selectors. -func (c *endpointSlices) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EndpointSliceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.EndpointSliceList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("endpointslices"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of EndpointSlices -func (c *endpointSlices) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EndpointSliceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.EndpointSliceList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("endpointslices"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested endpointSlices. -func (c *endpointSlices) 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("endpointslices"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a endpointSlice and creates it. Returns the server's representation of the endpointSlice, and an error, if there is any. -func (c *endpointSlices) Create(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.CreateOptions) (result *v1beta1.EndpointSlice, err error) { - result = &v1beta1.EndpointSlice{} - err = c.client.Post(). - Namespace(c.ns). - Resource("endpointslices"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(endpointSlice). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a endpointSlice and updates it. Returns the server's representation of the endpointSlice, and an error, if there is any. -func (c *endpointSlices) Update(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.UpdateOptions) (result *v1beta1.EndpointSlice, err error) { - result = &v1beta1.EndpointSlice{} - err = c.client.Put(). - Namespace(c.ns). - Resource("endpointslices"). - Name(endpointSlice.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(endpointSlice). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the endpointSlice and deletes it. Returns an error if one occurs. -func (c *endpointSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("endpointslices"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *endpointSlices) 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("endpointslices"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched endpointSlice. -func (c *endpointSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.EndpointSlice, err error) { - result = &v1beta1.EndpointSlice{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("endpointslices"). - 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 endpointSlice. -func (c *endpointSlices) Apply(ctx context.Context, endpointSlice *discoveryv1beta1.EndpointSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.EndpointSlice, err error) { - if endpointSlice == nil { - return nil, fmt.Errorf("endpointSlice provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(endpointSlice) - if err != nil { - return nil, err - } - name := endpointSlice.Name - if name == nil { - return nil, fmt.Errorf("endpointSlice.Name must be provided to Apply") - } - result = &v1beta1.EndpointSlice{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("endpointslices"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/events/v1/event.go b/kubernetes/typed/events/v1/event.go index 129ec9a80b..d021a76c4e 100644 --- a/kubernetes/typed/events/v1/event.go +++ b/kubernetes/typed/events/v1/event.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/events/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" eventsv1 "k8s.io/client-go/applyconfigurations/events/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // EventsGetter has a method to return a EventInterface. @@ -58,190 +52,18 @@ type EventInterface interface { // events implements EventInterface type events struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.Event, *v1.EventList, *eventsv1.EventApplyConfiguration] } // newEvents returns a Events func newEvents(c *EventsV1Client, namespace string) *events { return &events{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.Event, *v1.EventList, *eventsv1.EventApplyConfiguration]( + "events", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.Event { return &v1.Event{} }, + func() *v1.EventList { return &v1.EventList{} }), } } - -// Get takes name of the event, and returns the corresponding event object, and an error if there is any. -func (c *events) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Event, err error) { - result = &v1.Event{} - err = c.client.Get(). - Namespace(c.ns). - Resource("events"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Events that match those selectors. -func (c *events) List(ctx context.Context, opts metav1.ListOptions) (*v1.EventList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for events, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for events", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for events ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for events", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of Events that match those selectors. -func (c *events) list(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.EventList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("events"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of Events -func (c *events) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.EventList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("events"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested events. -func (c *events) Watch(ctx context.Context, opts metav1.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("events"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any. -func (c *events) Create(ctx context.Context, event *v1.Event, opts metav1.CreateOptions) (result *v1.Event, err error) { - result = &v1.Event{} - err = c.client.Post(). - Namespace(c.ns). - Resource("events"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(event). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a event and updates it. Returns the server's representation of the event, and an error, if there is any. -func (c *events) Update(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (result *v1.Event, err error) { - result = &v1.Event{} - err = c.client.Put(). - Namespace(c.ns). - Resource("events"). - Name(event.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(event). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the event and deletes it. Returns an error if one occurs. -func (c *events) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("events"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *events) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("events"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched event. -func (c *events) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Event, err error) { - result = &v1.Event{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("events"). - 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 event. -func (c *events) Apply(ctx context.Context, event *eventsv1.EventApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Event, err error) { - if event == nil { - return nil, fmt.Errorf("event provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(event) - if err != nil { - return nil, err - } - name := event.Name - if name == nil { - return nil, fmt.Errorf("event.Name must be provided to Apply") - } - result = &v1.Event{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("events"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/events/v1beta1/event.go b/kubernetes/typed/events/v1beta1/event.go index edd3ea2233..77ca2e7756 100644 --- a/kubernetes/typed/events/v1beta1/event.go +++ b/kubernetes/typed/events/v1beta1/event.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/events/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" eventsv1beta1 "k8s.io/client-go/applyconfigurations/events/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // EventsGetter has a method to return a EventInterface. @@ -58,190 +52,18 @@ type EventInterface interface { // events implements EventInterface type events struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta1.Event, *v1beta1.EventList, *eventsv1beta1.EventApplyConfiguration] } // newEvents returns a Events func newEvents(c *EventsV1beta1Client, namespace string) *events { return &events{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta1.Event, *v1beta1.EventList, *eventsv1beta1.EventApplyConfiguration]( + "events", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.Event { return &v1beta1.Event{} }, + func() *v1beta1.EventList { return &v1beta1.EventList{} }), } } - -// Get takes name of the event, and returns the corresponding event object, and an error if there is any. -func (c *events) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Event, err error) { - result = &v1beta1.Event{} - err = c.client.Get(). - Namespace(c.ns). - Resource("events"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Events that match those selectors. -func (c *events) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.EventList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for events, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for events", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for events ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for events", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of Events that match those selectors. -func (c *events) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EventList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.EventList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("events"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of Events -func (c *events) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EventList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.EventList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("events"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested events. -func (c *events) 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("events"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any. -func (c *events) Create(ctx context.Context, event *v1beta1.Event, opts v1.CreateOptions) (result *v1beta1.Event, err error) { - result = &v1beta1.Event{} - err = c.client.Post(). - Namespace(c.ns). - Resource("events"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(event). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a event and updates it. Returns the server's representation of the event, and an error, if there is any. -func (c *events) Update(ctx context.Context, event *v1beta1.Event, opts v1.UpdateOptions) (result *v1beta1.Event, err error) { - result = &v1beta1.Event{} - err = c.client.Put(). - Namespace(c.ns). - Resource("events"). - Name(event.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(event). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the event and deletes it. Returns an error if one occurs. -func (c *events) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("events"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *events) 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("events"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched event. -func (c *events) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Event, err error) { - result = &v1beta1.Event{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("events"). - 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 event. -func (c *events) Apply(ctx context.Context, event *eventsv1beta1.EventApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Event, err error) { - if event == nil { - return nil, fmt.Errorf("event provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(event) - if err != nil { - return nil, err - } - name := event.Name - if name == nil { - return nil, fmt.Errorf("event.Name must be provided to Apply") - } - result = &v1beta1.Event{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("events"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/extensions/v1beta1/daemonset.go b/kubernetes/typed/extensions/v1beta1/daemonset.go index fc8ceaab4b..f86194bf05 100644 --- a/kubernetes/typed/extensions/v1beta1/daemonset.go +++ b/kubernetes/typed/extensions/v1beta1/daemonset.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // DaemonSetsGetter has a method to return a DaemonSetInterface. @@ -46,6 +40,7 @@ type DaemonSetsGetter interface { type DaemonSetInterface interface { Create(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.CreateOptions) (*v1beta1.DaemonSet, error) Update(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (*v1beta1.DaemonSet, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (*v1beta1.DaemonSet, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,242 +49,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 *v1beta1.DaemonSet, err error) Apply(ctx context.Context, daemonSet *extensionsv1beta1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.DaemonSet, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, daemonSet *extensionsv1beta1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.DaemonSet, err error) DaemonSetExpansion } // daemonSets implements DaemonSetInterface type daemonSets struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta1.DaemonSet, *v1beta1.DaemonSetList, *extensionsv1beta1.DaemonSetApplyConfiguration] } // newDaemonSets returns a DaemonSets func newDaemonSets(c *ExtensionsV1beta1Client, namespace string) *daemonSets { return &daemonSets{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta1.DaemonSet, *v1beta1.DaemonSetList, *extensionsv1beta1.DaemonSetApplyConfiguration]( + "daemonsets", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.DaemonSet { return &v1beta1.DaemonSet{} }, + func() *v1beta1.DaemonSetList { return &v1beta1.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 *v1beta1.DaemonSet, err error) { - result = &v1beta1.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) (*v1beta1.DaemonSetList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for daemonsets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for daemonsets", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for daemonsets ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for daemonsets", c.list, opts, result) - } - return result, err -} - -// 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 *v1beta1.DaemonSetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.DaemonSetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("daemonsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of DaemonSets -func (c *daemonSets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DaemonSetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.DaemonSetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("daemonsets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(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 *v1beta1.DaemonSet, opts v1.CreateOptions) (result *v1beta1.DaemonSet, err error) { - result = &v1beta1.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 *v1beta1.DaemonSet, opts v1.UpdateOptions) (result *v1beta1.DaemonSet, err error) { - result = &v1beta1.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 *v1beta1.DaemonSet, opts v1.UpdateOptions) (result *v1beta1.DaemonSet, err error) { - result = &v1beta1.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 *v1beta1.DaemonSet, err error) { - result = &v1beta1.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 *extensionsv1beta1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.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 = &v1beta1.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 *extensionsv1beta1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.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 = &v1beta1.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/kubernetes/typed/extensions/v1beta1/deployment.go b/kubernetes/typed/extensions/v1beta1/deployment.go index 794124b371..021fbb3b3b 100644 --- a/kubernetes/typed/extensions/v1beta1/deployment.go +++ b/kubernetes/typed/extensions/v1beta1/deployment.go @@ -22,18 +22,14 @@ import ( "context" json "encoding/json" "fmt" - "time" v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // DeploymentsGetter has a method to return a DeploymentInterface. @@ -46,6 +42,7 @@ type DeploymentsGetter interface { type DeploymentInterface interface { Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (*v1beta1.Deployment, error) Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (*v1beta1.Deployment, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (*v1beta1.Deployment, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,6 +51,7 @@ type DeploymentInterface 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 *v1beta1.Deployment, err error) Apply(ctx context.Context, deployment *extensionsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, deployment *extensionsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) GetScale(ctx context.Context, deploymentName string, options v1.GetOptions) (*v1beta1.Scale, error) UpdateScale(ctx context.Context, deploymentName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (*v1beta1.Scale, error) @@ -64,245 +62,27 @@ type DeploymentInterface interface { // deployments implements DeploymentInterface type deployments struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta1.Deployment, *v1beta1.DeploymentList, *extensionsv1beta1.DeploymentApplyConfiguration] } // newDeployments returns a Deployments func newDeployments(c *ExtensionsV1beta1Client, namespace string) *deployments { return &deployments{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta1.Deployment, *v1beta1.DeploymentList, *extensionsv1beta1.DeploymentApplyConfiguration]( + "deployments", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.Deployment { return &v1beta1.Deployment{} }, + func() *v1beta1.DeploymentList { return &v1beta1.DeploymentList{} }), } } -// Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. -func (c *deployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Deployment, err error) { - result = &v1beta1.Deployment{} - err = c.client.Get(). - Namespace(c.ns). - Resource("deployments"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Deployments that match those selectors. -func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DeploymentList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for deployments, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for deployments", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for deployments ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for deployments", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of Deployments that match those selectors. -func (c *deployments) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.DeploymentList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("deployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of Deployments -func (c *deployments) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.DeploymentList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("deployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested deployments. -func (c *deployments) 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("deployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *deployments) Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (result *v1beta1.Deployment, err error) { - result = &v1beta1.Deployment{} - err = c.client.Post(). - Namespace(c.ns). - Resource("deployments"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(deployment). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *deployments) Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { - result = &v1beta1.Deployment{} - err = c.client.Put(). - Namespace(c.ns). - Resource("deployments"). - Name(deployment.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(deployment). - 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 *deployments) UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { - result = &v1beta1.Deployment{} - err = c.client.Put(). - Namespace(c.ns). - Resource("deployments"). - Name(deployment.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(deployment). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the deployment and deletes it. Returns an error if one occurs. -func (c *deployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("deployments"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *deployments) 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("deployments"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched deployment. -func (c *deployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Deployment, err error) { - result = &v1beta1.Deployment{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("deployments"). - 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 deployment. -func (c *deployments) Apply(ctx context.Context, deployment *extensionsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) { - if deployment == nil { - return nil, fmt.Errorf("deployment provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(deployment) - if err != nil { - return nil, err - } - name := deployment.Name - if name == nil { - return nil, fmt.Errorf("deployment.Name must be provided to Apply") - } - result = &v1beta1.Deployment{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("deployments"). - 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 *deployments) ApplyStatus(ctx context.Context, deployment *extensionsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) { - if deployment == nil { - return nil, fmt.Errorf("deployment provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(deployment) - if err != nil { - return nil, err - } - - name := deployment.Name - if name == nil { - return nil, fmt.Errorf("deployment.Name must be provided to Apply") - } - - result = &v1beta1.Deployment{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("deployments"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - // GetScale takes name of the deployment, and returns the corresponding v1beta1.Scale object, and an error if there is any. func (c *deployments) GetScale(ctx context.Context, deploymentName string, options v1.GetOptions) (result *v1beta1.Scale, err error) { result = &v1beta1.Scale{} - err = c.client.Get(). - Namespace(c.ns). + err = c.GetClient().Get(). + Namespace(c.GetNamespace()). Resource("deployments"). Name(deploymentName). SubResource("scale"). @@ -315,8 +95,8 @@ func (c *deployments) GetScale(ctx context.Context, deploymentName string, optio // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *deployments) UpdateScale(ctx context.Context, deploymentName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (result *v1beta1.Scale, err error) { result = &v1beta1.Scale{} - err = c.client.Put(). - Namespace(c.ns). + err = c.GetClient().Put(). + Namespace(c.GetNamespace()). Resource("deployments"). Name(deploymentName). SubResource("scale"). @@ -340,8 +120,8 @@ func (c *deployments) ApplyScale(ctx context.Context, deploymentName string, sca } result = &v1beta1.Scale{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). + err = c.GetClient().Patch(types.ApplyPatchType). + Namespace(c.GetNamespace()). Resource("deployments"). Name(deploymentName). SubResource("scale"). diff --git a/kubernetes/typed/extensions/v1beta1/ingress.go b/kubernetes/typed/extensions/v1beta1/ingress.go index dcb8f369f2..4511c93fc2 100644 --- a/kubernetes/typed/extensions/v1beta1/ingress.go +++ b/kubernetes/typed/extensions/v1beta1/ingress.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // IngressesGetter has a method to return a IngressInterface. @@ -46,6 +40,7 @@ type IngressesGetter interface { type IngressInterface interface { Create(ctx context.Context, ingress *v1beta1.Ingress, opts v1.CreateOptions) (*v1beta1.Ingress, error) Update(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (*v1beta1.Ingress, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (*v1beta1.Ingress, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,242 +49,25 @@ type IngressInterface 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 *v1beta1.Ingress, err error) Apply(ctx context.Context, ingress *extensionsv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, ingress *extensionsv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) IngressExpansion } // ingresses implements IngressInterface type ingresses struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta1.Ingress, *v1beta1.IngressList, *extensionsv1beta1.IngressApplyConfiguration] } // newIngresses returns a Ingresses func newIngresses(c *ExtensionsV1beta1Client, namespace string) *ingresses { return &ingresses{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta1.Ingress, *v1beta1.IngressList, *extensionsv1beta1.IngressApplyConfiguration]( + "ingresses", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.Ingress { return &v1beta1.Ingress{} }, + func() *v1beta1.IngressList { return &v1beta1.IngressList{} }), } } - -// Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. -func (c *ingresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Ingress, err error) { - result = &v1beta1.Ingress{} - err = c.client.Get(). - Namespace(c.ns). - Resource("ingresses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Ingresses that match those selectors. -func (c *ingresses) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IngressList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for ingresses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for ingresses", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for ingresses ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingresses", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of Ingresses that match those selectors. -func (c *ingresses) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.IngressList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("ingresses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of Ingresses -func (c *ingresses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.IngressList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("ingresses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested ingresses. -func (c *ingresses) 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("ingresses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any. -func (c *ingresses) Create(ctx context.Context, ingress *v1beta1.Ingress, opts v1.CreateOptions) (result *v1beta1.Ingress, err error) { - result = &v1beta1.Ingress{} - err = c.client.Post(). - Namespace(c.ns). - Resource("ingresses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(ingress). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any. -func (c *ingresses) Update(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { - result = &v1beta1.Ingress{} - err = c.client.Put(). - Namespace(c.ns). - Resource("ingresses"). - Name(ingress.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(ingress). - 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 *ingresses) UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { - result = &v1beta1.Ingress{} - err = c.client.Put(). - Namespace(c.ns). - Resource("ingresses"). - Name(ingress.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(ingress). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the ingress and deletes it. Returns an error if one occurs. -func (c *ingresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("ingresses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *ingresses) 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("ingresses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched ingress. -func (c *ingresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Ingress, err error) { - result = &v1beta1.Ingress{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("ingresses"). - 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 ingress. -func (c *ingresses) Apply(ctx context.Context, ingress *extensionsv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) { - if ingress == nil { - return nil, fmt.Errorf("ingress provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(ingress) - if err != nil { - return nil, err - } - name := ingress.Name - if name == nil { - return nil, fmt.Errorf("ingress.Name must be provided to Apply") - } - result = &v1beta1.Ingress{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("ingresses"). - 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 *ingresses) ApplyStatus(ctx context.Context, ingress *extensionsv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) { - if ingress == nil { - return nil, fmt.Errorf("ingress provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(ingress) - if err != nil { - return nil, err - } - - name := ingress.Name - if name == nil { - return nil, fmt.Errorf("ingress.Name must be provided to Apply") - } - - result = &v1beta1.Ingress{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("ingresses"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/extensions/v1beta1/networkpolicy.go b/kubernetes/typed/extensions/v1beta1/networkpolicy.go index 7140ff5fcf..afa8203c3d 100644 --- a/kubernetes/typed/extensions/v1beta1/networkpolicy.go +++ b/kubernetes/typed/extensions/v1beta1/networkpolicy.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // NetworkPoliciesGetter has a method to return a NetworkPolicyInterface. @@ -58,190 +52,18 @@ type NetworkPolicyInterface interface { // networkPolicies implements NetworkPolicyInterface type networkPolicies struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta1.NetworkPolicy, *v1beta1.NetworkPolicyList, *extensionsv1beta1.NetworkPolicyApplyConfiguration] } // newNetworkPolicies returns a NetworkPolicies func newNetworkPolicies(c *ExtensionsV1beta1Client, namespace string) *networkPolicies { return &networkPolicies{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta1.NetworkPolicy, *v1beta1.NetworkPolicyList, *extensionsv1beta1.NetworkPolicyApplyConfiguration]( + "networkpolicies", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.NetworkPolicy { return &v1beta1.NetworkPolicy{} }, + func() *v1beta1.NetworkPolicyList { return &v1beta1.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 *v1beta1.NetworkPolicy, err error) { - result = &v1beta1.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) (*v1beta1.NetworkPolicyList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for networkpolicies, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for networkpolicies", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for networkpolicies ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for networkpolicies", c.list, opts, result) - } - return result, err -} - -// 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 *v1beta1.NetworkPolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.NetworkPolicyList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("networkpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of NetworkPolicies -func (c *networkPolicies) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.NetworkPolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.NetworkPolicyList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("networkpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(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 *v1beta1.NetworkPolicy, opts v1.CreateOptions) (result *v1beta1.NetworkPolicy, err error) { - result = &v1beta1.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 *v1beta1.NetworkPolicy, opts v1.UpdateOptions) (result *v1beta1.NetworkPolicy, err error) { - result = &v1beta1.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 *v1beta1.NetworkPolicy, err error) { - result = &v1beta1.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 *extensionsv1beta1.NetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.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 = &v1beta1.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/kubernetes/typed/extensions/v1beta1/replicaset.go b/kubernetes/typed/extensions/v1beta1/replicaset.go index 363857e6da..8973948f39 100644 --- a/kubernetes/typed/extensions/v1beta1/replicaset.go +++ b/kubernetes/typed/extensions/v1beta1/replicaset.go @@ -22,18 +22,14 @@ import ( "context" json "encoding/json" "fmt" - "time" v1beta1 "k8s.io/api/extensions/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ReplicaSetsGetter has a method to return a ReplicaSetInterface. @@ -46,6 +42,7 @@ type ReplicaSetsGetter interface { type ReplicaSetInterface interface { Create(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.CreateOptions) (*v1beta1.ReplicaSet, error) Update(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.UpdateOptions) (*v1beta1.ReplicaSet, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.UpdateOptions) (*v1beta1.ReplicaSet, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,6 +51,7 @@ type ReplicaSetInterface 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 *v1beta1.ReplicaSet, err error) Apply(ctx context.Context, replicaSet *extensionsv1beta1.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ReplicaSet, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, replicaSet *extensionsv1beta1.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ReplicaSet, err error) GetScale(ctx context.Context, replicaSetName string, options v1.GetOptions) (*v1beta1.Scale, error) UpdateScale(ctx context.Context, replicaSetName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (*v1beta1.Scale, error) @@ -64,245 +62,27 @@ type ReplicaSetInterface interface { // replicaSets implements ReplicaSetInterface type replicaSets struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta1.ReplicaSet, *v1beta1.ReplicaSetList, *extensionsv1beta1.ReplicaSetApplyConfiguration] } // newReplicaSets returns a ReplicaSets func newReplicaSets(c *ExtensionsV1beta1Client, namespace string) *replicaSets { return &replicaSets{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta1.ReplicaSet, *v1beta1.ReplicaSetList, *extensionsv1beta1.ReplicaSetApplyConfiguration]( + "replicasets", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.ReplicaSet { return &v1beta1.ReplicaSet{} }, + func() *v1beta1.ReplicaSetList { return &v1beta1.ReplicaSetList{} }), } } -// Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any. -func (c *replicaSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ReplicaSet, err error) { - result = &v1beta1.ReplicaSet{} - err = c.client.Get(). - Namespace(c.ns). - Resource("replicasets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. -func (c *replicaSets) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ReplicaSetList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for replicasets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for replicasets", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for replicasets ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for replicasets", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ReplicaSets that match those selectors. -func (c *replicaSets) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ReplicaSetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ReplicaSetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("replicasets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ReplicaSets -func (c *replicaSets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ReplicaSetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ReplicaSetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("replicasets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested replicaSets. -func (c *replicaSets) 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("replicasets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any. -func (c *replicaSets) Create(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.CreateOptions) (result *v1beta1.ReplicaSet, err error) { - result = &v1beta1.ReplicaSet{} - err = c.client.Post(). - Namespace(c.ns). - Resource("replicasets"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(replicaSet). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any. -func (c *replicaSets) Update(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.UpdateOptions) (result *v1beta1.ReplicaSet, err error) { - result = &v1beta1.ReplicaSet{} - err = c.client.Put(). - Namespace(c.ns). - Resource("replicasets"). - Name(replicaSet.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(replicaSet). - 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 *replicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.UpdateOptions) (result *v1beta1.ReplicaSet, err error) { - result = &v1beta1.ReplicaSet{} - err = c.client.Put(). - Namespace(c.ns). - Resource("replicasets"). - Name(replicaSet.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(replicaSet). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. -func (c *replicaSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("replicasets"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *replicaSets) 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("replicasets"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched replicaSet. -func (c *replicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ReplicaSet, err error) { - result = &v1beta1.ReplicaSet{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("replicasets"). - 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 replicaSet. -func (c *replicaSets) Apply(ctx context.Context, replicaSet *extensionsv1beta1.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ReplicaSet, err error) { - if replicaSet == nil { - return nil, fmt.Errorf("replicaSet provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(replicaSet) - if err != nil { - return nil, err - } - name := replicaSet.Name - if name == nil { - return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") - } - result = &v1beta1.ReplicaSet{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("replicasets"). - 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 *replicaSets) ApplyStatus(ctx context.Context, replicaSet *extensionsv1beta1.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ReplicaSet, err error) { - if replicaSet == nil { - return nil, fmt.Errorf("replicaSet provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(replicaSet) - if err != nil { - return nil, err - } - - name := replicaSet.Name - if name == nil { - return nil, fmt.Errorf("replicaSet.Name must be provided to Apply") - } - - result = &v1beta1.ReplicaSet{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("replicasets"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} - // GetScale takes name of the replicaSet, and returns the corresponding v1beta1.Scale object, and an error if there is any. func (c *replicaSets) GetScale(ctx context.Context, replicaSetName string, options v1.GetOptions) (result *v1beta1.Scale, err error) { result = &v1beta1.Scale{} - err = c.client.Get(). - Namespace(c.ns). + err = c.GetClient().Get(). + Namespace(c.GetNamespace()). Resource("replicasets"). Name(replicaSetName). SubResource("scale"). @@ -315,8 +95,8 @@ func (c *replicaSets) GetScale(ctx context.Context, replicaSetName string, optio // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. func (c *replicaSets) UpdateScale(ctx context.Context, replicaSetName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (result *v1beta1.Scale, err error) { result = &v1beta1.Scale{} - err = c.client.Put(). - Namespace(c.ns). + err = c.GetClient().Put(). + Namespace(c.GetNamespace()). Resource("replicasets"). Name(replicaSetName). SubResource("scale"). @@ -340,8 +120,8 @@ func (c *replicaSets) ApplyScale(ctx context.Context, replicaSetName string, sca } result = &v1beta1.Scale{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). + err = c.GetClient().Patch(types.ApplyPatchType). + Namespace(c.GetNamespace()). Resource("replicasets"). Name(replicaSetName). SubResource("scale"). diff --git a/kubernetes/typed/flowcontrol/v1/flowschema.go b/kubernetes/typed/flowcontrol/v1/flowschema.go index 966e12b8d4..2606cee070 100644 --- a/kubernetes/typed/flowcontrol/v1/flowschema.go +++ b/kubernetes/typed/flowcontrol/v1/flowschema.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/flowcontrol/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // FlowSchemasGetter has a method to return a FlowSchemaInterface. @@ -46,6 +40,7 @@ type FlowSchemasGetter interface { type FlowSchemaInterface interface { Create(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.CreateOptions) (*v1.FlowSchema, error) Update(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (*v1.FlowSchema, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (*v1.FlowSchema, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -54,228 +49,25 @@ type FlowSchemaInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FlowSchema, err error) Apply(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) FlowSchemaExpansion } // flowSchemas implements FlowSchemaInterface type flowSchemas struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1.FlowSchema, *v1.FlowSchemaList, *flowcontrolv1.FlowSchemaApplyConfiguration] } // newFlowSchemas returns a FlowSchemas func newFlowSchemas(c *FlowcontrolV1Client) *flowSchemas { return &flowSchemas{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1.FlowSchema, *v1.FlowSchemaList, *flowcontrolv1.FlowSchemaApplyConfiguration]( + "flowschemas", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.FlowSchema { return &v1.FlowSchema{} }, + func() *v1.FlowSchemaList { return &v1.FlowSchemaList{} }), } } - -// Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. -func (c *flowSchemas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.FlowSchema, err error) { - result = &v1.FlowSchema{} - err = c.client.Get(). - Resource("flowschemas"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. -func (c *flowSchemas) List(ctx context.Context, opts metav1.ListOptions) (*v1.FlowSchemaList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for flowschemas, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for flowschemas", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for flowschemas ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of FlowSchemas that match those selectors. -func (c *flowSchemas) list(ctx context.Context, opts metav1.ListOptions) (result *v1.FlowSchemaList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.FlowSchemaList{} - err = c.client.Get(). - Resource("flowschemas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of FlowSchemas -func (c *flowSchemas) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.FlowSchemaList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.FlowSchemaList{} - err = c.client.Get(). - Resource("flowschemas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested flowSchemas. -func (c *flowSchemas) Watch(ctx context.Context, opts metav1.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("flowschemas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *flowSchemas) Create(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.CreateOptions) (result *v1.FlowSchema, err error) { - result = &v1.FlowSchema{} - err = c.client.Post(). - Resource("flowschemas"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(flowSchema). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *flowSchemas) Update(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (result *v1.FlowSchema, err error) { - result = &v1.FlowSchema{} - err = c.client.Put(). - Resource("flowschemas"). - Name(flowSchema.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(flowSchema). - 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 *flowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (result *v1.FlowSchema, err error) { - result = &v1.FlowSchema{} - err = c.client.Put(). - Resource("flowschemas"). - Name(flowSchema.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(flowSchema). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the flowSchema and deletes it. Returns an error if one occurs. -func (c *flowSchemas) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("flowschemas"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *flowSchemas) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("flowschemas"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched flowSchema. -func (c *flowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FlowSchema, err error) { - result = &v1.FlowSchema{} - err = c.client.Patch(pt). - Resource("flowschemas"). - 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 flowSchema. -func (c *flowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) { - if flowSchema == nil { - return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(flowSchema) - if err != nil { - return nil, err - } - name := flowSchema.Name - if name == nil { - return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") - } - result = &v1.FlowSchema{} - err = c.client.Patch(types.ApplyPatchType). - Resource("flowschemas"). - 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 *flowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) { - if flowSchema == nil { - return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(flowSchema) - if err != nil { - return nil, err - } - - name := flowSchema.Name - if name == nil { - return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") - } - - result = &v1.FlowSchema{} - err = c.client.Patch(types.ApplyPatchType). - Resource("flowschemas"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go index 2859a5f47a..64907af606 100644 --- a/kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1/prioritylevelconfiguration.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/flowcontrol/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface. @@ -46,6 +40,7 @@ type PriorityLevelConfigurationsGetter interface { type PriorityLevelConfigurationInterface interface { Create(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.CreateOptions) (*v1.PriorityLevelConfiguration, error) Update(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*v1.PriorityLevelConfiguration, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*v1.PriorityLevelConfiguration, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -54,228 +49,25 @@ type PriorityLevelConfigurationInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityLevelConfiguration, err error) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) PriorityLevelConfigurationExpansion } // priorityLevelConfigurations implements PriorityLevelConfigurationInterface type priorityLevelConfigurations struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1.PriorityLevelConfiguration, *v1.PriorityLevelConfigurationList, *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration] } // newPriorityLevelConfigurations returns a PriorityLevelConfigurations func newPriorityLevelConfigurations(c *FlowcontrolV1Client) *priorityLevelConfigurations { return &priorityLevelConfigurations{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1.PriorityLevelConfiguration, *v1.PriorityLevelConfigurationList, *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration]( + "prioritylevelconfigurations", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.PriorityLevelConfiguration { return &v1.PriorityLevelConfiguration{} }, + func() *v1.PriorityLevelConfigurationList { return &v1.PriorityLevelConfigurationList{} }), } } - -// Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. -func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PriorityLevelConfiguration, err error) { - result = &v1.PriorityLevelConfiguration{} - err = c.client.Get(). - Resource("prioritylevelconfigurations"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. -func (c *priorityLevelConfigurations) List(ctx context.Context, opts metav1.ListOptions) (*v1.PriorityLevelConfigurationList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for prioritylevelconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for prioritylevelconfigurations", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for prioritylevelconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. -func (c *priorityLevelConfigurations) list(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityLevelConfigurationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.PriorityLevelConfigurationList{} - err = c.client.Get(). - Resource("prioritylevelconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of PriorityLevelConfigurations -func (c *priorityLevelConfigurations) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityLevelConfigurationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.PriorityLevelConfigurationList{} - err = c.client.Get(). - Resource("prioritylevelconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. -func (c *priorityLevelConfigurations) Watch(ctx context.Context, opts metav1.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("prioritylevelconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *priorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.CreateOptions) (result *v1.PriorityLevelConfiguration, err error) { - result = &v1.PriorityLevelConfiguration{} - err = c.client.Post(). - Resource("prioritylevelconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(priorityLevelConfiguration). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *priorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (result *v1.PriorityLevelConfiguration, err error) { - result = &v1.PriorityLevelConfiguration{} - err = c.client.Put(). - Resource("prioritylevelconfigurations"). - Name(priorityLevelConfiguration.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(priorityLevelConfiguration). - 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 *priorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (result *v1.PriorityLevelConfiguration, err error) { - result = &v1.PriorityLevelConfiguration{} - err = c.client.Put(). - Resource("prioritylevelconfigurations"). - Name(priorityLevelConfiguration.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(priorityLevelConfiguration). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs. -func (c *priorityLevelConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("prioritylevelconfigurations"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *priorityLevelConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("prioritylevelconfigurations"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched priorityLevelConfiguration. -func (c *priorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityLevelConfiguration, err error) { - result = &v1.PriorityLevelConfiguration{} - err = c.client.Patch(pt). - Resource("prioritylevelconfigurations"). - 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 priorityLevelConfiguration. -func (c *priorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) { - if priorityLevelConfiguration == nil { - return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(priorityLevelConfiguration) - if err != nil { - return nil, err - } - name := priorityLevelConfiguration.Name - if name == nil { - return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") - } - result = &v1.PriorityLevelConfiguration{} - err = c.client.Patch(types.ApplyPatchType). - Resource("prioritylevelconfigurations"). - 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 *priorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) { - if priorityLevelConfiguration == nil { - return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(priorityLevelConfiguration) - if err != nil { - return nil, err - } - - name := priorityLevelConfiguration.Name - if name == nil { - return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") - } - - result = &v1.PriorityLevelConfiguration{} - err = c.client.Patch(types.ApplyPatchType). - Resource("prioritylevelconfigurations"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/flowcontrol/v1beta1/flowschema.go b/kubernetes/typed/flowcontrol/v1beta1/flowschema.go index 33bd0e1c2e..3c6805b9bc 100644 --- a/kubernetes/typed/flowcontrol/v1beta1/flowschema.go +++ b/kubernetes/typed/flowcontrol/v1beta1/flowschema.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/flowcontrol/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1beta1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // FlowSchemasGetter has a method to return a FlowSchemaInterface. @@ -46,6 +40,7 @@ type FlowSchemasGetter interface { type FlowSchemaInterface interface { Create(ctx context.Context, flowSchema *v1beta1.FlowSchema, opts v1.CreateOptions) (*v1beta1.FlowSchema, error) Update(ctx context.Context, flowSchema *v1beta1.FlowSchema, opts v1.UpdateOptions) (*v1beta1.FlowSchema, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, flowSchema *v1beta1.FlowSchema, opts v1.UpdateOptions) (*v1beta1.FlowSchema, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,228 +49,25 @@ type FlowSchemaInterface 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 *v1beta1.FlowSchema, err error) Apply(ctx context.Context, flowSchema *flowcontrolv1beta1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.FlowSchema, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1beta1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.FlowSchema, err error) FlowSchemaExpansion } // flowSchemas implements FlowSchemaInterface type flowSchemas struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1beta1.FlowSchema, *v1beta1.FlowSchemaList, *flowcontrolv1beta1.FlowSchemaApplyConfiguration] } // newFlowSchemas returns a FlowSchemas func newFlowSchemas(c *FlowcontrolV1beta1Client) *flowSchemas { return &flowSchemas{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1beta1.FlowSchema, *v1beta1.FlowSchemaList, *flowcontrolv1beta1.FlowSchemaApplyConfiguration]( + "flowschemas", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.FlowSchema { return &v1beta1.FlowSchema{} }, + func() *v1beta1.FlowSchemaList { return &v1beta1.FlowSchemaList{} }), } } - -// Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. -func (c *flowSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.FlowSchema, err error) { - result = &v1beta1.FlowSchema{} - err = c.client.Get(). - Resource("flowschemas"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. -func (c *flowSchemas) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.FlowSchemaList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for flowschemas, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for flowschemas", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for flowschemas ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of FlowSchemas that match those selectors. -func (c *flowSchemas) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.FlowSchemaList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.FlowSchemaList{} - err = c.client.Get(). - Resource("flowschemas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of FlowSchemas -func (c *flowSchemas) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.FlowSchemaList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.FlowSchemaList{} - err = c.client.Get(). - Resource("flowschemas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested flowSchemas. -func (c *flowSchemas) 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("flowschemas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *flowSchemas) Create(ctx context.Context, flowSchema *v1beta1.FlowSchema, opts v1.CreateOptions) (result *v1beta1.FlowSchema, err error) { - result = &v1beta1.FlowSchema{} - err = c.client.Post(). - Resource("flowschemas"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(flowSchema). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *flowSchemas) Update(ctx context.Context, flowSchema *v1beta1.FlowSchema, opts v1.UpdateOptions) (result *v1beta1.FlowSchema, err error) { - result = &v1beta1.FlowSchema{} - err = c.client.Put(). - Resource("flowschemas"). - Name(flowSchema.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(flowSchema). - 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 *flowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1beta1.FlowSchema, opts v1.UpdateOptions) (result *v1beta1.FlowSchema, err error) { - result = &v1beta1.FlowSchema{} - err = c.client.Put(). - Resource("flowschemas"). - Name(flowSchema.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(flowSchema). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the flowSchema and deletes it. Returns an error if one occurs. -func (c *flowSchemas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("flowschemas"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *flowSchemas) 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("flowschemas"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched flowSchema. -func (c *flowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.FlowSchema, err error) { - result = &v1beta1.FlowSchema{} - err = c.client.Patch(pt). - Resource("flowschemas"). - 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 flowSchema. -func (c *flowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1beta1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.FlowSchema, err error) { - if flowSchema == nil { - return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(flowSchema) - if err != nil { - return nil, err - } - name := flowSchema.Name - if name == nil { - return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") - } - result = &v1beta1.FlowSchema{} - err = c.client.Patch(types.ApplyPatchType). - Resource("flowschemas"). - 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 *flowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1beta1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.FlowSchema, err error) { - if flowSchema == nil { - return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(flowSchema) - if err != nil { - return nil, err - } - - name := flowSchema.Name - if name == nil { - return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") - } - - result = &v1beta1.FlowSchema{} - err = c.client.Patch(types.ApplyPatchType). - Resource("flowschemas"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/flowcontrol/v1beta1/prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1beta1/prioritylevelconfiguration.go index 42ac35353c..049f4049d6 100644 --- a/kubernetes/typed/flowcontrol/v1beta1/prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1beta1/prioritylevelconfiguration.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/flowcontrol/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1beta1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface. @@ -46,6 +40,7 @@ type PriorityLevelConfigurationsGetter interface { type PriorityLevelConfigurationInterface interface { Create(ctx context.Context, priorityLevelConfiguration *v1beta1.PriorityLevelConfiguration, opts v1.CreateOptions) (*v1beta1.PriorityLevelConfiguration, error) Update(ctx context.Context, priorityLevelConfiguration *v1beta1.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1beta1.PriorityLevelConfiguration, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta1.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1beta1.PriorityLevelConfiguration, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,228 +49,25 @@ type PriorityLevelConfigurationInterface 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 *v1beta1.PriorityLevelConfiguration, err error) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PriorityLevelConfiguration, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PriorityLevelConfiguration, err error) PriorityLevelConfigurationExpansion } // priorityLevelConfigurations implements PriorityLevelConfigurationInterface type priorityLevelConfigurations struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1beta1.PriorityLevelConfiguration, *v1beta1.PriorityLevelConfigurationList, *flowcontrolv1beta1.PriorityLevelConfigurationApplyConfiguration] } // newPriorityLevelConfigurations returns a PriorityLevelConfigurations func newPriorityLevelConfigurations(c *FlowcontrolV1beta1Client) *priorityLevelConfigurations { return &priorityLevelConfigurations{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1beta1.PriorityLevelConfiguration, *v1beta1.PriorityLevelConfigurationList, *flowcontrolv1beta1.PriorityLevelConfigurationApplyConfiguration]( + "prioritylevelconfigurations", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.PriorityLevelConfiguration { return &v1beta1.PriorityLevelConfiguration{} }, + func() *v1beta1.PriorityLevelConfigurationList { return &v1beta1.PriorityLevelConfigurationList{} }), } } - -// Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. -func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { - result = &v1beta1.PriorityLevelConfiguration{} - err = c.client.Get(). - Resource("prioritylevelconfigurations"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. -func (c *priorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PriorityLevelConfigurationList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for prioritylevelconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for prioritylevelconfigurations", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for prioritylevelconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. -func (c *priorityLevelConfigurations) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityLevelConfigurationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.PriorityLevelConfigurationList{} - err = c.client.Get(). - Resource("prioritylevelconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of PriorityLevelConfigurations -func (c *priorityLevelConfigurations) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityLevelConfigurationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.PriorityLevelConfigurationList{} - err = c.client.Get(). - Resource("prioritylevelconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. -func (c *priorityLevelConfigurations) 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("prioritylevelconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *priorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1beta1.PriorityLevelConfiguration, opts v1.CreateOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { - result = &v1beta1.PriorityLevelConfiguration{} - err = c.client.Post(). - Resource("prioritylevelconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(priorityLevelConfiguration). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *priorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1beta1.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { - result = &v1beta1.PriorityLevelConfiguration{} - err = c.client.Put(). - Resource("prioritylevelconfigurations"). - Name(priorityLevelConfiguration.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(priorityLevelConfiguration). - 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 *priorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta1.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { - result = &v1beta1.PriorityLevelConfiguration{} - err = c.client.Put(). - Resource("prioritylevelconfigurations"). - Name(priorityLevelConfiguration.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(priorityLevelConfiguration). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs. -func (c *priorityLevelConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("prioritylevelconfigurations"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *priorityLevelConfigurations) 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("prioritylevelconfigurations"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched priorityLevelConfiguration. -func (c *priorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PriorityLevelConfiguration, err error) { - result = &v1beta1.PriorityLevelConfiguration{} - err = c.client.Patch(pt). - Resource("prioritylevelconfigurations"). - 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 priorityLevelConfiguration. -func (c *priorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { - if priorityLevelConfiguration == nil { - return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(priorityLevelConfiguration) - if err != nil { - return nil, err - } - name := priorityLevelConfiguration.Name - if name == nil { - return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") - } - result = &v1beta1.PriorityLevelConfiguration{} - err = c.client.Patch(types.ApplyPatchType). - Resource("prioritylevelconfigurations"). - 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 *priorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { - if priorityLevelConfiguration == nil { - return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(priorityLevelConfiguration) - if err != nil { - return nil, err - } - - name := priorityLevelConfiguration.Name - if name == nil { - return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") - } - - result = &v1beta1.PriorityLevelConfiguration{} - err = c.client.Patch(types.ApplyPatchType). - Resource("prioritylevelconfigurations"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/flowcontrol/v1beta2/flowschema.go b/kubernetes/typed/flowcontrol/v1beta2/flowschema.go index 88e7951ed9..2706157628 100644 --- a/kubernetes/typed/flowcontrol/v1beta2/flowschema.go +++ b/kubernetes/typed/flowcontrol/v1beta2/flowschema.go @@ -20,20 +20,14 @@ package v1beta2 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta2 "k8s.io/api/flowcontrol/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1beta2 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // FlowSchemasGetter has a method to return a FlowSchemaInterface. @@ -46,6 +40,7 @@ type FlowSchemasGetter interface { type FlowSchemaInterface interface { Create(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.CreateOptions) (*v1beta2.FlowSchema, error) Update(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.UpdateOptions) (*v1beta2.FlowSchema, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.UpdateOptions) (*v1beta2.FlowSchema, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,228 +49,25 @@ type FlowSchemaInterface 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 *v1beta2.FlowSchema, err error) Apply(ctx context.Context, flowSchema *flowcontrolv1beta2.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.FlowSchema, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1beta2.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.FlowSchema, err error) FlowSchemaExpansion } // flowSchemas implements FlowSchemaInterface type flowSchemas struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1beta2.FlowSchema, *v1beta2.FlowSchemaList, *flowcontrolv1beta2.FlowSchemaApplyConfiguration] } // newFlowSchemas returns a FlowSchemas func newFlowSchemas(c *FlowcontrolV1beta2Client) *flowSchemas { return &flowSchemas{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1beta2.FlowSchema, *v1beta2.FlowSchemaList, *flowcontrolv1beta2.FlowSchemaApplyConfiguration]( + "flowschemas", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta2.FlowSchema { return &v1beta2.FlowSchema{} }, + func() *v1beta2.FlowSchemaList { return &v1beta2.FlowSchemaList{} }), } } - -// Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. -func (c *flowSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.FlowSchema, err error) { - result = &v1beta2.FlowSchema{} - err = c.client.Get(). - Resource("flowschemas"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. -func (c *flowSchemas) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.FlowSchemaList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for flowschemas, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for flowschemas", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for flowschemas ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of FlowSchemas that match those selectors. -func (c *flowSchemas) list(ctx context.Context, opts v1.ListOptions) (result *v1beta2.FlowSchemaList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta2.FlowSchemaList{} - err = c.client.Get(). - Resource("flowschemas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of FlowSchemas -func (c *flowSchemas) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.FlowSchemaList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta2.FlowSchemaList{} - err = c.client.Get(). - Resource("flowschemas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested flowSchemas. -func (c *flowSchemas) 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("flowschemas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *flowSchemas) Create(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.CreateOptions) (result *v1beta2.FlowSchema, err error) { - result = &v1beta2.FlowSchema{} - err = c.client.Post(). - Resource("flowschemas"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(flowSchema). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *flowSchemas) Update(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.UpdateOptions) (result *v1beta2.FlowSchema, err error) { - result = &v1beta2.FlowSchema{} - err = c.client.Put(). - Resource("flowschemas"). - Name(flowSchema.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(flowSchema). - 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 *flowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.UpdateOptions) (result *v1beta2.FlowSchema, err error) { - result = &v1beta2.FlowSchema{} - err = c.client.Put(). - Resource("flowschemas"). - Name(flowSchema.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(flowSchema). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the flowSchema and deletes it. Returns an error if one occurs. -func (c *flowSchemas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("flowschemas"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *flowSchemas) 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("flowschemas"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched flowSchema. -func (c *flowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.FlowSchema, err error) { - result = &v1beta2.FlowSchema{} - err = c.client.Patch(pt). - Resource("flowschemas"). - 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 flowSchema. -func (c *flowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1beta2.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.FlowSchema, err error) { - if flowSchema == nil { - return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(flowSchema) - if err != nil { - return nil, err - } - name := flowSchema.Name - if name == nil { - return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") - } - result = &v1beta2.FlowSchema{} - err = c.client.Patch(types.ApplyPatchType). - Resource("flowschemas"). - 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 *flowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1beta2.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.FlowSchema, err error) { - if flowSchema == nil { - return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(flowSchema) - if err != nil { - return nil, err - } - - name := flowSchema.Name - if name == nil { - return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") - } - - result = &v1beta2.FlowSchema{} - err = c.client.Patch(types.ApplyPatchType). - Resource("flowschemas"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/flowcontrol/v1beta2/prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1beta2/prioritylevelconfiguration.go index e1cd060244..00ead4c60d 100644 --- a/kubernetes/typed/flowcontrol/v1beta2/prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1beta2/prioritylevelconfiguration.go @@ -20,20 +20,14 @@ package v1beta2 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta2 "k8s.io/api/flowcontrol/v1beta2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1beta2 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface. @@ -46,6 +40,7 @@ type PriorityLevelConfigurationsGetter interface { type PriorityLevelConfigurationInterface interface { Create(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.CreateOptions) (*v1beta2.PriorityLevelConfiguration, error) Update(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1beta2.PriorityLevelConfiguration, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1beta2.PriorityLevelConfiguration, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,228 +49,25 @@ type PriorityLevelConfigurationInterface 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 *v1beta2.PriorityLevelConfiguration, err error) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.PriorityLevelConfiguration, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.PriorityLevelConfiguration, err error) PriorityLevelConfigurationExpansion } // priorityLevelConfigurations implements PriorityLevelConfigurationInterface type priorityLevelConfigurations struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1beta2.PriorityLevelConfiguration, *v1beta2.PriorityLevelConfigurationList, *flowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration] } // newPriorityLevelConfigurations returns a PriorityLevelConfigurations func newPriorityLevelConfigurations(c *FlowcontrolV1beta2Client) *priorityLevelConfigurations { return &priorityLevelConfigurations{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1beta2.PriorityLevelConfiguration, *v1beta2.PriorityLevelConfigurationList, *flowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration]( + "prioritylevelconfigurations", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta2.PriorityLevelConfiguration { return &v1beta2.PriorityLevelConfiguration{} }, + func() *v1beta2.PriorityLevelConfigurationList { return &v1beta2.PriorityLevelConfigurationList{} }), } } - -// Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. -func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { - result = &v1beta2.PriorityLevelConfiguration{} - err = c.client.Get(). - Resource("prioritylevelconfigurations"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. -func (c *priorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (*v1beta2.PriorityLevelConfigurationList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for prioritylevelconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for prioritylevelconfigurations", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for prioritylevelconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. -func (c *priorityLevelConfigurations) list(ctx context.Context, opts v1.ListOptions) (result *v1beta2.PriorityLevelConfigurationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta2.PriorityLevelConfigurationList{} - err = c.client.Get(). - Resource("prioritylevelconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of PriorityLevelConfigurations -func (c *priorityLevelConfigurations) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta2.PriorityLevelConfigurationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta2.PriorityLevelConfigurationList{} - err = c.client.Get(). - Resource("prioritylevelconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. -func (c *priorityLevelConfigurations) 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("prioritylevelconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *priorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.CreateOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { - result = &v1beta2.PriorityLevelConfiguration{} - err = c.client.Post(). - Resource("prioritylevelconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(priorityLevelConfiguration). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *priorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { - result = &v1beta2.PriorityLevelConfiguration{} - err = c.client.Put(). - Resource("prioritylevelconfigurations"). - Name(priorityLevelConfiguration.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(priorityLevelConfiguration). - 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 *priorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { - result = &v1beta2.PriorityLevelConfiguration{} - err = c.client.Put(). - Resource("prioritylevelconfigurations"). - Name(priorityLevelConfiguration.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(priorityLevelConfiguration). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs. -func (c *priorityLevelConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("prioritylevelconfigurations"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *priorityLevelConfigurations) 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("prioritylevelconfigurations"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched priorityLevelConfiguration. -func (c *priorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.PriorityLevelConfiguration, err error) { - result = &v1beta2.PriorityLevelConfiguration{} - err = c.client.Patch(pt). - Resource("prioritylevelconfigurations"). - 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 priorityLevelConfiguration. -func (c *priorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { - if priorityLevelConfiguration == nil { - return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(priorityLevelConfiguration) - if err != nil { - return nil, err - } - name := priorityLevelConfiguration.Name - if name == nil { - return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") - } - result = &v1beta2.PriorityLevelConfiguration{} - err = c.client.Patch(types.ApplyPatchType). - Resource("prioritylevelconfigurations"). - 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 *priorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { - if priorityLevelConfiguration == nil { - return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(priorityLevelConfiguration) - if err != nil { - return nil, err - } - - name := priorityLevelConfiguration.Name - if name == nil { - return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") - } - - result = &v1beta2.PriorityLevelConfiguration{} - err = c.client.Patch(types.ApplyPatchType). - Resource("prioritylevelconfigurations"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/flowcontrol/v1beta3/flowschema.go b/kubernetes/typed/flowcontrol/v1beta3/flowschema.go index 1f61872e17..35f600cdf4 100644 --- a/kubernetes/typed/flowcontrol/v1beta3/flowschema.go +++ b/kubernetes/typed/flowcontrol/v1beta3/flowschema.go @@ -20,20 +20,14 @@ package v1beta3 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta3 "k8s.io/api/flowcontrol/v1beta3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1beta3 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // FlowSchemasGetter has a method to return a FlowSchemaInterface. @@ -46,6 +40,7 @@ type FlowSchemasGetter interface { type FlowSchemaInterface interface { Create(ctx context.Context, flowSchema *v1beta3.FlowSchema, opts v1.CreateOptions) (*v1beta3.FlowSchema, error) Update(ctx context.Context, flowSchema *v1beta3.FlowSchema, opts v1.UpdateOptions) (*v1beta3.FlowSchema, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, flowSchema *v1beta3.FlowSchema, opts v1.UpdateOptions) (*v1beta3.FlowSchema, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,228 +49,25 @@ type FlowSchemaInterface 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 *v1beta3.FlowSchema, err error) Apply(ctx context.Context, flowSchema *flowcontrolv1beta3.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta3.FlowSchema, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1beta3.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta3.FlowSchema, err error) FlowSchemaExpansion } // flowSchemas implements FlowSchemaInterface type flowSchemas struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1beta3.FlowSchema, *v1beta3.FlowSchemaList, *flowcontrolv1beta3.FlowSchemaApplyConfiguration] } // newFlowSchemas returns a FlowSchemas func newFlowSchemas(c *FlowcontrolV1beta3Client) *flowSchemas { return &flowSchemas{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1beta3.FlowSchema, *v1beta3.FlowSchemaList, *flowcontrolv1beta3.FlowSchemaApplyConfiguration]( + "flowschemas", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta3.FlowSchema { return &v1beta3.FlowSchema{} }, + func() *v1beta3.FlowSchemaList { return &v1beta3.FlowSchemaList{} }), } } - -// Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. -func (c *flowSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta3.FlowSchema, err error) { - result = &v1beta3.FlowSchema{} - err = c.client.Get(). - Resource("flowschemas"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. -func (c *flowSchemas) List(ctx context.Context, opts v1.ListOptions) (*v1beta3.FlowSchemaList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for flowschemas, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for flowschemas", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for flowschemas ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for flowschemas", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of FlowSchemas that match those selectors. -func (c *flowSchemas) list(ctx context.Context, opts v1.ListOptions) (result *v1beta3.FlowSchemaList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta3.FlowSchemaList{} - err = c.client.Get(). - Resource("flowschemas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of FlowSchemas -func (c *flowSchemas) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta3.FlowSchemaList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta3.FlowSchemaList{} - err = c.client.Get(). - Resource("flowschemas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested flowSchemas. -func (c *flowSchemas) 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("flowschemas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *flowSchemas) Create(ctx context.Context, flowSchema *v1beta3.FlowSchema, opts v1.CreateOptions) (result *v1beta3.FlowSchema, err error) { - result = &v1beta3.FlowSchema{} - err = c.client.Post(). - Resource("flowschemas"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(flowSchema). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *flowSchemas) Update(ctx context.Context, flowSchema *v1beta3.FlowSchema, opts v1.UpdateOptions) (result *v1beta3.FlowSchema, err error) { - result = &v1beta3.FlowSchema{} - err = c.client.Put(). - Resource("flowschemas"). - Name(flowSchema.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(flowSchema). - 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 *flowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1beta3.FlowSchema, opts v1.UpdateOptions) (result *v1beta3.FlowSchema, err error) { - result = &v1beta3.FlowSchema{} - err = c.client.Put(). - Resource("flowschemas"). - Name(flowSchema.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(flowSchema). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the flowSchema and deletes it. Returns an error if one occurs. -func (c *flowSchemas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("flowschemas"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *flowSchemas) 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("flowschemas"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched flowSchema. -func (c *flowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta3.FlowSchema, err error) { - result = &v1beta3.FlowSchema{} - err = c.client.Patch(pt). - Resource("flowschemas"). - 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 flowSchema. -func (c *flowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1beta3.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta3.FlowSchema, err error) { - if flowSchema == nil { - return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(flowSchema) - if err != nil { - return nil, err - } - name := flowSchema.Name - if name == nil { - return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") - } - result = &v1beta3.FlowSchema{} - err = c.client.Patch(types.ApplyPatchType). - Resource("flowschemas"). - 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 *flowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1beta3.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta3.FlowSchema, err error) { - if flowSchema == nil { - return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(flowSchema) - if err != nil { - return nil, err - } - - name := flowSchema.Name - if name == nil { - return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") - } - - result = &v1beta3.FlowSchema{} - err = c.client.Patch(types.ApplyPatchType). - Resource("flowschemas"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/flowcontrol/v1beta3/prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1beta3/prioritylevelconfiguration.go index c834127877..93842e0cf0 100644 --- a/kubernetes/typed/flowcontrol/v1beta3/prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1beta3/prioritylevelconfiguration.go @@ -20,20 +20,14 @@ package v1beta3 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta3 "k8s.io/api/flowcontrol/v1beta3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" flowcontrolv1beta3 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface. @@ -46,6 +40,7 @@ type PriorityLevelConfigurationsGetter interface { type PriorityLevelConfigurationInterface interface { Create(ctx context.Context, priorityLevelConfiguration *v1beta3.PriorityLevelConfiguration, opts v1.CreateOptions) (*v1beta3.PriorityLevelConfiguration, error) Update(ctx context.Context, priorityLevelConfiguration *v1beta3.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1beta3.PriorityLevelConfiguration, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta3.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1beta3.PriorityLevelConfiguration, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,228 +49,25 @@ type PriorityLevelConfigurationInterface 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 *v1beta3.PriorityLevelConfiguration, err error) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta3.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta3.PriorityLevelConfiguration, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta3.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta3.PriorityLevelConfiguration, err error) PriorityLevelConfigurationExpansion } // priorityLevelConfigurations implements PriorityLevelConfigurationInterface type priorityLevelConfigurations struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1beta3.PriorityLevelConfiguration, *v1beta3.PriorityLevelConfigurationList, *flowcontrolv1beta3.PriorityLevelConfigurationApplyConfiguration] } // newPriorityLevelConfigurations returns a PriorityLevelConfigurations func newPriorityLevelConfigurations(c *FlowcontrolV1beta3Client) *priorityLevelConfigurations { return &priorityLevelConfigurations{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1beta3.PriorityLevelConfiguration, *v1beta3.PriorityLevelConfigurationList, *flowcontrolv1beta3.PriorityLevelConfigurationApplyConfiguration]( + "prioritylevelconfigurations", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta3.PriorityLevelConfiguration { return &v1beta3.PriorityLevelConfiguration{} }, + func() *v1beta3.PriorityLevelConfigurationList { return &v1beta3.PriorityLevelConfigurationList{} }), } } - -// Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. -func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { - result = &v1beta3.PriorityLevelConfiguration{} - err = c.client.Get(). - Resource("prioritylevelconfigurations"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. -func (c *priorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (*v1beta3.PriorityLevelConfigurationList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for prioritylevelconfigurations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for prioritylevelconfigurations", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for prioritylevelconfigurations ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for prioritylevelconfigurations", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. -func (c *priorityLevelConfigurations) list(ctx context.Context, opts v1.ListOptions) (result *v1beta3.PriorityLevelConfigurationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta3.PriorityLevelConfigurationList{} - err = c.client.Get(). - Resource("prioritylevelconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of PriorityLevelConfigurations -func (c *priorityLevelConfigurations) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta3.PriorityLevelConfigurationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta3.PriorityLevelConfigurationList{} - err = c.client.Get(). - Resource("prioritylevelconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. -func (c *priorityLevelConfigurations) 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("prioritylevelconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *priorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1beta3.PriorityLevelConfiguration, opts v1.CreateOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { - result = &v1beta3.PriorityLevelConfiguration{} - err = c.client.Post(). - Resource("prioritylevelconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(priorityLevelConfiguration). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *priorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1beta3.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { - result = &v1beta3.PriorityLevelConfiguration{} - err = c.client.Put(). - Resource("prioritylevelconfigurations"). - Name(priorityLevelConfiguration.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(priorityLevelConfiguration). - 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 *priorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta3.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { - result = &v1beta3.PriorityLevelConfiguration{} - err = c.client.Put(). - Resource("prioritylevelconfigurations"). - Name(priorityLevelConfiguration.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(priorityLevelConfiguration). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs. -func (c *priorityLevelConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("prioritylevelconfigurations"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *priorityLevelConfigurations) 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("prioritylevelconfigurations"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched priorityLevelConfiguration. -func (c *priorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta3.PriorityLevelConfiguration, err error) { - result = &v1beta3.PriorityLevelConfiguration{} - err = c.client.Patch(pt). - Resource("prioritylevelconfigurations"). - 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 priorityLevelConfiguration. -func (c *priorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta3.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { - if priorityLevelConfiguration == nil { - return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(priorityLevelConfiguration) - if err != nil { - return nil, err - } - name := priorityLevelConfiguration.Name - if name == nil { - return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") - } - result = &v1beta3.PriorityLevelConfiguration{} - err = c.client.Patch(types.ApplyPatchType). - Resource("prioritylevelconfigurations"). - 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 *priorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta3.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { - if priorityLevelConfiguration == nil { - return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(priorityLevelConfiguration) - if err != nil { - return nil, err - } - - name := priorityLevelConfiguration.Name - if name == nil { - return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") - } - - result = &v1beta3.PriorityLevelConfiguration{} - err = c.client.Patch(types.ApplyPatchType). - Resource("prioritylevelconfigurations"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/networking/v1/ingress.go b/kubernetes/typed/networking/v1/ingress.go index bb87b1c9f1..afaff4912a 100644 --- a/kubernetes/typed/networking/v1/ingress.go +++ b/kubernetes/typed/networking/v1/ingress.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // IngressesGetter has a method to return a IngressInterface. @@ -46,6 +40,7 @@ type IngressesGetter interface { type IngressInterface interface { Create(ctx context.Context, ingress *v1.Ingress, opts metav1.CreateOptions) (*v1.Ingress, error) Update(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (*v1.Ingress, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (*v1.Ingress, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -54,242 +49,25 @@ type IngressInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Ingress, err error) Apply(ctx context.Context, ingress *networkingv1.IngressApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Ingress, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, ingress *networkingv1.IngressApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Ingress, err error) IngressExpansion } // ingresses implements IngressInterface type ingresses struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.Ingress, *v1.IngressList, *networkingv1.IngressApplyConfiguration] } // newIngresses returns a Ingresses func newIngresses(c *NetworkingV1Client, namespace string) *ingresses { return &ingresses{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.Ingress, *v1.IngressList, *networkingv1.IngressApplyConfiguration]( + "ingresses", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.Ingress { return &v1.Ingress{} }, + func() *v1.IngressList { return &v1.IngressList{} }), } } - -// Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. -func (c *ingresses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Ingress, err error) { - result = &v1.Ingress{} - err = c.client.Get(). - Namespace(c.ns). - Resource("ingresses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Ingresses that match those selectors. -func (c *ingresses) List(ctx context.Context, opts metav1.ListOptions) (*v1.IngressList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for ingresses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for ingresses", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for ingresses ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingresses", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of Ingresses that match those selectors. -func (c *ingresses) list(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.IngressList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("ingresses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of Ingresses -func (c *ingresses) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.IngressList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("ingresses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested ingresses. -func (c *ingresses) Watch(ctx context.Context, opts metav1.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("ingresses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any. -func (c *ingresses) Create(ctx context.Context, ingress *v1.Ingress, opts metav1.CreateOptions) (result *v1.Ingress, err error) { - result = &v1.Ingress{} - err = c.client.Post(). - Namespace(c.ns). - Resource("ingresses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(ingress). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any. -func (c *ingresses) Update(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (result *v1.Ingress, err error) { - result = &v1.Ingress{} - err = c.client.Put(). - Namespace(c.ns). - Resource("ingresses"). - Name(ingress.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(ingress). - 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 *ingresses) UpdateStatus(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (result *v1.Ingress, err error) { - result = &v1.Ingress{} - err = c.client.Put(). - Namespace(c.ns). - Resource("ingresses"). - Name(ingress.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(ingress). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the ingress and deletes it. Returns an error if one occurs. -func (c *ingresses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("ingresses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *ingresses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("ingresses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched ingress. -func (c *ingresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Ingress, err error) { - result = &v1.Ingress{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("ingresses"). - 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 ingress. -func (c *ingresses) Apply(ctx context.Context, ingress *networkingv1.IngressApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Ingress, err error) { - if ingress == nil { - return nil, fmt.Errorf("ingress provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(ingress) - if err != nil { - return nil, err - } - name := ingress.Name - if name == nil { - return nil, fmt.Errorf("ingress.Name must be provided to Apply") - } - result = &v1.Ingress{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("ingresses"). - 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 *ingresses) ApplyStatus(ctx context.Context, ingress *networkingv1.IngressApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Ingress, err error) { - if ingress == nil { - return nil, fmt.Errorf("ingress provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(ingress) - if err != nil { - return nil, err - } - - name := ingress.Name - if name == nil { - return nil, fmt.Errorf("ingress.Name must be provided to Apply") - } - - result = &v1.Ingress{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("ingresses"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/networking/v1/ingressclass.go b/kubernetes/typed/networking/v1/ingressclass.go index 22de5240ba..3301e87994 100644 --- a/kubernetes/typed/networking/v1/ingressclass.go +++ b/kubernetes/typed/networking/v1/ingressclass.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // IngressClassesGetter has a method to return a IngressClassInterface. @@ -58,178 +52,18 @@ type IngressClassInterface interface { // ingressClasses implements IngressClassInterface type ingressClasses struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1.IngressClass, *v1.IngressClassList, *networkingv1.IngressClassApplyConfiguration] } // newIngressClasses returns a IngressClasses func newIngressClasses(c *NetworkingV1Client) *ingressClasses { return &ingressClasses{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1.IngressClass, *v1.IngressClassList, *networkingv1.IngressClassApplyConfiguration]( + "ingressclasses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.IngressClass { return &v1.IngressClass{} }, + func() *v1.IngressClassList { return &v1.IngressClassList{} }), } } - -// Get takes name of the ingressClass, and returns the corresponding ingressClass object, and an error if there is any. -func (c *ingressClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.IngressClass, err error) { - result = &v1.IngressClass{} - err = c.client.Get(). - Resource("ingressclasses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of IngressClasses that match those selectors. -func (c *ingressClasses) List(ctx context.Context, opts metav1.ListOptions) (*v1.IngressClassList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for ingressclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for ingressclasses", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for ingressclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingressclasses", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of IngressClasses that match those selectors. -func (c *ingressClasses) list(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.IngressClassList{} - err = c.client.Get(). - Resource("ingressclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of IngressClasses -func (c *ingressClasses) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.IngressClassList{} - err = c.client.Get(). - Resource("ingressclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested ingressClasses. -func (c *ingressClasses) Watch(ctx context.Context, opts metav1.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("ingressclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a ingressClass and creates it. Returns the server's representation of the ingressClass, and an error, if there is any. -func (c *ingressClasses) Create(ctx context.Context, ingressClass *v1.IngressClass, opts metav1.CreateOptions) (result *v1.IngressClass, err error) { - result = &v1.IngressClass{} - err = c.client.Post(). - Resource("ingressclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(ingressClass). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a ingressClass and updates it. Returns the server's representation of the ingressClass, and an error, if there is any. -func (c *ingressClasses) Update(ctx context.Context, ingressClass *v1.IngressClass, opts metav1.UpdateOptions) (result *v1.IngressClass, err error) { - result = &v1.IngressClass{} - err = c.client.Put(). - Resource("ingressclasses"). - Name(ingressClass.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(ingressClass). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the ingressClass and deletes it. Returns an error if one occurs. -func (c *ingressClasses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("ingressclasses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *ingressClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("ingressclasses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched ingressClass. -func (c *ingressClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.IngressClass, err error) { - result = &v1.IngressClass{} - err = c.client.Patch(pt). - Resource("ingressclasses"). - 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 ingressClass. -func (c *ingressClasses) Apply(ctx context.Context, ingressClass *networkingv1.IngressClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.IngressClass, err error) { - if ingressClass == nil { - return nil, fmt.Errorf("ingressClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(ingressClass) - if err != nil { - return nil, err - } - name := ingressClass.Name - if name == nil { - return nil, fmt.Errorf("ingressClass.Name must be provided to Apply") - } - result = &v1.IngressClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("ingressclasses"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/networking/v1/networkpolicy.go b/kubernetes/typed/networking/v1/networkpolicy.go index 1fcd858258..ba2ef32dbd 100644 --- a/kubernetes/typed/networking/v1/networkpolicy.go +++ b/kubernetes/typed/networking/v1/networkpolicy.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // NetworkPoliciesGetter has a method to return a NetworkPolicyInterface. @@ -58,190 +52,18 @@ type NetworkPolicyInterface interface { // networkPolicies implements NetworkPolicyInterface type networkPolicies struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.NetworkPolicy, *v1.NetworkPolicyList, *networkingv1.NetworkPolicyApplyConfiguration] } // newNetworkPolicies returns a NetworkPolicies func newNetworkPolicies(c *NetworkingV1Client, namespace string) *networkPolicies { return &networkPolicies{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.NetworkPolicy, *v1.NetworkPolicyList, *networkingv1.NetworkPolicyApplyConfiguration]( + "networkpolicies", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.NetworkPolicy { return &v1.NetworkPolicy{} }, + func() *v1.NetworkPolicyList { return &v1.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 metav1.GetOptions) (result *v1.NetworkPolicy, err error) { - result = &v1.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 metav1.ListOptions) (*v1.NetworkPolicyList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for networkpolicies, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for networkpolicies", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for networkpolicies ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for networkpolicies", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of NetworkPolicies that match those selectors. -func (c *networkPolicies) list(ctx context.Context, opts metav1.ListOptions) (result *v1.NetworkPolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.NetworkPolicyList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("networkpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of NetworkPolicies -func (c *networkPolicies) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.NetworkPolicyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.NetworkPolicyList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("networkpolicies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested networkPolicies. -func (c *networkPolicies) Watch(ctx context.Context, opts metav1.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 *v1.NetworkPolicy, opts metav1.CreateOptions) (result *v1.NetworkPolicy, err error) { - result = &v1.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 *v1.NetworkPolicy, opts metav1.UpdateOptions) (result *v1.NetworkPolicy, err error) { - result = &v1.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 metav1.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 metav1.DeleteOptions, listOpts metav1.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 metav1.PatchOptions, subresources ...string) (result *v1.NetworkPolicy, err error) { - result = &v1.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 *networkingv1.NetworkPolicyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.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 = &v1.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/kubernetes/typed/networking/v1alpha1/ipaddress.go b/kubernetes/typed/networking/v1alpha1/ipaddress.go index c942f1c486..33e90d18a3 100644 --- a/kubernetes/typed/networking/v1alpha1/ipaddress.go +++ b/kubernetes/typed/networking/v1alpha1/ipaddress.go @@ -20,20 +20,14 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "k8s.io/api/networking/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // IPAddressesGetter has a method to return a IPAddressInterface. @@ -58,178 +52,18 @@ type IPAddressInterface interface { // iPAddresses implements IPAddressInterface type iPAddresses struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.IPAddress, *v1alpha1.IPAddressList, *networkingv1alpha1.IPAddressApplyConfiguration] } // newIPAddresses returns a IPAddresses func newIPAddresses(c *NetworkingV1alpha1Client) *iPAddresses { return &iPAddresses{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.IPAddress, *v1alpha1.IPAddressList, *networkingv1alpha1.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) (*v1alpha1.IPAddressList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for ipaddresses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for ipaddresses", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for ipaddresses ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ipaddresses", c.list, opts, result) - } - return result, err -} - -// 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 -} - -// watchList establishes a watch stream with the server and returns the list of IPAddresses -func (c *iPAddresses) watchList(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). - WatchList(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 *networkingv1alpha1.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/kubernetes/typed/networking/v1alpha1/servicecidr.go b/kubernetes/typed/networking/v1alpha1/servicecidr.go index b3a81ffd23..b72fe5b696 100644 --- a/kubernetes/typed/networking/v1alpha1/servicecidr.go +++ b/kubernetes/typed/networking/v1alpha1/servicecidr.go @@ -20,20 +20,14 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "k8s.io/api/networking/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ServiceCIDRsGetter has a method to return a ServiceCIDRInterface. @@ -46,6 +40,7 @@ type ServiceCIDRsGetter interface { type ServiceCIDRInterface interface { Create(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.CreateOptions) (*v1alpha1.ServiceCIDR, error) Update(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (*v1alpha1.ServiceCIDR, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (*v1alpha1.ServiceCIDR, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,228 +49,25 @@ type ServiceCIDRInterface 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.ServiceCIDR, err error) Apply(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ServiceCIDR, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ServiceCIDR, err error) ServiceCIDRExpansion } // serviceCIDRs implements ServiceCIDRInterface type serviceCIDRs struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.ServiceCIDR, *v1alpha1.ServiceCIDRList, *networkingv1alpha1.ServiceCIDRApplyConfiguration] } // newServiceCIDRs returns a ServiceCIDRs func newServiceCIDRs(c *NetworkingV1alpha1Client) *serviceCIDRs { return &serviceCIDRs{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.ServiceCIDR, *v1alpha1.ServiceCIDRList, *networkingv1alpha1.ServiceCIDRApplyConfiguration]( + "servicecidrs", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.ServiceCIDR { return &v1alpha1.ServiceCIDR{} }, + func() *v1alpha1.ServiceCIDRList { return &v1alpha1.ServiceCIDRList{} }), } } - -// Get takes name of the serviceCIDR, and returns the corresponding serviceCIDR object, and an error if there is any. -func (c *serviceCIDRs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ServiceCIDR, err error) { - result = &v1alpha1.ServiceCIDR{} - err = c.client.Get(). - Resource("servicecidrs"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ServiceCIDRs that match those selectors. -func (c *serviceCIDRs) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ServiceCIDRList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for servicecidrs, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for servicecidrs", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for servicecidrs ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for servicecidrs", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ServiceCIDRs that match those selectors. -func (c *serviceCIDRs) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ServiceCIDRList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ServiceCIDRList{} - err = c.client.Get(). - Resource("servicecidrs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ServiceCIDRs -func (c *serviceCIDRs) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ServiceCIDRList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ServiceCIDRList{} - err = c.client.Get(). - Resource("servicecidrs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested serviceCIDRs. -func (c *serviceCIDRs) 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("servicecidrs"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a serviceCIDR and creates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. -func (c *serviceCIDRs) Create(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.CreateOptions) (result *v1alpha1.ServiceCIDR, err error) { - result = &v1alpha1.ServiceCIDR{} - err = c.client.Post(). - Resource("servicecidrs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(serviceCIDR). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a serviceCIDR and updates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. -func (c *serviceCIDRs) Update(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (result *v1alpha1.ServiceCIDR, err error) { - result = &v1alpha1.ServiceCIDR{} - err = c.client.Put(). - Resource("servicecidrs"). - Name(serviceCIDR.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(serviceCIDR). - 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 *serviceCIDRs) UpdateStatus(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (result *v1alpha1.ServiceCIDR, err error) { - result = &v1alpha1.ServiceCIDR{} - err = c.client.Put(). - Resource("servicecidrs"). - Name(serviceCIDR.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(serviceCIDR). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the serviceCIDR and deletes it. Returns an error if one occurs. -func (c *serviceCIDRs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("servicecidrs"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *serviceCIDRs) 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("servicecidrs"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched serviceCIDR. -func (c *serviceCIDRs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ServiceCIDR, err error) { - result = &v1alpha1.ServiceCIDR{} - err = c.client.Patch(pt). - Resource("servicecidrs"). - 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 serviceCIDR. -func (c *serviceCIDRs) Apply(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ServiceCIDR, err error) { - if serviceCIDR == nil { - return nil, fmt.Errorf("serviceCIDR provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(serviceCIDR) - if err != nil { - return nil, err - } - name := serviceCIDR.Name - if name == nil { - return nil, fmt.Errorf("serviceCIDR.Name must be provided to Apply") - } - result = &v1alpha1.ServiceCIDR{} - err = c.client.Patch(types.ApplyPatchType). - Resource("servicecidrs"). - 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 *serviceCIDRs) ApplyStatus(ctx context.Context, serviceCIDR *networkingv1alpha1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ServiceCIDR, err error) { - if serviceCIDR == nil { - return nil, fmt.Errorf("serviceCIDR provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(serviceCIDR) - if err != nil { - return nil, err - } - - name := serviceCIDR.Name - if name == nil { - return nil, fmt.Errorf("serviceCIDR.Name must be provided to Apply") - } - - result = &v1alpha1.ServiceCIDR{} - err = c.client.Patch(types.ApplyPatchType). - Resource("servicecidrs"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/networking/v1beta1/ingress.go b/kubernetes/typed/networking/v1beta1/ingress.go index e4b9b4a5cd..90be275adc 100644 --- a/kubernetes/typed/networking/v1beta1/ingress.go +++ b/kubernetes/typed/networking/v1beta1/ingress.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/networking/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // IngressesGetter has a method to return a IngressInterface. @@ -46,6 +40,7 @@ type IngressesGetter interface { type IngressInterface interface { Create(ctx context.Context, ingress *v1beta1.Ingress, opts v1.CreateOptions) (*v1beta1.Ingress, error) Update(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (*v1beta1.Ingress, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (*v1beta1.Ingress, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,242 +49,25 @@ type IngressInterface 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 *v1beta1.Ingress, err error) Apply(ctx context.Context, ingress *networkingv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, ingress *networkingv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) IngressExpansion } // ingresses implements IngressInterface type ingresses struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta1.Ingress, *v1beta1.IngressList, *networkingv1beta1.IngressApplyConfiguration] } // newIngresses returns a Ingresses func newIngresses(c *NetworkingV1beta1Client, namespace string) *ingresses { return &ingresses{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta1.Ingress, *v1beta1.IngressList, *networkingv1beta1.IngressApplyConfiguration]( + "ingresses", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.Ingress { return &v1beta1.Ingress{} }, + func() *v1beta1.IngressList { return &v1beta1.IngressList{} }), } } - -// Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. -func (c *ingresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Ingress, err error) { - result = &v1beta1.Ingress{} - err = c.client.Get(). - Namespace(c.ns). - Resource("ingresses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Ingresses that match those selectors. -func (c *ingresses) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IngressList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for ingresses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for ingresses", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for ingresses ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingresses", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of Ingresses that match those selectors. -func (c *ingresses) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.IngressList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("ingresses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of Ingresses -func (c *ingresses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.IngressList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("ingresses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested ingresses. -func (c *ingresses) 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("ingresses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any. -func (c *ingresses) Create(ctx context.Context, ingress *v1beta1.Ingress, opts v1.CreateOptions) (result *v1beta1.Ingress, err error) { - result = &v1beta1.Ingress{} - err = c.client.Post(). - Namespace(c.ns). - Resource("ingresses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(ingress). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any. -func (c *ingresses) Update(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { - result = &v1beta1.Ingress{} - err = c.client.Put(). - Namespace(c.ns). - Resource("ingresses"). - Name(ingress.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(ingress). - 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 *ingresses) UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { - result = &v1beta1.Ingress{} - err = c.client.Put(). - Namespace(c.ns). - Resource("ingresses"). - Name(ingress.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(ingress). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the ingress and deletes it. Returns an error if one occurs. -func (c *ingresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("ingresses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *ingresses) 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("ingresses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched ingress. -func (c *ingresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Ingress, err error) { - result = &v1beta1.Ingress{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("ingresses"). - 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 ingress. -func (c *ingresses) Apply(ctx context.Context, ingress *networkingv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) { - if ingress == nil { - return nil, fmt.Errorf("ingress provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(ingress) - if err != nil { - return nil, err - } - name := ingress.Name - if name == nil { - return nil, fmt.Errorf("ingress.Name must be provided to Apply") - } - result = &v1beta1.Ingress{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("ingresses"). - 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 *ingresses) ApplyStatus(ctx context.Context, ingress *networkingv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) { - if ingress == nil { - return nil, fmt.Errorf("ingress provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(ingress) - if err != nil { - return nil, err - } - - name := ingress.Name - if name == nil { - return nil, fmt.Errorf("ingress.Name must be provided to Apply") - } - - result = &v1beta1.Ingress{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("ingresses"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/networking/v1beta1/ingressclass.go b/kubernetes/typed/networking/v1beta1/ingressclass.go index 1591e8d589..c55da4168f 100644 --- a/kubernetes/typed/networking/v1beta1/ingressclass.go +++ b/kubernetes/typed/networking/v1beta1/ingressclass.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/networking/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" networkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // IngressClassesGetter has a method to return a IngressClassInterface. @@ -58,178 +52,18 @@ type IngressClassInterface interface { // ingressClasses implements IngressClassInterface type ingressClasses struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1beta1.IngressClass, *v1beta1.IngressClassList, *networkingv1beta1.IngressClassApplyConfiguration] } // newIngressClasses returns a IngressClasses func newIngressClasses(c *NetworkingV1beta1Client) *ingressClasses { return &ingressClasses{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1beta1.IngressClass, *v1beta1.IngressClassList, *networkingv1beta1.IngressClassApplyConfiguration]( + "ingressclasses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.IngressClass { return &v1beta1.IngressClass{} }, + func() *v1beta1.IngressClassList { return &v1beta1.IngressClassList{} }), } } - -// Get takes name of the ingressClass, and returns the corresponding ingressClass object, and an error if there is any. -func (c *ingressClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.IngressClass, err error) { - result = &v1beta1.IngressClass{} - err = c.client.Get(). - Resource("ingressclasses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of IngressClasses that match those selectors. -func (c *ingressClasses) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IngressClassList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for ingressclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for ingressclasses", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for ingressclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for ingressclasses", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of IngressClasses that match those selectors. -func (c *ingressClasses) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.IngressClassList{} - err = c.client.Get(). - Resource("ingressclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of IngressClasses -func (c *ingressClasses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.IngressClassList{} - err = c.client.Get(). - Resource("ingressclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested ingressClasses. -func (c *ingressClasses) 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("ingressclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a ingressClass and creates it. Returns the server's representation of the ingressClass, and an error, if there is any. -func (c *ingressClasses) Create(ctx context.Context, ingressClass *v1beta1.IngressClass, opts v1.CreateOptions) (result *v1beta1.IngressClass, err error) { - result = &v1beta1.IngressClass{} - err = c.client.Post(). - Resource("ingressclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(ingressClass). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a ingressClass and updates it. Returns the server's representation of the ingressClass, and an error, if there is any. -func (c *ingressClasses) Update(ctx context.Context, ingressClass *v1beta1.IngressClass, opts v1.UpdateOptions) (result *v1beta1.IngressClass, err error) { - result = &v1beta1.IngressClass{} - err = c.client.Put(). - Resource("ingressclasses"). - Name(ingressClass.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(ingressClass). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the ingressClass and deletes it. Returns an error if one occurs. -func (c *ingressClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("ingressclasses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *ingressClasses) 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("ingressclasses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched ingressClass. -func (c *ingressClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.IngressClass, err error) { - result = &v1beta1.IngressClass{} - err = c.client.Patch(pt). - Resource("ingressclasses"). - 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 ingressClass. -func (c *ingressClasses) Apply(ctx context.Context, ingressClass *networkingv1beta1.IngressClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.IngressClass, err error) { - if ingressClass == nil { - return nil, fmt.Errorf("ingressClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(ingressClass) - if err != nil { - return nil, err - } - name := ingressClass.Name - if name == nil { - return nil, fmt.Errorf("ingressClass.Name must be provided to Apply") - } - result = &v1beta1.IngressClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("ingressclasses"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/node/v1/runtimeclass.go b/kubernetes/typed/node/v1/runtimeclass.go index 7b86fe9097..6c8110640d 100644 --- a/kubernetes/typed/node/v1/runtimeclass.go +++ b/kubernetes/typed/node/v1/runtimeclass.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/node/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" nodev1 "k8s.io/client-go/applyconfigurations/node/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // RuntimeClassesGetter has a method to return a RuntimeClassInterface. @@ -58,178 +52,18 @@ type RuntimeClassInterface interface { // runtimeClasses implements RuntimeClassInterface type runtimeClasses struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1.RuntimeClass, *v1.RuntimeClassList, *nodev1.RuntimeClassApplyConfiguration] } // newRuntimeClasses returns a RuntimeClasses func newRuntimeClasses(c *NodeV1Client) *runtimeClasses { return &runtimeClasses{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1.RuntimeClass, *v1.RuntimeClassList, *nodev1.RuntimeClassApplyConfiguration]( + "runtimeclasses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.RuntimeClass { return &v1.RuntimeClass{} }, + func() *v1.RuntimeClassList { return &v1.RuntimeClassList{} }), } } - -// Get takes name of the runtimeClass, and returns the corresponding runtimeClass object, and an error if there is any. -func (c *runtimeClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RuntimeClass, err error) { - result = &v1.RuntimeClass{} - err = c.client.Get(). - Resource("runtimeclasses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. -func (c *runtimeClasses) List(ctx context.Context, opts metav1.ListOptions) (*v1.RuntimeClassList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for runtimeclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for runtimeclasses", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for runtimeclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for runtimeclasses", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. -func (c *runtimeClasses) list(ctx context.Context, opts metav1.ListOptions) (result *v1.RuntimeClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.RuntimeClassList{} - err = c.client.Get(). - Resource("runtimeclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of RuntimeClasses -func (c *runtimeClasses) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.RuntimeClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.RuntimeClassList{} - err = c.client.Get(). - Resource("runtimeclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested runtimeClasses. -func (c *runtimeClasses) Watch(ctx context.Context, opts metav1.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("runtimeclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a runtimeClass and creates it. Returns the server's representation of the runtimeClass, and an error, if there is any. -func (c *runtimeClasses) Create(ctx context.Context, runtimeClass *v1.RuntimeClass, opts metav1.CreateOptions) (result *v1.RuntimeClass, err error) { - result = &v1.RuntimeClass{} - err = c.client.Post(). - Resource("runtimeclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(runtimeClass). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a runtimeClass and updates it. Returns the server's representation of the runtimeClass, and an error, if there is any. -func (c *runtimeClasses) Update(ctx context.Context, runtimeClass *v1.RuntimeClass, opts metav1.UpdateOptions) (result *v1.RuntimeClass, err error) { - result = &v1.RuntimeClass{} - err = c.client.Put(). - Resource("runtimeclasses"). - Name(runtimeClass.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(runtimeClass). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the runtimeClass and deletes it. Returns an error if one occurs. -func (c *runtimeClasses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("runtimeclasses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *runtimeClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("runtimeclasses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched runtimeClass. -func (c *runtimeClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RuntimeClass, err error) { - result = &v1.RuntimeClass{} - err = c.client.Patch(pt). - Resource("runtimeclasses"). - 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 runtimeClass. -func (c *runtimeClasses) Apply(ctx context.Context, runtimeClass *nodev1.RuntimeClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.RuntimeClass, err error) { - if runtimeClass == nil { - return nil, fmt.Errorf("runtimeClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(runtimeClass) - if err != nil { - return nil, err - } - name := runtimeClass.Name - if name == nil { - return nil, fmt.Errorf("runtimeClass.Name must be provided to Apply") - } - result = &v1.RuntimeClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("runtimeclasses"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/node/v1alpha1/runtimeclass.go b/kubernetes/typed/node/v1alpha1/runtimeclass.go index 1df0b59043..60aa4a213b 100644 --- a/kubernetes/typed/node/v1alpha1/runtimeclass.go +++ b/kubernetes/typed/node/v1alpha1/runtimeclass.go @@ -20,20 +20,14 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "k8s.io/api/node/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" nodev1alpha1 "k8s.io/client-go/applyconfigurations/node/v1alpha1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // RuntimeClassesGetter has a method to return a RuntimeClassInterface. @@ -58,178 +52,18 @@ type RuntimeClassInterface interface { // runtimeClasses implements RuntimeClassInterface type runtimeClasses struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.RuntimeClass, *v1alpha1.RuntimeClassList, *nodev1alpha1.RuntimeClassApplyConfiguration] } // newRuntimeClasses returns a RuntimeClasses func newRuntimeClasses(c *NodeV1alpha1Client) *runtimeClasses { return &runtimeClasses{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.RuntimeClass, *v1alpha1.RuntimeClassList, *nodev1alpha1.RuntimeClassApplyConfiguration]( + "runtimeclasses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.RuntimeClass { return &v1alpha1.RuntimeClass{} }, + func() *v1alpha1.RuntimeClassList { return &v1alpha1.RuntimeClassList{} }), } } - -// Get takes name of the runtimeClass, and returns the corresponding runtimeClass object, and an error if there is any. -func (c *runtimeClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RuntimeClass, err error) { - result = &v1alpha1.RuntimeClass{} - err = c.client.Get(). - Resource("runtimeclasses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. -func (c *runtimeClasses) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RuntimeClassList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for runtimeclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for runtimeclasses", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for runtimeclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for runtimeclasses", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. -func (c *runtimeClasses) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RuntimeClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.RuntimeClassList{} - err = c.client.Get(). - Resource("runtimeclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of RuntimeClasses -func (c *runtimeClasses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RuntimeClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.RuntimeClassList{} - err = c.client.Get(). - Resource("runtimeclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested runtimeClasses. -func (c *runtimeClasses) 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("runtimeclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a runtimeClass and creates it. Returns the server's representation of the runtimeClass, and an error, if there is any. -func (c *runtimeClasses) Create(ctx context.Context, runtimeClass *v1alpha1.RuntimeClass, opts v1.CreateOptions) (result *v1alpha1.RuntimeClass, err error) { - result = &v1alpha1.RuntimeClass{} - err = c.client.Post(). - Resource("runtimeclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(runtimeClass). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a runtimeClass and updates it. Returns the server's representation of the runtimeClass, and an error, if there is any. -func (c *runtimeClasses) Update(ctx context.Context, runtimeClass *v1alpha1.RuntimeClass, opts v1.UpdateOptions) (result *v1alpha1.RuntimeClass, err error) { - result = &v1alpha1.RuntimeClass{} - err = c.client.Put(). - Resource("runtimeclasses"). - Name(runtimeClass.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(runtimeClass). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the runtimeClass and deletes it. Returns an error if one occurs. -func (c *runtimeClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("runtimeclasses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *runtimeClasses) 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("runtimeclasses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched runtimeClass. -func (c *runtimeClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RuntimeClass, err error) { - result = &v1alpha1.RuntimeClass{} - err = c.client.Patch(pt). - Resource("runtimeclasses"). - 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 runtimeClass. -func (c *runtimeClasses) Apply(ctx context.Context, runtimeClass *nodev1alpha1.RuntimeClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.RuntimeClass, err error) { - if runtimeClass == nil { - return nil, fmt.Errorf("runtimeClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(runtimeClass) - if err != nil { - return nil, err - } - name := runtimeClass.Name - if name == nil { - return nil, fmt.Errorf("runtimeClass.Name must be provided to Apply") - } - result = &v1alpha1.RuntimeClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("runtimeclasses"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/node/v1beta1/runtimeclass.go b/kubernetes/typed/node/v1beta1/runtimeclass.go index cf5f95ecd2..8e15d52889 100644 --- a/kubernetes/typed/node/v1beta1/runtimeclass.go +++ b/kubernetes/typed/node/v1beta1/runtimeclass.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/node/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" nodev1beta1 "k8s.io/client-go/applyconfigurations/node/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // RuntimeClassesGetter has a method to return a RuntimeClassInterface. @@ -58,178 +52,18 @@ type RuntimeClassInterface interface { // runtimeClasses implements RuntimeClassInterface type runtimeClasses struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1beta1.RuntimeClass, *v1beta1.RuntimeClassList, *nodev1beta1.RuntimeClassApplyConfiguration] } // newRuntimeClasses returns a RuntimeClasses func newRuntimeClasses(c *NodeV1beta1Client) *runtimeClasses { return &runtimeClasses{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1beta1.RuntimeClass, *v1beta1.RuntimeClassList, *nodev1beta1.RuntimeClassApplyConfiguration]( + "runtimeclasses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.RuntimeClass { return &v1beta1.RuntimeClass{} }, + func() *v1beta1.RuntimeClassList { return &v1beta1.RuntimeClassList{} }), } } - -// Get takes name of the runtimeClass, and returns the corresponding runtimeClass object, and an error if there is any. -func (c *runtimeClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.RuntimeClass, err error) { - result = &v1beta1.RuntimeClass{} - err = c.client.Get(). - Resource("runtimeclasses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. -func (c *runtimeClasses) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RuntimeClassList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for runtimeclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for runtimeclasses", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for runtimeclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for runtimeclasses", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. -func (c *runtimeClasses) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RuntimeClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.RuntimeClassList{} - err = c.client.Get(). - Resource("runtimeclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of RuntimeClasses -func (c *runtimeClasses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RuntimeClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.RuntimeClassList{} - err = c.client.Get(). - Resource("runtimeclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested runtimeClasses. -func (c *runtimeClasses) 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("runtimeclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a runtimeClass and creates it. Returns the server's representation of the runtimeClass, and an error, if there is any. -func (c *runtimeClasses) Create(ctx context.Context, runtimeClass *v1beta1.RuntimeClass, opts v1.CreateOptions) (result *v1beta1.RuntimeClass, err error) { - result = &v1beta1.RuntimeClass{} - err = c.client.Post(). - Resource("runtimeclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(runtimeClass). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a runtimeClass and updates it. Returns the server's representation of the runtimeClass, and an error, if there is any. -func (c *runtimeClasses) Update(ctx context.Context, runtimeClass *v1beta1.RuntimeClass, opts v1.UpdateOptions) (result *v1beta1.RuntimeClass, err error) { - result = &v1beta1.RuntimeClass{} - err = c.client.Put(). - Resource("runtimeclasses"). - Name(runtimeClass.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(runtimeClass). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the runtimeClass and deletes it. Returns an error if one occurs. -func (c *runtimeClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("runtimeclasses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *runtimeClasses) 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("runtimeclasses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched runtimeClass. -func (c *runtimeClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.RuntimeClass, err error) { - result = &v1beta1.RuntimeClass{} - err = c.client.Patch(pt). - Resource("runtimeclasses"). - 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 runtimeClass. -func (c *runtimeClasses) Apply(ctx context.Context, runtimeClass *nodev1beta1.RuntimeClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.RuntimeClass, err error) { - if runtimeClass == nil { - return nil, fmt.Errorf("runtimeClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(runtimeClass) - if err != nil { - return nil, err - } - name := runtimeClass.Name - if name == nil { - return nil, fmt.Errorf("runtimeClass.Name must be provided to Apply") - } - result = &v1beta1.RuntimeClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("runtimeclasses"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/policy/v1/eviction.go b/kubernetes/typed/policy/v1/eviction.go index cd1aac9c29..22173d36de 100644 --- a/kubernetes/typed/policy/v1/eviction.go +++ b/kubernetes/typed/policy/v1/eviction.go @@ -19,7 +19,9 @@ limitations under the License. package v1 import ( - rest "k8s.io/client-go/rest" + v1 "k8s.io/api/policy/v1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" ) // EvictionsGetter has a method to return a EvictionInterface. @@ -35,14 +37,17 @@ type EvictionInterface interface { // evictions implements EvictionInterface type evictions struct { - client rest.Interface - ns string + *gentype.Client[*v1.Eviction] } // newEvictions returns a Evictions func newEvictions(c *PolicyV1Client, namespace string) *evictions { return &evictions{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClient[*v1.Eviction]( + "evictions", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.Eviction { return &v1.Eviction{} }), } } diff --git a/kubernetes/typed/policy/v1/poddisruptionbudget.go b/kubernetes/typed/policy/v1/poddisruptionbudget.go index f629d67ef5..6d011cbce2 100644 --- a/kubernetes/typed/policy/v1/poddisruptionbudget.go +++ b/kubernetes/typed/policy/v1/poddisruptionbudget.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/policy/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" policyv1 "k8s.io/client-go/applyconfigurations/policy/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // PodDisruptionBudgetsGetter has a method to return a PodDisruptionBudgetInterface. @@ -46,6 +40,7 @@ type PodDisruptionBudgetsGetter interface { type PodDisruptionBudgetInterface interface { Create(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.CreateOptions) (*v1.PodDisruptionBudget, error) Update(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (*v1.PodDisruptionBudget, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (*v1.PodDisruptionBudget, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -54,242 +49,25 @@ type PodDisruptionBudgetInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodDisruptionBudget, err error) Apply(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudgetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodDisruptionBudget, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudgetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodDisruptionBudget, err error) PodDisruptionBudgetExpansion } // podDisruptionBudgets implements PodDisruptionBudgetInterface type podDisruptionBudgets struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.PodDisruptionBudget, *v1.PodDisruptionBudgetList, *policyv1.PodDisruptionBudgetApplyConfiguration] } // newPodDisruptionBudgets returns a PodDisruptionBudgets func newPodDisruptionBudgets(c *PolicyV1Client, namespace string) *podDisruptionBudgets { return &podDisruptionBudgets{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.PodDisruptionBudget, *v1.PodDisruptionBudgetList, *policyv1.PodDisruptionBudgetApplyConfiguration]( + "poddisruptionbudgets", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.PodDisruptionBudget { return &v1.PodDisruptionBudget{} }, + func() *v1.PodDisruptionBudgetList { return &v1.PodDisruptionBudgetList{} }), } } - -// Get takes name of the podDisruptionBudget, and returns the corresponding podDisruptionBudget object, and an error if there is any. -func (c *podDisruptionBudgets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PodDisruptionBudget, err error) { - result = &v1.PodDisruptionBudget{} - err = c.client.Get(). - Namespace(c.ns). - Resource("poddisruptionbudgets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. -func (c *podDisruptionBudgets) List(ctx context.Context, opts metav1.ListOptions) (*v1.PodDisruptionBudgetList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for poddisruptionbudgets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for poddisruptionbudgets", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for poddisruptionbudgets ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for poddisruptionbudgets", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. -func (c *podDisruptionBudgets) list(ctx context.Context, opts metav1.ListOptions) (result *v1.PodDisruptionBudgetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.PodDisruptionBudgetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("poddisruptionbudgets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of PodDisruptionBudgets -func (c *podDisruptionBudgets) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.PodDisruptionBudgetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.PodDisruptionBudgetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("poddisruptionbudgets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested podDisruptionBudgets. -func (c *podDisruptionBudgets) Watch(ctx context.Context, opts metav1.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("poddisruptionbudgets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a podDisruptionBudget and creates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. -func (c *podDisruptionBudgets) Create(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.CreateOptions) (result *v1.PodDisruptionBudget, err error) { - result = &v1.PodDisruptionBudget{} - err = c.client.Post(). - Namespace(c.ns). - Resource("poddisruptionbudgets"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(podDisruptionBudget). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a podDisruptionBudget and updates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. -func (c *podDisruptionBudgets) Update(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (result *v1.PodDisruptionBudget, err error) { - result = &v1.PodDisruptionBudget{} - err = c.client.Put(). - Namespace(c.ns). - Resource("poddisruptionbudgets"). - Name(podDisruptionBudget.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(podDisruptionBudget). - 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 *podDisruptionBudgets) UpdateStatus(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (result *v1.PodDisruptionBudget, err error) { - result = &v1.PodDisruptionBudget{} - err = c.client.Put(). - Namespace(c.ns). - Resource("poddisruptionbudgets"). - Name(podDisruptionBudget.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(podDisruptionBudget). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the podDisruptionBudget and deletes it. Returns an error if one occurs. -func (c *podDisruptionBudgets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("poddisruptionbudgets"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *podDisruptionBudgets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("poddisruptionbudgets"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched podDisruptionBudget. -func (c *podDisruptionBudgets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodDisruptionBudget, err error) { - result = &v1.PodDisruptionBudget{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("poddisruptionbudgets"). - 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 podDisruptionBudget. -func (c *podDisruptionBudgets) Apply(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudgetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodDisruptionBudget, err error) { - if podDisruptionBudget == nil { - return nil, fmt.Errorf("podDisruptionBudget provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(podDisruptionBudget) - if err != nil { - return nil, err - } - name := podDisruptionBudget.Name - if name == nil { - return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply") - } - result = &v1.PodDisruptionBudget{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("poddisruptionbudgets"). - 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 *podDisruptionBudgets) ApplyStatus(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudgetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodDisruptionBudget, err error) { - if podDisruptionBudget == nil { - return nil, fmt.Errorf("podDisruptionBudget provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(podDisruptionBudget) - if err != nil { - return nil, err - } - - name := podDisruptionBudget.Name - if name == nil { - return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply") - } - - result = &v1.PodDisruptionBudget{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("poddisruptionbudgets"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/policy/v1beta1/eviction.go b/kubernetes/typed/policy/v1beta1/eviction.go index 12e8e76edc..e003ece6bd 100644 --- a/kubernetes/typed/policy/v1beta1/eviction.go +++ b/kubernetes/typed/policy/v1beta1/eviction.go @@ -19,7 +19,9 @@ limitations under the License. package v1beta1 import ( - rest "k8s.io/client-go/rest" + v1beta1 "k8s.io/api/policy/v1beta1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" ) // EvictionsGetter has a method to return a EvictionInterface. @@ -35,14 +37,17 @@ type EvictionInterface interface { // evictions implements EvictionInterface type evictions struct { - client rest.Interface - ns string + *gentype.Client[*v1beta1.Eviction] } // newEvictions returns a Evictions func newEvictions(c *PolicyV1beta1Client, namespace string) *evictions { return &evictions{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClient[*v1beta1.Eviction]( + "evictions", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.Eviction { return &v1beta1.Eviction{} }), } } diff --git a/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go b/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go index 27e20786ab..4111812376 100644 --- a/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go +++ b/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/policy/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" policyv1beta1 "k8s.io/client-go/applyconfigurations/policy/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // PodDisruptionBudgetsGetter has a method to return a PodDisruptionBudgetInterface. @@ -46,6 +40,7 @@ type PodDisruptionBudgetsGetter interface { type PodDisruptionBudgetInterface interface { Create(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.CreateOptions) (*v1beta1.PodDisruptionBudget, error) Update(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.UpdateOptions) (*v1beta1.PodDisruptionBudget, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.UpdateOptions) (*v1beta1.PodDisruptionBudget, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,242 +49,25 @@ type PodDisruptionBudgetInterface 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 *v1beta1.PodDisruptionBudget, err error) Apply(ctx context.Context, podDisruptionBudget *policyv1beta1.PodDisruptionBudgetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodDisruptionBudget, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, podDisruptionBudget *policyv1beta1.PodDisruptionBudgetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodDisruptionBudget, err error) PodDisruptionBudgetExpansion } // podDisruptionBudgets implements PodDisruptionBudgetInterface type podDisruptionBudgets struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta1.PodDisruptionBudget, *v1beta1.PodDisruptionBudgetList, *policyv1beta1.PodDisruptionBudgetApplyConfiguration] } // newPodDisruptionBudgets returns a PodDisruptionBudgets func newPodDisruptionBudgets(c *PolicyV1beta1Client, namespace string) *podDisruptionBudgets { return &podDisruptionBudgets{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta1.PodDisruptionBudget, *v1beta1.PodDisruptionBudgetList, *policyv1beta1.PodDisruptionBudgetApplyConfiguration]( + "poddisruptionbudgets", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.PodDisruptionBudget { return &v1beta1.PodDisruptionBudget{} }, + func() *v1beta1.PodDisruptionBudgetList { return &v1beta1.PodDisruptionBudgetList{} }), } } - -// Get takes name of the podDisruptionBudget, and returns the corresponding podDisruptionBudget object, and an error if there is any. -func (c *podDisruptionBudgets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PodDisruptionBudget, err error) { - result = &v1beta1.PodDisruptionBudget{} - err = c.client.Get(). - Namespace(c.ns). - Resource("poddisruptionbudgets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. -func (c *podDisruptionBudgets) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PodDisruptionBudgetList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for poddisruptionbudgets, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for poddisruptionbudgets", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for poddisruptionbudgets ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for poddisruptionbudgets", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. -func (c *podDisruptionBudgets) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PodDisruptionBudgetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.PodDisruptionBudgetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("poddisruptionbudgets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of PodDisruptionBudgets -func (c *podDisruptionBudgets) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PodDisruptionBudgetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.PodDisruptionBudgetList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("poddisruptionbudgets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested podDisruptionBudgets. -func (c *podDisruptionBudgets) 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("poddisruptionbudgets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a podDisruptionBudget and creates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. -func (c *podDisruptionBudgets) Create(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.CreateOptions) (result *v1beta1.PodDisruptionBudget, err error) { - result = &v1beta1.PodDisruptionBudget{} - err = c.client.Post(). - Namespace(c.ns). - Resource("poddisruptionbudgets"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(podDisruptionBudget). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a podDisruptionBudget and updates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. -func (c *podDisruptionBudgets) Update(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.UpdateOptions) (result *v1beta1.PodDisruptionBudget, err error) { - result = &v1beta1.PodDisruptionBudget{} - err = c.client.Put(). - Namespace(c.ns). - Resource("poddisruptionbudgets"). - Name(podDisruptionBudget.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(podDisruptionBudget). - 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 *podDisruptionBudgets) UpdateStatus(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.UpdateOptions) (result *v1beta1.PodDisruptionBudget, err error) { - result = &v1beta1.PodDisruptionBudget{} - err = c.client.Put(). - Namespace(c.ns). - Resource("poddisruptionbudgets"). - Name(podDisruptionBudget.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(podDisruptionBudget). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the podDisruptionBudget and deletes it. Returns an error if one occurs. -func (c *podDisruptionBudgets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("poddisruptionbudgets"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *podDisruptionBudgets) 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("poddisruptionbudgets"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched podDisruptionBudget. -func (c *podDisruptionBudgets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PodDisruptionBudget, err error) { - result = &v1beta1.PodDisruptionBudget{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("poddisruptionbudgets"). - 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 podDisruptionBudget. -func (c *podDisruptionBudgets) Apply(ctx context.Context, podDisruptionBudget *policyv1beta1.PodDisruptionBudgetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodDisruptionBudget, err error) { - if podDisruptionBudget == nil { - return nil, fmt.Errorf("podDisruptionBudget provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(podDisruptionBudget) - if err != nil { - return nil, err - } - name := podDisruptionBudget.Name - if name == nil { - return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply") - } - result = &v1beta1.PodDisruptionBudget{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("poddisruptionbudgets"). - 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 *podDisruptionBudgets) ApplyStatus(ctx context.Context, podDisruptionBudget *policyv1beta1.PodDisruptionBudgetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodDisruptionBudget, err error) { - if podDisruptionBudget == nil { - return nil, fmt.Errorf("podDisruptionBudget provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(podDisruptionBudget) - if err != nil { - return nil, err - } - - name := podDisruptionBudget.Name - if name == nil { - return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply") - } - - result = &v1beta1.PodDisruptionBudget{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("poddisruptionbudgets"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/rbac/v1/clusterrole.go b/kubernetes/typed/rbac/v1/clusterrole.go index 6462a2d3dc..19fff0ee47 100644 --- a/kubernetes/typed/rbac/v1/clusterrole.go +++ b/kubernetes/typed/rbac/v1/clusterrole.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ClusterRolesGetter has a method to return a ClusterRoleInterface. @@ -58,178 +52,18 @@ type ClusterRoleInterface interface { // clusterRoles implements ClusterRoleInterface type clusterRoles struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1.ClusterRole, *v1.ClusterRoleList, *rbacv1.ClusterRoleApplyConfiguration] } // newClusterRoles returns a ClusterRoles func newClusterRoles(c *RbacV1Client) *clusterRoles { return &clusterRoles{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1.ClusterRole, *v1.ClusterRoleList, *rbacv1.ClusterRoleApplyConfiguration]( + "clusterroles", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.ClusterRole { return &v1.ClusterRole{} }, + func() *v1.ClusterRoleList { return &v1.ClusterRoleList{} }), } } - -// Get takes name of the clusterRole, and returns the corresponding clusterRole object, and an error if there is any. -func (c *clusterRoles) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterRole, err error) { - result = &v1.ClusterRole{} - err = c.client.Get(). - Resource("clusterroles"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. -func (c *clusterRoles) List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterRoleList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for clusterroles, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for clusterroles", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for clusterroles ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterroles", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ClusterRoles that match those selectors. -func (c *clusterRoles) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ClusterRoleList{} - err = c.client.Get(). - Resource("clusterroles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ClusterRoles -func (c *clusterRoles) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ClusterRoleList{} - err = c.client.Get(). - Resource("clusterroles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterRoles. -func (c *clusterRoles) Watch(ctx context.Context, opts metav1.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("clusterroles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a clusterRole and creates it. Returns the server's representation of the clusterRole, and an error, if there is any. -func (c *clusterRoles) Create(ctx context.Context, clusterRole *v1.ClusterRole, opts metav1.CreateOptions) (result *v1.ClusterRole, err error) { - result = &v1.ClusterRole{} - err = c.client.Post(). - Resource("clusterroles"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterRole). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a clusterRole and updates it. Returns the server's representation of the clusterRole, and an error, if there is any. -func (c *clusterRoles) Update(ctx context.Context, clusterRole *v1.ClusterRole, opts metav1.UpdateOptions) (result *v1.ClusterRole, err error) { - result = &v1.ClusterRole{} - err = c.client.Put(). - Resource("clusterroles"). - Name(clusterRole.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterRole). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the clusterRole and deletes it. Returns an error if one occurs. -func (c *clusterRoles) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("clusterroles"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterRoles) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("clusterroles"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched clusterRole. -func (c *clusterRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterRole, err error) { - result = &v1.ClusterRole{} - err = c.client.Patch(pt). - Resource("clusterroles"). - 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 clusterRole. -func (c *clusterRoles) Apply(ctx context.Context, clusterRole *rbacv1.ClusterRoleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ClusterRole, err error) { - if clusterRole == nil { - return nil, fmt.Errorf("clusterRole provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(clusterRole) - if err != nil { - return nil, err - } - name := clusterRole.Name - if name == nil { - return nil, fmt.Errorf("clusterRole.Name must be provided to Apply") - } - result = &v1.ClusterRole{} - err = c.client.Patch(types.ApplyPatchType). - Resource("clusterroles"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/rbac/v1/clusterrolebinding.go b/kubernetes/typed/rbac/v1/clusterrolebinding.go index e2f3d94778..77fb3785e4 100644 --- a/kubernetes/typed/rbac/v1/clusterrolebinding.go +++ b/kubernetes/typed/rbac/v1/clusterrolebinding.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ClusterRoleBindingsGetter has a method to return a ClusterRoleBindingInterface. @@ -58,178 +52,18 @@ type ClusterRoleBindingInterface interface { // clusterRoleBindings implements ClusterRoleBindingInterface type clusterRoleBindings struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1.ClusterRoleBinding, *v1.ClusterRoleBindingList, *rbacv1.ClusterRoleBindingApplyConfiguration] } // newClusterRoleBindings returns a ClusterRoleBindings func newClusterRoleBindings(c *RbacV1Client) *clusterRoleBindings { return &clusterRoleBindings{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1.ClusterRoleBinding, *v1.ClusterRoleBindingList, *rbacv1.ClusterRoleBindingApplyConfiguration]( + "clusterrolebindings", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.ClusterRoleBinding { return &v1.ClusterRoleBinding{} }, + func() *v1.ClusterRoleBindingList { return &v1.ClusterRoleBindingList{} }), } } - -// Get takes name of the clusterRoleBinding, and returns the corresponding clusterRoleBinding object, and an error if there is any. -func (c *clusterRoleBindings) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterRoleBinding, err error) { - result = &v1.ClusterRoleBinding{} - err = c.client.Get(). - Resource("clusterrolebindings"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. -func (c *clusterRoleBindings) List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterRoleBindingList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for clusterrolebindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for clusterrolebindings", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for clusterrolebindings ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterrolebindings", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. -func (c *clusterRoleBindings) list(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ClusterRoleBindingList{} - err = c.client.Get(). - Resource("clusterrolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ClusterRoleBindings -func (c *clusterRoleBindings) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.ClusterRoleBindingList{} - err = c.client.Get(). - Resource("clusterrolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterRoleBindings. -func (c *clusterRoleBindings) Watch(ctx context.Context, opts metav1.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("clusterrolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a clusterRoleBinding and creates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. -func (c *clusterRoleBindings) Create(ctx context.Context, clusterRoleBinding *v1.ClusterRoleBinding, opts metav1.CreateOptions) (result *v1.ClusterRoleBinding, err error) { - result = &v1.ClusterRoleBinding{} - err = c.client.Post(). - Resource("clusterrolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterRoleBinding). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a clusterRoleBinding and updates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. -func (c *clusterRoleBindings) Update(ctx context.Context, clusterRoleBinding *v1.ClusterRoleBinding, opts metav1.UpdateOptions) (result *v1.ClusterRoleBinding, err error) { - result = &v1.ClusterRoleBinding{} - err = c.client.Put(). - Resource("clusterrolebindings"). - Name(clusterRoleBinding.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterRoleBinding). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the clusterRoleBinding and deletes it. Returns an error if one occurs. -func (c *clusterRoleBindings) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("clusterrolebindings"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterRoleBindings) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("clusterrolebindings"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched clusterRoleBinding. -func (c *clusterRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterRoleBinding, err error) { - result = &v1.ClusterRoleBinding{} - err = c.client.Patch(pt). - Resource("clusterrolebindings"). - 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 clusterRoleBinding. -func (c *clusterRoleBindings) Apply(ctx context.Context, clusterRoleBinding *rbacv1.ClusterRoleBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ClusterRoleBinding, err error) { - if clusterRoleBinding == nil { - return nil, fmt.Errorf("clusterRoleBinding provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(clusterRoleBinding) - if err != nil { - return nil, err - } - name := clusterRoleBinding.Name - if name == nil { - return nil, fmt.Errorf("clusterRoleBinding.Name must be provided to Apply") - } - result = &v1.ClusterRoleBinding{} - err = c.client.Patch(types.ApplyPatchType). - Resource("clusterrolebindings"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/rbac/v1/role.go b/kubernetes/typed/rbac/v1/role.go index cac029866a..b75b055f07 100644 --- a/kubernetes/typed/rbac/v1/role.go +++ b/kubernetes/typed/rbac/v1/role.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // RolesGetter has a method to return a RoleInterface. @@ -58,190 +52,18 @@ type RoleInterface interface { // roles implements RoleInterface type roles struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.Role, *v1.RoleList, *rbacv1.RoleApplyConfiguration] } // newRoles returns a Roles func newRoles(c *RbacV1Client, namespace string) *roles { return &roles{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.Role, *v1.RoleList, *rbacv1.RoleApplyConfiguration]( + "roles", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.Role { return &v1.Role{} }, + func() *v1.RoleList { return &v1.RoleList{} }), } } - -// Get takes name of the role, and returns the corresponding role object, and an error if there is any. -func (c *roles) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Role, err error) { - result = &v1.Role{} - err = c.client.Get(). - Namespace(c.ns). - Resource("roles"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Roles that match those selectors. -func (c *roles) List(ctx context.Context, opts metav1.ListOptions) (*v1.RoleList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for roles, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for roles", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for roles ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for roles", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of Roles that match those selectors. -func (c *roles) list(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.RoleList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("roles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of Roles -func (c *roles) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.RoleList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("roles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested roles. -func (c *roles) Watch(ctx context.Context, opts metav1.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("roles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a role and creates it. Returns the server's representation of the role, and an error, if there is any. -func (c *roles) Create(ctx context.Context, role *v1.Role, opts metav1.CreateOptions) (result *v1.Role, err error) { - result = &v1.Role{} - err = c.client.Post(). - Namespace(c.ns). - Resource("roles"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(role). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a role and updates it. Returns the server's representation of the role, and an error, if there is any. -func (c *roles) Update(ctx context.Context, role *v1.Role, opts metav1.UpdateOptions) (result *v1.Role, err error) { - result = &v1.Role{} - err = c.client.Put(). - Namespace(c.ns). - Resource("roles"). - Name(role.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(role). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the role and deletes it. Returns an error if one occurs. -func (c *roles) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("roles"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *roles) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("roles"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched role. -func (c *roles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Role, err error) { - result = &v1.Role{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("roles"). - 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 role. -func (c *roles) Apply(ctx context.Context, role *rbacv1.RoleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Role, err error) { - if role == nil { - return nil, fmt.Errorf("role provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(role) - if err != nil { - return nil, err - } - name := role.Name - if name == nil { - return nil, fmt.Errorf("role.Name must be provided to Apply") - } - result = &v1.Role{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("roles"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/rbac/v1/rolebinding.go b/kubernetes/typed/rbac/v1/rolebinding.go index 2cbead33a5..fcbb1c0e26 100644 --- a/kubernetes/typed/rbac/v1/rolebinding.go +++ b/kubernetes/typed/rbac/v1/rolebinding.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // RoleBindingsGetter has a method to return a RoleBindingInterface. @@ -58,190 +52,18 @@ type RoleBindingInterface interface { // roleBindings implements RoleBindingInterface type roleBindings struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.RoleBinding, *v1.RoleBindingList, *rbacv1.RoleBindingApplyConfiguration] } // newRoleBindings returns a RoleBindings func newRoleBindings(c *RbacV1Client, namespace string) *roleBindings { return &roleBindings{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.RoleBinding, *v1.RoleBindingList, *rbacv1.RoleBindingApplyConfiguration]( + "rolebindings", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.RoleBinding { return &v1.RoleBinding{} }, + func() *v1.RoleBindingList { return &v1.RoleBindingList{} }), } } - -// Get takes name of the roleBinding, and returns the corresponding roleBinding object, and an error if there is any. -func (c *roleBindings) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RoleBinding, err error) { - result = &v1.RoleBinding{} - err = c.client.Get(). - Namespace(c.ns). - Resource("rolebindings"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of RoleBindings that match those selectors. -func (c *roleBindings) List(ctx context.Context, opts metav1.ListOptions) (*v1.RoleBindingList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for rolebindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for rolebindings", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for rolebindings ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for rolebindings", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of RoleBindings that match those selectors. -func (c *roleBindings) list(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.RoleBindingList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("rolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of RoleBindings -func (c *roleBindings) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.RoleBindingList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("rolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested roleBindings. -func (c *roleBindings) Watch(ctx context.Context, opts metav1.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("rolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a roleBinding and creates it. Returns the server's representation of the roleBinding, and an error, if there is any. -func (c *roleBindings) Create(ctx context.Context, roleBinding *v1.RoleBinding, opts metav1.CreateOptions) (result *v1.RoleBinding, err error) { - result = &v1.RoleBinding{} - err = c.client.Post(). - Namespace(c.ns). - Resource("rolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(roleBinding). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a roleBinding and updates it. Returns the server's representation of the roleBinding, and an error, if there is any. -func (c *roleBindings) Update(ctx context.Context, roleBinding *v1.RoleBinding, opts metav1.UpdateOptions) (result *v1.RoleBinding, err error) { - result = &v1.RoleBinding{} - err = c.client.Put(). - Namespace(c.ns). - Resource("rolebindings"). - Name(roleBinding.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(roleBinding). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the roleBinding and deletes it. Returns an error if one occurs. -func (c *roleBindings) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("rolebindings"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *roleBindings) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("rolebindings"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched roleBinding. -func (c *roleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RoleBinding, err error) { - result = &v1.RoleBinding{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("rolebindings"). - 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 roleBinding. -func (c *roleBindings) Apply(ctx context.Context, roleBinding *rbacv1.RoleBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.RoleBinding, err error) { - if roleBinding == nil { - return nil, fmt.Errorf("roleBinding provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(roleBinding) - if err != nil { - return nil, err - } - name := roleBinding.Name - if name == nil { - return nil, fmt.Errorf("roleBinding.Name must be provided to Apply") - } - result = &v1.RoleBinding{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("rolebindings"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/rbac/v1alpha1/clusterrole.go b/kubernetes/typed/rbac/v1alpha1/clusterrole.go index f22b5b3e35..f91e2c50a1 100644 --- a/kubernetes/typed/rbac/v1alpha1/clusterrole.go +++ b/kubernetes/typed/rbac/v1alpha1/clusterrole.go @@ -20,20 +20,14 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ClusterRolesGetter has a method to return a ClusterRoleInterface. @@ -58,178 +52,18 @@ type ClusterRoleInterface interface { // clusterRoles implements ClusterRoleInterface type clusterRoles struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.ClusterRole, *v1alpha1.ClusterRoleList, *rbacv1alpha1.ClusterRoleApplyConfiguration] } // newClusterRoles returns a ClusterRoles func newClusterRoles(c *RbacV1alpha1Client) *clusterRoles { return &clusterRoles{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.ClusterRole, *v1alpha1.ClusterRoleList, *rbacv1alpha1.ClusterRoleApplyConfiguration]( + "clusterroles", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.ClusterRole { return &v1alpha1.ClusterRole{} }, + func() *v1alpha1.ClusterRoleList { return &v1alpha1.ClusterRoleList{} }), } } - -// Get takes name of the clusterRole, and returns the corresponding clusterRole object, and an error if there is any. -func (c *clusterRoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterRole, err error) { - result = &v1alpha1.ClusterRole{} - err = c.client.Get(). - Resource("clusterroles"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. -func (c *clusterRoles) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterRoleList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for clusterroles, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for clusterroles", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for clusterroles ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterroles", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ClusterRoles that match those selectors. -func (c *clusterRoles) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ClusterRoleList{} - err = c.client.Get(). - Resource("clusterroles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ClusterRoles -func (c *clusterRoles) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ClusterRoleList{} - err = c.client.Get(). - Resource("clusterroles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterRoles. -func (c *clusterRoles) 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("clusterroles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a clusterRole and creates it. Returns the server's representation of the clusterRole, and an error, if there is any. -func (c *clusterRoles) Create(ctx context.Context, clusterRole *v1alpha1.ClusterRole, opts v1.CreateOptions) (result *v1alpha1.ClusterRole, err error) { - result = &v1alpha1.ClusterRole{} - err = c.client.Post(). - Resource("clusterroles"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterRole). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a clusterRole and updates it. Returns the server's representation of the clusterRole, and an error, if there is any. -func (c *clusterRoles) Update(ctx context.Context, clusterRole *v1alpha1.ClusterRole, opts v1.UpdateOptions) (result *v1alpha1.ClusterRole, err error) { - result = &v1alpha1.ClusterRole{} - err = c.client.Put(). - Resource("clusterroles"). - Name(clusterRole.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterRole). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the clusterRole and deletes it. Returns an error if one occurs. -func (c *clusterRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("clusterroles"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterRoles) 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("clusterroles"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched clusterRole. -func (c *clusterRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterRole, err error) { - result = &v1alpha1.ClusterRole{} - err = c.client.Patch(pt). - Resource("clusterroles"). - 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 clusterRole. -func (c *clusterRoles) Apply(ctx context.Context, clusterRole *rbacv1alpha1.ClusterRoleApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterRole, err error) { - if clusterRole == nil { - return nil, fmt.Errorf("clusterRole provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(clusterRole) - if err != nil { - return nil, err - } - name := clusterRole.Name - if name == nil { - return nil, fmt.Errorf("clusterRole.Name must be provided to Apply") - } - result = &v1alpha1.ClusterRole{} - err = c.client.Patch(types.ApplyPatchType). - Resource("clusterroles"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go b/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go index f3ef567913..3f04526f0b 100644 --- a/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go +++ b/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go @@ -20,20 +20,14 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ClusterRoleBindingsGetter has a method to return a ClusterRoleBindingInterface. @@ -58,178 +52,18 @@ type ClusterRoleBindingInterface interface { // clusterRoleBindings implements ClusterRoleBindingInterface type clusterRoleBindings struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.ClusterRoleBinding, *v1alpha1.ClusterRoleBindingList, *rbacv1alpha1.ClusterRoleBindingApplyConfiguration] } // newClusterRoleBindings returns a ClusterRoleBindings func newClusterRoleBindings(c *RbacV1alpha1Client) *clusterRoleBindings { return &clusterRoleBindings{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.ClusterRoleBinding, *v1alpha1.ClusterRoleBindingList, *rbacv1alpha1.ClusterRoleBindingApplyConfiguration]( + "clusterrolebindings", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.ClusterRoleBinding { return &v1alpha1.ClusterRoleBinding{} }, + func() *v1alpha1.ClusterRoleBindingList { return &v1alpha1.ClusterRoleBindingList{} }), } } - -// Get takes name of the clusterRoleBinding, and returns the corresponding clusterRoleBinding object, and an error if there is any. -func (c *clusterRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterRoleBinding, err error) { - result = &v1alpha1.ClusterRoleBinding{} - err = c.client.Get(). - Resource("clusterrolebindings"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. -func (c *clusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterRoleBindingList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for clusterrolebindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for clusterrolebindings", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for clusterrolebindings ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterrolebindings", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. -func (c *clusterRoleBindings) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ClusterRoleBindingList{} - err = c.client.Get(). - Resource("clusterrolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ClusterRoleBindings -func (c *clusterRoleBindings) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ClusterRoleBindingList{} - err = c.client.Get(). - Resource("clusterrolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterRoleBindings. -func (c *clusterRoleBindings) 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("clusterrolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a clusterRoleBinding and creates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. -func (c *clusterRoleBindings) Create(ctx context.Context, clusterRoleBinding *v1alpha1.ClusterRoleBinding, opts v1.CreateOptions) (result *v1alpha1.ClusterRoleBinding, err error) { - result = &v1alpha1.ClusterRoleBinding{} - err = c.client.Post(). - Resource("clusterrolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterRoleBinding). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a clusterRoleBinding and updates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. -func (c *clusterRoleBindings) Update(ctx context.Context, clusterRoleBinding *v1alpha1.ClusterRoleBinding, opts v1.UpdateOptions) (result *v1alpha1.ClusterRoleBinding, err error) { - result = &v1alpha1.ClusterRoleBinding{} - err = c.client.Put(). - Resource("clusterrolebindings"). - Name(clusterRoleBinding.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterRoleBinding). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the clusterRoleBinding and deletes it. Returns an error if one occurs. -func (c *clusterRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("clusterrolebindings"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterRoleBindings) 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("clusterrolebindings"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched clusterRoleBinding. -func (c *clusterRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterRoleBinding, err error) { - result = &v1alpha1.ClusterRoleBinding{} - err = c.client.Patch(pt). - Resource("clusterrolebindings"). - 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 clusterRoleBinding. -func (c *clusterRoleBindings) Apply(ctx context.Context, clusterRoleBinding *rbacv1alpha1.ClusterRoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterRoleBinding, err error) { - if clusterRoleBinding == nil { - return nil, fmt.Errorf("clusterRoleBinding provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(clusterRoleBinding) - if err != nil { - return nil, err - } - name := clusterRoleBinding.Name - if name == nil { - return nil, fmt.Errorf("clusterRoleBinding.Name must be provided to Apply") - } - result = &v1alpha1.ClusterRoleBinding{} - err = c.client.Patch(types.ApplyPatchType). - Resource("clusterrolebindings"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/rbac/v1alpha1/role.go b/kubernetes/typed/rbac/v1alpha1/role.go index 13f4b80af7..4a1876a7d5 100644 --- a/kubernetes/typed/rbac/v1alpha1/role.go +++ b/kubernetes/typed/rbac/v1alpha1/role.go @@ -20,20 +20,14 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // RolesGetter has a method to return a RoleInterface. @@ -58,190 +52,18 @@ type RoleInterface interface { // roles implements RoleInterface type roles struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.Role, *v1alpha1.RoleList, *rbacv1alpha1.RoleApplyConfiguration] } // newRoles returns a Roles func newRoles(c *RbacV1alpha1Client, namespace string) *roles { return &roles{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.Role, *v1alpha1.RoleList, *rbacv1alpha1.RoleApplyConfiguration]( + "roles", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.Role { return &v1alpha1.Role{} }, + func() *v1alpha1.RoleList { return &v1alpha1.RoleList{} }), } } - -// Get takes name of the role, and returns the corresponding role object, and an error if there is any. -func (c *roles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Role, err error) { - result = &v1alpha1.Role{} - err = c.client.Get(). - Namespace(c.ns). - Resource("roles"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Roles that match those selectors. -func (c *roles) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RoleList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for roles, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for roles", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for roles ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for roles", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of Roles that match those selectors. -func (c *roles) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.RoleList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("roles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of Roles -func (c *roles) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.RoleList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("roles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested roles. -func (c *roles) 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("roles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a role and creates it. Returns the server's representation of the role, and an error, if there is any. -func (c *roles) Create(ctx context.Context, role *v1alpha1.Role, opts v1.CreateOptions) (result *v1alpha1.Role, err error) { - result = &v1alpha1.Role{} - err = c.client.Post(). - Namespace(c.ns). - Resource("roles"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(role). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a role and updates it. Returns the server's representation of the role, and an error, if there is any. -func (c *roles) Update(ctx context.Context, role *v1alpha1.Role, opts v1.UpdateOptions) (result *v1alpha1.Role, err error) { - result = &v1alpha1.Role{} - err = c.client.Put(). - Namespace(c.ns). - Resource("roles"). - Name(role.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(role). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the role and deletes it. Returns an error if one occurs. -func (c *roles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("roles"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *roles) 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("roles"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched role. -func (c *roles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Role, err error) { - result = &v1alpha1.Role{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("roles"). - 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 role. -func (c *roles) Apply(ctx context.Context, role *rbacv1alpha1.RoleApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Role, err error) { - if role == nil { - return nil, fmt.Errorf("role provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(role) - if err != nil { - return nil, err - } - name := role.Name - if name == nil { - return nil, fmt.Errorf("role.Name must be provided to Apply") - } - result = &v1alpha1.Role{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("roles"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/rbac/v1alpha1/rolebinding.go b/kubernetes/typed/rbac/v1alpha1/rolebinding.go index 30285ccaf2..6473132f1c 100644 --- a/kubernetes/typed/rbac/v1alpha1/rolebinding.go +++ b/kubernetes/typed/rbac/v1alpha1/rolebinding.go @@ -20,20 +20,14 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "k8s.io/api/rbac/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // RoleBindingsGetter has a method to return a RoleBindingInterface. @@ -58,190 +52,18 @@ type RoleBindingInterface interface { // roleBindings implements RoleBindingInterface type roleBindings struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.RoleBinding, *v1alpha1.RoleBindingList, *rbacv1alpha1.RoleBindingApplyConfiguration] } // newRoleBindings returns a RoleBindings func newRoleBindings(c *RbacV1alpha1Client, namespace string) *roleBindings { return &roleBindings{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.RoleBinding, *v1alpha1.RoleBindingList, *rbacv1alpha1.RoleBindingApplyConfiguration]( + "rolebindings", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.RoleBinding { return &v1alpha1.RoleBinding{} }, + func() *v1alpha1.RoleBindingList { return &v1alpha1.RoleBindingList{} }), } } - -// Get takes name of the roleBinding, and returns the corresponding roleBinding object, and an error if there is any. -func (c *roleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RoleBinding, err error) { - result = &v1alpha1.RoleBinding{} - err = c.client.Get(). - Namespace(c.ns). - Resource("rolebindings"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of RoleBindings that match those selectors. -func (c *roleBindings) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RoleBindingList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for rolebindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for rolebindings", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for rolebindings ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for rolebindings", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of RoleBindings that match those selectors. -func (c *roleBindings) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.RoleBindingList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("rolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of RoleBindings -func (c *roleBindings) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.RoleBindingList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("rolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested roleBindings. -func (c *roleBindings) 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("rolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a roleBinding and creates it. Returns the server's representation of the roleBinding, and an error, if there is any. -func (c *roleBindings) Create(ctx context.Context, roleBinding *v1alpha1.RoleBinding, opts v1.CreateOptions) (result *v1alpha1.RoleBinding, err error) { - result = &v1alpha1.RoleBinding{} - err = c.client.Post(). - Namespace(c.ns). - Resource("rolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(roleBinding). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a roleBinding and updates it. Returns the server's representation of the roleBinding, and an error, if there is any. -func (c *roleBindings) Update(ctx context.Context, roleBinding *v1alpha1.RoleBinding, opts v1.UpdateOptions) (result *v1alpha1.RoleBinding, err error) { - result = &v1alpha1.RoleBinding{} - err = c.client.Put(). - Namespace(c.ns). - Resource("rolebindings"). - Name(roleBinding.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(roleBinding). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the roleBinding and deletes it. Returns an error if one occurs. -func (c *roleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("rolebindings"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *roleBindings) 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("rolebindings"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched roleBinding. -func (c *roleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RoleBinding, err error) { - result = &v1alpha1.RoleBinding{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("rolebindings"). - 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 roleBinding. -func (c *roleBindings) Apply(ctx context.Context, roleBinding *rbacv1alpha1.RoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.RoleBinding, err error) { - if roleBinding == nil { - return nil, fmt.Errorf("roleBinding provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(roleBinding) - if err != nil { - return nil, err - } - name := roleBinding.Name - if name == nil { - return nil, fmt.Errorf("roleBinding.Name must be provided to Apply") - } - result = &v1alpha1.RoleBinding{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("rolebindings"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/rbac/v1beta1/clusterrole.go b/kubernetes/typed/rbac/v1beta1/clusterrole.go index 3df9c1c65e..ed398333a1 100644 --- a/kubernetes/typed/rbac/v1beta1/clusterrole.go +++ b/kubernetes/typed/rbac/v1beta1/clusterrole.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ClusterRolesGetter has a method to return a ClusterRoleInterface. @@ -58,178 +52,18 @@ type ClusterRoleInterface interface { // clusterRoles implements ClusterRoleInterface type clusterRoles struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1beta1.ClusterRole, *v1beta1.ClusterRoleList, *rbacv1beta1.ClusterRoleApplyConfiguration] } // newClusterRoles returns a ClusterRoles func newClusterRoles(c *RbacV1beta1Client) *clusterRoles { return &clusterRoles{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1beta1.ClusterRole, *v1beta1.ClusterRoleList, *rbacv1beta1.ClusterRoleApplyConfiguration]( + "clusterroles", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.ClusterRole { return &v1beta1.ClusterRole{} }, + func() *v1beta1.ClusterRoleList { return &v1beta1.ClusterRoleList{} }), } } - -// Get takes name of the clusterRole, and returns the corresponding clusterRole object, and an error if there is any. -func (c *clusterRoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterRole, err error) { - result = &v1beta1.ClusterRole{} - err = c.client.Get(). - Resource("clusterroles"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. -func (c *clusterRoles) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterRoleList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for clusterroles, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for clusterroles", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for clusterroles ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterroles", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ClusterRoles that match those selectors. -func (c *clusterRoles) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ClusterRoleList{} - err = c.client.Get(). - Resource("clusterroles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ClusterRoles -func (c *clusterRoles) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ClusterRoleList{} - err = c.client.Get(). - Resource("clusterroles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterRoles. -func (c *clusterRoles) 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("clusterroles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a clusterRole and creates it. Returns the server's representation of the clusterRole, and an error, if there is any. -func (c *clusterRoles) Create(ctx context.Context, clusterRole *v1beta1.ClusterRole, opts v1.CreateOptions) (result *v1beta1.ClusterRole, err error) { - result = &v1beta1.ClusterRole{} - err = c.client.Post(). - Resource("clusterroles"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterRole). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a clusterRole and updates it. Returns the server's representation of the clusterRole, and an error, if there is any. -func (c *clusterRoles) Update(ctx context.Context, clusterRole *v1beta1.ClusterRole, opts v1.UpdateOptions) (result *v1beta1.ClusterRole, err error) { - result = &v1beta1.ClusterRole{} - err = c.client.Put(). - Resource("clusterroles"). - Name(clusterRole.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterRole). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the clusterRole and deletes it. Returns an error if one occurs. -func (c *clusterRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("clusterroles"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterRoles) 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("clusterroles"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched clusterRole. -func (c *clusterRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterRole, err error) { - result = &v1beta1.ClusterRole{} - err = c.client.Patch(pt). - Resource("clusterroles"). - 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 clusterRole. -func (c *clusterRoles) Apply(ctx context.Context, clusterRole *rbacv1beta1.ClusterRoleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ClusterRole, err error) { - if clusterRole == nil { - return nil, fmt.Errorf("clusterRole provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(clusterRole) - if err != nil { - return nil, err - } - name := clusterRole.Name - if name == nil { - return nil, fmt.Errorf("clusterRole.Name must be provided to Apply") - } - result = &v1beta1.ClusterRole{} - err = c.client.Patch(types.ApplyPatchType). - Resource("clusterroles"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go b/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go index 0820a7bcdf..3010a99ae2 100644 --- a/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go +++ b/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ClusterRoleBindingsGetter has a method to return a ClusterRoleBindingInterface. @@ -58,178 +52,18 @@ type ClusterRoleBindingInterface interface { // clusterRoleBindings implements ClusterRoleBindingInterface type clusterRoleBindings struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1beta1.ClusterRoleBinding, *v1beta1.ClusterRoleBindingList, *rbacv1beta1.ClusterRoleBindingApplyConfiguration] } // newClusterRoleBindings returns a ClusterRoleBindings func newClusterRoleBindings(c *RbacV1beta1Client) *clusterRoleBindings { return &clusterRoleBindings{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1beta1.ClusterRoleBinding, *v1beta1.ClusterRoleBindingList, *rbacv1beta1.ClusterRoleBindingApplyConfiguration]( + "clusterrolebindings", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.ClusterRoleBinding { return &v1beta1.ClusterRoleBinding{} }, + func() *v1beta1.ClusterRoleBindingList { return &v1beta1.ClusterRoleBindingList{} }), } } - -// Get takes name of the clusterRoleBinding, and returns the corresponding clusterRoleBinding object, and an error if there is any. -func (c *clusterRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterRoleBinding, err error) { - result = &v1beta1.ClusterRoleBinding{} - err = c.client.Get(). - Resource("clusterrolebindings"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. -func (c *clusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterRoleBindingList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for clusterrolebindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for clusterrolebindings", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for clusterrolebindings ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for clusterrolebindings", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. -func (c *clusterRoleBindings) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ClusterRoleBindingList{} - err = c.client.Get(). - Resource("clusterrolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ClusterRoleBindings -func (c *clusterRoleBindings) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.ClusterRoleBindingList{} - err = c.client.Get(). - Resource("clusterrolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterRoleBindings. -func (c *clusterRoleBindings) 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("clusterrolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a clusterRoleBinding and creates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. -func (c *clusterRoleBindings) Create(ctx context.Context, clusterRoleBinding *v1beta1.ClusterRoleBinding, opts v1.CreateOptions) (result *v1beta1.ClusterRoleBinding, err error) { - result = &v1beta1.ClusterRoleBinding{} - err = c.client.Post(). - Resource("clusterrolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterRoleBinding). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a clusterRoleBinding and updates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. -func (c *clusterRoleBindings) Update(ctx context.Context, clusterRoleBinding *v1beta1.ClusterRoleBinding, opts v1.UpdateOptions) (result *v1beta1.ClusterRoleBinding, err error) { - result = &v1beta1.ClusterRoleBinding{} - err = c.client.Put(). - Resource("clusterrolebindings"). - Name(clusterRoleBinding.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterRoleBinding). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the clusterRoleBinding and deletes it. Returns an error if one occurs. -func (c *clusterRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("clusterrolebindings"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterRoleBindings) 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("clusterrolebindings"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched clusterRoleBinding. -func (c *clusterRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterRoleBinding, err error) { - result = &v1beta1.ClusterRoleBinding{} - err = c.client.Patch(pt). - Resource("clusterrolebindings"). - 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 clusterRoleBinding. -func (c *clusterRoleBindings) Apply(ctx context.Context, clusterRoleBinding *rbacv1beta1.ClusterRoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ClusterRoleBinding, err error) { - if clusterRoleBinding == nil { - return nil, fmt.Errorf("clusterRoleBinding provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(clusterRoleBinding) - if err != nil { - return nil, err - } - name := clusterRoleBinding.Name - if name == nil { - return nil, fmt.Errorf("clusterRoleBinding.Name must be provided to Apply") - } - result = &v1beta1.ClusterRoleBinding{} - err = c.client.Patch(types.ApplyPatchType). - Resource("clusterrolebindings"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/rbac/v1beta1/role.go b/kubernetes/typed/rbac/v1beta1/role.go index a2e9cbb97a..92e51da1b1 100644 --- a/kubernetes/typed/rbac/v1beta1/role.go +++ b/kubernetes/typed/rbac/v1beta1/role.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // RolesGetter has a method to return a RoleInterface. @@ -58,190 +52,18 @@ type RoleInterface interface { // roles implements RoleInterface type roles struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta1.Role, *v1beta1.RoleList, *rbacv1beta1.RoleApplyConfiguration] } // newRoles returns a Roles func newRoles(c *RbacV1beta1Client, namespace string) *roles { return &roles{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta1.Role, *v1beta1.RoleList, *rbacv1beta1.RoleApplyConfiguration]( + "roles", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.Role { return &v1beta1.Role{} }, + func() *v1beta1.RoleList { return &v1beta1.RoleList{} }), } } - -// Get takes name of the role, and returns the corresponding role object, and an error if there is any. -func (c *roles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Role, err error) { - result = &v1beta1.Role{} - err = c.client.Get(). - Namespace(c.ns). - Resource("roles"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Roles that match those selectors. -func (c *roles) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RoleList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for roles, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for roles", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for roles ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for roles", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of Roles that match those selectors. -func (c *roles) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.RoleList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("roles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of Roles -func (c *roles) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.RoleList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("roles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested roles. -func (c *roles) 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("roles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a role and creates it. Returns the server's representation of the role, and an error, if there is any. -func (c *roles) Create(ctx context.Context, role *v1beta1.Role, opts v1.CreateOptions) (result *v1beta1.Role, err error) { - result = &v1beta1.Role{} - err = c.client.Post(). - Namespace(c.ns). - Resource("roles"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(role). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a role and updates it. Returns the server's representation of the role, and an error, if there is any. -func (c *roles) Update(ctx context.Context, role *v1beta1.Role, opts v1.UpdateOptions) (result *v1beta1.Role, err error) { - result = &v1beta1.Role{} - err = c.client.Put(). - Namespace(c.ns). - Resource("roles"). - Name(role.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(role). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the role and deletes it. Returns an error if one occurs. -func (c *roles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("roles"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *roles) 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("roles"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched role. -func (c *roles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Role, err error) { - result = &v1beta1.Role{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("roles"). - 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 role. -func (c *roles) Apply(ctx context.Context, role *rbacv1beta1.RoleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Role, err error) { - if role == nil { - return nil, fmt.Errorf("role provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(role) - if err != nil { - return nil, err - } - name := role.Name - if name == nil { - return nil, fmt.Errorf("role.Name must be provided to Apply") - } - result = &v1beta1.Role{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("roles"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/rbac/v1beta1/rolebinding.go b/kubernetes/typed/rbac/v1beta1/rolebinding.go index f44cc4a6c6..ad31bd051a 100644 --- a/kubernetes/typed/rbac/v1beta1/rolebinding.go +++ b/kubernetes/typed/rbac/v1beta1/rolebinding.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/rbac/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // RoleBindingsGetter has a method to return a RoleBindingInterface. @@ -58,190 +52,18 @@ type RoleBindingInterface interface { // roleBindings implements RoleBindingInterface type roleBindings struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta1.RoleBinding, *v1beta1.RoleBindingList, *rbacv1beta1.RoleBindingApplyConfiguration] } // newRoleBindings returns a RoleBindings func newRoleBindings(c *RbacV1beta1Client, namespace string) *roleBindings { return &roleBindings{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta1.RoleBinding, *v1beta1.RoleBindingList, *rbacv1beta1.RoleBindingApplyConfiguration]( + "rolebindings", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.RoleBinding { return &v1beta1.RoleBinding{} }, + func() *v1beta1.RoleBindingList { return &v1beta1.RoleBindingList{} }), } } - -// Get takes name of the roleBinding, and returns the corresponding roleBinding object, and an error if there is any. -func (c *roleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.RoleBinding, err error) { - result = &v1beta1.RoleBinding{} - err = c.client.Get(). - Namespace(c.ns). - Resource("rolebindings"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of RoleBindings that match those selectors. -func (c *roleBindings) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RoleBindingList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for rolebindings, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for rolebindings", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for rolebindings ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for rolebindings", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of RoleBindings that match those selectors. -func (c *roleBindings) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.RoleBindingList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("rolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of RoleBindings -func (c *roleBindings) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleBindingList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.RoleBindingList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("rolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested roleBindings. -func (c *roleBindings) 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("rolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a roleBinding and creates it. Returns the server's representation of the roleBinding, and an error, if there is any. -func (c *roleBindings) Create(ctx context.Context, roleBinding *v1beta1.RoleBinding, opts v1.CreateOptions) (result *v1beta1.RoleBinding, err error) { - result = &v1beta1.RoleBinding{} - err = c.client.Post(). - Namespace(c.ns). - Resource("rolebindings"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(roleBinding). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a roleBinding and updates it. Returns the server's representation of the roleBinding, and an error, if there is any. -func (c *roleBindings) Update(ctx context.Context, roleBinding *v1beta1.RoleBinding, opts v1.UpdateOptions) (result *v1beta1.RoleBinding, err error) { - result = &v1beta1.RoleBinding{} - err = c.client.Put(). - Namespace(c.ns). - Resource("rolebindings"). - Name(roleBinding.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(roleBinding). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the roleBinding and deletes it. Returns an error if one occurs. -func (c *roleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("rolebindings"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *roleBindings) 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("rolebindings"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched roleBinding. -func (c *roleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.RoleBinding, err error) { - result = &v1beta1.RoleBinding{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("rolebindings"). - 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 roleBinding. -func (c *roleBindings) Apply(ctx context.Context, roleBinding *rbacv1beta1.RoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.RoleBinding, err error) { - if roleBinding == nil { - return nil, fmt.Errorf("roleBinding provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(roleBinding) - if err != nil { - return nil, err - } - name := roleBinding.Name - if name == nil { - return nil, fmt.Errorf("roleBinding.Name must be provided to Apply") - } - result = &v1beta1.RoleBinding{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("rolebindings"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/resource/v1alpha2/podschedulingcontext.go b/kubernetes/typed/resource/v1alpha2/podschedulingcontext.go index 260d4318fe..0ffdc15013 100644 --- a/kubernetes/typed/resource/v1alpha2/podschedulingcontext.go +++ b/kubernetes/typed/resource/v1alpha2/podschedulingcontext.go @@ -20,20 +20,14 @@ package v1alpha2 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha2 "k8s.io/api/resource/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // PodSchedulingContextsGetter has a method to return a PodSchedulingContextInterface. @@ -46,6 +40,7 @@ type PodSchedulingContextsGetter interface { type PodSchedulingContextInterface interface { Create(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.CreateOptions) (*v1alpha2.PodSchedulingContext, error) Update(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.UpdateOptions) (*v1alpha2.PodSchedulingContext, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.UpdateOptions) (*v1alpha2.PodSchedulingContext, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,242 +49,25 @@ type PodSchedulingContextInterface 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 *v1alpha2.PodSchedulingContext, err error) Apply(ctx context.Context, podSchedulingContext *resourcev1alpha2.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.PodSchedulingContext, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, podSchedulingContext *resourcev1alpha2.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.PodSchedulingContext, err error) PodSchedulingContextExpansion } // podSchedulingContexts implements PodSchedulingContextInterface type podSchedulingContexts struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha2.PodSchedulingContext, *v1alpha2.PodSchedulingContextList, *resourcev1alpha2.PodSchedulingContextApplyConfiguration] } // newPodSchedulingContexts returns a PodSchedulingContexts func newPodSchedulingContexts(c *ResourceV1alpha2Client, namespace string) *podSchedulingContexts { return &podSchedulingContexts{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha2.PodSchedulingContext, *v1alpha2.PodSchedulingContextList, *resourcev1alpha2.PodSchedulingContextApplyConfiguration]( + "podschedulingcontexts", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha2.PodSchedulingContext { return &v1alpha2.PodSchedulingContext{} }, + func() *v1alpha2.PodSchedulingContextList { return &v1alpha2.PodSchedulingContextList{} }), } } - -// Get takes name of the podSchedulingContext, and returns the corresponding podSchedulingContext object, and an error if there is any. -func (c *podSchedulingContexts) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.PodSchedulingContext, err error) { - result = &v1alpha2.PodSchedulingContext{} - err = c.client.Get(). - Namespace(c.ns). - Resource("podschedulingcontexts"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PodSchedulingContexts that match those selectors. -func (c *podSchedulingContexts) List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.PodSchedulingContextList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for podschedulingcontexts, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for podschedulingcontexts", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for podschedulingcontexts ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for podschedulingcontexts", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of PodSchedulingContexts that match those selectors. -func (c *podSchedulingContexts) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.PodSchedulingContextList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.PodSchedulingContextList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("podschedulingcontexts"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of PodSchedulingContexts -func (c *podSchedulingContexts) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.PodSchedulingContextList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.PodSchedulingContextList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("podschedulingcontexts"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested podSchedulingContexts. -func (c *podSchedulingContexts) 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("podschedulingcontexts"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a podSchedulingContext and creates it. Returns the server's representation of the podSchedulingContext, and an error, if there is any. -func (c *podSchedulingContexts) Create(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.CreateOptions) (result *v1alpha2.PodSchedulingContext, err error) { - result = &v1alpha2.PodSchedulingContext{} - err = c.client.Post(). - Namespace(c.ns). - Resource("podschedulingcontexts"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(podSchedulingContext). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a podSchedulingContext and updates it. Returns the server's representation of the podSchedulingContext, and an error, if there is any. -func (c *podSchedulingContexts) Update(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.UpdateOptions) (result *v1alpha2.PodSchedulingContext, err error) { - result = &v1alpha2.PodSchedulingContext{} - err = c.client.Put(). - Namespace(c.ns). - Resource("podschedulingcontexts"). - Name(podSchedulingContext.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(podSchedulingContext). - 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 *podSchedulingContexts) UpdateStatus(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.UpdateOptions) (result *v1alpha2.PodSchedulingContext, err error) { - result = &v1alpha2.PodSchedulingContext{} - err = c.client.Put(). - Namespace(c.ns). - Resource("podschedulingcontexts"). - Name(podSchedulingContext.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(podSchedulingContext). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the podSchedulingContext and deletes it. Returns an error if one occurs. -func (c *podSchedulingContexts) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("podschedulingcontexts"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *podSchedulingContexts) 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("podschedulingcontexts"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched podSchedulingContext. -func (c *podSchedulingContexts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.PodSchedulingContext, err error) { - result = &v1alpha2.PodSchedulingContext{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("podschedulingcontexts"). - 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 podSchedulingContext. -func (c *podSchedulingContexts) Apply(ctx context.Context, podSchedulingContext *resourcev1alpha2.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.PodSchedulingContext, err error) { - if podSchedulingContext == nil { - return nil, fmt.Errorf("podSchedulingContext provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(podSchedulingContext) - if err != nil { - return nil, err - } - name := podSchedulingContext.Name - if name == nil { - return nil, fmt.Errorf("podSchedulingContext.Name must be provided to Apply") - } - result = &v1alpha2.PodSchedulingContext{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("podschedulingcontexts"). - 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 *podSchedulingContexts) ApplyStatus(ctx context.Context, podSchedulingContext *resourcev1alpha2.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.PodSchedulingContext, err error) { - if podSchedulingContext == nil { - return nil, fmt.Errorf("podSchedulingContext provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(podSchedulingContext) - if err != nil { - return nil, err - } - - name := podSchedulingContext.Name - if name == nil { - return nil, fmt.Errorf("podSchedulingContext.Name must be provided to Apply") - } - - result = &v1alpha2.PodSchedulingContext{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("podschedulingcontexts"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/resource/v1alpha2/resourceclaim.go b/kubernetes/typed/resource/v1alpha2/resourceclaim.go index 4fb2de3dc0..0f81e5008c 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceclaim.go +++ b/kubernetes/typed/resource/v1alpha2/resourceclaim.go @@ -20,20 +20,14 @@ package v1alpha2 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha2 "k8s.io/api/resource/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ResourceClaimsGetter has a method to return a ResourceClaimInterface. @@ -46,6 +40,7 @@ type ResourceClaimsGetter interface { type ResourceClaimInterface interface { Create(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.CreateOptions) (*v1alpha2.ResourceClaim, error) Update(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.UpdateOptions) (*v1alpha2.ResourceClaim, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.UpdateOptions) (*v1alpha2.ResourceClaim, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,242 +49,25 @@ type ResourceClaimInterface 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 *v1alpha2.ResourceClaim, err error) Apply(ctx context.Context, resourceClaim *resourcev1alpha2.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClaim, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, resourceClaim *resourcev1alpha2.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClaim, err error) ResourceClaimExpansion } // resourceClaims implements ResourceClaimInterface type resourceClaims struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha2.ResourceClaim, *v1alpha2.ResourceClaimList, *resourcev1alpha2.ResourceClaimApplyConfiguration] } // newResourceClaims returns a ResourceClaims func newResourceClaims(c *ResourceV1alpha2Client, namespace string) *resourceClaims { return &resourceClaims{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha2.ResourceClaim, *v1alpha2.ResourceClaimList, *resourcev1alpha2.ResourceClaimApplyConfiguration]( + "resourceclaims", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha2.ResourceClaim { return &v1alpha2.ResourceClaim{} }, + func() *v1alpha2.ResourceClaimList { return &v1alpha2.ResourceClaimList{} }), } } - -// Get takes name of the resourceClaim, and returns the corresponding resourceClaim object, and an error if there is any. -func (c *resourceClaims) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClaim, err error) { - result = &v1alpha2.ResourceClaim{} - err = c.client.Get(). - Namespace(c.ns). - Resource("resourceclaims"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ResourceClaims that match those selectors. -func (c *resourceClaims) List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClaimList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for resourceclaims, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for resourceclaims", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for resourceclaims ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclaims", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ResourceClaims that match those selectors. -func (c *resourceClaims) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.ResourceClaimList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("resourceclaims"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ResourceClaims -func (c *resourceClaims) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.ResourceClaimList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("resourceclaims"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested resourceClaims. -func (c *resourceClaims) 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("resourceclaims"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a resourceClaim and creates it. Returns the server's representation of the resourceClaim, and an error, if there is any. -func (c *resourceClaims) Create(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.CreateOptions) (result *v1alpha2.ResourceClaim, err error) { - result = &v1alpha2.ResourceClaim{} - err = c.client.Post(). - Namespace(c.ns). - Resource("resourceclaims"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceClaim). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a resourceClaim and updates it. Returns the server's representation of the resourceClaim, and an error, if there is any. -func (c *resourceClaims) Update(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.UpdateOptions) (result *v1alpha2.ResourceClaim, err error) { - result = &v1alpha2.ResourceClaim{} - err = c.client.Put(). - Namespace(c.ns). - Resource("resourceclaims"). - Name(resourceClaim.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceClaim). - 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 *resourceClaims) UpdateStatus(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.UpdateOptions) (result *v1alpha2.ResourceClaim, err error) { - result = &v1alpha2.ResourceClaim{} - err = c.client.Put(). - Namespace(c.ns). - Resource("resourceclaims"). - Name(resourceClaim.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceClaim). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the resourceClaim and deletes it. Returns an error if one occurs. -func (c *resourceClaims) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("resourceclaims"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *resourceClaims) 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("resourceclaims"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched resourceClaim. -func (c *resourceClaims) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClaim, err error) { - result = &v1alpha2.ResourceClaim{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("resourceclaims"). - 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 resourceClaim. -func (c *resourceClaims) Apply(ctx context.Context, resourceClaim *resourcev1alpha2.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClaim, err error) { - if resourceClaim == nil { - return nil, fmt.Errorf("resourceClaim provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(resourceClaim) - if err != nil { - return nil, err - } - name := resourceClaim.Name - if name == nil { - return nil, fmt.Errorf("resourceClaim.Name must be provided to Apply") - } - result = &v1alpha2.ResourceClaim{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("resourceclaims"). - 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 *resourceClaims) ApplyStatus(ctx context.Context, resourceClaim *resourcev1alpha2.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClaim, err error) { - if resourceClaim == nil { - return nil, fmt.Errorf("resourceClaim provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(resourceClaim) - if err != nil { - return nil, err - } - - name := resourceClaim.Name - if name == nil { - return nil, fmt.Errorf("resourceClaim.Name must be provided to Apply") - } - - result = &v1alpha2.ResourceClaim{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("resourceclaims"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go b/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go index c1a733e17f..e3fb474cd0 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go +++ b/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go @@ -20,20 +20,14 @@ package v1alpha2 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha2 "k8s.io/api/resource/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ResourceClaimParametersGetter has a method to return a ResourceClaimParametersInterface. @@ -58,190 +52,18 @@ type ResourceClaimParametersInterface interface { // resourceClaimParameters implements ResourceClaimParametersInterface type resourceClaimParameters struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha2.ResourceClaimParameters, *v1alpha2.ResourceClaimParametersList, *resourcev1alpha2.ResourceClaimParametersApplyConfiguration] } // newResourceClaimParameters returns a ResourceClaimParameters func newResourceClaimParameters(c *ResourceV1alpha2Client, namespace string) *resourceClaimParameters { return &resourceClaimParameters{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha2.ResourceClaimParameters, *v1alpha2.ResourceClaimParametersList, *resourcev1alpha2.ResourceClaimParametersApplyConfiguration]( + "resourceclaimparameters", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha2.ResourceClaimParameters { return &v1alpha2.ResourceClaimParameters{} }, + func() *v1alpha2.ResourceClaimParametersList { return &v1alpha2.ResourceClaimParametersList{} }), } } - -// Get takes name of the resourceClaimParameters, and returns the corresponding resourceClaimParameters object, and an error if there is any. -func (c *resourceClaimParameters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClaimParameters, err error) { - result = &v1alpha2.ResourceClaimParameters{} - err = c.client.Get(). - Namespace(c.ns). - Resource("resourceclaimparameters"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ResourceClaimParameters that match those selectors. -func (c *resourceClaimParameters) List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClaimParametersList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for resourceclaimparameters, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for resourceclaimparameters", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for resourceclaimparameters ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclaimparameters", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ResourceClaimParameters that match those selectors. -func (c *resourceClaimParameters) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimParametersList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.ResourceClaimParametersList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("resourceclaimparameters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ResourceClaimParameters -func (c *resourceClaimParameters) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimParametersList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.ResourceClaimParametersList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("resourceclaimparameters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested resourceClaimParameters. -func (c *resourceClaimParameters) 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("resourceclaimparameters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a resourceClaimParameters and creates it. Returns the server's representation of the resourceClaimParameters, and an error, if there is any. -func (c *resourceClaimParameters) Create(ctx context.Context, resourceClaimParameters *v1alpha2.ResourceClaimParameters, opts v1.CreateOptions) (result *v1alpha2.ResourceClaimParameters, err error) { - result = &v1alpha2.ResourceClaimParameters{} - err = c.client.Post(). - Namespace(c.ns). - Resource("resourceclaimparameters"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceClaimParameters). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a resourceClaimParameters and updates it. Returns the server's representation of the resourceClaimParameters, and an error, if there is any. -func (c *resourceClaimParameters) Update(ctx context.Context, resourceClaimParameters *v1alpha2.ResourceClaimParameters, opts v1.UpdateOptions) (result *v1alpha2.ResourceClaimParameters, err error) { - result = &v1alpha2.ResourceClaimParameters{} - err = c.client.Put(). - Namespace(c.ns). - Resource("resourceclaimparameters"). - Name(resourceClaimParameters.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceClaimParameters). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the resourceClaimParameters and deletes it. Returns an error if one occurs. -func (c *resourceClaimParameters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("resourceclaimparameters"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *resourceClaimParameters) 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("resourceclaimparameters"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched resourceClaimParameters. -func (c *resourceClaimParameters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClaimParameters, err error) { - result = &v1alpha2.ResourceClaimParameters{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("resourceclaimparameters"). - 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 resourceClaimParameters. -func (c *resourceClaimParameters) Apply(ctx context.Context, resourceClaimParameters *resourcev1alpha2.ResourceClaimParametersApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClaimParameters, err error) { - if resourceClaimParameters == nil { - return nil, fmt.Errorf("resourceClaimParameters provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(resourceClaimParameters) - if err != nil { - return nil, err - } - name := resourceClaimParameters.Name - if name == nil { - return nil, fmt.Errorf("resourceClaimParameters.Name must be provided to Apply") - } - result = &v1alpha2.ResourceClaimParameters{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("resourceclaimparameters"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/resource/v1alpha2/resourceclaimtemplate.go b/kubernetes/typed/resource/v1alpha2/resourceclaimtemplate.go index 6257b6a4c4..3b6451a9a6 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceclaimtemplate.go +++ b/kubernetes/typed/resource/v1alpha2/resourceclaimtemplate.go @@ -20,20 +20,14 @@ package v1alpha2 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha2 "k8s.io/api/resource/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ResourceClaimTemplatesGetter has a method to return a ResourceClaimTemplateInterface. @@ -58,190 +52,18 @@ type ResourceClaimTemplateInterface interface { // resourceClaimTemplates implements ResourceClaimTemplateInterface type resourceClaimTemplates struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha2.ResourceClaimTemplate, *v1alpha2.ResourceClaimTemplateList, *resourcev1alpha2.ResourceClaimTemplateApplyConfiguration] } // newResourceClaimTemplates returns a ResourceClaimTemplates func newResourceClaimTemplates(c *ResourceV1alpha2Client, namespace string) *resourceClaimTemplates { return &resourceClaimTemplates{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha2.ResourceClaimTemplate, *v1alpha2.ResourceClaimTemplateList, *resourcev1alpha2.ResourceClaimTemplateApplyConfiguration]( + "resourceclaimtemplates", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha2.ResourceClaimTemplate { return &v1alpha2.ResourceClaimTemplate{} }, + func() *v1alpha2.ResourceClaimTemplateList { return &v1alpha2.ResourceClaimTemplateList{} }), } } - -// Get takes name of the resourceClaimTemplate, and returns the corresponding resourceClaimTemplate object, and an error if there is any. -func (c *resourceClaimTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClaimTemplate, err error) { - result = &v1alpha2.ResourceClaimTemplate{} - err = c.client.Get(). - Namespace(c.ns). - Resource("resourceclaimtemplates"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ResourceClaimTemplates that match those selectors. -func (c *resourceClaimTemplates) List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClaimTemplateList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for resourceclaimtemplates, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for resourceclaimtemplates", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for resourceclaimtemplates ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclaimtemplates", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ResourceClaimTemplates that match those selectors. -func (c *resourceClaimTemplates) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimTemplateList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.ResourceClaimTemplateList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("resourceclaimtemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ResourceClaimTemplates -func (c *resourceClaimTemplates) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimTemplateList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.ResourceClaimTemplateList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("resourceclaimtemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested resourceClaimTemplates. -func (c *resourceClaimTemplates) 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("resourceclaimtemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a resourceClaimTemplate and creates it. Returns the server's representation of the resourceClaimTemplate, and an error, if there is any. -func (c *resourceClaimTemplates) Create(ctx context.Context, resourceClaimTemplate *v1alpha2.ResourceClaimTemplate, opts v1.CreateOptions) (result *v1alpha2.ResourceClaimTemplate, err error) { - result = &v1alpha2.ResourceClaimTemplate{} - err = c.client.Post(). - Namespace(c.ns). - Resource("resourceclaimtemplates"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceClaimTemplate). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a resourceClaimTemplate and updates it. Returns the server's representation of the resourceClaimTemplate, and an error, if there is any. -func (c *resourceClaimTemplates) Update(ctx context.Context, resourceClaimTemplate *v1alpha2.ResourceClaimTemplate, opts v1.UpdateOptions) (result *v1alpha2.ResourceClaimTemplate, err error) { - result = &v1alpha2.ResourceClaimTemplate{} - err = c.client.Put(). - Namespace(c.ns). - Resource("resourceclaimtemplates"). - Name(resourceClaimTemplate.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceClaimTemplate). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the resourceClaimTemplate and deletes it. Returns an error if one occurs. -func (c *resourceClaimTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("resourceclaimtemplates"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *resourceClaimTemplates) 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("resourceclaimtemplates"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched resourceClaimTemplate. -func (c *resourceClaimTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClaimTemplate, err error) { - result = &v1alpha2.ResourceClaimTemplate{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("resourceclaimtemplates"). - 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 resourceClaimTemplate. -func (c *resourceClaimTemplates) Apply(ctx context.Context, resourceClaimTemplate *resourcev1alpha2.ResourceClaimTemplateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClaimTemplate, err error) { - if resourceClaimTemplate == nil { - return nil, fmt.Errorf("resourceClaimTemplate provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(resourceClaimTemplate) - if err != nil { - return nil, err - } - name := resourceClaimTemplate.Name - if name == nil { - return nil, fmt.Errorf("resourceClaimTemplate.Name must be provided to Apply") - } - result = &v1alpha2.ResourceClaimTemplate{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("resourceclaimtemplates"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/resource/v1alpha2/resourceclass.go b/kubernetes/typed/resource/v1alpha2/resourceclass.go index 0990fcb906..c4600d3475 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceclass.go +++ b/kubernetes/typed/resource/v1alpha2/resourceclass.go @@ -20,20 +20,14 @@ package v1alpha2 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha2 "k8s.io/api/resource/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ResourceClassesGetter has a method to return a ResourceClassInterface. @@ -58,178 +52,18 @@ type ResourceClassInterface interface { // resourceClasses implements ResourceClassInterface type resourceClasses struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha2.ResourceClass, *v1alpha2.ResourceClassList, *resourcev1alpha2.ResourceClassApplyConfiguration] } // newResourceClasses returns a ResourceClasses func newResourceClasses(c *ResourceV1alpha2Client) *resourceClasses { return &resourceClasses{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha2.ResourceClass, *v1alpha2.ResourceClassList, *resourcev1alpha2.ResourceClassApplyConfiguration]( + "resourceclasses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha2.ResourceClass { return &v1alpha2.ResourceClass{} }, + func() *v1alpha2.ResourceClassList { return &v1alpha2.ResourceClassList{} }), } } - -// Get takes name of the resourceClass, and returns the corresponding resourceClass object, and an error if there is any. -func (c *resourceClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClass, err error) { - result = &v1alpha2.ResourceClass{} - err = c.client.Get(). - Resource("resourceclasses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ResourceClasses that match those selectors. -func (c *resourceClasses) List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClassList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for resourceclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for resourceclasses", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for resourceclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclasses", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ResourceClasses that match those selectors. -func (c *resourceClasses) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.ResourceClassList{} - err = c.client.Get(). - Resource("resourceclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ResourceClasses -func (c *resourceClasses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.ResourceClassList{} - err = c.client.Get(). - Resource("resourceclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested resourceClasses. -func (c *resourceClasses) 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("resourceclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a resourceClass and creates it. Returns the server's representation of the resourceClass, and an error, if there is any. -func (c *resourceClasses) Create(ctx context.Context, resourceClass *v1alpha2.ResourceClass, opts v1.CreateOptions) (result *v1alpha2.ResourceClass, err error) { - result = &v1alpha2.ResourceClass{} - err = c.client.Post(). - Resource("resourceclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceClass). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a resourceClass and updates it. Returns the server's representation of the resourceClass, and an error, if there is any. -func (c *resourceClasses) Update(ctx context.Context, resourceClass *v1alpha2.ResourceClass, opts v1.UpdateOptions) (result *v1alpha2.ResourceClass, err error) { - result = &v1alpha2.ResourceClass{} - err = c.client.Put(). - Resource("resourceclasses"). - Name(resourceClass.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceClass). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the resourceClass and deletes it. Returns an error if one occurs. -func (c *resourceClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("resourceclasses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *resourceClasses) 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("resourceclasses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched resourceClass. -func (c *resourceClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClass, err error) { - result = &v1alpha2.ResourceClass{} - err = c.client.Patch(pt). - Resource("resourceclasses"). - 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 resourceClass. -func (c *resourceClasses) Apply(ctx context.Context, resourceClass *resourcev1alpha2.ResourceClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClass, err error) { - if resourceClass == nil { - return nil, fmt.Errorf("resourceClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(resourceClass) - if err != nil { - return nil, err - } - name := resourceClass.Name - if name == nil { - return nil, fmt.Errorf("resourceClass.Name must be provided to Apply") - } - result = &v1alpha2.ResourceClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("resourceclasses"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go b/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go index cedf4300c8..e7cdddce4d 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go +++ b/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go @@ -20,20 +20,14 @@ package v1alpha2 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha2 "k8s.io/api/resource/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ResourceClassParametersGetter has a method to return a ResourceClassParametersInterface. @@ -58,190 +52,18 @@ type ResourceClassParametersInterface interface { // resourceClassParameters implements ResourceClassParametersInterface type resourceClassParameters struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha2.ResourceClassParameters, *v1alpha2.ResourceClassParametersList, *resourcev1alpha2.ResourceClassParametersApplyConfiguration] } // newResourceClassParameters returns a ResourceClassParameters func newResourceClassParameters(c *ResourceV1alpha2Client, namespace string) *resourceClassParameters { return &resourceClassParameters{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha2.ResourceClassParameters, *v1alpha2.ResourceClassParametersList, *resourcev1alpha2.ResourceClassParametersApplyConfiguration]( + "resourceclassparameters", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha2.ResourceClassParameters { return &v1alpha2.ResourceClassParameters{} }, + func() *v1alpha2.ResourceClassParametersList { return &v1alpha2.ResourceClassParametersList{} }), } } - -// Get takes name of the resourceClassParameters, and returns the corresponding resourceClassParameters object, and an error if there is any. -func (c *resourceClassParameters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClassParameters, err error) { - result = &v1alpha2.ResourceClassParameters{} - err = c.client.Get(). - Namespace(c.ns). - Resource("resourceclassparameters"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ResourceClassParameters that match those selectors. -func (c *resourceClassParameters) List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClassParametersList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for resourceclassparameters, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for resourceclassparameters", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for resourceclassparameters ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceclassparameters", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ResourceClassParameters that match those selectors. -func (c *resourceClassParameters) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassParametersList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.ResourceClassParametersList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("resourceclassparameters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ResourceClassParameters -func (c *resourceClassParameters) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassParametersList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.ResourceClassParametersList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("resourceclassparameters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested resourceClassParameters. -func (c *resourceClassParameters) 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("resourceclassparameters"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a resourceClassParameters and creates it. Returns the server's representation of the resourceClassParameters, and an error, if there is any. -func (c *resourceClassParameters) Create(ctx context.Context, resourceClassParameters *v1alpha2.ResourceClassParameters, opts v1.CreateOptions) (result *v1alpha2.ResourceClassParameters, err error) { - result = &v1alpha2.ResourceClassParameters{} - err = c.client.Post(). - Namespace(c.ns). - Resource("resourceclassparameters"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceClassParameters). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a resourceClassParameters and updates it. Returns the server's representation of the resourceClassParameters, and an error, if there is any. -func (c *resourceClassParameters) Update(ctx context.Context, resourceClassParameters *v1alpha2.ResourceClassParameters, opts v1.UpdateOptions) (result *v1alpha2.ResourceClassParameters, err error) { - result = &v1alpha2.ResourceClassParameters{} - err = c.client.Put(). - Namespace(c.ns). - Resource("resourceclassparameters"). - Name(resourceClassParameters.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceClassParameters). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the resourceClassParameters and deletes it. Returns an error if one occurs. -func (c *resourceClassParameters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("resourceclassparameters"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *resourceClassParameters) 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("resourceclassparameters"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched resourceClassParameters. -func (c *resourceClassParameters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClassParameters, err error) { - result = &v1alpha2.ResourceClassParameters{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("resourceclassparameters"). - 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 resourceClassParameters. -func (c *resourceClassParameters) Apply(ctx context.Context, resourceClassParameters *resourcev1alpha2.ResourceClassParametersApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClassParameters, err error) { - if resourceClassParameters == nil { - return nil, fmt.Errorf("resourceClassParameters provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(resourceClassParameters) - if err != nil { - return nil, err - } - name := resourceClassParameters.Name - if name == nil { - return nil, fmt.Errorf("resourceClassParameters.Name must be provided to Apply") - } - result = &v1alpha2.ResourceClassParameters{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("resourceclassparameters"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/resource/v1alpha2/resourceslice.go b/kubernetes/typed/resource/v1alpha2/resourceslice.go index 9f6ce4322d..fafeab7061 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceslice.go +++ b/kubernetes/typed/resource/v1alpha2/resourceslice.go @@ -20,20 +20,14 @@ package v1alpha2 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha2 "k8s.io/api/resource/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // ResourceSlicesGetter has a method to return a ResourceSliceInterface. @@ -58,178 +52,18 @@ type ResourceSliceInterface interface { // resourceSlices implements ResourceSliceInterface type resourceSlices struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha2.ResourceSlice, *v1alpha2.ResourceSliceList, *resourcev1alpha2.ResourceSliceApplyConfiguration] } // newResourceSlices returns a ResourceSlices func newResourceSlices(c *ResourceV1alpha2Client) *resourceSlices { return &resourceSlices{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha2.ResourceSlice, *v1alpha2.ResourceSliceList, *resourcev1alpha2.ResourceSliceApplyConfiguration]( + "resourceslices", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha2.ResourceSlice { return &v1alpha2.ResourceSlice{} }, + func() *v1alpha2.ResourceSliceList { return &v1alpha2.ResourceSliceList{} }), } } - -// Get takes name of the resourceSlice, and returns the corresponding resourceSlice object, and an error if there is any. -func (c *resourceSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceSlice, err error) { - result = &v1alpha2.ResourceSlice{} - err = c.client.Get(). - Resource("resourceslices"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ResourceSlices that match those selectors. -func (c *resourceSlices) List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceSliceList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for resourceslices, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for resourceslices", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for resourceslices ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for resourceslices", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of ResourceSlices that match those selectors. -func (c *resourceSlices) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceSliceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.ResourceSliceList{} - err = c.client.Get(). - Resource("resourceslices"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of ResourceSlices -func (c *resourceSlices) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceSliceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha2.ResourceSliceList{} - err = c.client.Get(). - Resource("resourceslices"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested resourceSlices. -func (c *resourceSlices) 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("resourceslices"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a resourceSlice and creates it. Returns the server's representation of the resourceSlice, and an error, if there is any. -func (c *resourceSlices) Create(ctx context.Context, resourceSlice *v1alpha2.ResourceSlice, opts v1.CreateOptions) (result *v1alpha2.ResourceSlice, err error) { - result = &v1alpha2.ResourceSlice{} - err = c.client.Post(). - Resource("resourceslices"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceSlice). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a resourceSlice and updates it. Returns the server's representation of the resourceSlice, and an error, if there is any. -func (c *resourceSlices) Update(ctx context.Context, resourceSlice *v1alpha2.ResourceSlice, opts v1.UpdateOptions) (result *v1alpha2.ResourceSlice, err error) { - result = &v1alpha2.ResourceSlice{} - err = c.client.Put(). - Resource("resourceslices"). - Name(resourceSlice.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceSlice). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the resourceSlice and deletes it. Returns an error if one occurs. -func (c *resourceSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("resourceslices"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *resourceSlices) 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("resourceslices"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched resourceSlice. -func (c *resourceSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceSlice, err error) { - result = &v1alpha2.ResourceSlice{} - err = c.client.Patch(pt). - Resource("resourceslices"). - 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 resourceSlice. -func (c *resourceSlices) Apply(ctx context.Context, resourceSlice *resourcev1alpha2.ResourceSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceSlice, err error) { - if resourceSlice == nil { - return nil, fmt.Errorf("resourceSlice provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(resourceSlice) - if err != nil { - return nil, err - } - name := resourceSlice.Name - if name == nil { - return nil, fmt.Errorf("resourceSlice.Name must be provided to Apply") - } - result = &v1alpha2.ResourceSlice{} - err = c.client.Patch(types.ApplyPatchType). - Resource("resourceslices"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/scheduling/v1/priorityclass.go b/kubernetes/typed/scheduling/v1/priorityclass.go index ebc575e046..a28ef2fd4a 100644 --- a/kubernetes/typed/scheduling/v1/priorityclass.go +++ b/kubernetes/typed/scheduling/v1/priorityclass.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/scheduling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" schedulingv1 "k8s.io/client-go/applyconfigurations/scheduling/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // PriorityClassesGetter has a method to return a PriorityClassInterface. @@ -58,178 +52,18 @@ type PriorityClassInterface interface { // priorityClasses implements PriorityClassInterface type priorityClasses struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1.PriorityClass, *v1.PriorityClassList, *schedulingv1.PriorityClassApplyConfiguration] } // newPriorityClasses returns a PriorityClasses func newPriorityClasses(c *SchedulingV1Client) *priorityClasses { return &priorityClasses{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1.PriorityClass, *v1.PriorityClassList, *schedulingv1.PriorityClassApplyConfiguration]( + "priorityclasses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.PriorityClass { return &v1.PriorityClass{} }, + func() *v1.PriorityClassList { return &v1.PriorityClassList{} }), } } - -// Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any. -func (c *priorityClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PriorityClass, err error) { - result = &v1.PriorityClass{} - err = c.client.Get(). - Resource("priorityclasses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. -func (c *priorityClasses) List(ctx context.Context, opts metav1.ListOptions) (*v1.PriorityClassList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for priorityclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for priorityclasses", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for priorityclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for priorityclasses", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of PriorityClasses that match those selectors. -func (c *priorityClasses) list(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.PriorityClassList{} - err = c.client.Get(). - Resource("priorityclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of PriorityClasses -func (c *priorityClasses) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.PriorityClassList{} - err = c.client.Get(). - Resource("priorityclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested priorityClasses. -func (c *priorityClasses) Watch(ctx context.Context, opts metav1.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("priorityclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any. -func (c *priorityClasses) Create(ctx context.Context, priorityClass *v1.PriorityClass, opts metav1.CreateOptions) (result *v1.PriorityClass, err error) { - result = &v1.PriorityClass{} - err = c.client.Post(). - Resource("priorityclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(priorityClass). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any. -func (c *priorityClasses) Update(ctx context.Context, priorityClass *v1.PriorityClass, opts metav1.UpdateOptions) (result *v1.PriorityClass, err error) { - result = &v1.PriorityClass{} - err = c.client.Put(). - Resource("priorityclasses"). - Name(priorityClass.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(priorityClass). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the priorityClass and deletes it. Returns an error if one occurs. -func (c *priorityClasses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("priorityclasses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *priorityClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("priorityclasses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched priorityClass. -func (c *priorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityClass, err error) { - result = &v1.PriorityClass{} - err = c.client.Patch(pt). - Resource("priorityclasses"). - 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 priorityClass. -func (c *priorityClasses) Apply(ctx context.Context, priorityClass *schedulingv1.PriorityClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityClass, err error) { - if priorityClass == nil { - return nil, fmt.Errorf("priorityClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(priorityClass) - if err != nil { - return nil, err - } - name := priorityClass.Name - if name == nil { - return nil, fmt.Errorf("priorityClass.Name must be provided to Apply") - } - result = &v1.PriorityClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("priorityclasses"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/scheduling/v1alpha1/priorityclass.go b/kubernetes/typed/scheduling/v1alpha1/priorityclass.go index 605ae7706d..5c78f3de9f 100644 --- a/kubernetes/typed/scheduling/v1alpha1/priorityclass.go +++ b/kubernetes/typed/scheduling/v1alpha1/priorityclass.go @@ -20,20 +20,14 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "k8s.io/api/scheduling/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" schedulingv1alpha1 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // PriorityClassesGetter has a method to return a PriorityClassInterface. @@ -58,178 +52,18 @@ type PriorityClassInterface interface { // priorityClasses implements PriorityClassInterface type priorityClasses struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.PriorityClass, *v1alpha1.PriorityClassList, *schedulingv1alpha1.PriorityClassApplyConfiguration] } // newPriorityClasses returns a PriorityClasses func newPriorityClasses(c *SchedulingV1alpha1Client) *priorityClasses { return &priorityClasses{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.PriorityClass, *v1alpha1.PriorityClassList, *schedulingv1alpha1.PriorityClassApplyConfiguration]( + "priorityclasses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.PriorityClass { return &v1alpha1.PriorityClass{} }, + func() *v1alpha1.PriorityClassList { return &v1alpha1.PriorityClassList{} }), } } - -// Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any. -func (c *priorityClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PriorityClass, err error) { - result = &v1alpha1.PriorityClass{} - err = c.client.Get(). - Resource("priorityclasses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. -func (c *priorityClasses) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PriorityClassList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for priorityclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for priorityclasses", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for priorityclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for priorityclasses", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of PriorityClasses that match those selectors. -func (c *priorityClasses) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PriorityClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.PriorityClassList{} - err = c.client.Get(). - Resource("priorityclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of PriorityClasses -func (c *priorityClasses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PriorityClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.PriorityClassList{} - err = c.client.Get(). - Resource("priorityclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested priorityClasses. -func (c *priorityClasses) 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("priorityclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any. -func (c *priorityClasses) Create(ctx context.Context, priorityClass *v1alpha1.PriorityClass, opts v1.CreateOptions) (result *v1alpha1.PriorityClass, err error) { - result = &v1alpha1.PriorityClass{} - err = c.client.Post(). - Resource("priorityclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(priorityClass). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any. -func (c *priorityClasses) Update(ctx context.Context, priorityClass *v1alpha1.PriorityClass, opts v1.UpdateOptions) (result *v1alpha1.PriorityClass, err error) { - result = &v1alpha1.PriorityClass{} - err = c.client.Put(). - Resource("priorityclasses"). - Name(priorityClass.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(priorityClass). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the priorityClass and deletes it. Returns an error if one occurs. -func (c *priorityClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("priorityclasses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *priorityClasses) 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("priorityclasses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched priorityClass. -func (c *priorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PriorityClass, err error) { - result = &v1alpha1.PriorityClass{} - err = c.client.Patch(pt). - Resource("priorityclasses"). - 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 priorityClass. -func (c *priorityClasses) Apply(ctx context.Context, priorityClass *schedulingv1alpha1.PriorityClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PriorityClass, err error) { - if priorityClass == nil { - return nil, fmt.Errorf("priorityClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(priorityClass) - if err != nil { - return nil, err - } - name := priorityClass.Name - if name == nil { - return nil, fmt.Errorf("priorityClass.Name must be provided to Apply") - } - result = &v1alpha1.PriorityClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("priorityclasses"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/scheduling/v1beta1/priorityclass.go b/kubernetes/typed/scheduling/v1beta1/priorityclass.go index 561c9adc96..9fef1d7596 100644 --- a/kubernetes/typed/scheduling/v1beta1/priorityclass.go +++ b/kubernetes/typed/scheduling/v1beta1/priorityclass.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/scheduling/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" schedulingv1beta1 "k8s.io/client-go/applyconfigurations/scheduling/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // PriorityClassesGetter has a method to return a PriorityClassInterface. @@ -58,178 +52,18 @@ type PriorityClassInterface interface { // priorityClasses implements PriorityClassInterface type priorityClasses struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1beta1.PriorityClass, *v1beta1.PriorityClassList, *schedulingv1beta1.PriorityClassApplyConfiguration] } // newPriorityClasses returns a PriorityClasses func newPriorityClasses(c *SchedulingV1beta1Client) *priorityClasses { return &priorityClasses{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1beta1.PriorityClass, *v1beta1.PriorityClassList, *schedulingv1beta1.PriorityClassApplyConfiguration]( + "priorityclasses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.PriorityClass { return &v1beta1.PriorityClass{} }, + func() *v1beta1.PriorityClassList { return &v1beta1.PriorityClassList{} }), } } - -// Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any. -func (c *priorityClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PriorityClass, err error) { - result = &v1beta1.PriorityClass{} - err = c.client.Get(). - Resource("priorityclasses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. -func (c *priorityClasses) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PriorityClassList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for priorityclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for priorityclasses", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for priorityclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for priorityclasses", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of PriorityClasses that match those selectors. -func (c *priorityClasses) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.PriorityClassList{} - err = c.client.Get(). - Resource("priorityclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of PriorityClasses -func (c *priorityClasses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.PriorityClassList{} - err = c.client.Get(). - Resource("priorityclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested priorityClasses. -func (c *priorityClasses) 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("priorityclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any. -func (c *priorityClasses) Create(ctx context.Context, priorityClass *v1beta1.PriorityClass, opts v1.CreateOptions) (result *v1beta1.PriorityClass, err error) { - result = &v1beta1.PriorityClass{} - err = c.client.Post(). - Resource("priorityclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(priorityClass). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any. -func (c *priorityClasses) Update(ctx context.Context, priorityClass *v1beta1.PriorityClass, opts v1.UpdateOptions) (result *v1beta1.PriorityClass, err error) { - result = &v1beta1.PriorityClass{} - err = c.client.Put(). - Resource("priorityclasses"). - Name(priorityClass.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(priorityClass). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the priorityClass and deletes it. Returns an error if one occurs. -func (c *priorityClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("priorityclasses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *priorityClasses) 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("priorityclasses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched priorityClass. -func (c *priorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PriorityClass, err error) { - result = &v1beta1.PriorityClass{} - err = c.client.Patch(pt). - Resource("priorityclasses"). - 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 priorityClass. -func (c *priorityClasses) Apply(ctx context.Context, priorityClass *schedulingv1beta1.PriorityClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PriorityClass, err error) { - if priorityClass == nil { - return nil, fmt.Errorf("priorityClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(priorityClass) - if err != nil { - return nil, err - } - name := priorityClass.Name - if name == nil { - return nil, fmt.Errorf("priorityClass.Name must be provided to Apply") - } - result = &v1beta1.PriorityClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("priorityclasses"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/storage/v1/csidriver.go b/kubernetes/typed/storage/v1/csidriver.go index b07cb4f353..2e14db6000 100644 --- a/kubernetes/typed/storage/v1/csidriver.go +++ b/kubernetes/typed/storage/v1/csidriver.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // CSIDriversGetter has a method to return a CSIDriverInterface. @@ -58,178 +52,18 @@ type CSIDriverInterface interface { // cSIDrivers implements CSIDriverInterface type cSIDrivers struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1.CSIDriver, *v1.CSIDriverList, *storagev1.CSIDriverApplyConfiguration] } // newCSIDrivers returns a CSIDrivers func newCSIDrivers(c *StorageV1Client) *cSIDrivers { return &cSIDrivers{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1.CSIDriver, *v1.CSIDriverList, *storagev1.CSIDriverApplyConfiguration]( + "csidrivers", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.CSIDriver { return &v1.CSIDriver{} }, + func() *v1.CSIDriverList { return &v1.CSIDriverList{} }), } } - -// Get takes name of the cSIDriver, and returns the corresponding cSIDriver object, and an error if there is any. -func (c *cSIDrivers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CSIDriver, err error) { - result = &v1.CSIDriver{} - err = c.client.Get(). - Resource("csidrivers"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of CSIDrivers that match those selectors. -func (c *cSIDrivers) List(ctx context.Context, opts metav1.ListOptions) (*v1.CSIDriverList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for csidrivers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for csidrivers", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for csidrivers ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csidrivers", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of CSIDrivers that match those selectors. -func (c *cSIDrivers) list(ctx context.Context, opts metav1.ListOptions) (result *v1.CSIDriverList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.CSIDriverList{} - err = c.client.Get(). - Resource("csidrivers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of CSIDrivers -func (c *cSIDrivers) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.CSIDriverList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.CSIDriverList{} - err = c.client.Get(). - Resource("csidrivers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested cSIDrivers. -func (c *cSIDrivers) Watch(ctx context.Context, opts metav1.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("csidrivers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a cSIDriver and creates it. Returns the server's representation of the cSIDriver, and an error, if there is any. -func (c *cSIDrivers) Create(ctx context.Context, cSIDriver *v1.CSIDriver, opts metav1.CreateOptions) (result *v1.CSIDriver, err error) { - result = &v1.CSIDriver{} - err = c.client.Post(). - Resource("csidrivers"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cSIDriver). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a cSIDriver and updates it. Returns the server's representation of the cSIDriver, and an error, if there is any. -func (c *cSIDrivers) Update(ctx context.Context, cSIDriver *v1.CSIDriver, opts metav1.UpdateOptions) (result *v1.CSIDriver, err error) { - result = &v1.CSIDriver{} - err = c.client.Put(). - Resource("csidrivers"). - Name(cSIDriver.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cSIDriver). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the cSIDriver and deletes it. Returns an error if one occurs. -func (c *cSIDrivers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("csidrivers"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *cSIDrivers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("csidrivers"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched cSIDriver. -func (c *cSIDrivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSIDriver, err error) { - result = &v1.CSIDriver{} - err = c.client.Patch(pt). - Resource("csidrivers"). - 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 cSIDriver. -func (c *cSIDrivers) Apply(ctx context.Context, cSIDriver *storagev1.CSIDriverApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CSIDriver, err error) { - if cSIDriver == nil { - return nil, fmt.Errorf("cSIDriver provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(cSIDriver) - if err != nil { - return nil, err - } - name := cSIDriver.Name - if name == nil { - return nil, fmt.Errorf("cSIDriver.Name must be provided to Apply") - } - result = &v1.CSIDriver{} - err = c.client.Patch(types.ApplyPatchType). - Resource("csidrivers"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/storage/v1/csinode.go b/kubernetes/typed/storage/v1/csinode.go index 308ae9ce08..6d28d7ed11 100644 --- a/kubernetes/typed/storage/v1/csinode.go +++ b/kubernetes/typed/storage/v1/csinode.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // CSINodesGetter has a method to return a CSINodeInterface. @@ -58,178 +52,18 @@ type CSINodeInterface interface { // cSINodes implements CSINodeInterface type cSINodes struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1.CSINode, *v1.CSINodeList, *storagev1.CSINodeApplyConfiguration] } // newCSINodes returns a CSINodes func newCSINodes(c *StorageV1Client) *cSINodes { return &cSINodes{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1.CSINode, *v1.CSINodeList, *storagev1.CSINodeApplyConfiguration]( + "csinodes", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.CSINode { return &v1.CSINode{} }, + func() *v1.CSINodeList { return &v1.CSINodeList{} }), } } - -// Get takes name of the cSINode, and returns the corresponding cSINode object, and an error if there is any. -func (c *cSINodes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CSINode, err error) { - result = &v1.CSINode{} - err = c.client.Get(). - Resource("csinodes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of CSINodes that match those selectors. -func (c *cSINodes) List(ctx context.Context, opts metav1.ListOptions) (*v1.CSINodeList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for csinodes, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for csinodes", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for csinodes ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csinodes", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of CSINodes that match those selectors. -func (c *cSINodes) list(ctx context.Context, opts metav1.ListOptions) (result *v1.CSINodeList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.CSINodeList{} - err = c.client.Get(). - Resource("csinodes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of CSINodes -func (c *cSINodes) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.CSINodeList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.CSINodeList{} - err = c.client.Get(). - Resource("csinodes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested cSINodes. -func (c *cSINodes) Watch(ctx context.Context, opts metav1.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("csinodes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a cSINode and creates it. Returns the server's representation of the cSINode, and an error, if there is any. -func (c *cSINodes) Create(ctx context.Context, cSINode *v1.CSINode, opts metav1.CreateOptions) (result *v1.CSINode, err error) { - result = &v1.CSINode{} - err = c.client.Post(). - Resource("csinodes"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cSINode). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a cSINode and updates it. Returns the server's representation of the cSINode, and an error, if there is any. -func (c *cSINodes) Update(ctx context.Context, cSINode *v1.CSINode, opts metav1.UpdateOptions) (result *v1.CSINode, err error) { - result = &v1.CSINode{} - err = c.client.Put(). - Resource("csinodes"). - Name(cSINode.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cSINode). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the cSINode and deletes it. Returns an error if one occurs. -func (c *cSINodes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("csinodes"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *cSINodes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("csinodes"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched cSINode. -func (c *cSINodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSINode, err error) { - result = &v1.CSINode{} - err = c.client.Patch(pt). - Resource("csinodes"). - 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 cSINode. -func (c *cSINodes) Apply(ctx context.Context, cSINode *storagev1.CSINodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CSINode, err error) { - if cSINode == nil { - return nil, fmt.Errorf("cSINode provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(cSINode) - if err != nil { - return nil, err - } - name := cSINode.Name - if name == nil { - return nil, fmt.Errorf("cSINode.Name must be provided to Apply") - } - result = &v1.CSINode{} - err = c.client.Patch(types.ApplyPatchType). - Resource("csinodes"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/storage/v1/csistoragecapacity.go b/kubernetes/typed/storage/v1/csistoragecapacity.go index f80825633c..8a762b9fff 100644 --- a/kubernetes/typed/storage/v1/csistoragecapacity.go +++ b/kubernetes/typed/storage/v1/csistoragecapacity.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // CSIStorageCapacitiesGetter has a method to return a CSIStorageCapacityInterface. @@ -58,190 +52,18 @@ type CSIStorageCapacityInterface interface { // cSIStorageCapacities implements CSIStorageCapacityInterface type cSIStorageCapacities struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1.CSIStorageCapacity, *v1.CSIStorageCapacityList, *storagev1.CSIStorageCapacityApplyConfiguration] } // newCSIStorageCapacities returns a CSIStorageCapacities func newCSIStorageCapacities(c *StorageV1Client, namespace string) *cSIStorageCapacities { return &cSIStorageCapacities{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1.CSIStorageCapacity, *v1.CSIStorageCapacityList, *storagev1.CSIStorageCapacityApplyConfiguration]( + "csistoragecapacities", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1.CSIStorageCapacity { return &v1.CSIStorageCapacity{} }, + func() *v1.CSIStorageCapacityList { return &v1.CSIStorageCapacityList{} }), } } - -// Get takes name of the cSIStorageCapacity, and returns the corresponding cSIStorageCapacity object, and an error if there is any. -func (c *cSIStorageCapacities) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CSIStorageCapacity, err error) { - result = &v1.CSIStorageCapacity{} - err = c.client.Get(). - Namespace(c.ns). - Resource("csistoragecapacities"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. -func (c *cSIStorageCapacities) List(ctx context.Context, opts metav1.ListOptions) (*v1.CSIStorageCapacityList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for csistoragecapacities, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for csistoragecapacities", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for csistoragecapacities ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csistoragecapacities", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. -func (c *cSIStorageCapacities) list(ctx context.Context, opts metav1.ListOptions) (result *v1.CSIStorageCapacityList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.CSIStorageCapacityList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("csistoragecapacities"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of CSIStorageCapacities -func (c *cSIStorageCapacities) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.CSIStorageCapacityList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.CSIStorageCapacityList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("csistoragecapacities"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested cSIStorageCapacities. -func (c *cSIStorageCapacities) Watch(ctx context.Context, opts metav1.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("csistoragecapacities"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a cSIStorageCapacity and creates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. -func (c *cSIStorageCapacities) Create(ctx context.Context, cSIStorageCapacity *v1.CSIStorageCapacity, opts metav1.CreateOptions) (result *v1.CSIStorageCapacity, err error) { - result = &v1.CSIStorageCapacity{} - err = c.client.Post(). - Namespace(c.ns). - Resource("csistoragecapacities"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cSIStorageCapacity). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a cSIStorageCapacity and updates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. -func (c *cSIStorageCapacities) Update(ctx context.Context, cSIStorageCapacity *v1.CSIStorageCapacity, opts metav1.UpdateOptions) (result *v1.CSIStorageCapacity, err error) { - result = &v1.CSIStorageCapacity{} - err = c.client.Put(). - Namespace(c.ns). - Resource("csistoragecapacities"). - Name(cSIStorageCapacity.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cSIStorageCapacity). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the cSIStorageCapacity and deletes it. Returns an error if one occurs. -func (c *cSIStorageCapacities) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("csistoragecapacities"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *cSIStorageCapacities) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("csistoragecapacities"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched cSIStorageCapacity. -func (c *cSIStorageCapacities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSIStorageCapacity, err error) { - result = &v1.CSIStorageCapacity{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("csistoragecapacities"). - 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 cSIStorageCapacity. -func (c *cSIStorageCapacities) Apply(ctx context.Context, cSIStorageCapacity *storagev1.CSIStorageCapacityApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CSIStorageCapacity, err error) { - if cSIStorageCapacity == nil { - return nil, fmt.Errorf("cSIStorageCapacity provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(cSIStorageCapacity) - if err != nil { - return nil, err - } - name := cSIStorageCapacity.Name - if name == nil { - return nil, fmt.Errorf("cSIStorageCapacity.Name must be provided to Apply") - } - result = &v1.CSIStorageCapacity{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("csistoragecapacities"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/storage/v1/storageclass.go b/kubernetes/typed/storage/v1/storageclass.go index e012275b4c..d7b6ff68aa 100644 --- a/kubernetes/typed/storage/v1/storageclass.go +++ b/kubernetes/typed/storage/v1/storageclass.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // StorageClassesGetter has a method to return a StorageClassInterface. @@ -58,178 +52,18 @@ type StorageClassInterface interface { // storageClasses implements StorageClassInterface type storageClasses struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1.StorageClass, *v1.StorageClassList, *storagev1.StorageClassApplyConfiguration] } // newStorageClasses returns a StorageClasses func newStorageClasses(c *StorageV1Client) *storageClasses { return &storageClasses{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1.StorageClass, *v1.StorageClassList, *storagev1.StorageClassApplyConfiguration]( + "storageclasses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.StorageClass { return &v1.StorageClass{} }, + func() *v1.StorageClassList { return &v1.StorageClassList{} }), } } - -// Get takes name of the storageClass, and returns the corresponding storageClass object, and an error if there is any. -func (c *storageClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.StorageClass, err error) { - result = &v1.StorageClass{} - err = c.client.Get(). - Resource("storageclasses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of StorageClasses that match those selectors. -func (c *storageClasses) List(ctx context.Context, opts metav1.ListOptions) (*v1.StorageClassList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for storageclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for storageclasses", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for storageclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for storageclasses", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of StorageClasses that match those selectors. -func (c *storageClasses) list(ctx context.Context, opts metav1.ListOptions) (result *v1.StorageClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.StorageClassList{} - err = c.client.Get(). - Resource("storageclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of StorageClasses -func (c *storageClasses) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.StorageClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.StorageClassList{} - err = c.client.Get(). - Resource("storageclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested storageClasses. -func (c *storageClasses) Watch(ctx context.Context, opts metav1.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("storageclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a storageClass and creates it. Returns the server's representation of the storageClass, and an error, if there is any. -func (c *storageClasses) Create(ctx context.Context, storageClass *v1.StorageClass, opts metav1.CreateOptions) (result *v1.StorageClass, err error) { - result = &v1.StorageClass{} - err = c.client.Post(). - Resource("storageclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(storageClass). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a storageClass and updates it. Returns the server's representation of the storageClass, and an error, if there is any. -func (c *storageClasses) Update(ctx context.Context, storageClass *v1.StorageClass, opts metav1.UpdateOptions) (result *v1.StorageClass, err error) { - result = &v1.StorageClass{} - err = c.client.Put(). - Resource("storageclasses"). - Name(storageClass.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(storageClass). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the storageClass and deletes it. Returns an error if one occurs. -func (c *storageClasses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("storageclasses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *storageClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("storageclasses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched storageClass. -func (c *storageClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.StorageClass, err error) { - result = &v1.StorageClass{} - err = c.client.Patch(pt). - Resource("storageclasses"). - 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 storageClass. -func (c *storageClasses) Apply(ctx context.Context, storageClass *storagev1.StorageClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.StorageClass, err error) { - if storageClass == nil { - return nil, fmt.Errorf("storageClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(storageClass) - if err != nil { - return nil, err - } - name := storageClass.Name - if name == nil { - return nil, fmt.Errorf("storageClass.Name must be provided to Apply") - } - result = &v1.StorageClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("storageclasses"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/storage/v1/volumeattachment.go b/kubernetes/typed/storage/v1/volumeattachment.go index 503093e428..3a0404284f 100644 --- a/kubernetes/typed/storage/v1/volumeattachment.go +++ b/kubernetes/typed/storage/v1/volumeattachment.go @@ -20,20 +20,14 @@ package v1 import ( "context" - json "encoding/json" - "fmt" - "time" v1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1 "k8s.io/client-go/applyconfigurations/storage/v1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // VolumeAttachmentsGetter has a method to return a VolumeAttachmentInterface. @@ -46,6 +40,7 @@ type VolumeAttachmentsGetter interface { type VolumeAttachmentInterface interface { Create(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.CreateOptions) (*v1.VolumeAttachment, error) Update(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.UpdateOptions) (*v1.VolumeAttachment, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.UpdateOptions) (*v1.VolumeAttachment, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error @@ -54,228 +49,25 @@ type VolumeAttachmentInterface interface { Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VolumeAttachment, err error) Apply(ctx context.Context, volumeAttachment *storagev1.VolumeAttachmentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.VolumeAttachment, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, volumeAttachment *storagev1.VolumeAttachmentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.VolumeAttachment, err error) VolumeAttachmentExpansion } // volumeAttachments implements VolumeAttachmentInterface type volumeAttachments struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1.VolumeAttachment, *v1.VolumeAttachmentList, *storagev1.VolumeAttachmentApplyConfiguration] } // newVolumeAttachments returns a VolumeAttachments func newVolumeAttachments(c *StorageV1Client) *volumeAttachments { return &volumeAttachments{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1.VolumeAttachment, *v1.VolumeAttachmentList, *storagev1.VolumeAttachmentApplyConfiguration]( + "volumeattachments", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1.VolumeAttachment { return &v1.VolumeAttachment{} }, + func() *v1.VolumeAttachmentList { return &v1.VolumeAttachmentList{} }), } } - -// Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any. -func (c *volumeAttachments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VolumeAttachment, err error) { - result = &v1.VolumeAttachment{} - err = c.client.Get(). - Resource("volumeattachments"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. -func (c *volumeAttachments) List(ctx context.Context, opts metav1.ListOptions) (*v1.VolumeAttachmentList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for volumeattachments, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for volumeattachments", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for volumeattachments ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for volumeattachments", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. -func (c *volumeAttachments) list(ctx context.Context, opts metav1.ListOptions) (result *v1.VolumeAttachmentList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.VolumeAttachmentList{} - err = c.client.Get(). - Resource("volumeattachments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of VolumeAttachments -func (c *volumeAttachments) watchList(ctx context.Context, opts metav1.ListOptions) (result *v1.VolumeAttachmentList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.VolumeAttachmentList{} - err = c.client.Get(). - Resource("volumeattachments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested volumeAttachments. -func (c *volumeAttachments) Watch(ctx context.Context, opts metav1.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("volumeattachments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. -func (c *volumeAttachments) Create(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.CreateOptions) (result *v1.VolumeAttachment, err error) { - result = &v1.VolumeAttachment{} - err = c.client.Post(). - Resource("volumeattachments"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volumeAttachment). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a volumeAttachment and updates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. -func (c *volumeAttachments) Update(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.UpdateOptions) (result *v1.VolumeAttachment, err error) { - result = &v1.VolumeAttachment{} - err = c.client.Put(). - Resource("volumeattachments"). - Name(volumeAttachment.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volumeAttachment). - 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 *volumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.UpdateOptions) (result *v1.VolumeAttachment, err error) { - result = &v1.VolumeAttachment{} - err = c.client.Put(). - Resource("volumeattachments"). - Name(volumeAttachment.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volumeAttachment). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. -func (c *volumeAttachments) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Resource("volumeattachments"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *volumeAttachments) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("volumeattachments"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched volumeAttachment. -func (c *volumeAttachments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VolumeAttachment, err error) { - result = &v1.VolumeAttachment{} - err = c.client.Patch(pt). - Resource("volumeattachments"). - 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 volumeAttachment. -func (c *volumeAttachments) Apply(ctx context.Context, volumeAttachment *storagev1.VolumeAttachmentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.VolumeAttachment, err error) { - if volumeAttachment == nil { - return nil, fmt.Errorf("volumeAttachment provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(volumeAttachment) - if err != nil { - return nil, err - } - name := volumeAttachment.Name - if name == nil { - return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") - } - result = &v1.VolumeAttachment{} - err = c.client.Patch(types.ApplyPatchType). - Resource("volumeattachments"). - 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 *volumeAttachments) ApplyStatus(ctx context.Context, volumeAttachment *storagev1.VolumeAttachmentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.VolumeAttachment, err error) { - if volumeAttachment == nil { - return nil, fmt.Errorf("volumeAttachment provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(volumeAttachment) - if err != nil { - return nil, err - } - - name := volumeAttachment.Name - if name == nil { - return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") - } - - result = &v1.VolumeAttachment{} - err = c.client.Patch(types.ApplyPatchType). - Resource("volumeattachments"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/storage/v1alpha1/csistoragecapacity.go b/kubernetes/typed/storage/v1alpha1/csistoragecapacity.go index b8923b0fc1..6819deff62 100644 --- a/kubernetes/typed/storage/v1alpha1/csistoragecapacity.go +++ b/kubernetes/typed/storage/v1alpha1/csistoragecapacity.go @@ -20,20 +20,14 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "k8s.io/api/storage/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // CSIStorageCapacitiesGetter has a method to return a CSIStorageCapacityInterface. @@ -58,190 +52,18 @@ type CSIStorageCapacityInterface interface { // cSIStorageCapacities implements CSIStorageCapacityInterface type cSIStorageCapacities struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1alpha1.CSIStorageCapacity, *v1alpha1.CSIStorageCapacityList, *storagev1alpha1.CSIStorageCapacityApplyConfiguration] } // newCSIStorageCapacities returns a CSIStorageCapacities func newCSIStorageCapacities(c *StorageV1alpha1Client, namespace string) *cSIStorageCapacities { return &cSIStorageCapacities{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1alpha1.CSIStorageCapacity, *v1alpha1.CSIStorageCapacityList, *storagev1alpha1.CSIStorageCapacityApplyConfiguration]( + "csistoragecapacities", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.CSIStorageCapacity { return &v1alpha1.CSIStorageCapacity{} }, + func() *v1alpha1.CSIStorageCapacityList { return &v1alpha1.CSIStorageCapacityList{} }), } } - -// Get takes name of the cSIStorageCapacity, and returns the corresponding cSIStorageCapacity object, and an error if there is any. -func (c *cSIStorageCapacities) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.CSIStorageCapacity, err error) { - result = &v1alpha1.CSIStorageCapacity{} - err = c.client.Get(). - Namespace(c.ns). - Resource("csistoragecapacities"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. -func (c *cSIStorageCapacities) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.CSIStorageCapacityList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for csistoragecapacities, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for csistoragecapacities", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for csistoragecapacities ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csistoragecapacities", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. -func (c *cSIStorageCapacities) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.CSIStorageCapacityList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.CSIStorageCapacityList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("csistoragecapacities"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of CSIStorageCapacities -func (c *cSIStorageCapacities) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.CSIStorageCapacityList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.CSIStorageCapacityList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("csistoragecapacities"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested cSIStorageCapacities. -func (c *cSIStorageCapacities) 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("csistoragecapacities"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a cSIStorageCapacity and creates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. -func (c *cSIStorageCapacities) Create(ctx context.Context, cSIStorageCapacity *v1alpha1.CSIStorageCapacity, opts v1.CreateOptions) (result *v1alpha1.CSIStorageCapacity, err error) { - result = &v1alpha1.CSIStorageCapacity{} - err = c.client.Post(). - Namespace(c.ns). - Resource("csistoragecapacities"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cSIStorageCapacity). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a cSIStorageCapacity and updates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. -func (c *cSIStorageCapacities) Update(ctx context.Context, cSIStorageCapacity *v1alpha1.CSIStorageCapacity, opts v1.UpdateOptions) (result *v1alpha1.CSIStorageCapacity, err error) { - result = &v1alpha1.CSIStorageCapacity{} - err = c.client.Put(). - Namespace(c.ns). - Resource("csistoragecapacities"). - Name(cSIStorageCapacity.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cSIStorageCapacity). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the cSIStorageCapacity and deletes it. Returns an error if one occurs. -func (c *cSIStorageCapacities) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("csistoragecapacities"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *cSIStorageCapacities) 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("csistoragecapacities"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched cSIStorageCapacity. -func (c *cSIStorageCapacities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.CSIStorageCapacity, err error) { - result = &v1alpha1.CSIStorageCapacity{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("csistoragecapacities"). - 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 cSIStorageCapacity. -func (c *cSIStorageCapacities) Apply(ctx context.Context, cSIStorageCapacity *storagev1alpha1.CSIStorageCapacityApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.CSIStorageCapacity, err error) { - if cSIStorageCapacity == nil { - return nil, fmt.Errorf("cSIStorageCapacity provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(cSIStorageCapacity) - if err != nil { - return nil, err - } - name := cSIStorageCapacity.Name - if name == nil { - return nil, fmt.Errorf("cSIStorageCapacity.Name must be provided to Apply") - } - result = &v1alpha1.CSIStorageCapacity{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("csistoragecapacities"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/storage/v1alpha1/volumeattachment.go b/kubernetes/typed/storage/v1alpha1/volumeattachment.go index c782f46216..0982d5568a 100644 --- a/kubernetes/typed/storage/v1alpha1/volumeattachment.go +++ b/kubernetes/typed/storage/v1alpha1/volumeattachment.go @@ -20,20 +20,14 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "k8s.io/api/storage/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // VolumeAttachmentsGetter has a method to return a VolumeAttachmentInterface. @@ -46,6 +40,7 @@ type VolumeAttachmentsGetter interface { type VolumeAttachmentInterface interface { Create(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.CreateOptions) (*v1alpha1.VolumeAttachment, error) Update(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (*v1alpha1.VolumeAttachment, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (*v1alpha1.VolumeAttachment, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,228 +49,25 @@ type VolumeAttachmentInterface 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.VolumeAttachment, err error) Apply(ctx context.Context, volumeAttachment *storagev1alpha1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttachment, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, volumeAttachment *storagev1alpha1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttachment, err error) VolumeAttachmentExpansion } // volumeAttachments implements VolumeAttachmentInterface type volumeAttachments struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.VolumeAttachment, *v1alpha1.VolumeAttachmentList, *storagev1alpha1.VolumeAttachmentApplyConfiguration] } // newVolumeAttachments returns a VolumeAttachments func newVolumeAttachments(c *StorageV1alpha1Client) *volumeAttachments { return &volumeAttachments{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.VolumeAttachment, *v1alpha1.VolumeAttachmentList, *storagev1alpha1.VolumeAttachmentApplyConfiguration]( + "volumeattachments", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.VolumeAttachment { return &v1alpha1.VolumeAttachment{} }, + func() *v1alpha1.VolumeAttachmentList { return &v1alpha1.VolumeAttachmentList{} }), } } - -// Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any. -func (c *volumeAttachments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeAttachment, err error) { - result = &v1alpha1.VolumeAttachment{} - err = c.client.Get(). - Resource("volumeattachments"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. -func (c *volumeAttachments) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.VolumeAttachmentList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for volumeattachments, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for volumeattachments", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for volumeattachments ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for volumeattachments", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. -func (c *volumeAttachments) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttachmentList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.VolumeAttachmentList{} - err = c.client.Get(). - Resource("volumeattachments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of VolumeAttachments -func (c *volumeAttachments) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttachmentList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.VolumeAttachmentList{} - err = c.client.Get(). - Resource("volumeattachments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested volumeAttachments. -func (c *volumeAttachments) 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("volumeattachments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. -func (c *volumeAttachments) Create(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.CreateOptions) (result *v1alpha1.VolumeAttachment, err error) { - result = &v1alpha1.VolumeAttachment{} - err = c.client.Post(). - Resource("volumeattachments"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volumeAttachment). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a volumeAttachment and updates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. -func (c *volumeAttachments) Update(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttachment, err error) { - result = &v1alpha1.VolumeAttachment{} - err = c.client.Put(). - Resource("volumeattachments"). - Name(volumeAttachment.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volumeAttachment). - 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 *volumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttachment, err error) { - result = &v1alpha1.VolumeAttachment{} - err = c.client.Put(). - Resource("volumeattachments"). - Name(volumeAttachment.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volumeAttachment). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. -func (c *volumeAttachments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("volumeattachments"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *volumeAttachments) 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("volumeattachments"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched volumeAttachment. -func (c *volumeAttachments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttachment, err error) { - result = &v1alpha1.VolumeAttachment{} - err = c.client.Patch(pt). - Resource("volumeattachments"). - 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 volumeAttachment. -func (c *volumeAttachments) Apply(ctx context.Context, volumeAttachment *storagev1alpha1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttachment, err error) { - if volumeAttachment == nil { - return nil, fmt.Errorf("volumeAttachment provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(volumeAttachment) - if err != nil { - return nil, err - } - name := volumeAttachment.Name - if name == nil { - return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") - } - result = &v1alpha1.VolumeAttachment{} - err = c.client.Patch(types.ApplyPatchType). - Resource("volumeattachments"). - 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 *volumeAttachments) ApplyStatus(ctx context.Context, volumeAttachment *storagev1alpha1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttachment, err error) { - if volumeAttachment == nil { - return nil, fmt.Errorf("volumeAttachment provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(volumeAttachment) - if err != nil { - return nil, err - } - - name := volumeAttachment.Name - if name == nil { - return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") - } - - result = &v1alpha1.VolumeAttachment{} - err = c.client.Patch(types.ApplyPatchType). - Resource("volumeattachments"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go b/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go index c9bf5b2ddd..40cff75883 100644 --- a/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go +++ b/kubernetes/typed/storage/v1alpha1/volumeattributesclass.go @@ -20,20 +20,14 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "k8s.io/api/storage/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // VolumeAttributesClassesGetter has a method to return a VolumeAttributesClassInterface. @@ -58,178 +52,18 @@ type VolumeAttributesClassInterface interface { // volumeAttributesClasses implements VolumeAttributesClassInterface type volumeAttributesClasses struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.VolumeAttributesClass, *v1alpha1.VolumeAttributesClassList, *storagev1alpha1.VolumeAttributesClassApplyConfiguration] } // newVolumeAttributesClasses returns a VolumeAttributesClasses func newVolumeAttributesClasses(c *StorageV1alpha1Client) *volumeAttributesClasses { return &volumeAttributesClasses{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.VolumeAttributesClass, *v1alpha1.VolumeAttributesClassList, *storagev1alpha1.VolumeAttributesClassApplyConfiguration]( + "volumeattributesclasses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.VolumeAttributesClass { return &v1alpha1.VolumeAttributesClass{} }, + func() *v1alpha1.VolumeAttributesClassList { return &v1alpha1.VolumeAttributesClassList{} }), } } - -// Get takes name of the volumeAttributesClass, and returns the corresponding volumeAttributesClass object, and an error if there is any. -func (c *volumeAttributesClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - result = &v1alpha1.VolumeAttributesClass{} - err = c.client.Get(). - Resource("volumeattributesclasses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VolumeAttributesClasses that match those selectors. -func (c *volumeAttributesClasses) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.VolumeAttributesClassList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for volumeattributesclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for volumeattributesclasses", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for volumeattributesclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for volumeattributesclasses", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of VolumeAttributesClasses that match those selectors. -func (c *volumeAttributesClasses) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttributesClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.VolumeAttributesClassList{} - err = c.client.Get(). - Resource("volumeattributesclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of VolumeAttributesClasses -func (c *volumeAttributesClasses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttributesClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.VolumeAttributesClassList{} - err = c.client.Get(). - Resource("volumeattributesclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested volumeAttributesClasses. -func (c *volumeAttributesClasses) 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("volumeattributesclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a volumeAttributesClass and creates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. -func (c *volumeAttributesClasses) Create(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.CreateOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - result = &v1alpha1.VolumeAttributesClass{} - err = c.client.Post(). - Resource("volumeattributesclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volumeAttributesClass). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a volumeAttributesClass and updates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. -func (c *volumeAttributesClasses) Update(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - result = &v1alpha1.VolumeAttributesClass{} - err = c.client.Put(). - Resource("volumeattributesclasses"). - Name(volumeAttributesClass.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volumeAttributesClass). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the volumeAttributesClass and deletes it. Returns an error if one occurs. -func (c *volumeAttributesClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("volumeattributesclasses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *volumeAttributesClasses) 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("volumeattributesclasses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched volumeAttributesClass. -func (c *volumeAttributesClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttributesClass, err error) { - result = &v1alpha1.VolumeAttributesClass{} - err = c.client.Patch(pt). - Resource("volumeattributesclasses"). - 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 volumeAttributesClass. -func (c *volumeAttributesClasses) Apply(ctx context.Context, volumeAttributesClass *storagev1alpha1.VolumeAttributesClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttributesClass, err error) { - if volumeAttributesClass == nil { - return nil, fmt.Errorf("volumeAttributesClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(volumeAttributesClass) - if err != nil { - return nil, err - } - name := volumeAttributesClass.Name - if name == nil { - return nil, fmt.Errorf("volumeAttributesClass.Name must be provided to Apply") - } - result = &v1alpha1.VolumeAttributesClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("volumeattributesclasses"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/storage/v1beta1/csidriver.go b/kubernetes/typed/storage/v1beta1/csidriver.go index c6205cb867..2748919b40 100644 --- a/kubernetes/typed/storage/v1beta1/csidriver.go +++ b/kubernetes/typed/storage/v1beta1/csidriver.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // CSIDriversGetter has a method to return a CSIDriverInterface. @@ -58,178 +52,18 @@ type CSIDriverInterface interface { // cSIDrivers implements CSIDriverInterface type cSIDrivers struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1beta1.CSIDriver, *v1beta1.CSIDriverList, *storagev1beta1.CSIDriverApplyConfiguration] } // newCSIDrivers returns a CSIDrivers func newCSIDrivers(c *StorageV1beta1Client) *cSIDrivers { return &cSIDrivers{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1beta1.CSIDriver, *v1beta1.CSIDriverList, *storagev1beta1.CSIDriverApplyConfiguration]( + "csidrivers", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.CSIDriver { return &v1beta1.CSIDriver{} }, + func() *v1beta1.CSIDriverList { return &v1beta1.CSIDriverList{} }), } } - -// Get takes name of the cSIDriver, and returns the corresponding cSIDriver object, and an error if there is any. -func (c *cSIDrivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CSIDriver, err error) { - result = &v1beta1.CSIDriver{} - err = c.client.Get(). - Resource("csidrivers"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of CSIDrivers that match those selectors. -func (c *cSIDrivers) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CSIDriverList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for csidrivers, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for csidrivers", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for csidrivers ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csidrivers", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of CSIDrivers that match those selectors. -func (c *cSIDrivers) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIDriverList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.CSIDriverList{} - err = c.client.Get(). - Resource("csidrivers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of CSIDrivers -func (c *cSIDrivers) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIDriverList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.CSIDriverList{} - err = c.client.Get(). - Resource("csidrivers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested cSIDrivers. -func (c *cSIDrivers) 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("csidrivers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a cSIDriver and creates it. Returns the server's representation of the cSIDriver, and an error, if there is any. -func (c *cSIDrivers) Create(ctx context.Context, cSIDriver *v1beta1.CSIDriver, opts v1.CreateOptions) (result *v1beta1.CSIDriver, err error) { - result = &v1beta1.CSIDriver{} - err = c.client.Post(). - Resource("csidrivers"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cSIDriver). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a cSIDriver and updates it. Returns the server's representation of the cSIDriver, and an error, if there is any. -func (c *cSIDrivers) Update(ctx context.Context, cSIDriver *v1beta1.CSIDriver, opts v1.UpdateOptions) (result *v1beta1.CSIDriver, err error) { - result = &v1beta1.CSIDriver{} - err = c.client.Put(). - Resource("csidrivers"). - Name(cSIDriver.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cSIDriver). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the cSIDriver and deletes it. Returns an error if one occurs. -func (c *cSIDrivers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("csidrivers"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *cSIDrivers) 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("csidrivers"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched cSIDriver. -func (c *cSIDrivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSIDriver, err error) { - result = &v1beta1.CSIDriver{} - err = c.client.Patch(pt). - Resource("csidrivers"). - 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 cSIDriver. -func (c *cSIDrivers) Apply(ctx context.Context, cSIDriver *storagev1beta1.CSIDriverApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CSIDriver, err error) { - if cSIDriver == nil { - return nil, fmt.Errorf("cSIDriver provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(cSIDriver) - if err != nil { - return nil, err - } - name := cSIDriver.Name - if name == nil { - return nil, fmt.Errorf("cSIDriver.Name must be provided to Apply") - } - result = &v1beta1.CSIDriver{} - err = c.client.Patch(types.ApplyPatchType). - Resource("csidrivers"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/storage/v1beta1/csinode.go b/kubernetes/typed/storage/v1beta1/csinode.go index 4c0fefc764..fe6fe228e3 100644 --- a/kubernetes/typed/storage/v1beta1/csinode.go +++ b/kubernetes/typed/storage/v1beta1/csinode.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // CSINodesGetter has a method to return a CSINodeInterface. @@ -58,178 +52,18 @@ type CSINodeInterface interface { // cSINodes implements CSINodeInterface type cSINodes struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1beta1.CSINode, *v1beta1.CSINodeList, *storagev1beta1.CSINodeApplyConfiguration] } // newCSINodes returns a CSINodes func newCSINodes(c *StorageV1beta1Client) *cSINodes { return &cSINodes{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1beta1.CSINode, *v1beta1.CSINodeList, *storagev1beta1.CSINodeApplyConfiguration]( + "csinodes", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.CSINode { return &v1beta1.CSINode{} }, + func() *v1beta1.CSINodeList { return &v1beta1.CSINodeList{} }), } } - -// Get takes name of the cSINode, and returns the corresponding cSINode object, and an error if there is any. -func (c *cSINodes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CSINode, err error) { - result = &v1beta1.CSINode{} - err = c.client.Get(). - Resource("csinodes"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of CSINodes that match those selectors. -func (c *cSINodes) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CSINodeList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for csinodes, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for csinodes", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for csinodes ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csinodes", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of CSINodes that match those selectors. -func (c *cSINodes) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSINodeList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.CSINodeList{} - err = c.client.Get(). - Resource("csinodes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of CSINodes -func (c *cSINodes) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSINodeList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.CSINodeList{} - err = c.client.Get(). - Resource("csinodes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested cSINodes. -func (c *cSINodes) 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("csinodes"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a cSINode and creates it. Returns the server's representation of the cSINode, and an error, if there is any. -func (c *cSINodes) Create(ctx context.Context, cSINode *v1beta1.CSINode, opts v1.CreateOptions) (result *v1beta1.CSINode, err error) { - result = &v1beta1.CSINode{} - err = c.client.Post(). - Resource("csinodes"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cSINode). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a cSINode and updates it. Returns the server's representation of the cSINode, and an error, if there is any. -func (c *cSINodes) Update(ctx context.Context, cSINode *v1beta1.CSINode, opts v1.UpdateOptions) (result *v1beta1.CSINode, err error) { - result = &v1beta1.CSINode{} - err = c.client.Put(). - Resource("csinodes"). - Name(cSINode.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cSINode). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the cSINode and deletes it. Returns an error if one occurs. -func (c *cSINodes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("csinodes"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *cSINodes) 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("csinodes"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched cSINode. -func (c *cSINodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSINode, err error) { - result = &v1beta1.CSINode{} - err = c.client.Patch(pt). - Resource("csinodes"). - 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 cSINode. -func (c *cSINodes) Apply(ctx context.Context, cSINode *storagev1beta1.CSINodeApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CSINode, err error) { - if cSINode == nil { - return nil, fmt.Errorf("cSINode provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(cSINode) - if err != nil { - return nil, err - } - name := cSINode.Name - if name == nil { - return nil, fmt.Errorf("cSINode.Name must be provided to Apply") - } - result = &v1beta1.CSINode{} - err = c.client.Patch(types.ApplyPatchType). - Resource("csinodes"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/storage/v1beta1/csistoragecapacity.go b/kubernetes/typed/storage/v1beta1/csistoragecapacity.go index a001e70ef4..e9ffc1df92 100644 --- a/kubernetes/typed/storage/v1beta1/csistoragecapacity.go +++ b/kubernetes/typed/storage/v1beta1/csistoragecapacity.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // CSIStorageCapacitiesGetter has a method to return a CSIStorageCapacityInterface. @@ -58,190 +52,18 @@ type CSIStorageCapacityInterface interface { // cSIStorageCapacities implements CSIStorageCapacityInterface type cSIStorageCapacities struct { - client rest.Interface - ns string + *gentype.ClientWithListAndApply[*v1beta1.CSIStorageCapacity, *v1beta1.CSIStorageCapacityList, *storagev1beta1.CSIStorageCapacityApplyConfiguration] } // newCSIStorageCapacities returns a CSIStorageCapacities func newCSIStorageCapacities(c *StorageV1beta1Client, namespace string) *cSIStorageCapacities { return &cSIStorageCapacities{ - client: c.RESTClient(), - ns: namespace, + gentype.NewClientWithListAndApply[*v1beta1.CSIStorageCapacity, *v1beta1.CSIStorageCapacityList, *storagev1beta1.CSIStorageCapacityApplyConfiguration]( + "csistoragecapacities", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1beta1.CSIStorageCapacity { return &v1beta1.CSIStorageCapacity{} }, + func() *v1beta1.CSIStorageCapacityList { return &v1beta1.CSIStorageCapacityList{} }), } } - -// Get takes name of the cSIStorageCapacity, and returns the corresponding cSIStorageCapacity object, and an error if there is any. -func (c *cSIStorageCapacities) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CSIStorageCapacity, err error) { - result = &v1beta1.CSIStorageCapacity{} - err = c.client.Get(). - Namespace(c.ns). - Resource("csistoragecapacities"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. -func (c *cSIStorageCapacities) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CSIStorageCapacityList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for csistoragecapacities, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for csistoragecapacities", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for csistoragecapacities ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for csistoragecapacities", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. -func (c *cSIStorageCapacities) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIStorageCapacityList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.CSIStorageCapacityList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("csistoragecapacities"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of CSIStorageCapacities -func (c *cSIStorageCapacities) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIStorageCapacityList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.CSIStorageCapacityList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("csistoragecapacities"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested cSIStorageCapacities. -func (c *cSIStorageCapacities) 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("csistoragecapacities"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a cSIStorageCapacity and creates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. -func (c *cSIStorageCapacities) Create(ctx context.Context, cSIStorageCapacity *v1beta1.CSIStorageCapacity, opts v1.CreateOptions) (result *v1beta1.CSIStorageCapacity, err error) { - result = &v1beta1.CSIStorageCapacity{} - err = c.client.Post(). - Namespace(c.ns). - Resource("csistoragecapacities"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cSIStorageCapacity). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a cSIStorageCapacity and updates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any. -func (c *cSIStorageCapacities) Update(ctx context.Context, cSIStorageCapacity *v1beta1.CSIStorageCapacity, opts v1.UpdateOptions) (result *v1beta1.CSIStorageCapacity, err error) { - result = &v1beta1.CSIStorageCapacity{} - err = c.client.Put(). - Namespace(c.ns). - Resource("csistoragecapacities"). - Name(cSIStorageCapacity.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(cSIStorageCapacity). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the cSIStorageCapacity and deletes it. Returns an error if one occurs. -func (c *cSIStorageCapacities) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("csistoragecapacities"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *cSIStorageCapacities) 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("csistoragecapacities"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched cSIStorageCapacity. -func (c *cSIStorageCapacities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSIStorageCapacity, err error) { - result = &v1beta1.CSIStorageCapacity{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("csistoragecapacities"). - 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 cSIStorageCapacity. -func (c *cSIStorageCapacities) Apply(ctx context.Context, cSIStorageCapacity *storagev1beta1.CSIStorageCapacityApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CSIStorageCapacity, err error) { - if cSIStorageCapacity == nil { - return nil, fmt.Errorf("cSIStorageCapacity provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(cSIStorageCapacity) - if err != nil { - return nil, err - } - name := cSIStorageCapacity.Name - if name == nil { - return nil, fmt.Errorf("cSIStorageCapacity.Name must be provided to Apply") - } - result = &v1beta1.CSIStorageCapacity{} - err = c.client.Patch(types.ApplyPatchType). - Namespace(c.ns). - Resource("csistoragecapacities"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/storage/v1beta1/storageclass.go b/kubernetes/typed/storage/v1beta1/storageclass.go index 4a89634827..fed699cc85 100644 --- a/kubernetes/typed/storage/v1beta1/storageclass.go +++ b/kubernetes/typed/storage/v1beta1/storageclass.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // StorageClassesGetter has a method to return a StorageClassInterface. @@ -58,178 +52,18 @@ type StorageClassInterface interface { // storageClasses implements StorageClassInterface type storageClasses struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1beta1.StorageClass, *v1beta1.StorageClassList, *storagev1beta1.StorageClassApplyConfiguration] } // newStorageClasses returns a StorageClasses func newStorageClasses(c *StorageV1beta1Client) *storageClasses { return &storageClasses{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1beta1.StorageClass, *v1beta1.StorageClassList, *storagev1beta1.StorageClassApplyConfiguration]( + "storageclasses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.StorageClass { return &v1beta1.StorageClass{} }, + func() *v1beta1.StorageClassList { return &v1beta1.StorageClassList{} }), } } - -// Get takes name of the storageClass, and returns the corresponding storageClass object, and an error if there is any. -func (c *storageClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.StorageClass, err error) { - result = &v1beta1.StorageClass{} - err = c.client.Get(). - Resource("storageclasses"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of StorageClasses that match those selectors. -func (c *storageClasses) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.StorageClassList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for storageclasses, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for storageclasses", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for storageclasses ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for storageclasses", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of StorageClasses that match those selectors. -func (c *storageClasses) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StorageClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.StorageClassList{} - err = c.client.Get(). - Resource("storageclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of StorageClasses -func (c *storageClasses) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StorageClassList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.StorageClassList{} - err = c.client.Get(). - Resource("storageclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested storageClasses. -func (c *storageClasses) 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("storageclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a storageClass and creates it. Returns the server's representation of the storageClass, and an error, if there is any. -func (c *storageClasses) Create(ctx context.Context, storageClass *v1beta1.StorageClass, opts v1.CreateOptions) (result *v1beta1.StorageClass, err error) { - result = &v1beta1.StorageClass{} - err = c.client.Post(). - Resource("storageclasses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(storageClass). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a storageClass and updates it. Returns the server's representation of the storageClass, and an error, if there is any. -func (c *storageClasses) Update(ctx context.Context, storageClass *v1beta1.StorageClass, opts v1.UpdateOptions) (result *v1beta1.StorageClass, err error) { - result = &v1beta1.StorageClass{} - err = c.client.Put(). - Resource("storageclasses"). - Name(storageClass.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(storageClass). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the storageClass and deletes it. Returns an error if one occurs. -func (c *storageClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("storageclasses"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *storageClasses) 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("storageclasses"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched storageClass. -func (c *storageClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StorageClass, err error) { - result = &v1beta1.StorageClass{} - err = c.client.Patch(pt). - Resource("storageclasses"). - 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 storageClass. -func (c *storageClasses) Apply(ctx context.Context, storageClass *storagev1beta1.StorageClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.StorageClass, err error) { - if storageClass == nil { - return nil, fmt.Errorf("storageClass provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(storageClass) - if err != nil { - return nil, err - } - name := storageClass.Name - if name == nil { - return nil, fmt.Errorf("storageClass.Name must be provided to Apply") - } - result = &v1beta1.StorageClass{} - err = c.client.Patch(types.ApplyPatchType). - Resource("storageclasses"). - Name(*name). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/storage/v1beta1/volumeattachment.go b/kubernetes/typed/storage/v1beta1/volumeattachment.go index 0492a7a163..01024ce485 100644 --- a/kubernetes/typed/storage/v1beta1/volumeattachment.go +++ b/kubernetes/typed/storage/v1beta1/volumeattachment.go @@ -20,20 +20,14 @@ package v1beta1 import ( "context" - json "encoding/json" - "fmt" - "time" v1beta1 "k8s.io/api/storage/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // VolumeAttachmentsGetter has a method to return a VolumeAttachmentInterface. @@ -46,6 +40,7 @@ type VolumeAttachmentsGetter interface { type VolumeAttachmentInterface interface { Create(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.CreateOptions) (*v1beta1.VolumeAttachment, error) Update(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.UpdateOptions) (*v1beta1.VolumeAttachment, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.UpdateOptions) (*v1beta1.VolumeAttachment, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,228 +49,25 @@ type VolumeAttachmentInterface 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 *v1beta1.VolumeAttachment, err error) Apply(ctx context.Context, volumeAttachment *storagev1beta1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.VolumeAttachment, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, volumeAttachment *storagev1beta1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.VolumeAttachment, err error) VolumeAttachmentExpansion } // volumeAttachments implements VolumeAttachmentInterface type volumeAttachments struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1beta1.VolumeAttachment, *v1beta1.VolumeAttachmentList, *storagev1beta1.VolumeAttachmentApplyConfiguration] } // newVolumeAttachments returns a VolumeAttachments func newVolumeAttachments(c *StorageV1beta1Client) *volumeAttachments { return &volumeAttachments{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1beta1.VolumeAttachment, *v1beta1.VolumeAttachmentList, *storagev1beta1.VolumeAttachmentApplyConfiguration]( + "volumeattachments", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.VolumeAttachment { return &v1beta1.VolumeAttachment{} }, + func() *v1beta1.VolumeAttachmentList { return &v1beta1.VolumeAttachmentList{} }), } } - -// Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any. -func (c *volumeAttachments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeAttachment, err error) { - result = &v1beta1.VolumeAttachment{} - err = c.client.Get(). - Resource("volumeattachments"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. -func (c *volumeAttachments) List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VolumeAttachmentList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for volumeattachments, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for volumeattachments", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for volumeattachments ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for volumeattachments", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. -func (c *volumeAttachments) list(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeAttachmentList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.VolumeAttachmentList{} - err = c.client.Get(). - Resource("volumeattachments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of VolumeAttachments -func (c *volumeAttachments) watchList(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeAttachmentList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1beta1.VolumeAttachmentList{} - err = c.client.Get(). - Resource("volumeattachments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested volumeAttachments. -func (c *volumeAttachments) 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("volumeattachments"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. -func (c *volumeAttachments) Create(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.CreateOptions) (result *v1beta1.VolumeAttachment, err error) { - result = &v1beta1.VolumeAttachment{} - err = c.client.Post(). - Resource("volumeattachments"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volumeAttachment). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a volumeAttachment and updates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. -func (c *volumeAttachments) Update(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.UpdateOptions) (result *v1beta1.VolumeAttachment, err error) { - result = &v1beta1.VolumeAttachment{} - err = c.client.Put(). - Resource("volumeattachments"). - Name(volumeAttachment.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volumeAttachment). - 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 *volumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.UpdateOptions) (result *v1beta1.VolumeAttachment, err error) { - result = &v1beta1.VolumeAttachment{} - err = c.client.Put(). - Resource("volumeattachments"). - Name(volumeAttachment.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(volumeAttachment). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. -func (c *volumeAttachments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("volumeattachments"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *volumeAttachments) 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("volumeattachments"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched volumeAttachment. -func (c *volumeAttachments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeAttachment, err error) { - result = &v1beta1.VolumeAttachment{} - err = c.client.Patch(pt). - Resource("volumeattachments"). - 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 volumeAttachment. -func (c *volumeAttachments) Apply(ctx context.Context, volumeAttachment *storagev1beta1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.VolumeAttachment, err error) { - if volumeAttachment == nil { - return nil, fmt.Errorf("volumeAttachment provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(volumeAttachment) - if err != nil { - return nil, err - } - name := volumeAttachment.Name - if name == nil { - return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") - } - result = &v1beta1.VolumeAttachment{} - err = c.client.Patch(types.ApplyPatchType). - Resource("volumeattachments"). - 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 *volumeAttachments) ApplyStatus(ctx context.Context, volumeAttachment *storagev1beta1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.VolumeAttachment, err error) { - if volumeAttachment == nil { - return nil, fmt.Errorf("volumeAttachment provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(volumeAttachment) - if err != nil { - return nil, err - } - - name := volumeAttachment.Name - if name == nil { - return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply") - } - - result = &v1beta1.VolumeAttachment{} - err = c.client.Patch(types.ApplyPatchType). - Resource("volumeattachments"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/kubernetes/typed/storagemigration/v1alpha1/storageversionmigration.go b/kubernetes/typed/storagemigration/v1alpha1/storageversionmigration.go index 5b9356f9ca..5fc0fd5197 100644 --- a/kubernetes/typed/storagemigration/v1alpha1/storageversionmigration.go +++ b/kubernetes/typed/storagemigration/v1alpha1/storageversionmigration.go @@ -20,20 +20,14 @@ package v1alpha1 import ( "context" - json "encoding/json" - "fmt" - "time" v1alpha1 "k8s.io/api/storagemigration/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" storagemigrationv1alpha1 "k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1" + gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" - consistencydetector "k8s.io/client-go/util/consistencydetector" - watchlist "k8s.io/client-go/util/watchlist" - "k8s.io/klog/v2" ) // StorageVersionMigrationsGetter has a method to return a StorageVersionMigrationInterface. @@ -46,6 +40,7 @@ type StorageVersionMigrationsGetter interface { type StorageVersionMigrationInterface interface { Create(ctx context.Context, storageVersionMigration *v1alpha1.StorageVersionMigration, opts v1.CreateOptions) (*v1alpha1.StorageVersionMigration, error) Update(ctx context.Context, storageVersionMigration *v1alpha1.StorageVersionMigration, opts v1.UpdateOptions) (*v1alpha1.StorageVersionMigration, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). UpdateStatus(ctx context.Context, storageVersionMigration *v1alpha1.StorageVersionMigration, opts v1.UpdateOptions) (*v1alpha1.StorageVersionMigration, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error @@ -54,228 +49,25 @@ type StorageVersionMigrationInterface 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.StorageVersionMigration, err error) Apply(ctx context.Context, storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigrationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersionMigration, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). ApplyStatus(ctx context.Context, storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigrationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersionMigration, err error) StorageVersionMigrationExpansion } // storageVersionMigrations implements StorageVersionMigrationInterface type storageVersionMigrations struct { - client rest.Interface + *gentype.ClientWithListAndApply[*v1alpha1.StorageVersionMigration, *v1alpha1.StorageVersionMigrationList, *storagemigrationv1alpha1.StorageVersionMigrationApplyConfiguration] } // newStorageVersionMigrations returns a StorageVersionMigrations func newStorageVersionMigrations(c *StoragemigrationV1alpha1Client) *storageVersionMigrations { return &storageVersionMigrations{ - client: c.RESTClient(), + gentype.NewClientWithListAndApply[*v1alpha1.StorageVersionMigration, *v1alpha1.StorageVersionMigrationList, *storagemigrationv1alpha1.StorageVersionMigrationApplyConfiguration]( + "storageversionmigrations", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha1.StorageVersionMigration { return &v1alpha1.StorageVersionMigration{} }, + func() *v1alpha1.StorageVersionMigrationList { return &v1alpha1.StorageVersionMigrationList{} }), } } - -// Get takes name of the storageVersionMigration, and returns the corresponding storageVersionMigration object, and an error if there is any. -func (c *storageVersionMigrations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.StorageVersionMigration, err error) { - result = &v1alpha1.StorageVersionMigration{} - err = c.client.Get(). - Resource("storageversionmigrations"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of StorageVersionMigrations that match those selectors. -func (c *storageVersionMigrations) List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.StorageVersionMigrationList, error) { - if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { - klog.Warningf("Failed preparing watchlist options for storageversionmigrations, falling back to the standard LIST semantics, err = %v", watchListOptionsErr) - } else if hasWatchListOptionsPrepared { - result, err := c.watchList(ctx, watchListOptions) - if err == nil { - consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, "watchlist request for storageversionmigrations", c.list, opts, result) - return result, nil - } - klog.Warningf("The watchlist request for storageversionmigrations ended with an error, falling back to the standard LIST semantics, err = %v", err) - } - result, err := c.list(ctx, opts) - if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, "list request for storageversionmigrations", c.list, opts, result) - } - return result, err -} - -// list takes label and field selectors, and returns the list of StorageVersionMigrations that match those selectors. -func (c *storageVersionMigrations) list(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionMigrationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.StorageVersionMigrationList{} - err = c.client.Get(). - Resource("storageversionmigrations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// watchList establishes a watch stream with the server and returns the list of StorageVersionMigrations -func (c *storageVersionMigrations) watchList(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionMigrationList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.StorageVersionMigrationList{} - err = c.client.Get(). - Resource("storageversionmigrations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - WatchList(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested storageVersionMigrations. -func (c *storageVersionMigrations) 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("storageversionmigrations"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a storageVersionMigration and creates it. Returns the server's representation of the storageVersionMigration, and an error, if there is any. -func (c *storageVersionMigrations) Create(ctx context.Context, storageVersionMigration *v1alpha1.StorageVersionMigration, opts v1.CreateOptions) (result *v1alpha1.StorageVersionMigration, err error) { - result = &v1alpha1.StorageVersionMigration{} - err = c.client.Post(). - Resource("storageversionmigrations"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(storageVersionMigration). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a storageVersionMigration and updates it. Returns the server's representation of the storageVersionMigration, and an error, if there is any. -func (c *storageVersionMigrations) Update(ctx context.Context, storageVersionMigration *v1alpha1.StorageVersionMigration, opts v1.UpdateOptions) (result *v1alpha1.StorageVersionMigration, err error) { - result = &v1alpha1.StorageVersionMigration{} - err = c.client.Put(). - Resource("storageversionmigrations"). - Name(storageVersionMigration.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(storageVersionMigration). - 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 *storageVersionMigrations) UpdateStatus(ctx context.Context, storageVersionMigration *v1alpha1.StorageVersionMigration, opts v1.UpdateOptions) (result *v1alpha1.StorageVersionMigration, err error) { - result = &v1alpha1.StorageVersionMigration{} - err = c.client.Put(). - Resource("storageversionmigrations"). - Name(storageVersionMigration.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(storageVersionMigration). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the storageVersionMigration and deletes it. Returns an error if one occurs. -func (c *storageVersionMigrations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("storageversionmigrations"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *storageVersionMigrations) 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("storageversionmigrations"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched storageVersionMigration. -func (c *storageVersionMigrations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.StorageVersionMigration, err error) { - result = &v1alpha1.StorageVersionMigration{} - err = c.client.Patch(pt). - Resource("storageversionmigrations"). - 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 storageVersionMigration. -func (c *storageVersionMigrations) Apply(ctx context.Context, storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigrationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersionMigration, err error) { - if storageVersionMigration == nil { - return nil, fmt.Errorf("storageVersionMigration provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(storageVersionMigration) - if err != nil { - return nil, err - } - name := storageVersionMigration.Name - if name == nil { - return nil, fmt.Errorf("storageVersionMigration.Name must be provided to Apply") - } - result = &v1alpha1.StorageVersionMigration{} - err = c.client.Patch(types.ApplyPatchType). - Resource("storageversionmigrations"). - 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 *storageVersionMigrations) ApplyStatus(ctx context.Context, storageVersionMigration *storagemigrationv1alpha1.StorageVersionMigrationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersionMigration, err error) { - if storageVersionMigration == nil { - return nil, fmt.Errorf("storageVersionMigration provided to Apply must not be nil") - } - patchOpts := opts.ToPatchOptions() - data, err := json.Marshal(storageVersionMigration) - if err != nil { - return nil, err - } - - name := storageVersionMigration.Name - if name == nil { - return nil, fmt.Errorf("storageVersionMigration.Name must be provided to Apply") - } - - result = &v1alpha1.StorageVersionMigration{} - err = c.client.Patch(types.ApplyPatchType). - Resource("storageversionmigrations"). - Name(*name). - SubResource("status"). - VersionedParams(&patchOpts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} From 1582c4c03dc3afa8e557f3ac93ba8bc5dd9690ee Mon Sep 17 00:00:00 2001 From: Vinayak Goyal Date: Thu, 16 May 2024 21:18:34 +0000 Subject: [PATCH 092/159] KEP-4633: Allow health-only anonymous auth mode. Signed-off-by: Vinayak Goyal Kubernetes-commit: 5e6a4937f5a3e20dd77238946220461332ecddff --- rest/config_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest/config_test.go b/rest/config_test.go index 555727d29e..4fc74f545a 100644 --- a/rest/config_test.go +++ b/rest/config_test.go @@ -298,7 +298,7 @@ func (fakeAuthProviderConfigPersister) Persist(map[string]string) error { var fakeAuthProviderConfigPersisterError = errors.New("fakeAuthProviderConfigPersisterError") -func TestAnonymousConfig(t *testing.T) { +func TestAnonymousAuthConfig(t *testing.T) { f := fuzz.New().NilChance(0.0).NumElements(1, 1) f.Funcs( func(r *runtime.Codec, f fuzz.Continue) { From a146a0f3533ce24812993f881ba469cf2c27bffa Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Tue, 21 May 2024 11:58:12 +0000 Subject: [PATCH 093/159] make update Kubernetes-commit: bc8bce2ef98b85d642c7e805e8c6d1fd92cbcf53 --- applyconfigurations/internal/internal.go | 79 ++++++ .../networking/v1beta1/ipaddress.go | 253 +++++++++++++++++ .../networking/v1beta1/ipaddressspec.go | 39 +++ .../networking/v1beta1/parentreference.go | 66 +++++ .../networking/v1beta1/servicecidr.go | 262 ++++++++++++++++++ .../networking/v1beta1/servicecidrspec.go | 41 +++ .../networking/v1beta1/servicecidrstatus.go | 48 ++++ applyconfigurations/utils.go | 12 + informers/generic.go | 4 + informers/networking/v1beta1/interface.go | 14 + informers/networking/v1beta1/ipaddress.go | 89 ++++++ informers/networking/v1beta1/servicecidr.go | 89 ++++++ .../networking/v1beta1/fake/fake_ipaddress.go | 151 ++++++++++ .../v1beta1/fake/fake_networking_client.go | 8 + .../v1beta1/fake/fake_servicecidr.go | 186 +++++++++++++ .../networking/v1beta1/generated_expansion.go | 4 + .../typed/networking/v1beta1/ipaddress.go | 69 +++++ .../networking/v1beta1/networking_client.go | 10 + .../typed/networking/v1beta1/servicecidr.go | 73 +++++ .../networking/v1beta1/expansion_generated.go | 8 + listers/networking/v1beta1/ipaddress.go | 48 ++++ listers/networking/v1beta1/servicecidr.go | 48 ++++ 22 files changed, 1601 insertions(+) create mode 100644 applyconfigurations/networking/v1beta1/ipaddress.go create mode 100644 applyconfigurations/networking/v1beta1/ipaddressspec.go create mode 100644 applyconfigurations/networking/v1beta1/parentreference.go create mode 100644 applyconfigurations/networking/v1beta1/servicecidr.go create mode 100644 applyconfigurations/networking/v1beta1/servicecidrspec.go create mode 100644 applyconfigurations/networking/v1beta1/servicecidrstatus.go create mode 100644 informers/networking/v1beta1/ipaddress.go create mode 100644 informers/networking/v1beta1/servicecidr.go create mode 100644 kubernetes/typed/networking/v1beta1/fake/fake_ipaddress.go create mode 100644 kubernetes/typed/networking/v1beta1/fake/fake_servicecidr.go create mode 100644 kubernetes/typed/networking/v1beta1/ipaddress.go create mode 100644 kubernetes/typed/networking/v1beta1/servicecidr.go create mode 100644 listers/networking/v1beta1/ipaddress.go create mode 100644 listers/networking/v1beta1/servicecidr.go diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 4d3adf8bcc..0b04331415 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -11078,6 +11078,29 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.networking.v1beta1.HTTPIngressPath elementRelationship: atomic +- name: io.k8s.api.networking.v1beta1.IPAddress + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.networking.v1beta1.IPAddressSpec + default: {} +- name: io.k8s.api.networking.v1beta1.IPAddressSpec + map: + fields: + - name: parentRef + type: + namedType: io.k8s.api.networking.v1beta1.ParentReference - name: io.k8s.api.networking.v1beta1.Ingress map: fields: @@ -11244,6 +11267,62 @@ var schemaYAML = typed.YAMLObject(`types: - name: secretName type: scalar: string +- name: io.k8s.api.networking.v1beta1.ParentReference + map: + fields: + - name: group + type: + scalar: string + - name: name + type: + scalar: string + - name: namespace + type: + scalar: string + - name: resource + type: + scalar: string +- name: io.k8s.api.networking.v1beta1.ServiceCIDR + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.networking.v1beta1.ServiceCIDRSpec + default: {} + - name: status + type: + namedType: io.k8s.api.networking.v1beta1.ServiceCIDRStatus + default: {} +- name: io.k8s.api.networking.v1beta1.ServiceCIDRSpec + map: + fields: + - name: cidrs + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.networking.v1beta1.ServiceCIDRStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type - name: io.k8s.api.node.v1.Overhead map: fields: diff --git a/applyconfigurations/networking/v1beta1/ipaddress.go b/applyconfigurations/networking/v1beta1/ipaddress.go new file mode 100644 index 0000000000..3047d79b95 --- /dev/null +++ b/applyconfigurations/networking/v1beta1/ipaddress.go @@ -0,0 +1,253 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + networkingv1beta1 "k8s.io/api/networking/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// IPAddressApplyConfiguration represents a declarative configuration of the IPAddress type for use +// with apply. +type IPAddressApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *IPAddressSpecApplyConfiguration `json:"spec,omitempty"` +} + +// IPAddress constructs a declarative configuration of the IPAddress type for use with +// apply. +func IPAddress(name string) *IPAddressApplyConfiguration { + b := &IPAddressApplyConfiguration{} + b.WithName(name) + b.WithKind("IPAddress") + b.WithAPIVersion("networking.k8s.io/v1beta1") + return b +} + +// ExtractIPAddress extracts the applied configuration owned by fieldManager from +// iPAddress. If no managedFields are found in iPAddress for fieldManager, a +// IPAddressApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// iPAddress must be a unmodified IPAddress API object that was retrieved from the Kubernetes API. +// ExtractIPAddress provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractIPAddress(iPAddress *networkingv1beta1.IPAddress, fieldManager string) (*IPAddressApplyConfiguration, error) { + return extractIPAddress(iPAddress, fieldManager, "") +} + +// ExtractIPAddressStatus is the same as ExtractIPAddress except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractIPAddressStatus(iPAddress *networkingv1beta1.IPAddress, fieldManager string) (*IPAddressApplyConfiguration, error) { + return extractIPAddress(iPAddress, fieldManager, "status") +} + +func extractIPAddress(iPAddress *networkingv1beta1.IPAddress, fieldManager string, subresource string) (*IPAddressApplyConfiguration, error) { + b := &IPAddressApplyConfiguration{} + err := managedfields.ExtractInto(iPAddress, internal.Parser().Type("io.k8s.api.networking.v1beta1.IPAddress"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(iPAddress.Name) + + b.WithKind("IPAddress") + b.WithAPIVersion("networking.k8s.io/v1beta1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithKind(value string) *IPAddressApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithAPIVersion(value string) *IPAddressApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithName(value string) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithGenerateName(value string) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithNamespace(value string) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithUID(value types.UID) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithResourceVersion(value string) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithGeneration(value int64) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithCreationTimestamp(value metav1.Time) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *IPAddressApplyConfiguration) WithLabels(entries map[string]string) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *IPAddressApplyConfiguration) WithAnnotations(entries map[string]string) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *IPAddressApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *IPAddressApplyConfiguration) WithFinalizers(values ...string) *IPAddressApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *IPAddressApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *IPAddressApplyConfiguration) WithSpec(value *IPAddressSpecApplyConfiguration) *IPAddressApplyConfiguration { + 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/applyconfigurations/networking/v1beta1/ipaddressspec.go b/applyconfigurations/networking/v1beta1/ipaddressspec.go new file mode 100644 index 0000000000..76b02137d2 --- /dev/null +++ b/applyconfigurations/networking/v1beta1/ipaddressspec.go @@ -0,0 +1,39 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// IPAddressSpecApplyConfiguration represents a declarative configuration of the IPAddressSpec type for use +// with apply. +type IPAddressSpecApplyConfiguration struct { + ParentRef *ParentReferenceApplyConfiguration `json:"parentRef,omitempty"` +} + +// IPAddressSpecApplyConfiguration constructs a declarative configuration of the IPAddressSpec type for use with +// apply. +func IPAddressSpec() *IPAddressSpecApplyConfiguration { + return &IPAddressSpecApplyConfiguration{} +} + +// WithParentRef sets the ParentRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ParentRef field is set to the value of the last call. +func (b *IPAddressSpecApplyConfiguration) WithParentRef(value *ParentReferenceApplyConfiguration) *IPAddressSpecApplyConfiguration { + b.ParentRef = value + return b +} diff --git a/applyconfigurations/networking/v1beta1/parentreference.go b/applyconfigurations/networking/v1beta1/parentreference.go new file mode 100644 index 0000000000..1863938f16 --- /dev/null +++ b/applyconfigurations/networking/v1beta1/parentreference.go @@ -0,0 +1,66 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// ParentReferenceApplyConfiguration represents a declarative configuration of the ParentReference type for use +// with apply. +type ParentReferenceApplyConfiguration struct { + Group *string `json:"group,omitempty"` + Resource *string `json:"resource,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Name *string `json:"name,omitempty"` +} + +// ParentReferenceApplyConfiguration constructs a declarative configuration of the ParentReference type for use with +// apply. +func ParentReference() *ParentReferenceApplyConfiguration { + return &ParentReferenceApplyConfiguration{} +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *ParentReferenceApplyConfiguration) WithGroup(value string) *ParentReferenceApplyConfiguration { + b.Group = &value + return b +} + +// WithResource sets the Resource field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Resource field is set to the value of the last call. +func (b *ParentReferenceApplyConfiguration) WithResource(value string) *ParentReferenceApplyConfiguration { + b.Resource = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ParentReferenceApplyConfiguration) WithNamespace(value string) *ParentReferenceApplyConfiguration { + b.Namespace = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ParentReferenceApplyConfiguration) WithName(value string) *ParentReferenceApplyConfiguration { + b.Name = &value + return b +} diff --git a/applyconfigurations/networking/v1beta1/servicecidr.go b/applyconfigurations/networking/v1beta1/servicecidr.go new file mode 100644 index 0000000000..4ef8e9ecac --- /dev/null +++ b/applyconfigurations/networking/v1beta1/servicecidr.go @@ -0,0 +1,262 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + networkingv1beta1 "k8s.io/api/networking/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ServiceCIDRApplyConfiguration represents a declarative configuration of the ServiceCIDR type for use +// with apply. +type ServiceCIDRApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ServiceCIDRSpecApplyConfiguration `json:"spec,omitempty"` + Status *ServiceCIDRStatusApplyConfiguration `json:"status,omitempty"` +} + +// ServiceCIDR constructs a declarative configuration of the ServiceCIDR type for use with +// apply. +func ServiceCIDR(name string) *ServiceCIDRApplyConfiguration { + b := &ServiceCIDRApplyConfiguration{} + b.WithName(name) + b.WithKind("ServiceCIDR") + b.WithAPIVersion("networking.k8s.io/v1beta1") + return b +} + +// ExtractServiceCIDR extracts the applied configuration owned by fieldManager from +// serviceCIDR. If no managedFields are found in serviceCIDR for fieldManager, a +// ServiceCIDRApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// serviceCIDR must be a unmodified ServiceCIDR API object that was retrieved from the Kubernetes API. +// ExtractServiceCIDR provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractServiceCIDR(serviceCIDR *networkingv1beta1.ServiceCIDR, fieldManager string) (*ServiceCIDRApplyConfiguration, error) { + return extractServiceCIDR(serviceCIDR, fieldManager, "") +} + +// ExtractServiceCIDRStatus is the same as ExtractServiceCIDR except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractServiceCIDRStatus(serviceCIDR *networkingv1beta1.ServiceCIDR, fieldManager string) (*ServiceCIDRApplyConfiguration, error) { + return extractServiceCIDR(serviceCIDR, fieldManager, "status") +} + +func extractServiceCIDR(serviceCIDR *networkingv1beta1.ServiceCIDR, fieldManager string, subresource string) (*ServiceCIDRApplyConfiguration, error) { + b := &ServiceCIDRApplyConfiguration{} + err := managedfields.ExtractInto(serviceCIDR, internal.Parser().Type("io.k8s.api.networking.v1beta1.ServiceCIDR"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(serviceCIDR.Name) + + b.WithKind("ServiceCIDR") + b.WithAPIVersion("networking.k8s.io/v1beta1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithKind(value string) *ServiceCIDRApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithAPIVersion(value string) *ServiceCIDRApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithName(value string) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithGenerateName(value string) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithNamespace(value string) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithUID(value types.UID) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithResourceVersion(value string) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithGeneration(value int64) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ServiceCIDRApplyConfiguration) WithLabels(entries map[string]string) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ServiceCIDRApplyConfiguration) WithAnnotations(entries map[string]string) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ServiceCIDRApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ServiceCIDRApplyConfiguration) WithFinalizers(values ...string) *ServiceCIDRApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ServiceCIDRApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithSpec(value *ServiceCIDRSpecApplyConfiguration) *ServiceCIDRApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ServiceCIDRApplyConfiguration) WithStatus(value *ServiceCIDRStatusApplyConfiguration) *ServiceCIDRApplyConfiguration { + b.Status = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ServiceCIDRApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/networking/v1beta1/servicecidrspec.go b/applyconfigurations/networking/v1beta1/servicecidrspec.go new file mode 100644 index 0000000000..1f283532d3 --- /dev/null +++ b/applyconfigurations/networking/v1beta1/servicecidrspec.go @@ -0,0 +1,41 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// ServiceCIDRSpecApplyConfiguration represents a declarative configuration of the ServiceCIDRSpec type for use +// with apply. +type ServiceCIDRSpecApplyConfiguration struct { + CIDRs []string `json:"cidrs,omitempty"` +} + +// ServiceCIDRSpecApplyConfiguration constructs a declarative configuration of the ServiceCIDRSpec type for use with +// apply. +func ServiceCIDRSpec() *ServiceCIDRSpecApplyConfiguration { + return &ServiceCIDRSpecApplyConfiguration{} +} + +// WithCIDRs adds the given value to the CIDRs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CIDRs field. +func (b *ServiceCIDRSpecApplyConfiguration) WithCIDRs(values ...string) *ServiceCIDRSpecApplyConfiguration { + for i := range values { + b.CIDRs = append(b.CIDRs, values[i]) + } + return b +} diff --git a/applyconfigurations/networking/v1beta1/servicecidrstatus.go b/applyconfigurations/networking/v1beta1/servicecidrstatus.go new file mode 100644 index 0000000000..f2dd92404d --- /dev/null +++ b/applyconfigurations/networking/v1beta1/servicecidrstatus.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ServiceCIDRStatusApplyConfiguration represents a declarative configuration of the ServiceCIDRStatus type for use +// with apply. +type ServiceCIDRStatusApplyConfiguration struct { + Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"` +} + +// ServiceCIDRStatusApplyConfiguration constructs a declarative configuration of the ServiceCIDRStatus type for use with +// apply. +func ServiceCIDRStatus() *ServiceCIDRStatusApplyConfiguration { + return &ServiceCIDRStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *ServiceCIDRStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *ServiceCIDRStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index a0b2d90371..7672fb0917 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -1436,6 +1436,18 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationsnetworkingv1beta1.IngressStatusApplyConfiguration{} case networkingv1beta1.SchemeGroupVersion.WithKind("IngressTLS"): return &applyconfigurationsnetworkingv1beta1.IngressTLSApplyConfiguration{} + case networkingv1beta1.SchemeGroupVersion.WithKind("IPAddress"): + return &applyconfigurationsnetworkingv1beta1.IPAddressApplyConfiguration{} + case networkingv1beta1.SchemeGroupVersion.WithKind("IPAddressSpec"): + return &applyconfigurationsnetworkingv1beta1.IPAddressSpecApplyConfiguration{} + case networkingv1beta1.SchemeGroupVersion.WithKind("ParentReference"): + return &applyconfigurationsnetworkingv1beta1.ParentReferenceApplyConfiguration{} + case networkingv1beta1.SchemeGroupVersion.WithKind("ServiceCIDR"): + return &applyconfigurationsnetworkingv1beta1.ServiceCIDRApplyConfiguration{} + case networkingv1beta1.SchemeGroupVersion.WithKind("ServiceCIDRSpec"): + return &applyconfigurationsnetworkingv1beta1.ServiceCIDRSpecApplyConfiguration{} + case networkingv1beta1.SchemeGroupVersion.WithKind("ServiceCIDRStatus"): + return &applyconfigurationsnetworkingv1beta1.ServiceCIDRStatusApplyConfiguration{} // Group=node.k8s.io, Version=v1 case nodev1.SchemeGroupVersion.WithKind("Overhead"): diff --git a/informers/generic.go b/informers/generic.go index d85117587c..db1eb4a833 100644 --- a/informers/generic.go +++ b/informers/generic.go @@ -307,10 +307,14 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha1().ServiceCIDRs().Informer()}, nil // Group=networking.k8s.io, Version=v1beta1 + case networkingv1beta1.SchemeGroupVersion.WithResource("ipaddresses"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1beta1().IPAddresses().Informer()}, nil case networkingv1beta1.SchemeGroupVersion.WithResource("ingresses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1beta1().Ingresses().Informer()}, nil case networkingv1beta1.SchemeGroupVersion.WithResource("ingressclasses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1beta1().IngressClasses().Informer()}, nil + case networkingv1beta1.SchemeGroupVersion.WithResource("servicecidrs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1beta1().ServiceCIDRs().Informer()}, nil // Group=node.k8s.io, Version=v1 case nodev1.SchemeGroupVersion.WithResource("runtimeclasses"): diff --git a/informers/networking/v1beta1/interface.go b/informers/networking/v1beta1/interface.go index 2dcc3129a5..974a8fd5bf 100644 --- a/informers/networking/v1beta1/interface.go +++ b/informers/networking/v1beta1/interface.go @@ -24,10 +24,14 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { + // IPAddresses returns a IPAddressInformer. + IPAddresses() IPAddressInformer // Ingresses returns a IngressInformer. Ingresses() IngressInformer // IngressClasses returns a IngressClassInformer. IngressClasses() IngressClassInformer + // ServiceCIDRs returns a ServiceCIDRInformer. + ServiceCIDRs() ServiceCIDRInformer } type version struct { @@ -41,6 +45,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } +// IPAddresses returns a IPAddressInformer. +func (v *version) IPAddresses() IPAddressInformer { + return &iPAddressInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + // Ingresses returns a IngressInformer. func (v *version) Ingresses() IngressInformer { return &ingressInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} @@ -50,3 +59,8 @@ func (v *version) Ingresses() IngressInformer { func (v *version) IngressClasses() IngressClassInformer { return &ingressClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } + +// ServiceCIDRs returns a ServiceCIDRInformer. +func (v *version) ServiceCIDRs() ServiceCIDRInformer { + return &serviceCIDRInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/informers/networking/v1beta1/ipaddress.go b/informers/networking/v1beta1/ipaddress.go new file mode 100644 index 0000000000..2a2dfa2907 --- /dev/null +++ b/informers/networking/v1beta1/ipaddress.go @@ -0,0 +1,89 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + networkingv1beta1 "k8s.io/api/networking/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + v1beta1 "k8s.io/client-go/listers/networking/v1beta1" + cache "k8s.io/client-go/tools/cache" +) + +// IPAddressInformer provides access to a shared informer and lister for +// IPAddresses. +type IPAddressInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.IPAddressLister +} + +type iPAddressInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewIPAddressInformer constructs a new informer for IPAddress type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewIPAddressInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredIPAddressInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredIPAddressInformer constructs a new informer for IPAddress type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredIPAddressInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1beta1().IPAddresses().List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1beta1().IPAddresses().Watch(context.TODO(), options) + }, + }, + &networkingv1beta1.IPAddress{}, + resyncPeriod, + indexers, + ) +} + +func (f *iPAddressInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredIPAddressInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *iPAddressInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&networkingv1beta1.IPAddress{}, f.defaultInformer) +} + +func (f *iPAddressInformer) Lister() v1beta1.IPAddressLister { + return v1beta1.NewIPAddressLister(f.Informer().GetIndexer()) +} diff --git a/informers/networking/v1beta1/servicecidr.go b/informers/networking/v1beta1/servicecidr.go new file mode 100644 index 0000000000..d5a9ce0146 --- /dev/null +++ b/informers/networking/v1beta1/servicecidr.go @@ -0,0 +1,89 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + networkingv1beta1 "k8s.io/api/networking/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + v1beta1 "k8s.io/client-go/listers/networking/v1beta1" + cache "k8s.io/client-go/tools/cache" +) + +// ServiceCIDRInformer provides access to a shared informer and lister for +// ServiceCIDRs. +type ServiceCIDRInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.ServiceCIDRLister +} + +type serviceCIDRInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewServiceCIDRInformer constructs a new informer for ServiceCIDR type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewServiceCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredServiceCIDRInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredServiceCIDRInformer constructs a new informer for ServiceCIDR type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredServiceCIDRInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1beta1().ServiceCIDRs().List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1beta1().ServiceCIDRs().Watch(context.TODO(), options) + }, + }, + &networkingv1beta1.ServiceCIDR{}, + resyncPeriod, + indexers, + ) +} + +func (f *serviceCIDRInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredServiceCIDRInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *serviceCIDRInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&networkingv1beta1.ServiceCIDR{}, f.defaultInformer) +} + +func (f *serviceCIDRInformer) Lister() v1beta1.ServiceCIDRLister { + return v1beta1.NewServiceCIDRLister(f.Informer().GetIndexer()) +} diff --git a/kubernetes/typed/networking/v1beta1/fake/fake_ipaddress.go b/kubernetes/typed/networking/v1beta1/fake/fake_ipaddress.go new file mode 100644 index 0000000000..d8352bb79f --- /dev/null +++ b/kubernetes/typed/networking/v1beta1/fake/fake_ipaddress.go @@ -0,0 +1,151 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1beta1 "k8s.io/api/networking/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + networkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" + testing "k8s.io/client-go/testing" +) + +// FakeIPAddresses implements IPAddressInterface +type FakeIPAddresses struct { + Fake *FakeNetworkingV1beta1 +} + +var ipaddressesResource = v1beta1.SchemeGroupVersion.WithResource("ipaddresses") + +var ipaddressesKind = v1beta1.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 *v1beta1.IPAddress, err error) { + emptyResult := &v1beta1.IPAddress{} + obj, err := c.Fake. + Invokes(testing.NewRootGetActionWithOptions(ipaddressesResource, name, options), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1beta1.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 *v1beta1.IPAddressList, err error) { + emptyResult := &v1beta1.IPAddressList{} + obj, err := c.Fake. + Invokes(testing.NewRootListActionWithOptions(ipaddressesResource, ipaddressesKind, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.IPAddressList{ListMeta: obj.(*v1beta1.IPAddressList).ListMeta} + for _, item := range obj.(*v1beta1.IPAddressList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested iPAddresses. +func (c *FakeIPAddresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + 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 *v1beta1.IPAddress, opts v1.CreateOptions) (result *v1beta1.IPAddress, err error) { + emptyResult := &v1beta1.IPAddress{} + obj, err := c.Fake. + Invokes(testing.NewRootCreateActionWithOptions(ipaddressesResource, iPAddress, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1beta1.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 *v1beta1.IPAddress, opts v1.UpdateOptions) (result *v1beta1.IPAddress, err error) { + emptyResult := &v1beta1.IPAddress{} + obj, err := c.Fake. + Invokes(testing.NewRootUpdateActionWithOptions(ipaddressesResource, iPAddress, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1beta1.IPAddress), err +} + +// Delete takes name of the iPAddress and deletes it. Returns an error if one occurs. +func (c *FakeIPAddresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(ipaddressesResource, name, opts), &v1beta1.IPAddress{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeIPAddresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionActionWithOptions(ipaddressesResource, opts, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.IPAddressList{}) + return err +} + +// 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 *v1beta1.IPAddress, err error) { + emptyResult := &v1beta1.IPAddress{} + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceActionWithOptions(ipaddressesResource, name, pt, data, opts, subresources...), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1beta1.IPAddress), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied iPAddress. +func (c *FakeIPAddresses) Apply(ctx context.Context, iPAddress *networkingv1beta1.IPAddressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.IPAddress, err error) { + if iPAddress == nil { + return nil, fmt.Errorf("iPAddress provided to Apply must not be nil") + } + 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") + } + emptyResult := &v1beta1.IPAddress{} + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceActionWithOptions(ipaddressesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1beta1.IPAddress), err +} diff --git a/kubernetes/typed/networking/v1beta1/fake/fake_networking_client.go b/kubernetes/typed/networking/v1beta1/fake/fake_networking_client.go index b8792a3064..bd72d59297 100644 --- a/kubernetes/typed/networking/v1beta1/fake/fake_networking_client.go +++ b/kubernetes/typed/networking/v1beta1/fake/fake_networking_client.go @@ -28,6 +28,10 @@ type FakeNetworkingV1beta1 struct { *testing.Fake } +func (c *FakeNetworkingV1beta1) IPAddresses() v1beta1.IPAddressInterface { + return &FakeIPAddresses{c} +} + func (c *FakeNetworkingV1beta1) Ingresses(namespace string) v1beta1.IngressInterface { return &FakeIngresses{c, namespace} } @@ -36,6 +40,10 @@ func (c *FakeNetworkingV1beta1) IngressClasses() v1beta1.IngressClassInterface { return &FakeIngressClasses{c} } +func (c *FakeNetworkingV1beta1) ServiceCIDRs() v1beta1.ServiceCIDRInterface { + return &FakeServiceCIDRs{c} +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeNetworkingV1beta1) RESTClient() rest.Interface { diff --git a/kubernetes/typed/networking/v1beta1/fake/fake_servicecidr.go b/kubernetes/typed/networking/v1beta1/fake/fake_servicecidr.go new file mode 100644 index 0000000000..0eb5b2f2bb --- /dev/null +++ b/kubernetes/typed/networking/v1beta1/fake/fake_servicecidr.go @@ -0,0 +1,186 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1beta1 "k8s.io/api/networking/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + networkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" + testing "k8s.io/client-go/testing" +) + +// FakeServiceCIDRs implements ServiceCIDRInterface +type FakeServiceCIDRs struct { + Fake *FakeNetworkingV1beta1 +} + +var servicecidrsResource = v1beta1.SchemeGroupVersion.WithResource("servicecidrs") + +var servicecidrsKind = v1beta1.SchemeGroupVersion.WithKind("ServiceCIDR") + +// Get takes name of the serviceCIDR, and returns the corresponding serviceCIDR object, and an error if there is any. +func (c *FakeServiceCIDRs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ServiceCIDR, err error) { + emptyResult := &v1beta1.ServiceCIDR{} + obj, err := c.Fake. + Invokes(testing.NewRootGetActionWithOptions(servicecidrsResource, name, options), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1beta1.ServiceCIDR), err +} + +// List takes label and field selectors, and returns the list of ServiceCIDRs that match those selectors. +func (c *FakeServiceCIDRs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ServiceCIDRList, err error) { + emptyResult := &v1beta1.ServiceCIDRList{} + obj, err := c.Fake. + Invokes(testing.NewRootListActionWithOptions(servicecidrsResource, servicecidrsKind, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.ServiceCIDRList{ListMeta: obj.(*v1beta1.ServiceCIDRList).ListMeta} + for _, item := range obj.(*v1beta1.ServiceCIDRList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested serviceCIDRs. +func (c *FakeServiceCIDRs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchActionWithOptions(servicecidrsResource, opts)) +} + +// Create takes the representation of a serviceCIDR and creates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. +func (c *FakeServiceCIDRs) Create(ctx context.Context, serviceCIDR *v1beta1.ServiceCIDR, opts v1.CreateOptions) (result *v1beta1.ServiceCIDR, err error) { + emptyResult := &v1beta1.ServiceCIDR{} + obj, err := c.Fake. + Invokes(testing.NewRootCreateActionWithOptions(servicecidrsResource, serviceCIDR, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1beta1.ServiceCIDR), err +} + +// Update takes the representation of a serviceCIDR and updates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. +func (c *FakeServiceCIDRs) Update(ctx context.Context, serviceCIDR *v1beta1.ServiceCIDR, opts v1.UpdateOptions) (result *v1beta1.ServiceCIDR, err error) { + emptyResult := &v1beta1.ServiceCIDR{} + obj, err := c.Fake. + Invokes(testing.NewRootUpdateActionWithOptions(servicecidrsResource, serviceCIDR, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1beta1.ServiceCIDR), 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 *FakeServiceCIDRs) UpdateStatus(ctx context.Context, serviceCIDR *v1beta1.ServiceCIDR, opts v1.UpdateOptions) (result *v1beta1.ServiceCIDR, err error) { + emptyResult := &v1beta1.ServiceCIDR{} + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(servicecidrsResource, "status", serviceCIDR, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1beta1.ServiceCIDR), err +} + +// Delete takes name of the serviceCIDR and deletes it. Returns an error if one occurs. +func (c *FakeServiceCIDRs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(servicecidrsResource, name, opts), &v1beta1.ServiceCIDR{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceCIDRs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionActionWithOptions(servicecidrsResource, opts, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.ServiceCIDRList{}) + return err +} + +// Patch applies the patch and returns the patched serviceCIDR. +func (c *FakeServiceCIDRs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ServiceCIDR, err error) { + emptyResult := &v1beta1.ServiceCIDR{} + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceActionWithOptions(servicecidrsResource, name, pt, data, opts, subresources...), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1beta1.ServiceCIDR), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied serviceCIDR. +func (c *FakeServiceCIDRs) Apply(ctx context.Context, serviceCIDR *networkingv1beta1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ServiceCIDR, err error) { + if serviceCIDR == nil { + return nil, fmt.Errorf("serviceCIDR provided to Apply must not be nil") + } + data, err := json.Marshal(serviceCIDR) + if err != nil { + return nil, err + } + name := serviceCIDR.Name + if name == nil { + return nil, fmt.Errorf("serviceCIDR.Name must be provided to Apply") + } + emptyResult := &v1beta1.ServiceCIDR{} + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceActionWithOptions(servicecidrsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1beta1.ServiceCIDR), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeServiceCIDRs) ApplyStatus(ctx context.Context, serviceCIDR *networkingv1beta1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ServiceCIDR, err error) { + if serviceCIDR == nil { + return nil, fmt.Errorf("serviceCIDR provided to Apply must not be nil") + } + data, err := json.Marshal(serviceCIDR) + if err != nil { + return nil, err + } + name := serviceCIDR.Name + if name == nil { + return nil, fmt.Errorf("serviceCIDR.Name must be provided to Apply") + } + emptyResult := &v1beta1.ServiceCIDR{} + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceActionWithOptions(servicecidrsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1beta1.ServiceCIDR), err +} diff --git a/kubernetes/typed/networking/v1beta1/generated_expansion.go b/kubernetes/typed/networking/v1beta1/generated_expansion.go index f74c7257ad..ac1ffbb984 100644 --- a/kubernetes/typed/networking/v1beta1/generated_expansion.go +++ b/kubernetes/typed/networking/v1beta1/generated_expansion.go @@ -18,6 +18,10 @@ limitations under the License. package v1beta1 +type IPAddressExpansion interface{} + type IngressExpansion interface{} type IngressClassExpansion interface{} + +type ServiceCIDRExpansion interface{} diff --git a/kubernetes/typed/networking/v1beta1/ipaddress.go b/kubernetes/typed/networking/v1beta1/ipaddress.go new file mode 100644 index 0000000000..09e4139e74 --- /dev/null +++ b/kubernetes/typed/networking/v1beta1/ipaddress.go @@ -0,0 +1,69 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + + v1beta1 "k8s.io/api/networking/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + networkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// IPAddressesGetter has a method to return a IPAddressInterface. +// A group's client should implement this interface. +type IPAddressesGetter interface { + IPAddresses() IPAddressInterface +} + +// IPAddressInterface has methods to work with IPAddress resources. +type IPAddressInterface interface { + Create(ctx context.Context, iPAddress *v1beta1.IPAddress, opts v1.CreateOptions) (*v1beta1.IPAddress, error) + Update(ctx context.Context, iPAddress *v1beta1.IPAddress, opts v1.UpdateOptions) (*v1beta1.IPAddress, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.IPAddress, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IPAddressList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.IPAddress, err error) + Apply(ctx context.Context, iPAddress *networkingv1beta1.IPAddressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.IPAddress, err error) + IPAddressExpansion +} + +// iPAddresses implements IPAddressInterface +type iPAddresses struct { + *gentype.ClientWithListAndApply[*v1beta1.IPAddress, *v1beta1.IPAddressList, *networkingv1beta1.IPAddressApplyConfiguration] +} + +// newIPAddresses returns a IPAddresses +func newIPAddresses(c *NetworkingV1beta1Client) *iPAddresses { + return &iPAddresses{ + gentype.NewClientWithListAndApply[*v1beta1.IPAddress, *v1beta1.IPAddressList, *networkingv1beta1.IPAddressApplyConfiguration]( + "ipaddresses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.IPAddress { return &v1beta1.IPAddress{} }, + func() *v1beta1.IPAddressList { return &v1beta1.IPAddressList{} }), + } +} diff --git a/kubernetes/typed/networking/v1beta1/networking_client.go b/kubernetes/typed/networking/v1beta1/networking_client.go index 851634ed0f..d35225abd8 100644 --- a/kubernetes/typed/networking/v1beta1/networking_client.go +++ b/kubernetes/typed/networking/v1beta1/networking_client.go @@ -28,8 +28,10 @@ import ( type NetworkingV1beta1Interface interface { RESTClient() rest.Interface + IPAddressesGetter IngressesGetter IngressClassesGetter + ServiceCIDRsGetter } // NetworkingV1beta1Client is used to interact with features provided by the networking.k8s.io group. @@ -37,6 +39,10 @@ type NetworkingV1beta1Client struct { restClient rest.Interface } +func (c *NetworkingV1beta1Client) IPAddresses() IPAddressInterface { + return newIPAddresses(c) +} + func (c *NetworkingV1beta1Client) Ingresses(namespace string) IngressInterface { return newIngresses(c, namespace) } @@ -45,6 +51,10 @@ func (c *NetworkingV1beta1Client) IngressClasses() IngressClassInterface { return newIngressClasses(c) } +func (c *NetworkingV1beta1Client) ServiceCIDRs() ServiceCIDRInterface { + return newServiceCIDRs(c) +} + // NewForConfig creates a new NetworkingV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). diff --git a/kubernetes/typed/networking/v1beta1/servicecidr.go b/kubernetes/typed/networking/v1beta1/servicecidr.go new file mode 100644 index 0000000000..d3336f2ec0 --- /dev/null +++ b/kubernetes/typed/networking/v1beta1/servicecidr.go @@ -0,0 +1,73 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + + v1beta1 "k8s.io/api/networking/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + networkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// ServiceCIDRsGetter has a method to return a ServiceCIDRInterface. +// A group's client should implement this interface. +type ServiceCIDRsGetter interface { + ServiceCIDRs() ServiceCIDRInterface +} + +// ServiceCIDRInterface has methods to work with ServiceCIDR resources. +type ServiceCIDRInterface interface { + Create(ctx context.Context, serviceCIDR *v1beta1.ServiceCIDR, opts v1.CreateOptions) (*v1beta1.ServiceCIDR, error) + Update(ctx context.Context, serviceCIDR *v1beta1.ServiceCIDR, opts v1.UpdateOptions) (*v1beta1.ServiceCIDR, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, serviceCIDR *v1beta1.ServiceCIDR, opts v1.UpdateOptions) (*v1beta1.ServiceCIDR, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ServiceCIDR, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ServiceCIDRList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ServiceCIDR, err error) + Apply(ctx context.Context, serviceCIDR *networkingv1beta1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ServiceCIDR, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, serviceCIDR *networkingv1beta1.ServiceCIDRApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ServiceCIDR, err error) + ServiceCIDRExpansion +} + +// serviceCIDRs implements ServiceCIDRInterface +type serviceCIDRs struct { + *gentype.ClientWithListAndApply[*v1beta1.ServiceCIDR, *v1beta1.ServiceCIDRList, *networkingv1beta1.ServiceCIDRApplyConfiguration] +} + +// newServiceCIDRs returns a ServiceCIDRs +func newServiceCIDRs(c *NetworkingV1beta1Client) *serviceCIDRs { + return &serviceCIDRs{ + gentype.NewClientWithListAndApply[*v1beta1.ServiceCIDR, *v1beta1.ServiceCIDRList, *networkingv1beta1.ServiceCIDRApplyConfiguration]( + "servicecidrs", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.ServiceCIDR { return &v1beta1.ServiceCIDR{} }, + func() *v1beta1.ServiceCIDRList { return &v1beta1.ServiceCIDRList{} }), + } +} diff --git a/listers/networking/v1beta1/expansion_generated.go b/listers/networking/v1beta1/expansion_generated.go index d8c99c186e..320af736e6 100644 --- a/listers/networking/v1beta1/expansion_generated.go +++ b/listers/networking/v1beta1/expansion_generated.go @@ -18,6 +18,10 @@ limitations under the License. package v1beta1 +// IPAddressListerExpansion allows custom methods to be added to +// IPAddressLister. +type IPAddressListerExpansion interface{} + // IngressListerExpansion allows custom methods to be added to // IngressLister. type IngressListerExpansion interface{} @@ -29,3 +33,7 @@ type IngressNamespaceListerExpansion interface{} // IngressClassListerExpansion allows custom methods to be added to // IngressClassLister. type IngressClassListerExpansion interface{} + +// ServiceCIDRListerExpansion allows custom methods to be added to +// ServiceCIDRLister. +type ServiceCIDRListerExpansion interface{} diff --git a/listers/networking/v1beta1/ipaddress.go b/listers/networking/v1beta1/ipaddress.go new file mode 100644 index 0000000000..3614066701 --- /dev/null +++ b/listers/networking/v1beta1/ipaddress.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "k8s.io/api/networking/v1beta1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" + "k8s.io/client-go/tools/cache" +) + +// IPAddressLister helps list IPAddresses. +// All objects returned here must be treated as read-only. +type IPAddressLister interface { + // List lists all IPAddresses in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.IPAddress, err error) + // Get retrieves the IPAddress from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.IPAddress, error) + IPAddressListerExpansion +} + +// iPAddressLister implements the IPAddressLister interface. +type iPAddressLister struct { + listers.ResourceIndexer[*v1beta1.IPAddress] +} + +// NewIPAddressLister returns a new IPAddressLister. +func NewIPAddressLister(indexer cache.Indexer) IPAddressLister { + return &iPAddressLister{listers.New[*v1beta1.IPAddress](indexer, v1beta1.Resource("ipaddress"))} +} diff --git a/listers/networking/v1beta1/servicecidr.go b/listers/networking/v1beta1/servicecidr.go new file mode 100644 index 0000000000..2902fa7f15 --- /dev/null +++ b/listers/networking/v1beta1/servicecidr.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "k8s.io/api/networking/v1beta1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" + "k8s.io/client-go/tools/cache" +) + +// ServiceCIDRLister helps list ServiceCIDRs. +// All objects returned here must be treated as read-only. +type ServiceCIDRLister interface { + // List lists all ServiceCIDRs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.ServiceCIDR, err error) + // Get retrieves the ServiceCIDR from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.ServiceCIDR, error) + ServiceCIDRListerExpansion +} + +// serviceCIDRLister implements the ServiceCIDRLister interface. +type serviceCIDRLister struct { + listers.ResourceIndexer[*v1beta1.ServiceCIDR] +} + +// NewServiceCIDRLister returns a new ServiceCIDRLister. +func NewServiceCIDRLister(indexer cache.Indexer) ServiceCIDRLister { + return &serviceCIDRLister{listers.New[*v1beta1.ServiceCIDR](indexer, v1beta1.Resource("servicecidr"))} +} From fdffb523da401f0aa0a081e5613afcdfefde671f Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Fri, 24 May 2024 15:24:24 +0200 Subject: [PATCH 094/159] DRA: remove "source" indirection from v1 Pod API This makes the API nicer: resourceClaims: - name: with-template resourceClaimTemplateName: test-inline-claim-template - name: with-claim resourceClaimName: test-shared-claim Previously, this was: resourceClaims: - name: with-template source: resourceClaimTemplateName: test-inline-claim-template - name: with-claim source: resourceClaimName: test-shared-claim A more long-term benefit is that other, future alternatives might not make sense under the "source" umbrella. This is a breaking change. It's justified because DRA is still alpha and will have several other API breaks in 1.31. Kubernetes-commit: bde9b64cdfbbbb185593c20fea84cdced631ffd6 --- applyconfigurations/core/v1/claimsource.go | 48 ------------------- .../core/v1/podresourceclaim.go | 21 +++++--- applyconfigurations/internal/internal.go | 17 ++----- applyconfigurations/utils.go | 2 - 4 files changed, 20 insertions(+), 68 deletions(-) delete mode 100644 applyconfigurations/core/v1/claimsource.go diff --git a/applyconfigurations/core/v1/claimsource.go b/applyconfigurations/core/v1/claimsource.go deleted file mode 100644 index fcd4e664ee..0000000000 --- a/applyconfigurations/core/v1/claimsource.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1 - -// ClaimSourceApplyConfiguration represents a declarative configuration of the ClaimSource type for use -// with apply. -type ClaimSourceApplyConfiguration struct { - ResourceClaimName *string `json:"resourceClaimName,omitempty"` - ResourceClaimTemplateName *string `json:"resourceClaimTemplateName,omitempty"` -} - -// ClaimSourceApplyConfiguration constructs a declarative configuration of the ClaimSource type for use with -// apply. -func ClaimSource() *ClaimSourceApplyConfiguration { - return &ClaimSourceApplyConfiguration{} -} - -// WithResourceClaimName sets the ResourceClaimName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceClaimName field is set to the value of the last call. -func (b *ClaimSourceApplyConfiguration) WithResourceClaimName(value string) *ClaimSourceApplyConfiguration { - b.ResourceClaimName = &value - return b -} - -// WithResourceClaimTemplateName sets the ResourceClaimTemplateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceClaimTemplateName field is set to the value of the last call. -func (b *ClaimSourceApplyConfiguration) WithResourceClaimTemplateName(value string) *ClaimSourceApplyConfiguration { - b.ResourceClaimTemplateName = &value - return b -} diff --git a/applyconfigurations/core/v1/podresourceclaim.go b/applyconfigurations/core/v1/podresourceclaim.go index 8206210f79..b0bd67fa11 100644 --- a/applyconfigurations/core/v1/podresourceclaim.go +++ b/applyconfigurations/core/v1/podresourceclaim.go @@ -21,8 +21,9 @@ package v1 // PodResourceClaimApplyConfiguration represents a declarative configuration of the PodResourceClaim type for use // with apply. type PodResourceClaimApplyConfiguration struct { - Name *string `json:"name,omitempty"` - Source *ClaimSourceApplyConfiguration `json:"source,omitempty"` + Name *string `json:"name,omitempty"` + ResourceClaimName *string `json:"resourceClaimName,omitempty"` + ResourceClaimTemplateName *string `json:"resourceClaimTemplateName,omitempty"` } // PodResourceClaimApplyConfiguration constructs a declarative configuration of the PodResourceClaim type for use with @@ -39,10 +40,18 @@ func (b *PodResourceClaimApplyConfiguration) WithName(value string) *PodResource return b } -// WithSource sets the Source field in the declarative configuration to the given value +// WithResourceClaimName sets the ResourceClaimName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Source field is set to the value of the last call. -func (b *PodResourceClaimApplyConfiguration) WithSource(value *ClaimSourceApplyConfiguration) *PodResourceClaimApplyConfiguration { - b.Source = value +// If called multiple times, the ResourceClaimName field is set to the value of the last call. +func (b *PodResourceClaimApplyConfiguration) WithResourceClaimName(value string) *PodResourceClaimApplyConfiguration { + b.ResourceClaimName = &value + return b +} + +// WithResourceClaimTemplateName sets the ResourceClaimTemplateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceClaimTemplateName field is set to the value of the last call. +func (b *PodResourceClaimApplyConfiguration) WithResourceClaimTemplateName(value string) *PodResourceClaimApplyConfiguration { + b.ResourceClaimTemplateName = &value return b } diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 9178368616..4d3adf8bcc 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -4659,15 +4659,6 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" -- name: io.k8s.api.core.v1.ClaimSource - map: - fields: - - name: resourceClaimName - type: - scalar: string - - name: resourceClaimTemplateName - type: - scalar: string - name: io.k8s.api.core.v1.ClientIPConfig map: fields: @@ -6800,10 +6791,12 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" - - name: source + - name: resourceClaimName type: - namedType: io.k8s.api.core.v1.ClaimSource - default: {} + scalar: string + - name: resourceClaimTemplateName + type: + scalar: string - name: io.k8s.api.core.v1.PodResourceClaimStatus map: fields: diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index a43705fed9..a0b2d90371 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -644,8 +644,6 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationscorev1.CinderPersistentVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("CinderVolumeSource"): return &applyconfigurationscorev1.CinderVolumeSourceApplyConfiguration{} - case corev1.SchemeGroupVersion.WithKind("ClaimSource"): - return &applyconfigurationscorev1.ClaimSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ClientIPConfig"): return &applyconfigurationscorev1.ClientIPConfigApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ClusterTrustBundleProjection"): From e1202c7e8207b3667432f15444c733373d3de82b Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Wed, 19 Jun 2024 11:08:42 -0700 Subject: [PATCH 095/159] Merge pull request #121439 from skitt/generic-client-go Use generics to share code in client-go implementations Kubernetes-commit: 33829b68b5040f23e04ba5e68ed76792d68d698f --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 1db4fc3f00..416bd7b098 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240611003639-590e50434bf1 - k8s.io/apimachinery v0.0.0-20240613101152-30b7bf11450a + k8s.io/api v0.0.0-20240618060712-857a946a225f + k8s.io/apimachinery v0.0.0-20240619060407-af4f0d893aed k8s.io/klog/v2 v2.120.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b diff --git a/go.sum b/go.sum index f3e77eb93f..62055557ad 100644 --- a/go.sum +++ b/go.sum @@ -157,10 +157,10 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240611003639-590e50434bf1 h1:oxDdCGF5j63Mpb6Des2N1CCsNubC8scZdBm1DRAkwRM= -k8s.io/api v0.0.0-20240611003639-590e50434bf1/go.mod h1:5Cjw9MqZjRGElVN/sncIVEj4uQqmgd5uRSkUupucc3U= -k8s.io/apimachinery v0.0.0-20240613101152-30b7bf11450a h1:CS/axI7Kd2PJvIwtGyWqDFCTB++MXTCgXGQEYmAkqyo= -k8s.io/apimachinery v0.0.0-20240613101152-30b7bf11450a/go.mod h1:3nAExNh3CrzC6eKT9a32j/rv+uJ8Zod87oOmgUjZNAY= +k8s.io/api v0.0.0-20240618060712-857a946a225f h1:cMkTTwHUJDigBCSff2TzB6oNGtUPOHZU3wjJyLNmGcE= +k8s.io/api v0.0.0-20240618060712-857a946a225f/go.mod h1:3Qn7Lr7vb+c7Wsh0a3lmzcNAMAmmsd1iKStjMJZMsls= +k8s.io/apimachinery v0.0.0-20240619060407-af4f0d893aed h1:Nd6kFbT+zsuSHZdDQjRdxcDBwQVqZ1Tcowf/vnekHUo= +k8s.io/apimachinery v0.0.0-20240619060407-af4f0d893aed/go.mod h1:3nAExNh3CrzC6eKT9a32j/rv+uJ8Zod87oOmgUjZNAY= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From db174bf2ffb9abb16cfea6883df3e40119470767 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Sun, 16 Jun 2024 14:04:43 +0200 Subject: [PATCH 096/159] dependencies: klog v2.130.1 Kubernetes-commit: f98e5d1dfcaa37fee2c394436583038cf3ff1e72 --- go.mod | 12 +++++++++--- go.sum | 15 +++++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 416bd7b098..078d57f860 100644 --- a/go.mod +++ b/go.mod @@ -25,9 +25,9 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240618060712-857a946a225f - k8s.io/apimachinery v0.0.0-20240619060407-af4f0d893aed - k8s.io/klog/v2 v2.120.1 + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 + k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd @@ -62,3 +62,9 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace ( + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go +) diff --git a/go.sum b/go.sum index 62055557ad..7438825635 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,8 @@ +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -106,8 +109,10 @@ go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -142,6 +147,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -157,12 +163,9 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240618060712-857a946a225f h1:cMkTTwHUJDigBCSff2TzB6oNGtUPOHZU3wjJyLNmGcE= -k8s.io/api v0.0.0-20240618060712-857a946a225f/go.mod h1:3Qn7Lr7vb+c7Wsh0a3lmzcNAMAmmsd1iKStjMJZMsls= -k8s.io/apimachinery v0.0.0-20240619060407-af4f0d893aed h1:Nd6kFbT+zsuSHZdDQjRdxcDBwQVqZ1Tcowf/vnekHUo= -k8s.io/apimachinery v0.0.0-20240619060407-af4f0d893aed/go.mod h1:3nAExNh3CrzC6eKT9a32j/rv+uJ8Zod87oOmgUjZNAY= -k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= -k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= 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-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= From 0b664571bb33ccc7e0516f1f92c834df3654df19 Mon Sep 17 00:00:00 2001 From: Sean Sullivan Date: Sun, 16 Jun 2024 13:51:09 -0700 Subject: [PATCH 097/159] Adds logging during remote command executor fallback Kubernetes-commit: d8269e5a394dfa0116e8baeb7aac0a82eb430e5e --- tools/remotecommand/fallback.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/remotecommand/fallback.go b/tools/remotecommand/fallback.go index 3efde3c588..78620d33cf 100644 --- a/tools/remotecommand/fallback.go +++ b/tools/remotecommand/fallback.go @@ -18,6 +18,8 @@ package remotecommand import ( "context" + + "k8s.io/klog/v2" ) var _ Executor = &FallbackExecutor{} @@ -51,6 +53,7 @@ func (f *FallbackExecutor) Stream(options StreamOptions) error { func (f *FallbackExecutor) StreamWithContext(ctx context.Context, options StreamOptions) error { err := f.primary.StreamWithContext(ctx, options) if f.shouldFallback(err) { + klog.V(4).Infof("RemoteCommand fallback: %v", err) return f.secondary.StreamWithContext(ctx, options) } return err From fd8492c66f48867658b5933bf939edf967c6d4f0 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Wed, 19 Jun 2024 00:43:16 +0000 Subject: [PATCH 098/159] update OpenTelemetry dependencies Kubernetes-commit: 82e9ce79c763f1028f542b1246114082430e6b20 --- go.mod | 18 ++++++++++++------ go.sum | 32 ++++++++++++++++++-------------- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index 5f8f05cbbc..95a051356b 100644 --- a/go.mod +++ b/go.mod @@ -11,22 +11,22 @@ require ( github.com/google/gnostic-models v0.6.8 github.com/google/go-cmp v0.6.0 github.com/google/gofuzz v1.2.0 - github.com/google/uuid v1.3.1 + github.com/google/uuid v1.6.0 github.com/gorilla/websocket v1.5.0 github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 github.com/imdario/mergo v0.3.6 github.com/peterbourgon/diskv v2.0.1+incompatible github.com/spf13/pflag v1.0.5 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 go.uber.org/goleak v1.3.0 golang.org/x/net v0.25.0 golang.org/x/oauth2 v0.20.0 golang.org/x/term v0.20.0 golang.org/x/time v0.3.0 - google.golang.org/protobuf v1.33.0 + google.golang.org/protobuf v1.34.1 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240620180646-e09016fffd8e - k8s.io/apimachinery v0.0.0-20240624224638-0e02b52b8933 + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -37,7 +37,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/emicklei/go-restful/v3 v3.12.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0-beta // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect @@ -62,3 +62,9 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace ( + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go +) diff --git a/go.sum b/go.sum index 66ed1f591c..1eea798154 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,15 @@ +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -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/emicklei/go-restful/v3 v3.12.0 h1:y2DdzBAURM29NFF94q6RaY4vjIH1rtwDapwQtU84iWk= +github.com/emicklei/go-restful/v3 v3.12.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/fxamacker/cbor/v2 v2.7.0-beta h1:m5bO941uTVpSms26QjzEJxUZaC3S/h1pSJexBCu4wAA= github.com/fxamacker/cbor/v2 v2.7.0-beta/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= @@ -38,8 +41,8 @@ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM= github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= -github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= -github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -84,19 +87,20 @@ 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/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= 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/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -106,8 +110,10 @@ go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -142,8 +148,9 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= 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= @@ -157,10 +164,7 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240620180646-e09016fffd8e h1:sikgfs6oUZr6NPm/El/AQPSUb8OFsnI4Vkwch/o4l1g= -k8s.io/api v0.0.0-20240620180646-e09016fffd8e/go.mod h1:1MT1m3FZiytU3Iz+RVL9/0UV96hiPGA1mPCSCgP0QTk= -k8s.io/apimachinery v0.0.0-20240624224638-0e02b52b8933 h1:fsde6T4riRzZKW3G3hDHgPuUAGocYZt4NEGA5Q4HhmQ= -k8s.io/apimachinery v0.0.0-20240624224638-0e02b52b8933/go.mod h1:wKr/cy6yAwcKdBBcxyg2m/xTdMwHdCRNo7Wt2GxZEP8= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 64e74f9623f8a27b102198b91cf50bdc2e0ff685 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Wed, 19 Jun 2024 11:15:41 -0700 Subject: [PATCH 099/159] Use +default for now deprecated RBD volume THis leaves us less hand-written code and a better schema. Kubernetes-commit: 03f0110b953a171bfc985fc65a40ffe6820a6007 --- applyconfigurations/internal/internal.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 4b500dee0e..f2235f31a1 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -7262,6 +7262,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: keyring type: scalar: string + default: /etc/ceph/keyring - name: monitors type: list: @@ -7271,6 +7272,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: pool type: scalar: string + default: rbd - name: readOnly type: scalar: boolean @@ -7280,6 +7282,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: user type: scalar: string + default: admin - name: io.k8s.api.core.v1.RBDVolumeSource map: fields: @@ -7293,6 +7296,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: keyring type: scalar: string + default: /etc/ceph/keyring - name: monitors type: list: @@ -7302,6 +7306,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: pool type: scalar: string + default: rbd - name: readOnly type: scalar: boolean @@ -7311,6 +7316,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: user type: scalar: string + default: admin - name: io.k8s.api.core.v1.ReplicationController map: fields: From 90902b591f823627ff0a3a1565b915dc1dde85e5 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Wed, 19 Jun 2024 11:28:55 -0700 Subject: [PATCH 100/159] Use +default for now deprecated ISCSI volume Kubernetes-commit: 333c02cf28baa02a234b977f62a9a51f41c98572 --- applyconfigurations/internal/internal.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index f2235f31a1..416567b649 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -5702,6 +5702,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: iscsiInterface type: scalar: string + default: default - name: lun type: scalar: numeric @@ -5744,6 +5745,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: iscsiInterface type: scalar: string + default: default - name: lun type: scalar: numeric From f9b8f88e7db1dfcacc468c17611719480d1ff9a7 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Wed, 19 Jun 2024 11:45:22 -0700 Subject: [PATCH 101/159] Use +default for now deprecated AzureDisk volume Kubernetes-commit: 0f5ab4beec4d05138ed3fff5a5b2a7e42bf75d0c --- applyconfigurations/internal/internal.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 416567b649..b240df0276 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -4454,6 +4454,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: cachingMode type: scalar: string + default: ReadWrite - name: diskName type: scalar: string @@ -4465,12 +4466,15 @@ var schemaYAML = typed.YAMLObject(`types: - name: fsType type: scalar: string + default: ext4 - name: kind type: scalar: string + default: Shared - name: readOnly type: scalar: boolean + default: false - name: io.k8s.api.core.v1.AzureFilePersistentVolumeSource map: fields: From af263053891a60885afb738068c519d507f98853 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Wed, 19 Jun 2024 12:18:33 -0700 Subject: [PATCH 102/159] Use +default for now deprecated ScaleIO volume Kubernetes-commit: a074dd6f2e3ce394b767c109701045d13a56b6e2 --- applyconfigurations/internal/internal.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index b240df0276..9178368616 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -7523,6 +7523,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: fsType type: scalar: string + default: xfs - name: gateway type: scalar: string @@ -7542,6 +7543,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: storageMode type: scalar: string + default: ThinProvisioned - name: storagePool type: scalar: string @@ -7558,6 +7560,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: fsType type: scalar: string + default: xfs - name: gateway type: scalar: string @@ -7577,6 +7580,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: storageMode type: scalar: string + default: ThinProvisioned - name: storagePool type: scalar: string From b9309ac26b168965a720c26e3f5329e563ae0c92 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Thu, 20 Jun 2024 07:13:40 -0700 Subject: [PATCH 103/159] Merge pull request #125531 from pohly/klog-update dependencies: klog v2.130.1 Kubernetes-commit: 44446e1c9c2e7f50061f2a998c76f6f55f3ca737 --- go.mod | 10 ++-------- go.sum | 11 ++++------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 078d57f860..4fc2b570f7 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0 - k8s.io/apimachinery v0.0.0 + k8s.io/api v0.0.0-20240620180645-9f6f03ff043b + k8s.io/apimachinery v0.0.0-20240620180412-04fe5186a7b1 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -62,9 +62,3 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace ( - k8s.io/api => ../api - k8s.io/apimachinery => ../apimachinery - k8s.io/client-go => ../client-go -) diff --git a/go.sum b/go.sum index 7438825635..d7604e6052 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,5 @@ -cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -109,10 +106,8 @@ go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -147,7 +142,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -163,7 +157,10 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= +k8s.io/api v0.0.0-20240620180645-9f6f03ff043b h1:MlO1MxAa8kX7fiaDMVyFJYqqancoCHGggG9UurjrKNc= +k8s.io/api v0.0.0-20240620180645-9f6f03ff043b/go.mod h1:1MT1m3FZiytU3Iz+RVL9/0UV96hiPGA1mPCSCgP0QTk= +k8s.io/apimachinery v0.0.0-20240620180412-04fe5186a7b1 h1:avzIPRkvVSlb207+JV7eZv498CJ0EBDMKvwmcTS3m2k= +k8s.io/apimachinery v0.0.0-20240620180412-04fe5186a7b1/go.mod h1:wKr/cy6yAwcKdBBcxyg2m/xTdMwHdCRNo7Wt2GxZEP8= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 96f66e9159ef1d3a8a7ce1dc31d0e5077f55e1d4 Mon Sep 17 00:00:00 2001 From: Joe Betz Date: Mon, 24 Jun 2024 15:41:38 -0400 Subject: [PATCH 104/159] Support options for all client fake actions Kubernetes-commit: 599f03c72264d5149ae63b1c9eccb33e8b32e900 --- testing/actions.go | 235 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 217 insertions(+), 18 deletions(-) diff --git a/testing/actions.go b/testing/actions.go index c8ae0aaf5d..270cc4ddbd 100644 --- a/testing/actions.go +++ b/testing/actions.go @@ -30,41 +30,61 @@ import ( ) func NewRootGetAction(resource schema.GroupVersionResource, name string) GetActionImpl { + return NewRootGetActionWithOptions(resource, name, metav1.GetOptions{}) +} + +func NewRootGetActionWithOptions(resource schema.GroupVersionResource, name string, opts metav1.GetOptions) GetActionImpl { action := GetActionImpl{} action.Verb = "get" action.Resource = resource action.Name = name + action.GetOptions = opts return action } func NewGetAction(resource schema.GroupVersionResource, namespace, name string) GetActionImpl { + return NewGetActionWithOptions(resource, namespace, name, metav1.GetOptions{}) +} + +func NewGetActionWithOptions(resource schema.GroupVersionResource, namespace, name string, opts metav1.GetOptions) GetActionImpl { action := GetActionImpl{} action.Verb = "get" action.Resource = resource action.Namespace = namespace action.Name = name + action.GetOptions = opts return action } func NewGetSubresourceAction(resource schema.GroupVersionResource, namespace, subresource, name string) GetActionImpl { + return NewGetSubresourceActionWithOptions(resource, namespace, subresource, name, metav1.GetOptions{}) +} + +func NewGetSubresourceActionWithOptions(resource schema.GroupVersionResource, namespace, subresource, name string, opts metav1.GetOptions) GetActionImpl { action := GetActionImpl{} action.Verb = "get" action.Resource = resource action.Subresource = subresource action.Namespace = namespace action.Name = name + action.GetOptions = opts return action } func NewRootGetSubresourceAction(resource schema.GroupVersionResource, subresource, name string) GetActionImpl { + return NewRootGetSubresourceActionWithOptions(resource, subresource, name, metav1.GetOptions{}) +} + +func NewRootGetSubresourceActionWithOptions(resource schema.GroupVersionResource, subresource, name string, opts metav1.GetOptions) GetActionImpl { action := GetActionImpl{} action.Verb = "get" action.Resource = resource action.Subresource = subresource action.Name = name + action.GetOptions = opts return action } @@ -76,6 +96,21 @@ func NewRootListAction(resource schema.GroupVersionResource, kind schema.GroupVe action.Kind = kind labelSelector, fieldSelector, _ := ExtractFromListOptions(opts) action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector} + action.ListOptions = metav1.ListOptions{LabelSelector: labelSelector.String(), FieldSelector: fieldSelector.String()} + + return action +} + +func NewRootListActionWithOptions(resource schema.GroupVersionResource, kind schema.GroupVersionKind, opts metav1.ListOptions) ListActionImpl { + action := ListActionImpl{} + action.Verb = "list" + action.Resource = resource + action.Kind = kind + action.ListOptions = opts + + labelSelector, fieldSelector, _ := ExtractFromListOptions(opts) + action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector} + action.ListOptions = metav1.ListOptions{LabelSelector: labelSelector.String(), FieldSelector: fieldSelector.String()} return action } @@ -86,6 +121,21 @@ func NewListAction(resource schema.GroupVersionResource, kind schema.GroupVersio action.Resource = resource action.Kind = kind action.Namespace = namespace + labelSelector, fieldSelector, _ := ExtractFromListOptions(opts) + action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector} + action.ListOptions = metav1.ListOptions{LabelSelector: labelSelector.String(), FieldSelector: fieldSelector.String()} + + return action +} + +func NewListActionWithOptions(resource schema.GroupVersionResource, kind schema.GroupVersionKind, namespace string, opts metav1.ListOptions) ListActionImpl { + action := ListActionImpl{} + action.Verb = "list" + action.Resource = resource + action.Kind = kind + action.Namespace = namespace + action.ListOptions = opts + labelSelector, fieldSelector, _ := ExtractFromListOptions(opts) action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector} @@ -93,36 +143,55 @@ func NewListAction(resource schema.GroupVersionResource, kind schema.GroupVersio } func NewRootCreateAction(resource schema.GroupVersionResource, object runtime.Object) CreateActionImpl { + return NewRootCreateActionWithOptions(resource, object, metav1.CreateOptions{}) +} + +func NewRootCreateActionWithOptions(resource schema.GroupVersionResource, object runtime.Object, opts metav1.CreateOptions) CreateActionImpl { action := CreateActionImpl{} action.Verb = "create" action.Resource = resource action.Object = object + action.CreateOptions = opts return action } func NewCreateAction(resource schema.GroupVersionResource, namespace string, object runtime.Object) CreateActionImpl { + return NewCreateActionWithOptions(resource, namespace, object, metav1.CreateOptions{}) +} + +func NewCreateActionWithOptions(resource schema.GroupVersionResource, namespace string, object runtime.Object, opts metav1.CreateOptions) CreateActionImpl { action := CreateActionImpl{} action.Verb = "create" action.Resource = resource action.Namespace = namespace action.Object = object + action.CreateOptions = opts return action } func NewRootCreateSubresourceAction(resource schema.GroupVersionResource, name, subresource string, object runtime.Object) CreateActionImpl { + return NewRootCreateSubresourceActionWithOptions(resource, name, subresource, object, metav1.CreateOptions{}) +} + +func NewRootCreateSubresourceActionWithOptions(resource schema.GroupVersionResource, name, subresource string, object runtime.Object, opts metav1.CreateOptions) CreateActionImpl { action := CreateActionImpl{} action.Verb = "create" action.Resource = resource action.Subresource = subresource action.Name = name action.Object = object + action.CreateOptions = opts return action } func NewCreateSubresourceAction(resource schema.GroupVersionResource, name, subresource, namespace string, object runtime.Object) CreateActionImpl { + return NewCreateSubresourceActionWithOptions(resource, name, subresource, namespace, object, metav1.CreateOptions{}) +} + +func NewCreateSubresourceActionWithOptions(resource schema.GroupVersionResource, name, subresource, namespace string, object runtime.Object, opts metav1.CreateOptions) CreateActionImpl { action := CreateActionImpl{} action.Verb = "create" action.Resource = resource @@ -130,41 +199,61 @@ func NewCreateSubresourceAction(resource schema.GroupVersionResource, name, subr action.Subresource = subresource action.Name = name action.Object = object + action.CreateOptions = opts return action } func NewRootUpdateAction(resource schema.GroupVersionResource, object runtime.Object) UpdateActionImpl { + return NewRootUpdateActionWithOptions(resource, object, metav1.UpdateOptions{}) +} + +func NewRootUpdateActionWithOptions(resource schema.GroupVersionResource, object runtime.Object, opts metav1.UpdateOptions) UpdateActionImpl { action := UpdateActionImpl{} action.Verb = "update" action.Resource = resource action.Object = object + action.UpdateOptions = opts return action } func NewUpdateAction(resource schema.GroupVersionResource, namespace string, object runtime.Object) UpdateActionImpl { + return NewUpdateActionWithOptions(resource, namespace, object, metav1.UpdateOptions{}) +} + +func NewUpdateActionWithOptions(resource schema.GroupVersionResource, namespace string, object runtime.Object, opts metav1.UpdateOptions) UpdateActionImpl { action := UpdateActionImpl{} action.Verb = "update" action.Resource = resource action.Namespace = namespace action.Object = object + action.UpdateOptions = opts return action } func NewRootPatchAction(resource schema.GroupVersionResource, name string, pt types.PatchType, patch []byte) PatchActionImpl { + return NewRootPatchActionWithOptions(resource, name, pt, patch, metav1.PatchOptions{}) +} + +func NewRootPatchActionWithOptions(resource schema.GroupVersionResource, name string, pt types.PatchType, patch []byte, opts metav1.PatchOptions) PatchActionImpl { action := PatchActionImpl{} action.Verb = "patch" action.Resource = resource action.Name = name action.PatchType = pt action.Patch = patch + action.PatchOptions = opts return action } func NewPatchAction(resource schema.GroupVersionResource, namespace string, name string, pt types.PatchType, patch []byte) PatchActionImpl { + return NewPatchActionWithOptions(resource, namespace, name, pt, patch, metav1.PatchOptions{}) +} + +func NewPatchActionWithOptions(resource schema.GroupVersionResource, namespace string, name string, pt types.PatchType, patch []byte, opts metav1.PatchOptions) PatchActionImpl { action := PatchActionImpl{} action.Verb = "patch" action.Resource = resource @@ -172,11 +261,16 @@ func NewPatchAction(resource schema.GroupVersionResource, namespace string, name action.Name = name action.PatchType = pt action.Patch = patch + action.PatchOptions = opts return action } func NewRootPatchSubresourceAction(resource schema.GroupVersionResource, name string, pt types.PatchType, patch []byte, subresources ...string) PatchActionImpl { + return NewRootPatchSubresourceActionWithOptions(resource, name, pt, patch, metav1.PatchOptions{}, subresources...) +} + +func NewRootPatchSubresourceActionWithOptions(resource schema.GroupVersionResource, name string, pt types.PatchType, patch []byte, opts metav1.PatchOptions, subresources ...string) PatchActionImpl { action := PatchActionImpl{} action.Verb = "patch" action.Resource = resource @@ -184,11 +278,16 @@ func NewRootPatchSubresourceAction(resource schema.GroupVersionResource, name st action.Name = name action.PatchType = pt action.Patch = patch + action.PatchOptions = opts return action } func NewPatchSubresourceAction(resource schema.GroupVersionResource, namespace, name string, pt types.PatchType, patch []byte, subresources ...string) PatchActionImpl { + return NewPatchSubresourceActionWithOptions(resource, namespace, name, pt, patch, metav1.PatchOptions{}, subresources...) +} + +func NewPatchSubresourceActionWithOptions(resource schema.GroupVersionResource, namespace, name string, pt types.PatchType, patch []byte, opts metav1.PatchOptions, subresources ...string) PatchActionImpl { action := PatchActionImpl{} action.Verb = "patch" action.Resource = resource @@ -197,26 +296,38 @@ func NewPatchSubresourceAction(resource schema.GroupVersionResource, namespace, action.Name = name action.PatchType = pt action.Patch = patch + action.PatchOptions = opts return action } func NewRootUpdateSubresourceAction(resource schema.GroupVersionResource, subresource string, object runtime.Object) UpdateActionImpl { + return NewRootUpdateSubresourceActionWithOptions(resource, subresource, object, metav1.UpdateOptions{}) +} + +func NewRootUpdateSubresourceActionWithOptions(resource schema.GroupVersionResource, subresource string, object runtime.Object, opts metav1.UpdateOptions) UpdateActionImpl { action := UpdateActionImpl{} action.Verb = "update" action.Resource = resource action.Subresource = subresource action.Object = object + action.UpdateOptions = opts return action } + func NewUpdateSubresourceAction(resource schema.GroupVersionResource, subresource string, namespace string, object runtime.Object) UpdateActionImpl { + return NewUpdateSubresourceActionWithOptions(resource, subresource, namespace, object, metav1.UpdateOptions{}) +} + +func NewUpdateSubresourceActionWithOptions(resource schema.GroupVersionResource, subresource string, namespace string, object runtime.Object, opts metav1.UpdateOptions) UpdateActionImpl { action := UpdateActionImpl{} action.Verb = "update" action.Resource = resource action.Subresource = subresource action.Namespace = namespace action.Object = object + action.UpdateOptions = opts return action } @@ -236,11 +347,16 @@ func NewRootDeleteActionWithOptions(resource schema.GroupVersionResource, name s } func NewRootDeleteSubresourceAction(resource schema.GroupVersionResource, subresource string, name string) DeleteActionImpl { + return NewRootDeleteSubresourceActionWithOptions(resource, subresource, name, metav1.DeleteOptions{}) +} + +func NewRootDeleteSubresourceActionWithOptions(resource schema.GroupVersionResource, subresource string, name string, opts metav1.DeleteOptions) DeleteActionImpl { action := DeleteActionImpl{} action.Verb = "delete" action.Resource = resource action.Subresource = subresource action.Name = name + action.DeleteOptions = opts return action } @@ -261,41 +377,69 @@ func NewDeleteActionWithOptions(resource schema.GroupVersionResource, namespace, } func NewDeleteSubresourceAction(resource schema.GroupVersionResource, subresource, namespace, name string) DeleteActionImpl { + return NewDeleteSubresourceActionWithOptions(resource, subresource, namespace, name, metav1.DeleteOptions{}) +} + +func NewDeleteSubresourceActionWithOptions(resource schema.GroupVersionResource, subresource, namespace, name string, opts metav1.DeleteOptions) DeleteActionImpl { action := DeleteActionImpl{} action.Verb = "delete" action.Resource = resource action.Subresource = subresource action.Namespace = namespace action.Name = name + action.DeleteOptions = opts return action } func NewRootDeleteCollectionAction(resource schema.GroupVersionResource, opts interface{}) DeleteCollectionActionImpl { + listOpts, _ := opts.(metav1.ListOptions) + return NewRootDeleteCollectionActionWithOptions(resource, metav1.DeleteOptions{}, listOpts) +} + +func NewRootDeleteCollectionActionWithOptions(resource schema.GroupVersionResource, deleteOpts metav1.DeleteOptions, listOpts metav1.ListOptions) DeleteCollectionActionImpl { action := DeleteCollectionActionImpl{} action.Verb = "delete-collection" action.Resource = resource - labelSelector, fieldSelector, _ := ExtractFromListOptions(opts) + action.DeleteOptions = deleteOpts + action.ListOptions = listOpts + + labelSelector, fieldSelector, _ := ExtractFromListOptions(listOpts) action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector} return action } func NewDeleteCollectionAction(resource schema.GroupVersionResource, namespace string, opts interface{}) DeleteCollectionActionImpl { + listOpts, _ := opts.(metav1.ListOptions) + return NewDeleteCollectionActionWithOptions(resource, namespace, metav1.DeleteOptions{}, listOpts) +} + +func NewDeleteCollectionActionWithOptions(resource schema.GroupVersionResource, namespace string, deleteOpts metav1.DeleteOptions, listOpts metav1.ListOptions) DeleteCollectionActionImpl { action := DeleteCollectionActionImpl{} action.Verb = "delete-collection" action.Resource = resource action.Namespace = namespace - labelSelector, fieldSelector, _ := ExtractFromListOptions(opts) + action.DeleteOptions = deleteOpts + action.ListOptions = listOpts + + labelSelector, fieldSelector, _ := ExtractFromListOptions(listOpts) action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector} return action } func NewRootWatchAction(resource schema.GroupVersionResource, opts interface{}) WatchActionImpl { + listOpts, _ := opts.(metav1.ListOptions) + return NewRootWatchActionWithOptions(resource, listOpts) +} + +func NewRootWatchActionWithOptions(resource schema.GroupVersionResource, opts metav1.ListOptions) WatchActionImpl { action := WatchActionImpl{} action.Verb = "watch" action.Resource = resource + action.ListOptions = opts + labelSelector, fieldSelector, resourceVersion := ExtractFromListOptions(opts) action.WatchRestrictions = WatchRestrictions{labelSelector, fieldSelector, resourceVersion} @@ -328,10 +472,17 @@ func ExtractFromListOptions(opts interface{}) (labelSelector labels.Selector, fi } func NewWatchAction(resource schema.GroupVersionResource, namespace string, opts interface{}) WatchActionImpl { + listOpts, _ := opts.(metav1.ListOptions) + return NewWatchActionWithOptions(resource, namespace, listOpts) +} + +func NewWatchActionWithOptions(resource schema.GroupVersionResource, namespace string, opts metav1.ListOptions) WatchActionImpl { action := WatchActionImpl{} action.Verb = "watch" action.Resource = resource action.Namespace = namespace + action.ListOptions = opts + labelSelector, fieldSelector, resourceVersion := ExtractFromListOptions(opts) action.WatchRestrictions = WatchRestrictions{labelSelector, fieldSelector, resourceVersion} @@ -487,17 +638,23 @@ func (a GenericActionImpl) DeepCopy() Action { type GetActionImpl struct { ActionImpl - Name string + Name string + GetOptions metav1.GetOptions } func (a GetActionImpl) GetName() string { return a.Name } +func (a GetActionImpl) GetGetOptions() metav1.GetOptions { + return a.GetOptions +} + func (a GetActionImpl) DeepCopy() Action { return GetActionImpl{ ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), Name: a.Name, + GetOptions: *a.GetOptions.DeepCopy(), } } @@ -506,6 +663,7 @@ type ListActionImpl struct { Kind schema.GroupVersionKind Name string ListRestrictions ListRestrictions + ListOptions metav1.ListOptions } func (a ListActionImpl) GetKind() schema.GroupVersionKind { @@ -516,6 +674,10 @@ func (a ListActionImpl) GetListRestrictions() ListRestrictions { return a.ListRestrictions } +func (a ListActionImpl) GetListOptions() metav1.ListOptions { + return a.ListOptions +} + func (a ListActionImpl) DeepCopy() Action { return ListActionImpl{ ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), @@ -525,48 +687,62 @@ func (a ListActionImpl) DeepCopy() Action { Labels: a.ListRestrictions.Labels.DeepCopySelector(), Fields: a.ListRestrictions.Fields.DeepCopySelector(), }, + ListOptions: *a.ListOptions.DeepCopy(), } } type CreateActionImpl struct { ActionImpl - Name string - Object runtime.Object + Name string + Object runtime.Object + CreateOptions metav1.CreateOptions } func (a CreateActionImpl) GetObject() runtime.Object { return a.Object } +func (a CreateActionImpl) GetCreateOptions() metav1.CreateOptions { + return a.CreateOptions +} + func (a CreateActionImpl) DeepCopy() Action { return CreateActionImpl{ - ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), - Name: a.Name, - Object: a.Object.DeepCopyObject(), + ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), + Name: a.Name, + Object: a.Object.DeepCopyObject(), + CreateOptions: *a.CreateOptions.DeepCopy(), } } type UpdateActionImpl struct { ActionImpl - Object runtime.Object + Object runtime.Object + UpdateOptions metav1.UpdateOptions } func (a UpdateActionImpl) GetObject() runtime.Object { return a.Object } +func (a UpdateActionImpl) GetUpdateOptions() metav1.UpdateOptions { + return a.UpdateOptions +} + func (a UpdateActionImpl) DeepCopy() Action { return UpdateActionImpl{ - ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), - Object: a.Object.DeepCopyObject(), + ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), + Object: a.Object.DeepCopyObject(), + UpdateOptions: *a.UpdateOptions.DeepCopy(), } } type PatchActionImpl struct { ActionImpl - Name string - PatchType types.PatchType - Patch []byte + Name string + PatchType types.PatchType + Patch []byte + PatchOptions metav1.PatchOptions } func (a PatchActionImpl) GetName() string { @@ -581,14 +757,19 @@ func (a PatchActionImpl) GetPatchType() types.PatchType { return a.PatchType } +func (a PatchActionImpl) GetPatchOptions() metav1.PatchOptions { + return a.PatchOptions +} + func (a PatchActionImpl) DeepCopy() Action { patch := make([]byte, len(a.Patch)) copy(patch, a.Patch) return PatchActionImpl{ - ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), - Name: a.Name, - PatchType: a.PatchType, - Patch: patch, + ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), + Name: a.Name, + PatchType: a.PatchType, + Patch: patch, + PatchOptions: *a.PatchOptions.DeepCopy(), } } @@ -617,12 +798,22 @@ func (a DeleteActionImpl) DeepCopy() Action { type DeleteCollectionActionImpl struct { ActionImpl ListRestrictions ListRestrictions + DeleteOptions metav1.DeleteOptions + ListOptions metav1.ListOptions } func (a DeleteCollectionActionImpl) GetListRestrictions() ListRestrictions { return a.ListRestrictions } +func (a DeleteCollectionActionImpl) GetDeleteOptions() metav1.DeleteOptions { + return a.DeleteOptions +} + +func (a DeleteCollectionActionImpl) GetListOptions() metav1.ListOptions { + return a.ListOptions +} + func (a DeleteCollectionActionImpl) DeepCopy() Action { return DeleteCollectionActionImpl{ ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), @@ -630,18 +821,25 @@ func (a DeleteCollectionActionImpl) DeepCopy() Action { Labels: a.ListRestrictions.Labels.DeepCopySelector(), Fields: a.ListRestrictions.Fields.DeepCopySelector(), }, + DeleteOptions: *a.DeleteOptions.DeepCopy(), + ListOptions: *a.ListOptions.DeepCopy(), } } type WatchActionImpl struct { ActionImpl WatchRestrictions WatchRestrictions + ListOptions metav1.ListOptions } func (a WatchActionImpl) GetWatchRestrictions() WatchRestrictions { return a.WatchRestrictions } +func (a WatchActionImpl) GetListOptions() metav1.ListOptions { + return a.ListOptions +} + func (a WatchActionImpl) DeepCopy() Action { return WatchActionImpl{ ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl), @@ -650,6 +848,7 @@ func (a WatchActionImpl) DeepCopy() Action { Fields: a.WatchRestrictions.Fields.DeepCopySelector(), ResourceVersion: a.WatchRestrictions.ResourceVersion, }, + ListOptions: *a.ListOptions.DeepCopy(), } } From 2c866525dd1378d8da20a216d3ae0b3b32bdcce8 Mon Sep 17 00:00:00 2001 From: Joe Betz Date: Mon, 24 Jun 2024 15:42:29 -0400 Subject: [PATCH 105/159] Add field tracker support to client fake fixtures Kubernetes-commit: 75d6f024326dadc13807b8221bedd8da7924c2ba --- testing/fixture.go | 668 ++++++++++++++++++++++++++++++++-------- testing/fixture_test.go | 162 ++++++++++ 2 files changed, 708 insertions(+), 122 deletions(-) diff --git a/testing/fixture.go b/testing/fixture.go index f626c12bf3..d288a3aa45 100644 --- a/testing/fixture.go +++ b/testing/fixture.go @@ -19,19 +19,24 @@ package testing import ( "fmt" "reflect" + "sigs.k8s.io/structured-merge-diff/v4/typed" + "sigs.k8s.io/yaml" "sort" "strings" "sync" jsonpatch "gopkg.in/evanphx/json-patch.v4" - "k8s.io/apimachinery/pkg/api/errors" + apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" + "k8s.io/apimachinery/pkg/api/meta/testrestmapper" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/json" + "k8s.io/apimachinery/pkg/util/managedfields" "k8s.io/apimachinery/pkg/util/strategicpatch" "k8s.io/apimachinery/pkg/watch" restclient "k8s.io/client-go/rest" @@ -46,26 +51,32 @@ type ObjectTracker interface { Add(obj runtime.Object) error // Get retrieves the object by its kind, namespace and name. - Get(gvr schema.GroupVersionResource, ns, name string) (runtime.Object, error) + Get(gvr schema.GroupVersionResource, ns, name string, opts ...metav1.GetOptions) (runtime.Object, error) // Create adds an object to the tracker in the specified namespace. - Create(gvr schema.GroupVersionResource, obj runtime.Object, ns string) error + Create(gvr schema.GroupVersionResource, obj runtime.Object, ns string, opts ...metav1.CreateOptions) error // Update updates an existing object in the tracker in the specified namespace. - Update(gvr schema.GroupVersionResource, obj runtime.Object, ns string) error + Update(gvr schema.GroupVersionResource, obj runtime.Object, ns string, opts ...metav1.UpdateOptions) error + + // Patch patches an existing object in the tracker in the specified namespace. + Patch(gvr schema.GroupVersionResource, obj runtime.Object, ns string, opts ...metav1.PatchOptions) error + + // Apply applies an object in the tracker in the specified namespace. + Apply(gvr schema.GroupVersionResource, applyConfiguration runtime.Object, ns string, opts ...metav1.PatchOptions) error // List retrieves all objects of a given kind in the given // namespace. Only non-List kinds are accepted. - List(gvr schema.GroupVersionResource, gvk schema.GroupVersionKind, ns string) (runtime.Object, error) + List(gvr schema.GroupVersionResource, gvk schema.GroupVersionKind, ns string, opts ...metav1.ListOptions) (runtime.Object, error) // Delete deletes an existing object from the tracker. If object // didn't exist in the tracker prior to deletion, Delete returns // no error. - Delete(gvr schema.GroupVersionResource, ns, name string) error + Delete(gvr schema.GroupVersionResource, ns, name string, opts ...metav1.DeleteOptions) error // Watch watches objects from the tracker. Watch returns a channel // which will push added / modified / deleted object. - Watch(gvr schema.GroupVersionResource, ns string) (watch.Interface, error) + Watch(gvr schema.GroupVersionResource, ns string, opts ...metav1.ListOptions) (watch.Interface, error) } // ObjectScheme abstracts the implementation of common operations on objects. @@ -76,133 +87,200 @@ type ObjectScheme interface { // ObjectReaction returns a ReactionFunc that applies core.Action to // the given tracker. +// +// If tracker also implements ManagedFieldObjectTracker, then managed fields +// will be handled by the tracker and apply patch actions will be evaluated +// using the field manager and will take field ownership into consideration. +// Without a ManagedFieldObjectTracker, apply patch actions do not consider +// field ownership. +// +// WARNING: There is no server side defaulting, validation, or conversion handled +// by the fake client and subresources are not handled accurately (fields in the +// root resource are not automatically updated when a scale resource is updated, for example). func ObjectReaction(tracker ObjectTracker) ReactionFunc { + reactor := objectTrackerReact{tracker: tracker} return func(action Action) (bool, runtime.Object, error) { - ns := action.GetNamespace() - gvr := action.GetResource() // Here and below we need to switch on implementation types, // not on interfaces, as some interfaces are identical // (e.g. UpdateAction and CreateAction), so if we use them, // updates and creates end up matching the same case branch. switch action := action.(type) { - case ListActionImpl: - obj, err := tracker.List(gvr, action.GetKind(), ns) + obj, err := reactor.List(action) return true, obj, err - case GetActionImpl: - obj, err := tracker.Get(gvr, ns, action.GetName()) + obj, err := reactor.Get(action) return true, obj, err - case CreateActionImpl: - objMeta, err := meta.Accessor(action.GetObject()) - if err != nil { - return true, nil, err - } - if action.GetSubresource() == "" { - err = tracker.Create(gvr, action.GetObject(), ns) - } else { - oldObj, getOldObjErr := tracker.Get(gvr, ns, objMeta.GetName()) - if getOldObjErr != nil { - return true, nil, getOldObjErr - } - // Check whether the existing historical object type is the same as the current operation object type that needs to be updated, and if it is the same, perform the update operation. - if reflect.TypeOf(oldObj) == reflect.TypeOf(action.GetObject()) { - // TODO: Currently we're handling subresource creation as an update - // on the enclosing resource. This works for some subresources but - // might not be generic enough. - err = tracker.Update(gvr, action.GetObject(), ns) - } else { - // If the historical object type is different from the current object type, need to make sure we return the object submitted,don't persist the submitted object in the tracker. - return true, action.GetObject(), nil - } - } - if err != nil { - return true, nil, err - } - obj, err := tracker.Get(gvr, ns, objMeta.GetName()) + obj, err := reactor.Create(action) return true, obj, err - case UpdateActionImpl: - objMeta, err := meta.Accessor(action.GetObject()) - if err != nil { - return true, nil, err - } - err = tracker.Update(gvr, action.GetObject(), ns) - if err != nil { - return true, nil, err - } - obj, err := tracker.Get(gvr, ns, objMeta.GetName()) + obj, err := reactor.Update(action) return true, obj, err - case DeleteActionImpl: - err := tracker.Delete(gvr, ns, action.GetName()) - if err != nil { - return true, nil, err - } - return true, nil, nil - + obj, err := reactor.Delete(action) + return true, obj, err case PatchActionImpl: - obj, err := tracker.Get(gvr, ns, action.GetName()) - if err != nil { - return true, nil, err + if action.GetPatchType() == types.ApplyPatchType { + obj, err := reactor.Apply(action) + return true, obj, err } + obj, err := reactor.Patch(action) + return true, obj, err + default: + return false, nil, fmt.Errorf("no reaction implemented for %s", action) + } + } +} - old, err := json.Marshal(obj) - if err != nil { - return true, nil, err - } +type objectTrackerReact struct { + tracker ObjectTracker +} - // reset the object in preparation to unmarshal, since unmarshal does not guarantee that fields - // in obj that are removed by patch are cleared - value := reflect.ValueOf(obj) - value.Elem().Set(reflect.New(value.Type().Elem()).Elem()) - - switch action.GetPatchType() { - case types.JSONPatchType: - patch, err := jsonpatch.DecodePatch(action.GetPatch()) - if err != nil { - return true, nil, err - } - modified, err := patch.Apply(old) - if err != nil { - return true, nil, err - } - - if err = json.Unmarshal(modified, obj); err != nil { - return true, nil, err - } - case types.MergePatchType: - modified, err := jsonpatch.MergePatch(old, action.GetPatch()) - if err != nil { - return true, nil, err - } - - if err := json.Unmarshal(modified, obj); err != nil { - return true, nil, err - } - case types.StrategicMergePatchType, types.ApplyPatchType: - mergedByte, err := strategicpatch.StrategicMergePatch(old, action.GetPatch(), obj) - if err != nil { - return true, nil, err - } - if err = json.Unmarshal(mergedByte, obj); err != nil { - return true, nil, err - } - default: - return true, nil, fmt.Errorf("PatchType is not supported") - } +func (o objectTrackerReact) List(action ListActionImpl) (runtime.Object, error) { + return o.tracker.List(action.GetResource(), action.GetKind(), action.GetNamespace(), action.ListOptions) +} - if err = tracker.Update(gvr, obj, ns); err != nil { - return true, nil, err - } +func (o objectTrackerReact) Get(action GetActionImpl) (runtime.Object, error) { + return o.tracker.Get(action.GetResource(), action.GetNamespace(), action.GetName(), action.GetOptions) +} + +func (o objectTrackerReact) Create(action CreateActionImpl) (runtime.Object, error) { + ns := action.GetNamespace() + gvr := action.GetResource() + objMeta, err := meta.Accessor(action.GetObject()) + if err != nil { + return nil, err + } + if action.GetSubresource() == "" { + err = o.tracker.Create(gvr, action.GetObject(), ns, action.CreateOptions) + if err != nil { + return nil, err + } + } else { + oldObj, getOldObjErr := o.tracker.Get(gvr, ns, objMeta.GetName(), metav1.GetOptions{}) + if getOldObjErr != nil { + return nil, getOldObjErr + } + // Check whether the existing historical object type is the same as the current operation object type that needs to be updated, and if it is the same, perform the update operation. + if reflect.TypeOf(oldObj) == reflect.TypeOf(action.GetObject()) { + // TODO: Currently we're handling subresource creation as an update + // on the enclosing resource. This works for some subresources but + // might not be generic enough. + err = o.tracker.Update(gvr, action.GetObject(), ns, metav1.UpdateOptions{ + DryRun: action.CreateOptions.DryRun, + FieldManager: action.CreateOptions.FieldManager, + FieldValidation: action.CreateOptions.FieldValidation, + }) + } else { + // If the historical object type is different from the current object type, need to make sure we return the object submitted,don't persist the submitted object in the tracker. + return action.GetObject(), nil + } + } + if err != nil { + return nil, err + } + obj, err := o.tracker.Get(gvr, ns, objMeta.GetName(), metav1.GetOptions{}) + return obj, err +} + +func (o objectTrackerReact) Update(action UpdateActionImpl) (runtime.Object, error) { + ns := action.GetNamespace() + gvr := action.GetResource() + objMeta, err := meta.Accessor(action.GetObject()) + if err != nil { + return nil, err + } - return true, obj, nil + err = o.tracker.Update(gvr, action.GetObject(), ns, action.UpdateOptions) + if err != nil { + return nil, err + } - default: - return false, nil, fmt.Errorf("no reaction implemented for %s", action) + obj, err := o.tracker.Get(gvr, ns, objMeta.GetName(), metav1.GetOptions{}) + return obj, err +} + +func (o objectTrackerReact) Delete(action DeleteActionImpl) (runtime.Object, error) { + err := o.tracker.Delete(action.GetResource(), action.GetNamespace(), action.GetName(), action.DeleteOptions) + return nil, err +} + +func (o objectTrackerReact) Apply(action PatchActionImpl) (runtime.Object, error) { + ns := action.GetNamespace() + gvr := action.GetResource() + + patchObj := &unstructured.Unstructured{Object: map[string]interface{}{}} + if err := yaml.Unmarshal(action.GetPatch(), &patchObj.Object); err != nil { + return nil, err + } + err := o.tracker.Apply(gvr, patchObj, ns, action.PatchOptions) + if err != nil { + return nil, err + } + obj, err := o.tracker.Get(gvr, ns, action.GetName(), metav1.GetOptions{}) + return obj, err +} + +func (o objectTrackerReact) Patch(action PatchActionImpl) (runtime.Object, error) { + ns := action.GetNamespace() + gvr := action.GetResource() + + obj, err := o.tracker.Get(gvr, ns, action.GetName(), metav1.GetOptions{}) + if err != nil { + return nil, err + } + + old, err := json.Marshal(obj) + if err != nil { + return nil, err + } + + // reset the object in preparation to unmarshal, since unmarshal does not guarantee that fields + // in obj that are removed by patch are cleared + value := reflect.ValueOf(obj) + value.Elem().Set(reflect.New(value.Type().Elem()).Elem()) + + switch action.GetPatchType() { + case types.JSONPatchType: + patch, err := jsonpatch.DecodePatch(action.GetPatch()) + if err != nil { + return nil, err + } + modified, err := patch.Apply(old) + if err != nil { + return nil, err + } + + if err = json.Unmarshal(modified, obj); err != nil { + return nil, err } + case types.MergePatchType: + modified, err := jsonpatch.MergePatch(old, action.GetPatch()) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(modified, obj); err != nil { + return nil, err + } + case types.StrategicMergePatchType: + mergedByte, err := strategicpatch.StrategicMergePatch(old, action.GetPatch(), obj) + if err != nil { + return nil, err + } + if err = json.Unmarshal(mergedByte, obj); err != nil { + return nil, err + } + default: + return nil, fmt.Errorf("PatchType %s is not supported", action.GetPatchType()) } + + if err = o.tracker.Patch(gvr, obj, ns, action.PatchOptions); err != nil { + return nil, err + } + + return obj, nil } type tracker struct { @@ -231,7 +309,11 @@ func NewObjectTracker(scheme ObjectScheme, decoder runtime.Decoder) ObjectTracke } } -func (t *tracker) List(gvr schema.GroupVersionResource, gvk schema.GroupVersionKind, ns string) (runtime.Object, error) { +func (t *tracker) List(gvr schema.GroupVersionResource, gvk schema.GroupVersionKind, ns string, opts ...metav1.ListOptions) (runtime.Object, error) { + _, err := assertOptionalSingleArgument(opts) + if err != nil { + return nil, err + } // Heuristic for list kind: original kind + List suffix. Might // not always be true but this tracker has a pretty limited // understanding of the actual API model. @@ -270,7 +352,12 @@ func (t *tracker) List(gvr schema.GroupVersionResource, gvk schema.GroupVersionK return list.DeepCopyObject(), nil } -func (t *tracker) Watch(gvr schema.GroupVersionResource, ns string) (watch.Interface, error) { +func (t *tracker) Watch(gvr schema.GroupVersionResource, ns string, opts ...metav1.ListOptions) (watch.Interface, error) { + _, err := assertOptionalSingleArgument(opts) + if err != nil { + return nil, err + } + t.lock.Lock() defer t.lock.Unlock() @@ -283,8 +370,12 @@ func (t *tracker) Watch(gvr schema.GroupVersionResource, ns string) (watch.Inter return fakewatcher, nil } -func (t *tracker) Get(gvr schema.GroupVersionResource, ns, name string) (runtime.Object, error) { - errNotFound := errors.NewNotFound(gvr.GroupResource(), name) +func (t *tracker) Get(gvr schema.GroupVersionResource, ns, name string, opts ...metav1.GetOptions) (runtime.Object, error) { + _, err := assertOptionalSingleArgument(opts) + if err != nil { + return nil, err + } + errNotFound := apierrors.NewNotFound(gvr.GroupResource(), name) t.lock.RLock() defer t.lock.RUnlock() @@ -305,7 +396,7 @@ func (t *tracker) Get(gvr schema.GroupVersionResource, ns, name string) (runtime obj := matchingObj.DeepCopyObject() if status, ok := obj.(*metav1.Status); ok { if status.Status != metav1.StatusSuccess { - return nil, &errors.StatusError{ErrStatus: *status} + return nil, &apierrors.StatusError{ErrStatus: *status} } } @@ -352,11 +443,70 @@ func (t *tracker) Add(obj runtime.Object) error { return nil } -func (t *tracker) Create(gvr schema.GroupVersionResource, obj runtime.Object, ns string) error { +func (t *tracker) Create(gvr schema.GroupVersionResource, obj runtime.Object, ns string, opts ...metav1.CreateOptions) error { + _, err := assertOptionalSingleArgument(opts) + if err != nil { + return err + } return t.add(gvr, obj, ns, false) } -func (t *tracker) Update(gvr schema.GroupVersionResource, obj runtime.Object, ns string) error { +func (t *tracker) Update(gvr schema.GroupVersionResource, obj runtime.Object, ns string, opts ...metav1.UpdateOptions) error { + _, err := assertOptionalSingleArgument(opts) + if err != nil { + return err + } + return t.add(gvr, obj, ns, true) +} + +func (t *tracker) Patch(gvr schema.GroupVersionResource, patchedObject runtime.Object, ns string, opts ...metav1.PatchOptions) error { + _, err := assertOptionalSingleArgument(opts) + if err != nil { + return err + } + return t.add(gvr, patchedObject, ns, true) +} + +func (t *tracker) Apply(gvr schema.GroupVersionResource, applyConfiguration runtime.Object, ns string, opts ...metav1.PatchOptions) error { + _, err := assertOptionalSingleArgument(opts) + if err != nil { + return err + } + applyConfigurationMeta, err := meta.Accessor(applyConfiguration) + if err != nil { + return err + } + + obj, err := t.Get(gvr, ns, applyConfigurationMeta.GetName(), metav1.GetOptions{}) + if err != nil { + return err + } + + old, err := json.Marshal(obj) + if err != nil { + return err + } + + // reset the object in preparation to unmarshal, since unmarshal does not guarantee that fields + // in obj that are removed by patch are cleared + value := reflect.ValueOf(obj) + value.Elem().Set(reflect.New(value.Type().Elem()).Elem()) + + // For backward compatibility with behavior 1.30 and earlier, continue to handle apply + // via strategic merge patch (clients may use fake.NewClientset and ManagedFieldObjectTracker + // for full field manager support). + patch, err := json.Marshal(applyConfiguration) + if err != nil { + return err + } + mergedByte, err := strategicpatch.StrategicMergePatch(old, patch, obj) + if err != nil { + return err + } + if err = json.Unmarshal(mergedByte, obj); err != nil { + return err + } + return t.add(gvr, obj, ns, true) } @@ -398,7 +548,7 @@ func (t *tracker) add(gvr schema.GroupVersionResource, obj runtime.Object, ns st if ns != newMeta.GetNamespace() { msg := fmt.Sprintf("request namespace does not match object namespace, request: %q object: %q", ns, newMeta.GetNamespace()) - return errors.NewBadRequest(msg) + return apierrors.NewBadRequest(msg) } _, ok := t.objects[gvr] @@ -416,12 +566,12 @@ func (t *tracker) add(gvr schema.GroupVersionResource, obj runtime.Object, ns st t.objects[gvr][namespacedName] = obj return nil } - return errors.NewAlreadyExists(gr, newMeta.GetName()) + return apierrors.NewAlreadyExists(gr, newMeta.GetName()) } if replaceExisting { // Tried to update but no matching object was found. - return errors.NewNotFound(gr, newMeta.GetName()) + return apierrors.NewNotFound(gr, newMeta.GetName()) } t.objects[gvr][namespacedName] = obj @@ -451,19 +601,23 @@ func (t *tracker) addList(obj runtime.Object, replaceExisting bool) error { return nil } -func (t *tracker) Delete(gvr schema.GroupVersionResource, ns, name string) error { +func (t *tracker) Delete(gvr schema.GroupVersionResource, ns, name string, opts ...metav1.DeleteOptions) error { + _, err := assertOptionalSingleArgument(opts) + if err != nil { + return err + } t.lock.Lock() defer t.lock.Unlock() objs, ok := t.objects[gvr] if !ok { - return errors.NewNotFound(gvr.GroupResource(), name) + return apierrors.NewNotFound(gvr.GroupResource(), name) } namespacedName := types.NamespacedName{Namespace: ns, Name: name} obj, ok := objs[namespacedName] if !ok { - return errors.NewNotFound(gvr.GroupResource(), name) + return apierrors.NewNotFound(gvr.GroupResource(), name) } delete(objs, namespacedName) @@ -473,6 +627,203 @@ func (t *tracker) Delete(gvr schema.GroupVersionResource, ns, name string) error return nil } +type managedFieldObjectTracker struct { + ObjectTracker + scheme ObjectScheme + objectConverter runtime.ObjectConvertor + mapper meta.RESTMapper + typeConverter managedfields.TypeConverter +} + +var _ ObjectTracker = &managedFieldObjectTracker{} + +// NewFieldManagedObjectTracker returns an ObjectTracker that can be used to keep track +// of objects and managed fields for the fake clientset. Mostly useful for unit tests. +func NewFieldManagedObjectTracker(scheme *runtime.Scheme, decoder runtime.Decoder, typeConverter managedfields.TypeConverter) ObjectTracker { + return &managedFieldObjectTracker{ + ObjectTracker: NewObjectTracker(scheme, decoder), + scheme: scheme, + objectConverter: scheme, + mapper: testrestmapper.TestOnlyStaticRESTMapper(scheme), + typeConverter: typeConverter, + } +} + +func (t *managedFieldObjectTracker) Create(gvr schema.GroupVersionResource, obj runtime.Object, ns string, vopts ...metav1.CreateOptions) error { + opts, err := assertOptionalSingleArgument(vopts) + if err != nil { + return err + } + gvk, err := t.mapper.KindFor(gvr) + if err != nil { + return err + } + mgr, err := t.fieldManagerFor(gvk) + if err != nil { + return err + } + + objType, err := meta.TypeAccessor(obj) + if err != nil { + return err + } + // Stamp GVK + apiVersion, kind := gvk.ToAPIVersionAndKind() + objType.SetAPIVersion(apiVersion) + objType.SetKind(kind) + + objMeta, err := meta.Accessor(obj) + if err != nil { + return err + } + liveObject, err := t.ObjectTracker.Get(gvr, ns, objMeta.GetName(), metav1.GetOptions{}) + if apierrors.IsNotFound(err) { + liveObject, err = t.scheme.New(gvk) + if err != nil { + return err + } + liveObject.GetObjectKind().SetGroupVersionKind(gvk) + } else if err != nil { + return err + } + objWithManagedFields, err := mgr.Update(liveObject, obj, opts.FieldManager) + if err != nil { + return err + } + return t.ObjectTracker.Create(gvr, objWithManagedFields, ns, opts) +} + +func (t *managedFieldObjectTracker) Update(gvr schema.GroupVersionResource, obj runtime.Object, ns string, vopts ...metav1.UpdateOptions) error { + opts, err := assertOptionalSingleArgument(vopts) + if err != nil { + return err + } + gvk, err := t.mapper.KindFor(gvr) + if err != nil { + return err + } + mgr, err := t.fieldManagerFor(gvk) + if err != nil { + return err + } + + objMeta, err := meta.Accessor(obj) + if err != nil { + return err + } + oldObj, err := t.ObjectTracker.Get(gvr, ns, objMeta.GetName(), metav1.GetOptions{}) + if err != nil { + return err + } + objWithManagedFields, err := mgr.Update(oldObj, obj, opts.FieldManager) + if err != nil { + return err + } + + return t.ObjectTracker.Update(gvr, objWithManagedFields, ns, opts) +} + +func (t *managedFieldObjectTracker) Patch(gvr schema.GroupVersionResource, patchedObject runtime.Object, ns string, vopts ...metav1.PatchOptions) error { + opts, err := assertOptionalSingleArgument(vopts) + if err != nil { + return err + } + gvk, err := t.mapper.KindFor(gvr) + if err != nil { + return err + } + mgr, err := t.fieldManagerFor(gvk) + if err != nil { + return err + } + + objMeta, err := meta.Accessor(patchedObject) + if err != nil { + return err + } + oldObj, err := t.ObjectTracker.Get(gvr, ns, objMeta.GetName(), metav1.GetOptions{}) + if err != nil { + return err + } + objWithManagedFields, err := mgr.Update(oldObj, patchedObject, opts.FieldManager) + if err != nil { + return err + } + return t.ObjectTracker.Patch(gvr, objWithManagedFields, ns, vopts...) +} + +func (t *managedFieldObjectTracker) Apply(gvr schema.GroupVersionResource, applyConfiguration runtime.Object, ns string, vopts ...metav1.PatchOptions) error { + opts, err := assertOptionalSingleArgument(vopts) + if err != nil { + return err + } + gvk, err := t.mapper.KindFor(gvr) + if err != nil { + return err + } + applyConfigurationMeta, err := meta.Accessor(applyConfiguration) + if err != nil { + return err + } + + exists := true + liveObject, err := t.ObjectTracker.Get(gvr, ns, applyConfigurationMeta.GetName(), metav1.GetOptions{}) + if apierrors.IsNotFound(err) { + exists = false + liveObject, err = t.scheme.New(gvk) + if err != nil { + return err + } + liveObject.GetObjectKind().SetGroupVersionKind(gvk) + } else if err != nil { + return err + } + mgr, err := t.fieldManagerFor(gvk) + if err != nil { + return err + } + force := false + if opts.Force != nil { + force = *opts.Force + } + objWithManagedFields, err := mgr.Apply(liveObject, applyConfiguration, opts.FieldManager, force) + if err != nil { + return err + } + + if !exists { + return t.ObjectTracker.Create(gvr, objWithManagedFields, ns, metav1.CreateOptions{ + DryRun: opts.DryRun, + FieldManager: opts.FieldManager, + FieldValidation: opts.FieldValidation, + }) + } else { + return t.ObjectTracker.Update(gvr, objWithManagedFields, ns, metav1.UpdateOptions{ + DryRun: opts.DryRun, + FieldManager: opts.FieldManager, + FieldValidation: opts.FieldValidation, + }) + } +} + +func (t *managedFieldObjectTracker) fieldManagerFor(gvk schema.GroupVersionKind) (*managedfields.FieldManager, error) { + return managedfields.NewDefaultFieldManager( + t.typeConverter, + t.objectConverter, + &objectDefaulter{}, + t.scheme, + gvk, + gvk.GroupVersion(), + "", + nil) +} + +// objectDefaulter implements runtime.Defaulter, but it actually +// does nothing. +type objectDefaulter struct{} + +func (d *objectDefaulter) Default(_ runtime.Object) {} + // filterByNamespace returns all objects in the collection that // match provided namespace. Empty namespace matches // non-namespaced objects. @@ -579,3 +930,76 @@ func resourceCovers(resource string, action Action) bool { return false } + +// assertOptionalSingleArgument returns an error if there is more than one variadic argument. +// Otherwise, it returns the first variadic argument, or zero value if there are no arguments. +func assertOptionalSingleArgument[T any](arguments []T) (T, error) { + var a T + switch len(arguments) { + case 0: + return a, nil + case 1: + return arguments[0], nil + default: + return a, fmt.Errorf("expected only one option argument but got %d", len(arguments)) + } +} + +type TypeResolver interface { + Type(openAPIName string) typed.ParseableType +} + +type TypeConverter struct { + Scheme *runtime.Scheme + TypeResolver TypeResolver +} + +func (tc TypeConverter) ObjectToTyped(obj runtime.Object, opts ...typed.ValidationOptions) (*typed.TypedValue, error) { + gvk := obj.GetObjectKind().GroupVersionKind() + name, err := tc.openAPIName(gvk) + if err != nil { + return nil, err + } + t := tc.TypeResolver.Type(name) + switch o := obj.(type) { + case *unstructured.Unstructured: + return t.FromUnstructured(o.UnstructuredContent(), opts...) + default: + return t.FromStructured(obj, opts...) + } +} + +func (tc TypeConverter) TypedToObject(value *typed.TypedValue) (runtime.Object, error) { + vu := value.AsValue().Unstructured() + switch o := vu.(type) { + case map[string]interface{}: + return &unstructured.Unstructured{Object: o}, nil + default: + return nil, fmt.Errorf("failed to convert value to unstructured for type %T", vu) + } +} + +func (tc TypeConverter) openAPIName(kind schema.GroupVersionKind) (string, error) { + example, err := tc.Scheme.New(kind) + if err != nil { + return "", err + } + rtype := reflect.TypeOf(example).Elem() + name := friendlyName(rtype.PkgPath() + "." + rtype.Name()) + return name, nil +} + +// This is a copy of openapi.friendlyName. +// TODO: consider introducing a shared version of this function in apimachinery. +func friendlyName(name string) string { + nameParts := strings.Split(name, "/") + // Reverse first part. e.g., io.k8s... instead of k8s.io... + if len(nameParts) > 0 && strings.Contains(nameParts[0], ".") { + parts := strings.Split(nameParts[0], ".") + for i, j := 0, len(parts)-1; i < j; i, j = i+1, j-1 { + parts[i], parts[j] = parts[j], parts[i] + } + nameParts[0] = strings.Join(parts, ".") + } + return strings.Join(nameParts, ".") +} diff --git a/testing/fixture_test.go b/testing/fixture_test.go index fb947f818c..efa6777c4f 100644 --- a/testing/fixture_test.go +++ b/testing/fixture_test.go @@ -17,22 +17,31 @@ limitations under the License. package testing import ( + "encoding/json" "fmt" "math/rand" + "os" + "path/filepath" "strconv" + "strings" "sync" "testing" "github.com/stretchr/testify/assert" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" runtime "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/managedfields" "k8s.io/apimachinery/pkg/watch" + "k8s.io/kube-openapi/pkg/validation/spec" + "k8s.io/utils/ptr" ) func getArbitraryResource(s schema.GroupVersionResource, name, namespace string) *unstructured.Unstructured { @@ -275,6 +284,137 @@ func TestPatchWithMissingObject(t *testing.T) { assert.EqualError(t, err, `nodes "node-1" not found`) } +func TestApplyCreate(t *testing.T) { + cmResource := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "configMaps"} + scheme := runtime.NewScheme() + scheme.AddKnownTypes(cmResource.GroupVersion(), &v1.ConfigMap{}) + codecs := serializer.NewCodecFactory(scheme) + o := NewFieldManagedObjectTracker(scheme, codecs.UniversalDecoder(), fakeTypeConverter) + + reaction := ObjectReaction(o) + patch := []byte(`{"apiVersion": "v1", "kind": "ConfigMap", "metadata": {"name": "cm-1"}, "data": {"k": "v"}}`) + action := NewPatchActionWithOptions(cmResource, "default", "cm-1", types.ApplyPatchType, patch, + metav1.PatchOptions{FieldManager: "test-manager"}) + handled, configMap, err := reaction(action) + assert.True(t, handled) + if err != nil { + t.Errorf("Failed to create a resource with apply: %v", err) + } + cm := configMap.(*v1.ConfigMap) + assert.Equal(t, cm.Data, map[string]string{"k": "v"}) +} + +func TestApplyUpdateMultipleFieldManagers(t *testing.T) { + cmResource := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "configMaps"} + scheme := runtime.NewScheme() + scheme.AddKnownTypes(cmResource.GroupVersion(), &v1.ConfigMap{}) + codecs := serializer.NewCodecFactory(scheme) + o := NewFieldManagedObjectTracker(scheme, codecs.UniversalDecoder(), fakeTypeConverter) + + reaction := ObjectReaction(o) + action := NewCreateAction(cmResource, "default", &v1.ConfigMap{ + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "ConfigMap", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "cm-1", + }, + Data: map[string]string{ + "k0": "v0", + }, + }) + handled, _, err := reaction(action) + assert.True(t, handled) + if err != nil { + t.Errorf("Failed to create resource: %v", err) + } + + // Apply with test-manager-1 + // Expect data to be shared with initial create + patch := []byte(`{"apiVersion": "v1", "kind": "ConfigMap", "metadata": {"name": "cm-1"}, "data": {"k1": "v1"}}`) + applyAction := NewPatchActionWithOptions(cmResource, "default", "cm-1", types.ApplyPatchType, patch, + metav1.PatchOptions{FieldManager: "test-manager-1"}) + handled, configMap, err := reaction(applyAction) + assert.True(t, handled) + if err != nil { + t.Errorf("Failed to apply resource: %v", err) + } + cm := configMap.(*v1.ConfigMap) + assert.Equal(t, map[string]string{"k0": "v0", "k1": "v1"}, cm.Data) + + // Apply conflicting with test-manager-2, expect apply to fail + patch = []byte(`{"apiVersion": "v1", "kind": "ConfigMap", "metadata": {"name": "cm-1"}, "data": {"k1": "xyz"}}`) + applyAction = NewPatchActionWithOptions(cmResource, "default", "cm-1", types.ApplyPatchType, patch, + metav1.PatchOptions{FieldManager: "test-manager-2"}) + handled, _, err = reaction(applyAction) + assert.True(t, handled) + if assert.Error(t, err) { + assert.Equal(t, "Apply failed with 1 conflict: conflict with \"test-manager-1\": .data.k1", err.Error()) + } + + // Apply with test-manager-2 + // Expect data to be shared with initial create and test-manager-1 + patch = []byte(`{"apiVersion": "v1", "kind": "ConfigMap", "metadata": {"name": "cm-1"}, "data": {"k2": "v2"}}`) + applyAction = NewPatchActionWithOptions(cmResource, "default", "cm-1", types.ApplyPatchType, patch, + metav1.PatchOptions{FieldManager: "test-manager-2"}) + handled, configMap, err = reaction(applyAction) + assert.True(t, handled) + if err != nil { + t.Errorf("Failed to apply resource: %v", err) + } + cm = configMap.(*v1.ConfigMap) + assert.Equal(t, map[string]string{"k0": "v0", "k1": "v1", "k2": "v2"}, cm.Data) + + // Apply with test-manager-1 + // Expect owned data to be updated + patch = []byte(`{"apiVersion": "v1", "kind": "ConfigMap", "metadata": {"name": "cm-1"}, "data": {"k1": "v101"}}`) + applyAction = NewPatchActionWithOptions(cmResource, "default", "cm-1", types.ApplyPatchType, patch, + metav1.PatchOptions{FieldManager: "test-manager-1"}) + handled, configMap, err = reaction(applyAction) + assert.True(t, handled) + if err != nil { + t.Errorf("Failed to apply resource: %v", err) + } + cm = configMap.(*v1.ConfigMap) + assert.Equal(t, map[string]string{"k0": "v0", "k1": "v101", "k2": "v2"}, cm.Data) + + // Force apply with test-manager-2 + // Expect data owned by test-manager-1 to be updated, expect data already owned but not in apply configuration to be removed + patch = []byte(`{"apiVersion": "v1", "kind": "ConfigMap", "metadata": {"name": "cm-1"}, "data": {"k1": "v202"}}`) + applyAction = NewPatchActionWithOptions(cmResource, "default", "cm-1", types.ApplyPatchType, patch, + metav1.PatchOptions{FieldManager: "test-manager-2", Force: ptr.To(true)}) + handled, configMap, err = reaction(applyAction) + assert.True(t, handled) + if err != nil { + t.Errorf("Failed to apply resource: %v", err) + } + cm = configMap.(*v1.ConfigMap) + assert.Equal(t, map[string]string{"k0": "v0", "k1": "v202"}, cm.Data) + + // Update with test-manager-1 to perform a force update of the entire resource + reaction = ObjectReaction(o) + updateAction := NewUpdateActionWithOptions(cmResource, "default", &v1.ConfigMap{ + TypeMeta: metav1.TypeMeta{ + APIVersion: "v1", + Kind: "ConfigMap", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: "cm-1", + }, + Data: map[string]string{ + "k99": "v99", + }, + }, metav1.UpdateOptions{FieldManager: "test-manager-1"}) + handled, configMap, err = reaction(updateAction) + assert.True(t, handled) + if err != nil { + t.Errorf("Failed to apply resource: %v", err) + } + typedCm := configMap.(*v1.ConfigMap) + assert.Equal(t, map[string]string{"k99": "v99"}, typedCm.Data) +} + func TestGetWithExactMatch(t *testing.T) { scheme := runtime.NewScheme() codecs := serializer.NewCodecFactory(scheme) @@ -408,3 +548,25 @@ func Test_resourceCovers(t *testing.T) { }) } } + +var fakeTypeConverter = func() managedfields.TypeConverter { + data, err := os.ReadFile(filepath.Join(strings.Repeat(".."+string(filepath.Separator), 5), + "api", "openapi-spec", "swagger.json")) + if err != nil { + panic(err) + } + swag := spec.Swagger{} + if err := json.Unmarshal(data, &swag); err != nil { + panic(err) + } + convertedDefs := map[string]*spec.Schema{} + for k, v := range swag.Definitions { + vCopy := v + convertedDefs[k] = &vCopy + } + typeConverter, err := managedfields.NewTypeConverter(convertedDefs, false) + if err != nil { + panic(err) + } + return typeConverter +}() From c4145a9c20d8944984158b7f35953a210e8a2207 Mon Sep 17 00:00:00 2001 From: Joe Betz Date: Mon, 24 Jun 2024 15:58:35 -0400 Subject: [PATCH 106/159] Generate code Kubernetes-commit: 7772769d19a82a26aa91181e0804ff2ccbdd843c --- applyconfigurations/utils.go | 7 ++ kubernetes/fake/clientset_generated.go | 39 +++++++- kubernetes/fake/clientset_generated_test.go | 88 ++++++++++++++++++- .../fake/fake_mutatingwebhookconfiguration.go | 16 ++-- .../v1/fake/fake_validatingadmissionpolicy.go | 20 ++--- .../fake_validatingadmissionpolicybinding.go | 16 ++-- .../fake_validatingwebhookconfiguration.go | 16 ++-- .../fake/fake_validatingadmissionpolicy.go | 20 ++--- .../fake_validatingadmissionpolicybinding.go | 16 ++-- .../fake/fake_mutatingwebhookconfiguration.go | 16 ++-- .../fake/fake_validatingadmissionpolicy.go | 20 ++--- .../fake_validatingadmissionpolicybinding.go | 16 ++-- .../fake_validatingwebhookconfiguration.go | 16 ++-- .../v1alpha1/fake/fake_storageversion.go | 20 ++--- .../apps/v1/fake/fake_controllerrevision.go | 16 ++-- .../typed/apps/v1/fake/fake_daemonset.go | 20 ++--- .../typed/apps/v1/fake/fake_deployment.go | 26 +++--- .../typed/apps/v1/fake/fake_replicaset.go | 26 +++--- .../typed/apps/v1/fake/fake_statefulset.go | 26 +++--- .../v1beta1/fake/fake_controllerrevision.go | 16 ++-- .../apps/v1beta1/fake/fake_deployment.go | 20 ++--- .../apps/v1beta1/fake/fake_statefulset.go | 20 ++--- .../v1beta2/fake/fake_controllerrevision.go | 16 ++-- .../typed/apps/v1beta2/fake/fake_daemonset.go | 20 ++--- .../apps/v1beta2/fake/fake_deployment.go | 20 ++--- .../apps/v1beta2/fake/fake_replicaset.go | 20 ++--- .../apps/v1beta2/fake/fake_statefulset.go | 26 +++--- .../v1/fake/fake_selfsubjectreview.go | 2 +- .../v1/fake/fake_tokenreview.go | 2 +- .../v1alpha1/fake/fake_selfsubjectreview.go | 2 +- .../v1beta1/fake/fake_selfsubjectreview.go | 2 +- .../v1beta1/fake/fake_tokenreview.go | 2 +- .../v1/fake/fake_localsubjectaccessreview.go | 2 +- .../v1/fake/fake_selfsubjectaccessreview.go | 2 +- .../v1/fake/fake_selfsubjectrulesreview.go | 2 +- .../v1/fake/fake_subjectaccessreview.go | 2 +- .../fake/fake_localsubjectaccessreview.go | 2 +- .../fake/fake_selfsubjectaccessreview.go | 2 +- .../fake/fake_selfsubjectrulesreview.go | 2 +- .../v1beta1/fake/fake_subjectaccessreview.go | 2 +- .../v1/fake/fake_horizontalpodautoscaler.go | 20 ++--- .../v2/fake/fake_horizontalpodautoscaler.go | 20 ++--- .../fake/fake_horizontalpodautoscaler.go | 20 ++--- .../fake/fake_horizontalpodautoscaler.go | 20 ++--- .../typed/batch/v1/fake/fake_cronjob.go | 20 ++--- kubernetes/typed/batch/v1/fake/fake_job.go | 20 ++--- .../typed/batch/v1beta1/fake/fake_cronjob.go | 20 ++--- .../v1/fake/fake_certificatesigningrequest.go | 22 ++--- .../v1alpha1/fake/fake_clustertrustbundle.go | 16 ++-- .../fake/fake_certificatesigningrequest.go | 20 ++--- .../typed/coordination/v1/fake/fake_lease.go | 16 ++-- .../coordination/v1beta1/fake/fake_lease.go | 16 ++-- .../core/v1/fake/fake_componentstatus.go | 16 ++-- .../typed/core/v1/fake/fake_configmap.go | 16 ++-- .../typed/core/v1/fake/fake_endpoints.go | 16 ++-- kubernetes/typed/core/v1/fake/fake_event.go | 16 ++-- .../typed/core/v1/fake/fake_limitrange.go | 16 ++-- .../typed/core/v1/fake/fake_namespace.go | 18 ++-- kubernetes/typed/core/v1/fake/fake_node.go | 20 ++--- .../core/v1/fake/fake_persistentvolume.go | 20 ++--- .../v1/fake/fake_persistentvolumeclaim.go | 20 ++--- kubernetes/typed/core/v1/fake/fake_pod.go | 22 ++--- .../typed/core/v1/fake/fake_podtemplate.go | 16 ++-- .../v1/fake/fake_replicationcontroller.go | 24 ++--- .../typed/core/v1/fake/fake_resourcequota.go | 20 ++--- kubernetes/typed/core/v1/fake/fake_secret.go | 16 ++-- kubernetes/typed/core/v1/fake/fake_service.go | 18 ++-- .../typed/core/v1/fake/fake_serviceaccount.go | 18 ++-- .../discovery/v1/fake/fake_endpointslice.go | 16 ++-- .../v1beta1/fake/fake_endpointslice.go | 16 ++-- kubernetes/typed/events/v1/fake/fake_event.go | 16 ++-- .../typed/events/v1beta1/fake/fake_event.go | 16 ++-- .../extensions/v1beta1/fake/fake_daemonset.go | 20 ++--- .../v1beta1/fake/fake_deployment.go | 26 +++--- .../extensions/v1beta1/fake/fake_ingress.go | 20 ++--- .../v1beta1/fake/fake_networkpolicy.go | 16 ++-- .../v1beta1/fake/fake_replicaset.go | 26 +++--- .../flowcontrol/v1/fake/fake_flowschema.go | 20 ++--- .../fake/fake_prioritylevelconfiguration.go | 20 ++--- .../v1beta1/fake/fake_flowschema.go | 20 ++--- .../fake/fake_prioritylevelconfiguration.go | 20 ++--- .../v1beta2/fake/fake_flowschema.go | 20 ++--- .../fake/fake_prioritylevelconfiguration.go | 20 ++--- .../v1beta3/fake/fake_flowschema.go | 20 ++--- .../fake/fake_prioritylevelconfiguration.go | 20 ++--- .../typed/networking/v1/fake/fake_ingress.go | 20 ++--- .../networking/v1/fake/fake_ingressclass.go | 16 ++-- .../networking/v1/fake/fake_networkpolicy.go | 16 ++-- .../v1alpha1/fake/fake_ipaddress.go | 16 ++-- .../v1alpha1/fake/fake_servicecidr.go | 20 ++--- .../networking/v1beta1/fake/fake_ingress.go | 20 ++--- .../v1beta1/fake/fake_ingressclass.go | 16 ++-- .../typed/node/v1/fake/fake_runtimeclass.go | 16 ++-- .../node/v1alpha1/fake/fake_runtimeclass.go | 16 ++-- .../node/v1beta1/fake/fake_runtimeclass.go | 16 ++-- .../v1/fake/fake_poddisruptionbudget.go | 20 ++--- .../v1beta1/fake/fake_poddisruptionbudget.go | 20 ++--- .../typed/rbac/v1/fake/fake_clusterrole.go | 16 ++-- .../rbac/v1/fake/fake_clusterrolebinding.go | 16 ++-- kubernetes/typed/rbac/v1/fake/fake_role.go | 16 ++-- .../typed/rbac/v1/fake/fake_rolebinding.go | 16 ++-- .../rbac/v1alpha1/fake/fake_clusterrole.go | 16 ++-- .../v1alpha1/fake/fake_clusterrolebinding.go | 16 ++-- .../typed/rbac/v1alpha1/fake/fake_role.go | 16 ++-- .../rbac/v1alpha1/fake/fake_rolebinding.go | 16 ++-- .../rbac/v1beta1/fake/fake_clusterrole.go | 16 ++-- .../v1beta1/fake/fake_clusterrolebinding.go | 16 ++-- .../typed/rbac/v1beta1/fake/fake_role.go | 16 ++-- .../rbac/v1beta1/fake/fake_rolebinding.go | 16 ++-- .../fake/fake_podschedulingcontext.go | 20 ++--- .../v1alpha2/fake/fake_resourceclaim.go | 20 ++--- .../fake/fake_resourceclaimparameters.go | 16 ++-- .../fake/fake_resourceclaimtemplate.go | 16 ++-- .../v1alpha2/fake/fake_resourceclass.go | 16 ++-- .../fake/fake_resourceclassparameters.go | 16 ++-- .../v1alpha2/fake/fake_resourceslice.go | 16 ++-- .../scheduling/v1/fake/fake_priorityclass.go | 16 ++-- .../v1alpha1/fake/fake_priorityclass.go | 16 ++-- .../v1beta1/fake/fake_priorityclass.go | 16 ++-- .../typed/storage/v1/fake/fake_csidriver.go | 16 ++-- .../typed/storage/v1/fake/fake_csinode.go | 16 ++-- .../v1/fake/fake_csistoragecapacity.go | 16 ++-- .../storage/v1/fake/fake_storageclass.go | 16 ++-- .../storage/v1/fake/fake_volumeattachment.go | 20 ++--- .../v1alpha1/fake/fake_csistoragecapacity.go | 16 ++-- .../v1alpha1/fake/fake_volumeattachment.go | 20 ++--- .../fake/fake_volumeattributesclass.go | 16 ++-- .../storage/v1beta1/fake/fake_csidriver.go | 16 ++-- .../storage/v1beta1/fake/fake_csinode.go | 16 ++-- .../v1beta1/fake/fake_csistoragecapacity.go | 16 ++-- .../storage/v1beta1/fake/fake_storageclass.go | 16 ++-- .../v1beta1/fake/fake_volumeattachment.go | 20 ++--- .../fake/fake_storageversionmigration.go | 20 ++--- 133 files changed, 1210 insertions(+), 1080 deletions(-) diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index 623c10376b..a43705fed9 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -68,6 +68,7 @@ import ( storagev1beta1 "k8s.io/api/storage/v1beta1" storagemigrationv1alpha1 "k8s.io/api/storagemigration/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1" admissionregistrationv1alpha1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1" @@ -98,6 +99,7 @@ import ( applyconfigurationsflowcontrolv1beta2 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta2" flowcontrolv1beta3 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta3" applyconfigurationsimagepolicyv1alpha1 "k8s.io/client-go/applyconfigurations/imagepolicy/v1alpha1" + internal "k8s.io/client-go/applyconfigurations/internal" applyconfigurationsmetav1 "k8s.io/client-go/applyconfigurations/meta/v1" applyconfigurationsnetworkingv1 "k8s.io/client-go/applyconfigurations/networking/v1" applyconfigurationsnetworkingv1alpha1 "k8s.io/client-go/applyconfigurations/networking/v1alpha1" @@ -118,6 +120,7 @@ import ( applyconfigurationsstoragev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1" applyconfigurationsstoragev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" applyconfigurationsstoragemigrationv1alpha1 "k8s.io/client-go/applyconfigurations/storagemigration/v1alpha1" + testing "k8s.io/client-go/testing" ) // ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no @@ -1715,3 +1718,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/kubernetes/fake/clientset_generated.go b/kubernetes/fake/clientset_generated.go index a62b8f7c45..7808a94a2f 100644 --- a/kubernetes/fake/clientset_generated.go +++ b/kubernetes/fake/clientset_generated.go @@ -21,6 +21,7 @@ package fake import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" + applyconfigurations "k8s.io/client-go/applyconfigurations" "k8s.io/client-go/discovery" fakediscovery "k8s.io/client-go/discovery/fake" clientset "k8s.io/client-go/kubernetes" @@ -133,8 +134,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 { @@ -176,6 +181,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/kubernetes/fake/clientset_generated_test.go b/kubernetes/fake/clientset_generated_test.go index 560bc0bfd8..54c1b265e6 100644 --- a/kubernetes/fake/clientset_generated_test.go +++ b/kubernetes/fake/clientset_generated_test.go @@ -18,10 +18,13 @@ package fake import ( "context" + "github.com/stretchr/testify/assert" + "testing" + v1 "k8s.io/api/core/v1" policy "k8s.io/api/policy/v1" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "testing" + v1ac "k8s.io/client-go/applyconfigurations/core/v1" ) func TestNewSimpleClientset(t *testing.T) { @@ -56,3 +59,86 @@ func TestNewSimpleClientset(t *testing.T) { t.Logf("TestNewSimpleClientset() res = %v", pods) } } + +func TestManagedFieldClientset(t *testing.T) { + client := NewClientset() + name := "pod-1" + namespace := "default" + cm, err := client.CoreV1().ConfigMaps("default").Create(context.Background(), + &v1.ConfigMap{ + ObjectMeta: meta_v1.ObjectMeta{Name: name, Namespace: namespace}, + Data: map[string]string{"k0": "v0"}, + }, meta_v1.CreateOptions{FieldManager: "test-manager-0"}) + if err != nil { + t.Errorf("Failed to create pod: %v", err) + } + assert.Equal(t, map[string]string{"k0": "v0"}, cm.Data) + + // Apply with test-manager-1 + // Expect data to be shared with initial create + cm, err = client.CoreV1().ConfigMaps("default").Apply(context.Background(), + v1ac.ConfigMap(name, namespace).WithData(map[string]string{"k1": "v1"}), + meta_v1.ApplyOptions{FieldManager: "test-manager-1"}) + if err != nil { + t.Errorf("Failed to create pod: %v", err) + } + assert.Equal(t, map[string]string{"k0": "v0", "k1": "v1"}, cm.Data) + + // Apply conflicting with test-manager-2, expect apply to fail + _, err = client.CoreV1().ConfigMaps("default").Apply(context.Background(), + v1ac.ConfigMap(name, namespace).WithData(map[string]string{"k1": "xyz"}), + meta_v1.ApplyOptions{FieldManager: "test-manager-2"}) + if assert.Error(t, err) { + assert.Equal(t, "Apply failed with 1 conflict: conflict with \"test-manager-1\": .data.k1", err.Error()) + } + + // Apply with test-manager-2 + // Expect data to be shared with initial create and test-manager-1 + cm, err = client.CoreV1().ConfigMaps("default").Apply(context.Background(), + v1ac.ConfigMap(name, namespace).WithData(map[string]string{"k2": "v2"}), + meta_v1.ApplyOptions{FieldManager: "test-manager-2"}) + if err != nil { + t.Errorf("Failed to create pod: %v", err) + } + assert.Equal(t, map[string]string{"k0": "v0", "k1": "v1", "k2": "v2"}, cm.Data) + + // Apply with test-manager-1 + // Expect owned data to be updated + cm, err = client.CoreV1().ConfigMaps("default").Apply(context.Background(), + v1ac.ConfigMap(name, namespace).WithData(map[string]string{"k1": "v101"}), + meta_v1.ApplyOptions{FieldManager: "test-manager-1"}) + if err != nil { + t.Errorf("Failed to create pod: %v", err) + } + assert.Equal(t, map[string]string{"k0": "v0", "k1": "v101", "k2": "v2"}, cm.Data) + + // Force apply with test-manager-2 + // Expect data owned by test-manager-1 to be updated, expect data already owned but not in apply configuration to be removed + cm, err = client.CoreV1().ConfigMaps("default").Apply(context.Background(), + v1ac.ConfigMap(name, namespace).WithData(map[string]string{"k1": "v202"}), + meta_v1.ApplyOptions{FieldManager: "test-manager-2", Force: true}) + if err != nil { + t.Errorf("Failed to create pod: %v", err) + } + assert.Equal(t, map[string]string{"k0": "v0", "k1": "v202"}, cm.Data) + + // Update with test-manager-1 to perform a force update of the entire resource + cm, err = client.CoreV1().ConfigMaps("default").Update(context.Background(), + &v1.ConfigMap{ + TypeMeta: meta_v1.TypeMeta{ + APIVersion: "v1", + Kind: "ConfigMap", + }, + ObjectMeta: meta_v1.ObjectMeta{ + Name: name, + Namespace: namespace, + }, + Data: map[string]string{ + "k99": "v99", + }, + }, meta_v1.UpdateOptions{FieldManager: "test-manager-0"}) + if err != nil { + t.Errorf("Failed to update pod: %v", err) + } + assert.Equal(t, map[string]string{"k99": "v99"}, cm.Data) +} diff --git a/kubernetes/typed/admissionregistration/v1/fake/fake_mutatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1/fake/fake_mutatingwebhookconfiguration.go index b2036825df..2d371e6fc7 100644 --- a/kubernetes/typed/admissionregistration/v1/fake/fake_mutatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1/fake/fake_mutatingwebhookconfiguration.go @@ -45,7 +45,7 @@ var mutatingwebhookconfigurationsKind = v1.SchemeGroupVersion.WithKind("Mutating func (c *FakeMutatingWebhookConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.MutatingWebhookConfiguration, err error) { emptyResult := &v1.MutatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(mutatingwebhookconfigurationsResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(mutatingwebhookconfigurationsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeMutatingWebhookConfigurations) Get(ctx context.Context, name string func (c *FakeMutatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.MutatingWebhookConfigurationList, err error) { emptyResult := &v1.MutatingWebhookConfigurationList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeMutatingWebhookConfigurations) List(ctx context.Context, opts metav // Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations. func (c *FakeMutatingWebhookConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(mutatingwebhookconfigurationsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(mutatingwebhookconfigurationsResource, opts)) } // Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. func (c *FakeMutatingWebhookConfigurations) Create(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.CreateOptions) (result *v1.MutatingWebhookConfiguration, err error) { emptyResult := &v1.MutatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeMutatingWebhookConfigurations) Create(ctx context.Context, mutating func (c *FakeMutatingWebhookConfigurations) Update(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.UpdateOptions) (result *v1.MutatingWebhookConfiguration, err error) { emptyResult := &v1.MutatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeMutatingWebhookConfigurations) Delete(ctx context.Context, name str // DeleteCollection deletes a collection of objects. func (c *FakeMutatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(mutatingwebhookconfigurationsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(mutatingwebhookconfigurationsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.MutatingWebhookConfigurationList{}) return err @@ -121,7 +121,7 @@ func (c *FakeMutatingWebhookConfigurations) DeleteCollection(ctx context.Context func (c *FakeMutatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.MutatingWebhookConfiguration, err error) { emptyResult := &v1.MutatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(mutatingwebhookconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeMutatingWebhookConfigurations) Apply(ctx context.Context, mutatingW } emptyResult := &v1.MutatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(mutatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicy.go b/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicy.go index f7ef06681d..d6c7bec898 100644 --- a/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicy.go +++ b/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicy.go @@ -45,7 +45,7 @@ var validatingadmissionpoliciesKind = v1.SchemeGroupVersion.WithKind("Validating func (c *FakeValidatingAdmissionPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(validatingadmissionpoliciesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpoliciesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeValidatingAdmissionPolicies) Get(ctx context.Context, name string, func (c *FakeValidatingAdmissionPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyList, err error) { emptyResult := &v1.ValidatingAdmissionPolicyList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeValidatingAdmissionPolicies) List(ctx context.Context, opts metav1. // Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies. func (c *FakeValidatingAdmissionPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(validatingadmissionpoliciesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpoliciesResource, opts)) } // Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. func (c *FakeValidatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.CreateOptions) (result *v1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeValidatingAdmissionPolicies) Create(ctx context.Context, validating func (c *FakeValidatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.UpdateOptions) (result *v1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -107,7 +107,7 @@ func (c *FakeValidatingAdmissionPolicies) Update(ctx context.Context, validating func (c *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.UpdateOptions) (result *v1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -123,7 +123,7 @@ func (c *FakeValidatingAdmissionPolicies) Delete(ctx context.Context, name strin // DeleteCollection deletes a collection of objects. func (c *FakeValidatingAdmissionPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(validatingadmissionpoliciesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpoliciesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ValidatingAdmissionPolicyList{}) return err @@ -133,7 +133,7 @@ func (c *FakeValidatingAdmissionPolicies) DeleteCollection(ctx context.Context, func (c *FakeValidatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -155,7 +155,7 @@ func (c *FakeValidatingAdmissionPolicies) Apply(ctx context.Context, validatingA } emptyResult := &v1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } @@ -178,7 +178,7 @@ func (c *FakeValidatingAdmissionPolicies) ApplyStatus(ctx context.Context, valid } emptyResult := &v1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicybinding.go b/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicybinding.go index b6cd66fc09..5b6719be0a 100644 --- a/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicybinding.go +++ b/kubernetes/typed/admissionregistration/v1/fake/fake_validatingadmissionpolicybinding.go @@ -45,7 +45,7 @@ var validatingadmissionpolicybindingsKind = v1.SchemeGroupVersion.WithKind("Vali func (c *FakeValidatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(validatingadmissionpolicybindingsResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpolicybindingsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeValidatingAdmissionPolicyBindings) Get(ctx context.Context, name st func (c *FakeValidatingAdmissionPolicyBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyBindingList, err error) { emptyResult := &v1.ValidatingAdmissionPolicyBindingList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeValidatingAdmissionPolicyBindings) List(ctx context.Context, opts m // Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings. func (c *FakeValidatingAdmissionPolicyBindings) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(validatingadmissionpolicybindingsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpolicybindingsResource, opts)) } // Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. func (c *FakeValidatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1.ValidatingAdmissionPolicyBinding, opts metav1.CreateOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeValidatingAdmissionPolicyBindings) Create(ctx context.Context, vali func (c *FakeValidatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1.ValidatingAdmissionPolicyBinding, opts metav1.UpdateOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeValidatingAdmissionPolicyBindings) Delete(ctx context.Context, name // DeleteCollection deletes a collection of objects. func (c *FakeValidatingAdmissionPolicyBindings) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(validatingadmissionpolicybindingsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpolicybindingsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ValidatingAdmissionPolicyBindingList{}) return err @@ -121,7 +121,7 @@ func (c *FakeValidatingAdmissionPolicyBindings) DeleteCollection(ctx context.Con func (c *FakeValidatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeValidatingAdmissionPolicyBindings) Apply(ctx context.Context, valid } emptyResult := &v1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/admissionregistration/v1/fake/fake_validatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1/fake/fake_validatingwebhookconfiguration.go index afd5879d28..ff7fc43013 100644 --- a/kubernetes/typed/admissionregistration/v1/fake/fake_validatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1/fake/fake_validatingwebhookconfiguration.go @@ -45,7 +45,7 @@ var validatingwebhookconfigurationsKind = v1.SchemeGroupVersion.WithKind("Valida func (c *FakeValidatingWebhookConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ValidatingWebhookConfiguration, err error) { emptyResult := &v1.ValidatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(validatingwebhookconfigurationsResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(validatingwebhookconfigurationsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeValidatingWebhookConfigurations) Get(ctx context.Context, name stri func (c *FakeValidatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingWebhookConfigurationList, err error) { emptyResult := &v1.ValidatingWebhookConfigurationList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeValidatingWebhookConfigurations) List(ctx context.Context, opts met // Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations. func (c *FakeValidatingWebhookConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(validatingwebhookconfigurationsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(validatingwebhookconfigurationsResource, opts)) } // Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. func (c *FakeValidatingWebhookConfigurations) Create(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.CreateOptions) (result *v1.ValidatingWebhookConfiguration, err error) { emptyResult := &v1.ValidatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(validatingwebhookconfigurationsResource, validatingWebhookConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeValidatingWebhookConfigurations) Create(ctx context.Context, valida func (c *FakeValidatingWebhookConfigurations) Update(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.UpdateOptions) (result *v1.ValidatingWebhookConfiguration, err error) { emptyResult := &v1.ValidatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(validatingwebhookconfigurationsResource, validatingWebhookConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeValidatingWebhookConfigurations) Delete(ctx context.Context, name s // DeleteCollection deletes a collection of objects. func (c *FakeValidatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(validatingwebhookconfigurationsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(validatingwebhookconfigurationsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ValidatingWebhookConfigurationList{}) return err @@ -121,7 +121,7 @@ func (c *FakeValidatingWebhookConfigurations) DeleteCollection(ctx context.Conte func (c *FakeValidatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingWebhookConfiguration, err error) { emptyResult := &v1.ValidatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingwebhookconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeValidatingWebhookConfigurations) Apply(ctx context.Context, validat } emptyResult := &v1.ValidatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicy.go b/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicy.go index fd8a17b2fd..ef4d843e00 100644 --- a/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicy.go +++ b/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicy.go @@ -45,7 +45,7 @@ var validatingadmissionpoliciesKind = v1alpha1.SchemeGroupVersion.WithKind("Vali func (c *FakeValidatingAdmissionPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(validatingadmissionpoliciesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpoliciesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeValidatingAdmissionPolicies) Get(ctx context.Context, name string, func (c *FakeValidatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyList, err error) { emptyResult := &v1alpha1.ValidatingAdmissionPolicyList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeValidatingAdmissionPolicies) List(ctx context.Context, opts v1.List // Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies. func (c *FakeValidatingAdmissionPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(validatingadmissionpoliciesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpoliciesResource, opts)) } // Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. func (c *FakeValidatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.CreateOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeValidatingAdmissionPolicies) Create(ctx context.Context, validating func (c *FakeValidatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -107,7 +107,7 @@ func (c *FakeValidatingAdmissionPolicies) Update(ctx context.Context, validating func (c *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -123,7 +123,7 @@ func (c *FakeValidatingAdmissionPolicies) Delete(ctx context.Context, name strin // DeleteCollection deletes a collection of objects. func (c *FakeValidatingAdmissionPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(validatingadmissionpoliciesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpoliciesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.ValidatingAdmissionPolicyList{}) return err @@ -133,7 +133,7 @@ func (c *FakeValidatingAdmissionPolicies) DeleteCollection(ctx context.Context, func (c *FakeValidatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -155,7 +155,7 @@ func (c *FakeValidatingAdmissionPolicies) Apply(ctx context.Context, validatingA } emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } @@ -178,7 +178,7 @@ func (c *FakeValidatingAdmissionPolicies) ApplyStatus(ctx context.Context, valid } emptyResult := &v1alpha1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicybinding.go b/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicybinding.go index ca6d25235a..f7cc966fb1 100644 --- a/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicybinding.go +++ b/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingadmissionpolicybinding.go @@ -45,7 +45,7 @@ var validatingadmissionpolicybindingsKind = v1alpha1.SchemeGroupVersion.WithKind func (c *FakeValidatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(validatingadmissionpolicybindingsResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpolicybindingsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeValidatingAdmissionPolicyBindings) Get(ctx context.Context, name st func (c *FakeValidatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyBindingList, err error) { emptyResult := &v1alpha1.ValidatingAdmissionPolicyBindingList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeValidatingAdmissionPolicyBindings) List(ctx context.Context, opts v // Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings. func (c *FakeValidatingAdmissionPolicyBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(validatingadmissionpolicybindingsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpolicybindingsResource, opts)) } // Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. func (c *FakeValidatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1alpha1.ValidatingAdmissionPolicyBinding, opts v1.CreateOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeValidatingAdmissionPolicyBindings) Create(ctx context.Context, vali func (c *FakeValidatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1alpha1.ValidatingAdmissionPolicyBinding, opts v1.UpdateOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeValidatingAdmissionPolicyBindings) Delete(ctx context.Context, name // DeleteCollection deletes a collection of objects. func (c *FakeValidatingAdmissionPolicyBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(validatingadmissionpolicybindingsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpolicybindingsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.ValidatingAdmissionPolicyBindingList{}) return err @@ -121,7 +121,7 @@ func (c *FakeValidatingAdmissionPolicyBindings) DeleteCollection(ctx context.Con func (c *FakeValidatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeValidatingAdmissionPolicyBindings) Apply(ctx context.Context, valid } emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go index aa864b12fd..7671549323 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1beta1/fake/fake_mutatingwebhookconfiguration.go @@ -45,7 +45,7 @@ var mutatingwebhookconfigurationsKind = v1beta1.SchemeGroupVersion.WithKind("Mut func (c *FakeMutatingWebhookConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { emptyResult := &v1beta1.MutatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(mutatingwebhookconfigurationsResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(mutatingwebhookconfigurationsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeMutatingWebhookConfigurations) Get(ctx context.Context, name string func (c *FakeMutatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MutatingWebhookConfigurationList, err error) { emptyResult := &v1beta1.MutatingWebhookConfigurationList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeMutatingWebhookConfigurations) List(ctx context.Context, opts v1.Li // Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations. func (c *FakeMutatingWebhookConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(mutatingwebhookconfigurationsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(mutatingwebhookconfigurationsResource, opts)) } // Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. func (c *FakeMutatingWebhookConfigurations) Create(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.CreateOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { emptyResult := &v1beta1.MutatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeMutatingWebhookConfigurations) Create(ctx context.Context, mutating func (c *FakeMutatingWebhookConfigurations) Update(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.UpdateOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { emptyResult := &v1beta1.MutatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeMutatingWebhookConfigurations) Delete(ctx context.Context, name str // DeleteCollection deletes a collection of objects. func (c *FakeMutatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(mutatingwebhookconfigurationsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(mutatingwebhookconfigurationsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.MutatingWebhookConfigurationList{}) return err @@ -121,7 +121,7 @@ func (c *FakeMutatingWebhookConfigurations) DeleteCollection(ctx context.Context func (c *FakeMutatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MutatingWebhookConfiguration, err error) { emptyResult := &v1beta1.MutatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(mutatingwebhookconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeMutatingWebhookConfigurations) Apply(ctx context.Context, mutatingW } emptyResult := &v1beta1.MutatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(mutatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicy.go b/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicy.go index 024fdec052..e30891c779 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicy.go +++ b/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicy.go @@ -45,7 +45,7 @@ var validatingadmissionpoliciesKind = v1beta1.SchemeGroupVersion.WithKind("Valid func (c *FakeValidatingAdmissionPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1beta1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(validatingadmissionpoliciesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpoliciesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeValidatingAdmissionPolicies) Get(ctx context.Context, name string, func (c *FakeValidatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyList, err error) { emptyResult := &v1beta1.ValidatingAdmissionPolicyList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeValidatingAdmissionPolicies) List(ctx context.Context, opts v1.List // Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies. func (c *FakeValidatingAdmissionPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(validatingadmissionpoliciesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpoliciesResource, opts)) } // Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any. func (c *FakeValidatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.CreateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1beta1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeValidatingAdmissionPolicies) Create(ctx context.Context, validating func (c *FakeValidatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1beta1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(validatingadmissionpoliciesResource, validatingAdmissionPolicy), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -107,7 +107,7 @@ func (c *FakeValidatingAdmissionPolicies) Update(ctx context.Context, validating func (c *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1beta1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -123,7 +123,7 @@ func (c *FakeValidatingAdmissionPolicies) Delete(ctx context.Context, name strin // DeleteCollection deletes a collection of objects. func (c *FakeValidatingAdmissionPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(validatingadmissionpoliciesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpoliciesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.ValidatingAdmissionPolicyList{}) return err @@ -133,7 +133,7 @@ func (c *FakeValidatingAdmissionPolicies) DeleteCollection(ctx context.Context, func (c *FakeValidatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingAdmissionPolicy, err error) { emptyResult := &v1beta1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -155,7 +155,7 @@ func (c *FakeValidatingAdmissionPolicies) Apply(ctx context.Context, validatingA } emptyResult := &v1beta1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } @@ -178,7 +178,7 @@ func (c *FakeValidatingAdmissionPolicies) ApplyStatus(ctx context.Context, valid } emptyResult := &v1beta1.ValidatingAdmissionPolicy{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicybinding.go b/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicybinding.go index 9d6ff51530..207db37529 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicybinding.go +++ b/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingadmissionpolicybinding.go @@ -45,7 +45,7 @@ var validatingadmissionpolicybindingsKind = v1beta1.SchemeGroupVersion.WithKind( func (c *FakeValidatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(validatingadmissionpolicybindingsResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpolicybindingsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeValidatingAdmissionPolicyBindings) Get(ctx context.Context, name st func (c *FakeValidatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyBindingList, err error) { emptyResult := &v1beta1.ValidatingAdmissionPolicyBindingList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeValidatingAdmissionPolicyBindings) List(ctx context.Context, opts v // Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings. func (c *FakeValidatingAdmissionPolicyBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(validatingadmissionpolicybindingsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpolicybindingsResource, opts)) } // Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any. func (c *FakeValidatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1beta1.ValidatingAdmissionPolicyBinding, opts v1.CreateOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeValidatingAdmissionPolicyBindings) Create(ctx context.Context, vali func (c *FakeValidatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1beta1.ValidatingAdmissionPolicyBinding, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeValidatingAdmissionPolicyBindings) Delete(ctx context.Context, name // DeleteCollection deletes a collection of objects. func (c *FakeValidatingAdmissionPolicyBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(validatingadmissionpolicybindingsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpolicybindingsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.ValidatingAdmissionPolicyBindingList{}) return err @@ -121,7 +121,7 @@ func (c *FakeValidatingAdmissionPolicyBindings) DeleteCollection(ctx context.Con func (c *FakeValidatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) { emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeValidatingAdmissionPolicyBindings) Apply(ctx context.Context, valid } emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go index 2c76bb9ac2..f78a31ee0e 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1beta1/fake/fake_validatingwebhookconfiguration.go @@ -45,7 +45,7 @@ var validatingwebhookconfigurationsKind = v1beta1.SchemeGroupVersion.WithKind("V func (c *FakeValidatingWebhookConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { emptyResult := &v1beta1.ValidatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(validatingwebhookconfigurationsResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(validatingwebhookconfigurationsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeValidatingWebhookConfigurations) Get(ctx context.Context, name stri func (c *FakeValidatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingWebhookConfigurationList, err error) { emptyResult := &v1beta1.ValidatingWebhookConfigurationList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeValidatingWebhookConfigurations) List(ctx context.Context, opts v1. // Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations. func (c *FakeValidatingWebhookConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(validatingwebhookconfigurationsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(validatingwebhookconfigurationsResource, opts)) } // Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. func (c *FakeValidatingWebhookConfigurations) Create(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.CreateOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { emptyResult := &v1beta1.ValidatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(validatingwebhookconfigurationsResource, validatingWebhookConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeValidatingWebhookConfigurations) Create(ctx context.Context, valida func (c *FakeValidatingWebhookConfigurations) Update(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.UpdateOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { emptyResult := &v1beta1.ValidatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(validatingwebhookconfigurationsResource, validatingWebhookConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeValidatingWebhookConfigurations) Delete(ctx context.Context, name s // DeleteCollection deletes a collection of objects. func (c *FakeValidatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(validatingwebhookconfigurationsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(validatingwebhookconfigurationsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.ValidatingWebhookConfigurationList{}) return err @@ -121,7 +121,7 @@ func (c *FakeValidatingWebhookConfigurations) DeleteCollection(ctx context.Conte func (c *FakeValidatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingWebhookConfiguration, err error) { emptyResult := &v1beta1.ValidatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingwebhookconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeValidatingWebhookConfigurations) Apply(ctx context.Context, validat } emptyResult := &v1beta1.ValidatingWebhookConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/apiserverinternal/v1alpha1/fake/fake_storageversion.go b/kubernetes/typed/apiserverinternal/v1alpha1/fake/fake_storageversion.go index bf66e0f3b0..e9f0b78d46 100644 --- a/kubernetes/typed/apiserverinternal/v1alpha1/fake/fake_storageversion.go +++ b/kubernetes/typed/apiserverinternal/v1alpha1/fake/fake_storageversion.go @@ -45,7 +45,7 @@ var storageversionsKind = v1alpha1.SchemeGroupVersion.WithKind("StorageVersion") func (c *FakeStorageVersions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.StorageVersion, err error) { emptyResult := &v1alpha1.StorageVersion{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(storageversionsResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(storageversionsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeStorageVersions) Get(ctx context.Context, name string, options v1.G func (c *FakeStorageVersions) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionList, err error) { emptyResult := &v1alpha1.StorageVersionList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(storageversionsResource, storageversionsKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(storageversionsResource, storageversionsKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeStorageVersions) List(ctx context.Context, opts v1.ListOptions) (re // Watch returns a watch.Interface that watches the requested storageVersions. func (c *FakeStorageVersions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(storageversionsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(storageversionsResource, opts)) } // Create takes the representation of a storageVersion and creates it. Returns the server's representation of the storageVersion, and an error, if there is any. func (c *FakeStorageVersions) Create(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.CreateOptions) (result *v1alpha1.StorageVersion, err error) { emptyResult := &v1alpha1.StorageVersion{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(storageversionsResource, storageVersion), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(storageversionsResource, storageVersion, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeStorageVersions) Create(ctx context.Context, storageVersion *v1alph func (c *FakeStorageVersions) Update(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.UpdateOptions) (result *v1alpha1.StorageVersion, err error) { emptyResult := &v1alpha1.StorageVersion{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(storageversionsResource, storageVersion), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(storageversionsResource, storageVersion, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -107,7 +107,7 @@ func (c *FakeStorageVersions) Update(ctx context.Context, storageVersion *v1alph func (c *FakeStorageVersions) UpdateStatus(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.UpdateOptions) (result *v1alpha1.StorageVersion, err error) { emptyResult := &v1alpha1.StorageVersion{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(storageversionsResource, "status", storageVersion), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(storageversionsResource, "status", storageVersion, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -123,7 +123,7 @@ func (c *FakeStorageVersions) Delete(ctx context.Context, name string, opts v1.D // DeleteCollection deletes a collection of objects. func (c *FakeStorageVersions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(storageversionsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(storageversionsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.StorageVersionList{}) return err @@ -133,7 +133,7 @@ func (c *FakeStorageVersions) DeleteCollection(ctx context.Context, opts v1.Dele func (c *FakeStorageVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.StorageVersion, err error) { emptyResult := &v1alpha1.StorageVersion{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(storageversionsResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageversionsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -155,7 +155,7 @@ func (c *FakeStorageVersions) Apply(ctx context.Context, storageVersion *apiserv } emptyResult := &v1alpha1.StorageVersion{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(storageversionsResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageversionsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } @@ -178,7 +178,7 @@ func (c *FakeStorageVersions) ApplyStatus(ctx context.Context, storageVersion *a } emptyResult := &v1alpha1.StorageVersion{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(storageversionsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageversionsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go b/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go index 1c12443299..c609ef534a 100644 --- a/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go +++ b/kubernetes/typed/apps/v1/fake/fake_controllerrevision.go @@ -46,7 +46,7 @@ var controllerrevisionsKind = v1.SchemeGroupVersion.WithKind("ControllerRevision func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ControllerRevision, err error) { emptyResult := &v1.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewGetAction(controllerrevisionsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(controllerrevisionsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options func (c *FakeControllerRevisions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ControllerRevisionList, err error) { emptyResult := &v1.ControllerRevisionList{} obj, err := c.Fake. - Invokes(testing.NewListAction(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeControllerRevisions) List(ctx context.Context, opts metav1.ListOpti // Watch returns a watch.Interface that watches the requested controllerRevisions. func (c *FakeControllerRevisions) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(controllerrevisionsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(controllerrevisionsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeControllerRevisions) Watch(ctx context.Context, opts metav1.ListOpt func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.CreateOptions) (result *v1.ControllerRevision, err error) { emptyResult := &v1.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(controllerrevisionsResource, c.ns, controllerRevision), emptyResult) + Invokes(testing.NewCreateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.UpdateOptions) (result *v1.ControllerRevision, err error) { emptyResult := &v1.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(controllerrevisionsResource, c.ns, controllerRevision), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, opts // DeleteCollection deletes a collection of objects. func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(controllerrevisionsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(controllerrevisionsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ControllerRevisionList{}) return err @@ -128,7 +128,7 @@ func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts met func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ControllerRevision, err error) { emptyResult := &v1.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision } emptyResult := &v1.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/apps/v1/fake/fake_daemonset.go b/kubernetes/typed/apps/v1/fake/fake_daemonset.go index c1b1d79483..bac3fc1225 100644 --- a/kubernetes/typed/apps/v1/fake/fake_daemonset.go +++ b/kubernetes/typed/apps/v1/fake/fake_daemonset.go @@ -46,7 +46,7 @@ var daemonsetsKind = v1.SchemeGroupVersion.WithKind("DaemonSet") func (c *FakeDaemonSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DaemonSet, err error) { emptyResult := &v1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewGetAction(daemonsetsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(daemonsetsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeDaemonSets) Get(ctx context.Context, name string, options metav1.Ge func (c *FakeDaemonSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DaemonSetList, err error) { emptyResult := &v1.DaemonSetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(daemonsetsResource, daemonsetsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(daemonsetsResource, daemonsetsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeDaemonSets) List(ctx context.Context, opts metav1.ListOptions) (res // Watch returns a watch.Interface that watches the requested daemonSets. func (c *FakeDaemonSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(daemonsetsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(daemonsetsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeDaemonSets) Watch(ctx context.Context, opts metav1.ListOptions) (wa func (c *FakeDaemonSets) Create(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.CreateOptions) (result *v1.DaemonSet, err error) { emptyResult := &v1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(daemonsetsResource, c.ns, daemonSet), emptyResult) + Invokes(testing.NewCreateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeDaemonSets) Create(ctx context.Context, daemonSet *v1.DaemonSet, op func (c *FakeDaemonSets) Update(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (result *v1.DaemonSet, err error) { emptyResult := &v1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeDaemonSets) Update(ctx context.Context, daemonSet *v1.DaemonSet, op func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (result *v1.DaemonSet, err error) { emptyResult := &v1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(daemonsetsResource, "status", c.ns, daemonSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakeDaemonSets) Delete(ctx context.Context, name string, opts metav1.De // DeleteCollection deletes a collection of objects. func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(daemonsetsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(daemonsetsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.DaemonSetList{}) return err @@ -141,7 +141,7 @@ func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, opts metav1.Delet func (c *FakeDaemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DaemonSet, err error) { emptyResult := &v1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeDaemonSets) Apply(ctx context.Context, daemonSet *appsv1.DaemonSetA } emptyResult := &v1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakeDaemonSets) ApplyStatus(ctx context.Context, daemonSet *appsv1.Daem } emptyResult := &v1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/apps/v1/fake/fake_deployment.go b/kubernetes/typed/apps/v1/fake/fake_deployment.go index c903e3f7be..8d5a77ec46 100644 --- a/kubernetes/typed/apps/v1/fake/fake_deployment.go +++ b/kubernetes/typed/apps/v1/fake/fake_deployment.go @@ -48,7 +48,7 @@ var deploymentsKind = v1.SchemeGroupVersion.WithKind("Deployment") func (c *FakeDeployments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Deployment, err error) { emptyResult := &v1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(deploymentsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -60,7 +60,7 @@ func (c *FakeDeployments) Get(ctx context.Context, name string, options metav1.G func (c *FakeDeployments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DeploymentList, err error) { emptyResult := &v1.DeploymentList{} obj, err := c.Fake. - Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -82,7 +82,7 @@ func (c *FakeDeployments) List(ctx context.Context, opts metav1.ListOptions) (re // Watch returns a watch.Interface that watches the requested deployments. func (c *FakeDeployments) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(deploymentsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(deploymentsResource, c.ns, opts)) } @@ -90,7 +90,7 @@ func (c *FakeDeployments) Watch(ctx context.Context, opts metav1.ListOptions) (w func (c *FakeDeployments) Create(ctx context.Context, deployment *v1.Deployment, opts metav1.CreateOptions) (result *v1.Deployment, err error) { emptyResult := &v1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), emptyResult) + Invokes(testing.NewCreateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err @@ -102,7 +102,7 @@ func (c *FakeDeployments) Create(ctx context.Context, deployment *v1.Deployment, func (c *FakeDeployments) Update(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (result *v1.Deployment, err error) { emptyResult := &v1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err @@ -115,7 +115,7 @@ func (c *FakeDeployments) Update(ctx context.Context, deployment *v1.Deployment, func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (result *v1.Deployment, err error) { emptyResult := &v1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(deploymentsResource, "status", c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err @@ -133,7 +133,7 @@ func (c *FakeDeployments) Delete(ctx context.Context, name string, opts metav1.D // DeleteCollection deletes a collection of objects. func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(deploymentsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.DeploymentList{}) return err @@ -143,7 +143,7 @@ func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts metav1.Dele func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Deployment, err error) { emptyResult := &v1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -166,7 +166,7 @@ func (c *FakeDeployments) Apply(ctx context.Context, deployment *appsv1.Deployme } emptyResult := &v1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -190,7 +190,7 @@ func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1.De } emptyResult := &v1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err @@ -202,7 +202,7 @@ func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1.De func (c *FakeDeployments) GetScale(ctx context.Context, deploymentName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewGetSubresourceAction(deploymentsResource, c.ns, "scale", deploymentName), emptyResult) + Invokes(testing.NewGetSubresourceActionWithOptions(deploymentsResource, c.ns, "scale", deploymentName, options), emptyResult) if obj == nil { return emptyResult, err @@ -214,7 +214,7 @@ func (c *FakeDeployments) GetScale(ctx context.Context, deploymentName string, o func (c *FakeDeployments) UpdateScale(ctx context.Context, deploymentName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "scale", c.ns, scale), &autoscalingv1.Scale{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(deploymentsResource, "scale", c.ns, scale, opts), &autoscalingv1.Scale{}) if obj == nil { return emptyResult, err @@ -234,7 +234,7 @@ func (c *FakeDeployments) ApplyScale(ctx context.Context, deploymentName string, } emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, deploymentName, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, deploymentName, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/apps/v1/fake/fake_replicaset.go b/kubernetes/typed/apps/v1/fake/fake_replicaset.go index 5df759dace..d5bf2cda05 100644 --- a/kubernetes/typed/apps/v1/fake/fake_replicaset.go +++ b/kubernetes/typed/apps/v1/fake/fake_replicaset.go @@ -48,7 +48,7 @@ var replicasetsKind = v1.SchemeGroupVersion.WithKind("ReplicaSet") func (c *FakeReplicaSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ReplicaSet, err error) { emptyResult := &v1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewGetAction(replicasetsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(replicasetsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -60,7 +60,7 @@ func (c *FakeReplicaSets) Get(ctx context.Context, name string, options metav1.G func (c *FakeReplicaSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicaSetList, err error) { emptyResult := &v1.ReplicaSetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(replicasetsResource, replicasetsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(replicasetsResource, replicasetsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -82,7 +82,7 @@ func (c *FakeReplicaSets) List(ctx context.Context, opts metav1.ListOptions) (re // Watch returns a watch.Interface that watches the requested replicaSets. func (c *FakeReplicaSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(replicasetsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(replicasetsResource, c.ns, opts)) } @@ -90,7 +90,7 @@ func (c *FakeReplicaSets) Watch(ctx context.Context, opts metav1.ListOptions) (w func (c *FakeReplicaSets) Create(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.CreateOptions) (result *v1.ReplicaSet, err error) { emptyResult := &v1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(replicasetsResource, c.ns, replicaSet), emptyResult) + Invokes(testing.NewCreateActionWithOptions(replicasetsResource, c.ns, replicaSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -102,7 +102,7 @@ func (c *FakeReplicaSets) Create(ctx context.Context, replicaSet *v1.ReplicaSet, func (c *FakeReplicaSets) Update(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (result *v1.ReplicaSet, err error) { emptyResult := &v1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(replicasetsResource, c.ns, replicaSet), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(replicasetsResource, c.ns, replicaSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -115,7 +115,7 @@ func (c *FakeReplicaSets) Update(ctx context.Context, replicaSet *v1.ReplicaSet, func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (result *v1.ReplicaSet, err error) { emptyResult := &v1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(replicasetsResource, "status", c.ns, replicaSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -133,7 +133,7 @@ func (c *FakeReplicaSets) Delete(ctx context.Context, name string, opts metav1.D // DeleteCollection deletes a collection of objects. func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(replicasetsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(replicasetsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ReplicaSetList{}) return err @@ -143,7 +143,7 @@ func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts metav1.Dele func (c *FakeReplicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ReplicaSet, err error) { emptyResult := &v1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -166,7 +166,7 @@ func (c *FakeReplicaSets) Apply(ctx context.Context, replicaSet *appsv1.ReplicaS } emptyResult := &v1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -190,7 +190,7 @@ func (c *FakeReplicaSets) ApplyStatus(ctx context.Context, replicaSet *appsv1.Re } emptyResult := &v1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err @@ -202,7 +202,7 @@ func (c *FakeReplicaSets) ApplyStatus(ctx context.Context, replicaSet *appsv1.Re func (c *FakeReplicaSets) GetScale(ctx context.Context, replicaSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewGetSubresourceAction(replicasetsResource, c.ns, "scale", replicaSetName), emptyResult) + Invokes(testing.NewGetSubresourceActionWithOptions(replicasetsResource, c.ns, "scale", replicaSetName, options), emptyResult) if obj == nil { return emptyResult, err @@ -214,7 +214,7 @@ func (c *FakeReplicaSets) GetScale(ctx context.Context, replicaSetName string, o func (c *FakeReplicaSets) UpdateScale(ctx context.Context, replicaSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "scale", c.ns, scale), &autoscalingv1.Scale{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(replicasetsResource, "scale", c.ns, scale, opts), &autoscalingv1.Scale{}) if obj == nil { return emptyResult, err @@ -234,7 +234,7 @@ func (c *FakeReplicaSets) ApplyScale(ctx context.Context, replicaSetName string, } emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, replicaSetName, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, replicaSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/apps/v1/fake/fake_statefulset.go b/kubernetes/typed/apps/v1/fake/fake_statefulset.go index 89848d56a9..f970e1d0c6 100644 --- a/kubernetes/typed/apps/v1/fake/fake_statefulset.go +++ b/kubernetes/typed/apps/v1/fake/fake_statefulset.go @@ -48,7 +48,7 @@ var statefulsetsKind = v1.SchemeGroupVersion.WithKind("StatefulSet") func (c *FakeStatefulSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.StatefulSet, err error) { emptyResult := &v1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewGetAction(statefulsetsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(statefulsetsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -60,7 +60,7 @@ func (c *FakeStatefulSets) Get(ctx context.Context, name string, options metav1. func (c *FakeStatefulSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.StatefulSetList, err error) { emptyResult := &v1.StatefulSetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(statefulsetsResource, statefulsetsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(statefulsetsResource, statefulsetsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -82,7 +82,7 @@ func (c *FakeStatefulSets) List(ctx context.Context, opts metav1.ListOptions) (r // Watch returns a watch.Interface that watches the requested statefulSets. func (c *FakeStatefulSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(statefulsetsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(statefulsetsResource, c.ns, opts)) } @@ -90,7 +90,7 @@ func (c *FakeStatefulSets) Watch(ctx context.Context, opts metav1.ListOptions) ( func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.CreateOptions) (result *v1.StatefulSet, err error) { emptyResult := &v1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(statefulsetsResource, c.ns, statefulSet), emptyResult) + Invokes(testing.NewCreateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -102,7 +102,7 @@ func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1.StatefulS func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (result *v1.StatefulSet, err error) { emptyResult := &v1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -115,7 +115,7 @@ func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1.StatefulS func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (result *v1.StatefulSet, err error) { emptyResult := &v1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "status", c.ns, statefulSet), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(statefulsetsResource, "status", c.ns, statefulSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -133,7 +133,7 @@ func (c *FakeStatefulSets) Delete(ctx context.Context, name string, opts metav1. // DeleteCollection deletes a collection of objects. func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(statefulsetsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(statefulsetsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.StatefulSetList{}) return err @@ -143,7 +143,7 @@ func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts metav1.Del func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.StatefulSet, err error) { emptyResult := &v1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -166,7 +166,7 @@ func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *appsv1.Statef } emptyResult := &v1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -190,7 +190,7 @@ func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1. } emptyResult := &v1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err @@ -202,7 +202,7 @@ func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1. func (c *FakeStatefulSets) GetScale(ctx context.Context, statefulSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewGetSubresourceAction(statefulsetsResource, c.ns, "scale", statefulSetName), emptyResult) + Invokes(testing.NewGetSubresourceActionWithOptions(statefulsetsResource, c.ns, "scale", statefulSetName, options), emptyResult) if obj == nil { return emptyResult, err @@ -214,7 +214,7 @@ func (c *FakeStatefulSets) GetScale(ctx context.Context, statefulSetName string, func (c *FakeStatefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "scale", c.ns, scale), &autoscalingv1.Scale{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(statefulsetsResource, "scale", c.ns, scale, opts), &autoscalingv1.Scale{}) if obj == nil { return emptyResult, err @@ -234,7 +234,7 @@ func (c *FakeStatefulSets) ApplyScale(ctx context.Context, statefulSetName strin } emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go b/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go index d427737361..7ea2b2e11b 100644 --- a/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go +++ b/kubernetes/typed/apps/v1beta1/fake/fake_controllerrevision.go @@ -46,7 +46,7 @@ var controllerrevisionsKind = v1beta1.SchemeGroupVersion.WithKind("ControllerRev func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ControllerRevision, err error) { emptyResult := &v1beta1.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewGetAction(controllerrevisionsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(controllerrevisionsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options func (c *FakeControllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ControllerRevisionList, err error) { emptyResult := &v1beta1.ControllerRevisionList{} obj, err := c.Fake. - Invokes(testing.NewListAction(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeControllerRevisions) List(ctx context.Context, opts v1.ListOptions) // Watch returns a watch.Interface that watches the requested controllerRevisions. func (c *FakeControllerRevisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(controllerrevisionsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(controllerrevisionsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeControllerRevisions) Watch(ctx context.Context, opts v1.ListOptions func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.CreateOptions) (result *v1beta1.ControllerRevision, err error) { emptyResult := &v1beta1.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(controllerrevisionsResource, c.ns, controllerRevision), emptyResult) + Invokes(testing.NewCreateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.UpdateOptions) (result *v1beta1.ControllerRevision, err error) { emptyResult := &v1beta1.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(controllerrevisionsResource, c.ns, controllerRevision), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, opts // DeleteCollection deletes a collection of objects. func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(controllerrevisionsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(controllerrevisionsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.ControllerRevisionList{}) return err @@ -128,7 +128,7 @@ func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts v1. func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ControllerRevision, err error) { emptyResult := &v1beta1.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision } emptyResult := &v1beta1.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go b/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go index f45355a08b..05c557ecb3 100644 --- a/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go +++ b/kubernetes/typed/apps/v1beta1/fake/fake_deployment.go @@ -46,7 +46,7 @@ var deploymentsKind = v1beta1.SchemeGroupVersion.WithKind("Deployment") func (c *FakeDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Deployment, err error) { emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(deploymentsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeDeployments) Get(ctx context.Context, name string, options v1.GetOp func (c *FakeDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { emptyResult := &v1beta1.DeploymentList{} obj, err := c.Fake. - Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeDeployments) List(ctx context.Context, opts v1.ListOptions) (result // Watch returns a watch.Interface that watches the requested deployments. func (c *FakeDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(deploymentsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(deploymentsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch func (c *FakeDeployments) Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (result *v1beta1.Deployment, err error) { emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), emptyResult) + Invokes(testing.NewCreateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeDeployments) Create(ctx context.Context, deployment *v1beta1.Deploy func (c *FakeDeployments) Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeDeployments) Update(ctx context.Context, deployment *v1beta1.Deploy func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(deploymentsResource, "status", c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakeDeployments) Delete(ctx context.Context, name string, opts v1.Delet // DeleteCollection deletes a collection of objects. func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(deploymentsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.DeploymentList{}) return err @@ -141,7 +141,7 @@ func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOp func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Deployment, err error) { emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeDeployments) Apply(ctx context.Context, deployment *appsv1beta1.Dep } emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1bet } emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go b/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go index ea6b517de7..c38690554a 100644 --- a/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go +++ b/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go @@ -46,7 +46,7 @@ var statefulsetsKind = v1beta1.SchemeGroupVersion.WithKind("StatefulSet") func (c *FakeStatefulSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.StatefulSet, err error) { emptyResult := &v1beta1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewGetAction(statefulsetsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(statefulsetsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeStatefulSets) Get(ctx context.Context, name string, options v1.GetO func (c *FakeStatefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) { emptyResult := &v1beta1.StatefulSetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(statefulsetsResource, statefulsetsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(statefulsetsResource, statefulsetsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeStatefulSets) List(ctx context.Context, opts v1.ListOptions) (resul // Watch returns a watch.Interface that watches the requested statefulSets. func (c *FakeStatefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(statefulsetsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(statefulsetsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeStatefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watc func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.CreateOptions) (result *v1beta1.StatefulSet, err error) { emptyResult := &v1beta1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(statefulsetsResource, c.ns, statefulSet), emptyResult) + Invokes(testing.NewCreateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1beta1.Stat func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (result *v1beta1.StatefulSet, err error) { emptyResult := &v1beta1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1beta1.Stat func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (result *v1beta1.StatefulSet, err error) { emptyResult := &v1beta1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "status", c.ns, statefulSet), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(statefulsetsResource, "status", c.ns, statefulSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakeStatefulSets) Delete(ctx context.Context, name string, opts v1.Dele // DeleteCollection deletes a collection of objects. func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(statefulsetsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(statefulsetsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.StatefulSetList{}) return err @@ -141,7 +141,7 @@ func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteO func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StatefulSet, err error) { emptyResult := &v1beta1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *appsv1beta1.S } emptyResult := &v1beta1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1b } emptyResult := &v1beta1.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go b/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go index 5e8ca6df2c..45b2050706 100644 --- a/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go +++ b/kubernetes/typed/apps/v1beta2/fake/fake_controllerrevision.go @@ -46,7 +46,7 @@ var controllerrevisionsKind = v1beta2.SchemeGroupVersion.WithKind("ControllerRev func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ControllerRevision, err error) { emptyResult := &v1beta2.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewGetAction(controllerrevisionsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(controllerrevisionsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options func (c *FakeControllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) { emptyResult := &v1beta2.ControllerRevisionList{} obj, err := c.Fake. - Invokes(testing.NewListAction(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeControllerRevisions) List(ctx context.Context, opts v1.ListOptions) // Watch returns a watch.Interface that watches the requested controllerRevisions. func (c *FakeControllerRevisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(controllerrevisionsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(controllerrevisionsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeControllerRevisions) Watch(ctx context.Context, opts v1.ListOptions func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.CreateOptions) (result *v1beta2.ControllerRevision, err error) { emptyResult := &v1beta2.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(controllerrevisionsResource, c.ns, controllerRevision), emptyResult) + Invokes(testing.NewCreateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.UpdateOptions) (result *v1beta2.ControllerRevision, err error) { emptyResult := &v1beta2.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(controllerrevisionsResource, c.ns, controllerRevision), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, opts // DeleteCollection deletes a collection of objects. func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(controllerrevisionsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(controllerrevisionsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta2.ControllerRevisionList{}) return err @@ -128,7 +128,7 @@ func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts v1. func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ControllerRevision, err error) { emptyResult := &v1beta2.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision } emptyResult := &v1beta2.ControllerRevision{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go b/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go index b554c22498..61ceeb1411 100644 --- a/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go +++ b/kubernetes/typed/apps/v1beta2/fake/fake_daemonset.go @@ -46,7 +46,7 @@ var daemonsetsKind = v1beta2.SchemeGroupVersion.WithKind("DaemonSet") func (c *FakeDaemonSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.DaemonSet, err error) { emptyResult := &v1beta2.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewGetAction(daemonsetsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(daemonsetsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeDaemonSets) Get(ctx context.Context, name string, options v1.GetOpt func (c *FakeDaemonSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DaemonSetList, err error) { emptyResult := &v1beta2.DaemonSetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(daemonsetsResource, daemonsetsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(daemonsetsResource, daemonsetsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ 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)) } @@ -88,7 +88,7 @@ func (c *FakeDaemonSets) Watch(ctx context.Context, opts v1.ListOptions) (watch. func (c *FakeDaemonSets) Create(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.CreateOptions) (result *v1beta2.DaemonSet, err error) { emptyResult := &v1beta2.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(daemonsetsResource, c.ns, daemonSet), emptyResult) + Invokes(testing.NewCreateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeDaemonSets) Create(ctx context.Context, daemonSet *v1beta2.DaemonSe func (c *FakeDaemonSets) Update(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (result *v1beta2.DaemonSet, err error) { emptyResult := &v1beta2.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeDaemonSets) Update(ctx context.Context, daemonSet *v1beta2.DaemonSe func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (result *v1beta2.DaemonSet, err error) { emptyResult := &v1beta2.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(daemonsetsResource, "status", c.ns, daemonSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,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, &v1beta2.DaemonSetList{}) return err @@ -141,7 +141,7 @@ func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, opts v1.DeleteOpt func (c *FakeDaemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.DaemonSet, err error) { emptyResult := &v1beta2.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeDaemonSets) Apply(ctx context.Context, daemonSet *appsv1beta2.Daemo } emptyResult := &v1beta2.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakeDaemonSets) ApplyStatus(ctx context.Context, daemonSet *appsv1beta2 } emptyResult := &v1beta2.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go b/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go index c2a10e8efd..d849856a40 100644 --- a/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go +++ b/kubernetes/typed/apps/v1beta2/fake/fake_deployment.go @@ -46,7 +46,7 @@ var deploymentsKind = v1beta2.SchemeGroupVersion.WithKind("Deployment") func (c *FakeDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.Deployment, err error) { emptyResult := &v1beta2.Deployment{} obj, err := c.Fake. - Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(deploymentsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeDeployments) Get(ctx context.Context, name string, options v1.GetOp func (c *FakeDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DeploymentList, err error) { emptyResult := &v1beta2.DeploymentList{} obj, err := c.Fake. - Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeDeployments) List(ctx context.Context, opts v1.ListOptions) (result // Watch returns a watch.Interface that watches the requested deployments. func (c *FakeDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(deploymentsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(deploymentsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch func (c *FakeDeployments) Create(ctx context.Context, deployment *v1beta2.Deployment, opts v1.CreateOptions) (result *v1beta2.Deployment, err error) { emptyResult := &v1beta2.Deployment{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), emptyResult) + Invokes(testing.NewCreateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeDeployments) Create(ctx context.Context, deployment *v1beta2.Deploy func (c *FakeDeployments) Update(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (result *v1beta2.Deployment, err error) { emptyResult := &v1beta2.Deployment{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeDeployments) Update(ctx context.Context, deployment *v1beta2.Deploy func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (result *v1beta2.Deployment, err error) { emptyResult := &v1beta2.Deployment{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(deploymentsResource, "status", c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakeDeployments) Delete(ctx context.Context, name string, opts v1.Delet // DeleteCollection deletes a collection of objects. func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(deploymentsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta2.DeploymentList{}) return err @@ -141,7 +141,7 @@ func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOp func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Deployment, err error) { emptyResult := &v1beta2.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeDeployments) Apply(ctx context.Context, deployment *appsv1beta2.Dep } emptyResult := &v1beta2.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1bet } emptyResult := &v1beta2.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go b/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go index 5af517d446..1f957f0843 100644 --- a/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go +++ b/kubernetes/typed/apps/v1beta2/fake/fake_replicaset.go @@ -46,7 +46,7 @@ var replicasetsKind = v1beta2.SchemeGroupVersion.WithKind("ReplicaSet") func (c *FakeReplicaSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ReplicaSet, err error) { emptyResult := &v1beta2.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewGetAction(replicasetsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(replicasetsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeReplicaSets) Get(ctx context.Context, name string, options v1.GetOp func (c *FakeReplicaSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ReplicaSetList, err error) { emptyResult := &v1beta2.ReplicaSetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(replicasetsResource, replicasetsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(replicasetsResource, replicasetsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeReplicaSets) List(ctx context.Context, opts v1.ListOptions) (result // Watch returns a watch.Interface that watches the requested replicaSets. func (c *FakeReplicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(replicasetsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(replicasetsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeReplicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch func (c *FakeReplicaSets) Create(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.CreateOptions) (result *v1beta2.ReplicaSet, err error) { emptyResult := &v1beta2.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(replicasetsResource, c.ns, replicaSet), emptyResult) + Invokes(testing.NewCreateActionWithOptions(replicasetsResource, c.ns, replicaSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeReplicaSets) Create(ctx context.Context, replicaSet *v1beta2.Replic func (c *FakeReplicaSets) Update(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (result *v1beta2.ReplicaSet, err error) { emptyResult := &v1beta2.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(replicasetsResource, c.ns, replicaSet), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(replicasetsResource, c.ns, replicaSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeReplicaSets) Update(ctx context.Context, replicaSet *v1beta2.Replic func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (result *v1beta2.ReplicaSet, err error) { emptyResult := &v1beta2.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(replicasetsResource, "status", c.ns, replicaSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakeReplicaSets) Delete(ctx context.Context, name string, opts v1.Delet // DeleteCollection deletes a collection of objects. func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(replicasetsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(replicasetsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta2.ReplicaSetList{}) return err @@ -141,7 +141,7 @@ func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOp func (c *FakeReplicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ReplicaSet, err error) { emptyResult := &v1beta2.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeReplicaSets) Apply(ctx context.Context, replicaSet *appsv1beta2.Rep } emptyResult := &v1beta2.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakeReplicaSets) ApplyStatus(ctx context.Context, replicaSet *appsv1bet } emptyResult := &v1beta2.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go b/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go index a439fe9dbb..5a32eba21c 100644 --- a/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go +++ b/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go @@ -46,7 +46,7 @@ var statefulsetsKind = v1beta2.SchemeGroupVersion.WithKind("StatefulSet") func (c *FakeStatefulSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.StatefulSet, err error) { emptyResult := &v1beta2.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewGetAction(statefulsetsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(statefulsetsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeStatefulSets) Get(ctx context.Context, name string, options v1.GetO func (c *FakeStatefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.StatefulSetList, err error) { emptyResult := &v1beta2.StatefulSetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(statefulsetsResource, statefulsetsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(statefulsetsResource, statefulsetsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeStatefulSets) List(ctx context.Context, opts v1.ListOptions) (resul // Watch returns a watch.Interface that watches the requested statefulSets. func (c *FakeStatefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(statefulsetsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(statefulsetsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeStatefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watc func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.CreateOptions) (result *v1beta2.StatefulSet, err error) { emptyResult := &v1beta2.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(statefulsetsResource, c.ns, statefulSet), emptyResult) + Invokes(testing.NewCreateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1beta2.Stat func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (result *v1beta2.StatefulSet, err error) { emptyResult := &v1beta2.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(statefulsetsResource, c.ns, statefulSet), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1beta2.Stat func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (result *v1beta2.StatefulSet, err error) { emptyResult := &v1beta2.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "status", c.ns, statefulSet), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(statefulsetsResource, "status", c.ns, statefulSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakeStatefulSets) Delete(ctx context.Context, name string, opts v1.Dele // DeleteCollection deletes a collection of objects. func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(statefulsetsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(statefulsetsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta2.StatefulSetList{}) return err @@ -141,7 +141,7 @@ func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteO func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.StatefulSet, err error) { emptyResult := &v1beta2.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *appsv1beta2.S } emptyResult := &v1beta2.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1b } emptyResult := &v1beta2.StatefulSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err @@ -200,7 +200,7 @@ func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1b func (c *FakeStatefulSets) GetScale(ctx context.Context, statefulSetName string, options v1.GetOptions) (result *v1beta2.Scale, err error) { emptyResult := &v1beta2.Scale{} obj, err := c.Fake. - Invokes(testing.NewGetSubresourceAction(statefulsetsResource, c.ns, "scale", statefulSetName), emptyResult) + Invokes(testing.NewGetSubresourceActionWithOptions(statefulsetsResource, c.ns, "scale", statefulSetName, options), emptyResult) if obj == nil { return emptyResult, err @@ -212,7 +212,7 @@ func (c *FakeStatefulSets) GetScale(ctx context.Context, statefulSetName string, func (c *FakeStatefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *v1beta2.Scale, opts v1.UpdateOptions) (result *v1beta2.Scale, err error) { emptyResult := &v1beta2.Scale{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(statefulsetsResource, "scale", c.ns, scale), &v1beta2.Scale{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(statefulsetsResource, "scale", c.ns, scale, opts), &v1beta2.Scale{}) if obj == nil { return emptyResult, err @@ -232,7 +232,7 @@ func (c *FakeStatefulSets) ApplyScale(ctx context.Context, statefulSetName strin } emptyResult := &v1beta2.Scale{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/authentication/v1/fake/fake_selfsubjectreview.go b/kubernetes/typed/authentication/v1/fake/fake_selfsubjectreview.go index 158b7f8051..7e7c3138a5 100644 --- a/kubernetes/typed/authentication/v1/fake/fake_selfsubjectreview.go +++ b/kubernetes/typed/authentication/v1/fake/fake_selfsubjectreview.go @@ -39,7 +39,7 @@ var selfsubjectreviewsKind = v1.SchemeGroupVersion.WithKind("SelfSubjectReview") func (c *FakeSelfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1.SelfSubjectReview, opts metav1.CreateOptions) (result *v1.SelfSubjectReview, err error) { emptyResult := &v1.SelfSubjectReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(selfsubjectreviewsResource, selfSubjectReview), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(selfsubjectreviewsResource, selfSubjectReview, opts), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go b/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go index 656bd8f07a..a22f335429 100644 --- a/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go +++ b/kubernetes/typed/authentication/v1/fake/fake_tokenreview.go @@ -39,7 +39,7 @@ var tokenreviewsKind = v1.SchemeGroupVersion.WithKind("TokenReview") func (c *FakeTokenReviews) Create(ctx context.Context, tokenReview *v1.TokenReview, opts metav1.CreateOptions) (result *v1.TokenReview, err error) { emptyResult := &v1.TokenReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(tokenreviewsResource, tokenReview), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(tokenreviewsResource, tokenReview, opts), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/authentication/v1alpha1/fake/fake_selfsubjectreview.go b/kubernetes/typed/authentication/v1alpha1/fake/fake_selfsubjectreview.go index 5252eedaab..680460f459 100644 --- a/kubernetes/typed/authentication/v1alpha1/fake/fake_selfsubjectreview.go +++ b/kubernetes/typed/authentication/v1alpha1/fake/fake_selfsubjectreview.go @@ -39,7 +39,7 @@ var selfsubjectreviewsKind = v1alpha1.SchemeGroupVersion.WithKind("SelfSubjectRe func (c *FakeSelfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1alpha1.SelfSubjectReview, opts v1.CreateOptions) (result *v1alpha1.SelfSubjectReview, err error) { emptyResult := &v1alpha1.SelfSubjectReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(selfsubjectreviewsResource, selfSubjectReview), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(selfsubjectreviewsResource, selfSubjectReview, opts), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/authentication/v1beta1/fake/fake_selfsubjectreview.go b/kubernetes/typed/authentication/v1beta1/fake/fake_selfsubjectreview.go index eedfebb6f9..33e130e9cc 100644 --- a/kubernetes/typed/authentication/v1beta1/fake/fake_selfsubjectreview.go +++ b/kubernetes/typed/authentication/v1beta1/fake/fake_selfsubjectreview.go @@ -39,7 +39,7 @@ var selfsubjectreviewsKind = v1beta1.SchemeGroupVersion.WithKind("SelfSubjectRev func (c *FakeSelfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1beta1.SelfSubjectReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectReview, err error) { emptyResult := &v1beta1.SelfSubjectReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(selfsubjectreviewsResource, selfSubjectReview), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(selfsubjectreviewsResource, selfSubjectReview, opts), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go b/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go index cd1f1333aa..b512f5c146 100644 --- a/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go +++ b/kubernetes/typed/authentication/v1beta1/fake/fake_tokenreview.go @@ -39,7 +39,7 @@ var tokenreviewsKind = v1beta1.SchemeGroupVersion.WithKind("TokenReview") func (c *FakeTokenReviews) Create(ctx context.Context, tokenReview *v1beta1.TokenReview, opts v1.CreateOptions) (result *v1beta1.TokenReview, err error) { emptyResult := &v1beta1.TokenReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(tokenreviewsResource, tokenReview), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(tokenreviewsResource, tokenReview, opts), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview.go b/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview.go index 491116f6e3..dd23481d39 100644 --- a/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview.go +++ b/kubernetes/typed/authorization/v1/fake/fake_localsubjectaccessreview.go @@ -40,7 +40,7 @@ var localsubjectaccessreviewsKind = v1.SchemeGroupVersion.WithKind("LocalSubject func (c *FakeLocalSubjectAccessReviews) Create(ctx context.Context, localSubjectAccessReview *v1.LocalSubjectAccessReview, opts metav1.CreateOptions) (result *v1.LocalSubjectAccessReview, err error) { emptyResult := &v1.LocalSubjectAccessReview{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(localsubjectaccessreviewsResource, c.ns, localSubjectAccessReview), emptyResult) + Invokes(testing.NewCreateActionWithOptions(localsubjectaccessreviewsResource, c.ns, localSubjectAccessReview, opts), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview.go b/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview.go index e2f1377f30..d04b8502f3 100644 --- a/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview.go +++ b/kubernetes/typed/authorization/v1/fake/fake_selfsubjectaccessreview.go @@ -39,7 +39,7 @@ var selfsubjectaccessreviewsKind = v1.SchemeGroupVersion.WithKind("SelfSubjectAc func (c *FakeSelfSubjectAccessReviews) Create(ctx context.Context, selfSubjectAccessReview *v1.SelfSubjectAccessReview, opts metav1.CreateOptions) (result *v1.SelfSubjectAccessReview, err error) { emptyResult := &v1.SelfSubjectAccessReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(selfsubjectaccessreviewsResource, selfSubjectAccessReview), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(selfsubjectaccessreviewsResource, selfSubjectAccessReview, opts), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview.go b/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview.go index 39edde853c..71ed326f8b 100644 --- a/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview.go +++ b/kubernetes/typed/authorization/v1/fake/fake_selfsubjectrulesreview.go @@ -39,7 +39,7 @@ var selfsubjectrulesreviewsKind = v1.SchemeGroupVersion.WithKind("SelfSubjectRul func (c *FakeSelfSubjectRulesReviews) Create(ctx context.Context, selfSubjectRulesReview *v1.SelfSubjectRulesReview, opts metav1.CreateOptions) (result *v1.SelfSubjectRulesReview, err error) { emptyResult := &v1.SelfSubjectRulesReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(selfsubjectrulesreviewsResource, selfSubjectRulesReview), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(selfsubjectrulesreviewsResource, selfSubjectRulesReview, opts), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview.go b/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview.go index c22cb26132..358ba9aa77 100644 --- a/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview.go +++ b/kubernetes/typed/authorization/v1/fake/fake_subjectaccessreview.go @@ -39,7 +39,7 @@ var subjectaccessreviewsKind = v1.SchemeGroupVersion.WithKind("SubjectAccessRevi func (c *FakeSubjectAccessReviews) Create(ctx context.Context, subjectAccessReview *v1.SubjectAccessReview, opts metav1.CreateOptions) (result *v1.SubjectAccessReview, err error) { emptyResult := &v1.SubjectAccessReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(subjectaccessreviewsResource, subjectAccessReview), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(subjectaccessreviewsResource, subjectAccessReview, opts), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go b/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go index 95ccfe7956..e2bf627736 100644 --- a/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go +++ b/kubernetes/typed/authorization/v1beta1/fake/fake_localsubjectaccessreview.go @@ -40,7 +40,7 @@ var localsubjectaccessreviewsKind = v1beta1.SchemeGroupVersion.WithKind("LocalSu func (c *FakeLocalSubjectAccessReviews) Create(ctx context.Context, localSubjectAccessReview *v1beta1.LocalSubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.LocalSubjectAccessReview, err error) { emptyResult := &v1beta1.LocalSubjectAccessReview{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(localsubjectaccessreviewsResource, c.ns, localSubjectAccessReview), emptyResult) + Invokes(testing.NewCreateActionWithOptions(localsubjectaccessreviewsResource, c.ns, localSubjectAccessReview, opts), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go b/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go index 1547c17d00..996e4d4108 100644 --- a/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go +++ b/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectaccessreview.go @@ -39,7 +39,7 @@ var selfsubjectaccessreviewsKind = v1beta1.SchemeGroupVersion.WithKind("SelfSubj func (c *FakeSelfSubjectAccessReviews) Create(ctx context.Context, selfSubjectAccessReview *v1beta1.SelfSubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectAccessReview, err error) { emptyResult := &v1beta1.SelfSubjectAccessReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(selfsubjectaccessreviewsResource, selfSubjectAccessReview), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(selfsubjectaccessreviewsResource, selfSubjectAccessReview, opts), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview.go b/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview.go index cfc11b5422..6e4c758909 100644 --- a/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview.go +++ b/kubernetes/typed/authorization/v1beta1/fake/fake_selfsubjectrulesreview.go @@ -39,7 +39,7 @@ var selfsubjectrulesreviewsKind = v1beta1.SchemeGroupVersion.WithKind("SelfSubje func (c *FakeSelfSubjectRulesReviews) Create(ctx context.Context, selfSubjectRulesReview *v1beta1.SelfSubjectRulesReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectRulesReview, err error) { emptyResult := &v1beta1.SelfSubjectRulesReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(selfsubjectrulesreviewsResource, selfSubjectRulesReview), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(selfsubjectrulesreviewsResource, selfSubjectRulesReview, opts), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go b/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go index 972d49e4d6..aab6e08dc2 100644 --- a/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go +++ b/kubernetes/typed/authorization/v1beta1/fake/fake_subjectaccessreview.go @@ -39,7 +39,7 @@ var subjectaccessreviewsKind = v1beta1.SchemeGroupVersion.WithKind("SubjectAcces func (c *FakeSubjectAccessReviews) Create(ctx context.Context, subjectAccessReview *v1beta1.SubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.SubjectAccessReview, err error) { emptyResult := &v1beta1.SubjectAccessReview{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(subjectaccessreviewsResource, subjectAccessReview), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(subjectaccessreviewsResource, subjectAccessReview, opts), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go index fe661a3326..23e2c391dd 100644 --- a/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go @@ -46,7 +46,7 @@ var horizontalpodautoscalersKind = v1.SchemeGroupVersion.WithKind("HorizontalPod func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HorizontalPodAutoscaler, err error) { emptyResult := &v1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(horizontalpodautoscalersResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, opt func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) { emptyResult := &v1.HorizontalPodAutoscalerList{} obj, err := c.Fake. - Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts metav1.Lis // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(horizontalpodautoscalersResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(horizontalpodautoscalersResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts metav1.Li func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.CreateOptions) (result *v1.HorizontalPodAutoscaler, err error) { emptyResult := &v1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult) + Invokes(testing.NewCreateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPod func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (result *v1.HorizontalPodAutoscaler, err error) { emptyResult := &v1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPod func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (result *v1.HorizontalPodAutoscaler, err error) { emptyResult := &v1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, // DeleteCollection deletes a collection of objects. func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(horizontalpodautoscalersResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.HorizontalPodAutoscalerList{}) return err @@ -141,7 +141,7 @@ func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opt func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) { emptyResult := &v1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodA } emptyResult := &v1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizont } emptyResult := &v1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/autoscaling/v2/fake/fake_horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v2/fake/fake_horizontalpodautoscaler.go index 57ce30f171..2ca3d27c94 100644 --- a/kubernetes/typed/autoscaling/v2/fake/fake_horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v2/fake/fake_horizontalpodautoscaler.go @@ -46,7 +46,7 @@ var horizontalpodautoscalersKind = v2.SchemeGroupVersion.WithKind("HorizontalPod func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.HorizontalPodAutoscaler, err error) { emptyResult := &v2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(horizontalpodautoscalersResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, opt func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2.HorizontalPodAutoscalerList, err error) { emptyResult := &v2.HorizontalPodAutoscalerList{} obj, err := c.Fake. - Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOpt // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(horizontalpodautoscalersResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(horizontalpodautoscalersResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOp func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *v2.HorizontalPodAutoscaler, err error) { emptyResult := &v2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult) + Invokes(testing.NewCreateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPod func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2.HorizontalPodAutoscaler, err error) { emptyResult := &v2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPod func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2.HorizontalPodAutoscaler, err error) { emptyResult := &v2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, // DeleteCollection deletes a collection of objects. func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(horizontalpodautoscalersResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v2.HorizontalPodAutoscalerList{}) return err @@ -141,7 +141,7 @@ func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opt func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.HorizontalPodAutoscaler, err error) { emptyResult := &v2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodA } emptyResult := &v2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizont } emptyResult := &v2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go index ad81314bfb..7f99b5e8fc 100644 --- a/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v2beta1/fake/fake_horizontalpodautoscaler.go @@ -46,7 +46,7 @@ var horizontalpodautoscalersKind = v2beta1.SchemeGroupVersion.WithKind("Horizont func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { emptyResult := &v2beta1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(horizontalpodautoscalersResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, opt func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta1.HorizontalPodAutoscalerList, err error) { emptyResult := &v2beta1.HorizontalPodAutoscalerList{} obj, err := c.Fake. - Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOpt // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(horizontalpodautoscalersResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(horizontalpodautoscalersResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOp func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { emptyResult := &v2beta1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult) + Invokes(testing.NewCreateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPod func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { emptyResult := &v2beta1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPod func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { emptyResult := &v2beta1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, // DeleteCollection deletes a collection of objects. func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(horizontalpodautoscalersResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v2beta1.HorizontalPodAutoscalerList{}) return err @@ -141,7 +141,7 @@ func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opt func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta1.HorizontalPodAutoscaler, err error) { emptyResult := &v2beta1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodA } emptyResult := &v2beta1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizont } emptyResult := &v2beta1.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/autoscaling/v2beta2/fake/fake_horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v2beta2/fake/fake_horizontalpodautoscaler.go index becd8eeb89..e037e8ac48 100644 --- a/kubernetes/typed/autoscaling/v2beta2/fake/fake_horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v2beta2/fake/fake_horizontalpodautoscaler.go @@ -46,7 +46,7 @@ var horizontalpodautoscalersKind = v2beta2.SchemeGroupVersion.WithKind("Horizont func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { emptyResult := &v2beta2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewGetAction(horizontalpodautoscalersResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(horizontalpodautoscalersResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeHorizontalPodAutoscalers) Get(ctx context.Context, name string, opt func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta2.HorizontalPodAutoscalerList, err error) { emptyResult := &v2beta2.HorizontalPodAutoscalerList{} obj, err := c.Fake. - Invokes(testing.NewListAction(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(horizontalpodautoscalersResource, horizontalpodautoscalersKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeHorizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOpt // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(horizontalpodautoscalersResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(horizontalpodautoscalersResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeHorizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOp func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { emptyResult := &v2beta2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult) + Invokes(testing.NewCreateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeHorizontalPodAutoscalers) Create(ctx context.Context, horizontalPod func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { emptyResult := &v2beta2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(horizontalpodautoscalersResource, c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeHorizontalPodAutoscalers) Update(ctx context.Context, horizontalPod func (c *FakeHorizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { emptyResult := &v2beta2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(horizontalpodautoscalersResource, "status", c.ns, horizontalPodAutoscaler, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakeHorizontalPodAutoscalers) Delete(ctx context.Context, name string, // DeleteCollection deletes a collection of objects. func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(horizontalpodautoscalersResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(horizontalpodautoscalersResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v2beta2.HorizontalPodAutoscalerList{}) return err @@ -141,7 +141,7 @@ func (c *FakeHorizontalPodAutoscalers) DeleteCollection(ctx context.Context, opt func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta2.HorizontalPodAutoscaler, err error) { emptyResult := &v2beta2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodA } emptyResult := &v2beta2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizont } emptyResult := &v2beta2.HorizontalPodAutoscaler{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/batch/v1/fake/fake_cronjob.go b/kubernetes/typed/batch/v1/fake/fake_cronjob.go index e14fbf68c6..171bb82329 100644 --- a/kubernetes/typed/batch/v1/fake/fake_cronjob.go +++ b/kubernetes/typed/batch/v1/fake/fake_cronjob.go @@ -46,7 +46,7 @@ var cronjobsKind = v1.SchemeGroupVersion.WithKind("CronJob") func (c *FakeCronJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CronJob, err error) { emptyResult := &v1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewGetAction(cronjobsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(cronjobsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeCronJobs) Get(ctx context.Context, name string, options metav1.GetO func (c *FakeCronJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CronJobList, err error) { emptyResult := &v1.CronJobList{} obj, err := c.Fake. - Invokes(testing.NewListAction(cronjobsResource, cronjobsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(cronjobsResource, cronjobsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeCronJobs) List(ctx context.Context, opts metav1.ListOptions) (resul // Watch returns a watch.Interface that watches the requested cronJobs. func (c *FakeCronJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(cronjobsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(cronjobsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeCronJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watc func (c *FakeCronJobs) Create(ctx context.Context, cronJob *v1.CronJob, opts metav1.CreateOptions) (result *v1.CronJob, err error) { emptyResult := &v1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(cronjobsResource, c.ns, cronJob), emptyResult) + Invokes(testing.NewCreateActionWithOptions(cronjobsResource, c.ns, cronJob, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeCronJobs) Create(ctx context.Context, cronJob *v1.CronJob, opts met func (c *FakeCronJobs) Update(ctx context.Context, cronJob *v1.CronJob, opts metav1.UpdateOptions) (result *v1.CronJob, err error) { emptyResult := &v1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(cronjobsResource, c.ns, cronJob), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(cronjobsResource, c.ns, cronJob, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeCronJobs) Update(ctx context.Context, cronJob *v1.CronJob, opts met func (c *FakeCronJobs) UpdateStatus(ctx context.Context, cronJob *v1.CronJob, opts metav1.UpdateOptions) (result *v1.CronJob, err error) { emptyResult := &v1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(cronjobsResource, "status", c.ns, cronJob), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(cronjobsResource, "status", c.ns, cronJob, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakeCronJobs) Delete(ctx context.Context, name string, opts metav1.Dele // DeleteCollection deletes a collection of objects. func (c *FakeCronJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(cronjobsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(cronjobsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.CronJobList{}) return err @@ -141,7 +141,7 @@ func (c *FakeCronJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteO func (c *FakeCronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CronJob, err error) { emptyResult := &v1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(cronjobsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeCronJobs) Apply(ctx context.Context, cronJob *batchv1.CronJobApplyC } emptyResult := &v1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakeCronJobs) ApplyStatus(ctx context.Context, cronJob *batchv1.CronJob } emptyResult := &v1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/batch/v1/fake/fake_job.go b/kubernetes/typed/batch/v1/fake/fake_job.go index b13d5f7367..23e66953cb 100644 --- a/kubernetes/typed/batch/v1/fake/fake_job.go +++ b/kubernetes/typed/batch/v1/fake/fake_job.go @@ -46,7 +46,7 @@ var jobsKind = v1.SchemeGroupVersion.WithKind("Job") func (c *FakeJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Job, err error) { emptyResult := &v1.Job{} obj, err := c.Fake. - Invokes(testing.NewGetAction(jobsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(jobsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeJobs) Get(ctx context.Context, name string, options metav1.GetOptio func (c *FakeJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.JobList, err error) { emptyResult := &v1.JobList{} obj, err := c.Fake. - Invokes(testing.NewListAction(jobsResource, jobsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(jobsResource, jobsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v // Watch returns a watch.Interface that watches the requested jobs. func (c *FakeJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(jobsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(jobsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.In func (c *FakeJobs) Create(ctx context.Context, job *v1.Job, opts metav1.CreateOptions) (result *v1.Job, err error) { emptyResult := &v1.Job{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(jobsResource, c.ns, job), emptyResult) + Invokes(testing.NewCreateActionWithOptions(jobsResource, c.ns, job, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeJobs) Create(ctx context.Context, job *v1.Job, opts metav1.CreateOp func (c *FakeJobs) Update(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (result *v1.Job, err error) { emptyResult := &v1.Job{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(jobsResource, c.ns, job), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(jobsResource, c.ns, job, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeJobs) Update(ctx context.Context, job *v1.Job, opts metav1.UpdateOp func (c *FakeJobs) UpdateStatus(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (result *v1.Job, err error) { emptyResult := &v1.Job{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(jobsResource, "status", c.ns, job), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(jobsResource, "status", c.ns, job, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakeJobs) Delete(ctx context.Context, name string, opts metav1.DeleteOp // DeleteCollection deletes a collection of objects. func (c *FakeJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(jobsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(jobsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.JobList{}) return err @@ -141,7 +141,7 @@ func (c *FakeJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptio func (c *FakeJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Job, err error) { emptyResult := &v1.Job{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(jobsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeJobs) Apply(ctx context.Context, job *batchv1.JobApplyConfiguration } emptyResult := &v1.Job{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(jobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakeJobs) ApplyStatus(ctx context.Context, job *batchv1.JobApplyConfigu } emptyResult := &v1.Job{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(jobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go b/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go index a624e8daac..71cd4f1653 100644 --- a/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go +++ b/kubernetes/typed/batch/v1beta1/fake/fake_cronjob.go @@ -46,7 +46,7 @@ var cronjobsKind = v1beta1.SchemeGroupVersion.WithKind("CronJob") func (c *FakeCronJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CronJob, err error) { emptyResult := &v1beta1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewGetAction(cronjobsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(cronjobsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeCronJobs) Get(ctx context.Context, name string, options v1.GetOptio func (c *FakeCronJobs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CronJobList, err error) { emptyResult := &v1beta1.CronJobList{} obj, err := c.Fake. - Invokes(testing.NewListAction(cronjobsResource, cronjobsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(cronjobsResource, cronjobsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeCronJobs) List(ctx context.Context, opts v1.ListOptions) (result *v // Watch returns a watch.Interface that watches the requested cronJobs. func (c *FakeCronJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(cronjobsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(cronjobsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeCronJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.In func (c *FakeCronJobs) Create(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.CreateOptions) (result *v1beta1.CronJob, err error) { emptyResult := &v1beta1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(cronjobsResource, c.ns, cronJob), emptyResult) + Invokes(testing.NewCreateActionWithOptions(cronjobsResource, c.ns, cronJob, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeCronJobs) Create(ctx context.Context, cronJob *v1beta1.CronJob, opt func (c *FakeCronJobs) Update(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (result *v1beta1.CronJob, err error) { emptyResult := &v1beta1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(cronjobsResource, c.ns, cronJob), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(cronjobsResource, c.ns, cronJob, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeCronJobs) Update(ctx context.Context, cronJob *v1beta1.CronJob, opt func (c *FakeCronJobs) UpdateStatus(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (result *v1beta1.CronJob, err error) { emptyResult := &v1beta1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(cronjobsResource, "status", c.ns, cronJob), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(cronjobsResource, "status", c.ns, cronJob, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakeCronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOp // DeleteCollection deletes a collection of objects. func (c *FakeCronJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(cronjobsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(cronjobsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.CronJobList{}) return err @@ -141,7 +141,7 @@ func (c *FakeCronJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptio func (c *FakeCronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CronJob, err error) { emptyResult := &v1beta1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(cronjobsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeCronJobs) Apply(ctx context.Context, cronJob *batchv1beta1.CronJobA } emptyResult := &v1beta1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakeCronJobs) ApplyStatus(ctx context.Context, cronJob *batchv1beta1.Cr } emptyResult := &v1beta1.CronJob{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/certificates/v1/fake/fake_certificatesigningrequest.go b/kubernetes/typed/certificates/v1/fake/fake_certificatesigningrequest.go index a46be0352d..f3fc99f839 100644 --- a/kubernetes/typed/certificates/v1/fake/fake_certificatesigningrequest.go +++ b/kubernetes/typed/certificates/v1/fake/fake_certificatesigningrequest.go @@ -45,7 +45,7 @@ var certificatesigningrequestsKind = v1.SchemeGroupVersion.WithKind("Certificate func (c *FakeCertificateSigningRequests) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CertificateSigningRequest, err error) { emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(certificatesigningrequestsResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(certificatesigningrequestsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeCertificateSigningRequests) Get(ctx context.Context, name string, o func (c *FakeCertificateSigningRequests) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CertificateSigningRequestList, err error) { emptyResult := &v1.CertificateSigningRequestList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(certificatesigningrequestsResource, certificatesigningrequestsKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(certificatesigningrequestsResource, certificatesigningrequestsKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeCertificateSigningRequests) List(ctx context.Context, opts metav1.L // Watch returns a watch.Interface that watches the requested certificateSigningRequests. func (c *FakeCertificateSigningRequests) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(certificatesigningrequestsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(certificatesigningrequestsResource, opts)) } // Create takes the representation of a certificateSigningRequest and creates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. func (c *FakeCertificateSigningRequests) Create(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.CreateOptions) (result *v1.CertificateSigningRequest, err error) { emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(certificatesigningrequestsResource, certificateSigningRequest), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(certificatesigningrequestsResource, certificateSigningRequest, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeCertificateSigningRequests) Create(ctx context.Context, certificate func (c *FakeCertificateSigningRequests) Update(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (result *v1.CertificateSigningRequest, err error) { emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(certificatesigningrequestsResource, certificateSigningRequest), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(certificatesigningrequestsResource, certificateSigningRequest, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -107,7 +107,7 @@ func (c *FakeCertificateSigningRequests) Update(ctx context.Context, certificate func (c *FakeCertificateSigningRequests) UpdateStatus(ctx context.Context, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (result *v1.CertificateSigningRequest, err error) { emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(certificatesigningrequestsResource, "status", certificateSigningRequest), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(certificatesigningrequestsResource, "status", certificateSigningRequest, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -123,7 +123,7 @@ func (c *FakeCertificateSigningRequests) Delete(ctx context.Context, name string // DeleteCollection deletes a collection of objects. func (c *FakeCertificateSigningRequests) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(certificatesigningrequestsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(certificatesigningrequestsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.CertificateSigningRequestList{}) return err @@ -133,7 +133,7 @@ func (c *FakeCertificateSigningRequests) DeleteCollection(ctx context.Context, o func (c *FakeCertificateSigningRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CertificateSigningRequest, err error) { emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(certificatesigningrequestsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -155,7 +155,7 @@ func (c *FakeCertificateSigningRequests) Apply(ctx context.Context, certificateS } emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(certificatesigningrequestsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } @@ -178,7 +178,7 @@ func (c *FakeCertificateSigningRequests) ApplyStatus(ctx context.Context, certif } emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(certificatesigningrequestsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } @@ -189,7 +189,7 @@ func (c *FakeCertificateSigningRequests) ApplyStatus(ctx context.Context, certif func (c *FakeCertificateSigningRequests) UpdateApproval(ctx context.Context, certificateSigningRequestName string, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (result *v1.CertificateSigningRequest, err error) { emptyResult := &v1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(certificatesigningrequestsResource, "approval", certificateSigningRequest), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(certificatesigningrequestsResource, "approval", certificateSigningRequest, opts), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/certificates/v1alpha1/fake/fake_clustertrustbundle.go b/kubernetes/typed/certificates/v1alpha1/fake/fake_clustertrustbundle.go index 39a1e0643d..1c4e97bd40 100644 --- a/kubernetes/typed/certificates/v1alpha1/fake/fake_clustertrustbundle.go +++ b/kubernetes/typed/certificates/v1alpha1/fake/fake_clustertrustbundle.go @@ -45,7 +45,7 @@ var clustertrustbundlesKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterTrust func (c *FakeClusterTrustBundles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterTrustBundle, err error) { emptyResult := &v1alpha1.ClusterTrustBundle{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clustertrustbundlesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(clustertrustbundlesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeClusterTrustBundles) Get(ctx context.Context, name string, options func (c *FakeClusterTrustBundles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterTrustBundleList, err error) { emptyResult := &v1alpha1.ClusterTrustBundleList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(clustertrustbundlesResource, clustertrustbundlesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(clustertrustbundlesResource, clustertrustbundlesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeClusterTrustBundles) List(ctx context.Context, opts v1.ListOptions) // Watch returns a watch.Interface that watches the requested clusterTrustBundles. func (c *FakeClusterTrustBundles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(clustertrustbundlesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(clustertrustbundlesResource, opts)) } // Create takes the representation of a clusterTrustBundle and creates it. Returns the server's representation of the clusterTrustBundle, and an error, if there is any. func (c *FakeClusterTrustBundles) Create(ctx context.Context, clusterTrustBundle *v1alpha1.ClusterTrustBundle, opts v1.CreateOptions) (result *v1alpha1.ClusterTrustBundle, err error) { emptyResult := &v1alpha1.ClusterTrustBundle{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clustertrustbundlesResource, clusterTrustBundle), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(clustertrustbundlesResource, clusterTrustBundle, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeClusterTrustBundles) Create(ctx context.Context, clusterTrustBundle func (c *FakeClusterTrustBundles) Update(ctx context.Context, clusterTrustBundle *v1alpha1.ClusterTrustBundle, opts v1.UpdateOptions) (result *v1alpha1.ClusterTrustBundle, err error) { emptyResult := &v1alpha1.ClusterTrustBundle{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clustertrustbundlesResource, clusterTrustBundle), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(clustertrustbundlesResource, clusterTrustBundle, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeClusterTrustBundles) Delete(ctx context.Context, name string, opts // DeleteCollection deletes a collection of objects. func (c *FakeClusterTrustBundles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clustertrustbundlesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(clustertrustbundlesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.ClusterTrustBundleList{}) return err @@ -121,7 +121,7 @@ func (c *FakeClusterTrustBundles) DeleteCollection(ctx context.Context, opts v1. func (c *FakeClusterTrustBundles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterTrustBundle, err error) { emptyResult := &v1alpha1.ClusterTrustBundle{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clustertrustbundlesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(clustertrustbundlesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeClusterTrustBundles) Apply(ctx context.Context, clusterTrustBundle } emptyResult := &v1alpha1.ClusterTrustBundle{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clustertrustbundlesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(clustertrustbundlesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go b/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go index 7fdbdf8785..ff5a9bd4c7 100644 --- a/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go +++ b/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest.go @@ -45,7 +45,7 @@ var certificatesigningrequestsKind = v1beta1.SchemeGroupVersion.WithKind("Certif func (c *FakeCertificateSigningRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CertificateSigningRequest, err error) { emptyResult := &v1beta1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(certificatesigningrequestsResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(certificatesigningrequestsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeCertificateSigningRequests) Get(ctx context.Context, name string, o func (c *FakeCertificateSigningRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CertificateSigningRequestList, err error) { emptyResult := &v1beta1.CertificateSigningRequestList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(certificatesigningrequestsResource, certificatesigningrequestsKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(certificatesigningrequestsResource, certificatesigningrequestsKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeCertificateSigningRequests) List(ctx context.Context, opts v1.ListO // Watch returns a watch.Interface that watches the requested certificateSigningRequests. func (c *FakeCertificateSigningRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(certificatesigningrequestsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(certificatesigningrequestsResource, opts)) } // Create takes the representation of a certificateSigningRequest and creates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. func (c *FakeCertificateSigningRequests) Create(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.CreateOptions) (result *v1beta1.CertificateSigningRequest, err error) { emptyResult := &v1beta1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(certificatesigningrequestsResource, certificateSigningRequest), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(certificatesigningrequestsResource, certificateSigningRequest, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeCertificateSigningRequests) Create(ctx context.Context, certificate func (c *FakeCertificateSigningRequests) Update(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (result *v1beta1.CertificateSigningRequest, err error) { emptyResult := &v1beta1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(certificatesigningrequestsResource, certificateSigningRequest), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(certificatesigningrequestsResource, certificateSigningRequest, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -107,7 +107,7 @@ func (c *FakeCertificateSigningRequests) Update(ctx context.Context, certificate func (c *FakeCertificateSigningRequests) UpdateStatus(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (result *v1beta1.CertificateSigningRequest, err error) { emptyResult := &v1beta1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(certificatesigningrequestsResource, "status", certificateSigningRequest), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(certificatesigningrequestsResource, "status", certificateSigningRequest, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -123,7 +123,7 @@ func (c *FakeCertificateSigningRequests) Delete(ctx context.Context, name string // DeleteCollection deletes a collection of objects. func (c *FakeCertificateSigningRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(certificatesigningrequestsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(certificatesigningrequestsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.CertificateSigningRequestList{}) return err @@ -133,7 +133,7 @@ func (c *FakeCertificateSigningRequests) DeleteCollection(ctx context.Context, o func (c *FakeCertificateSigningRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CertificateSigningRequest, err error) { emptyResult := &v1beta1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(certificatesigningrequestsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -155,7 +155,7 @@ func (c *FakeCertificateSigningRequests) Apply(ctx context.Context, certificateS } emptyResult := &v1beta1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(certificatesigningrequestsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } @@ -178,7 +178,7 @@ func (c *FakeCertificateSigningRequests) ApplyStatus(ctx context.Context, certif } emptyResult := &v1beta1.CertificateSigningRequest{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(certificatesigningrequestsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/coordination/v1/fake/fake_lease.go b/kubernetes/typed/coordination/v1/fake/fake_lease.go index 1649eba8ff..03f833f370 100644 --- a/kubernetes/typed/coordination/v1/fake/fake_lease.go +++ b/kubernetes/typed/coordination/v1/fake/fake_lease.go @@ -46,7 +46,7 @@ var leasesKind = v1.SchemeGroupVersion.WithKind("Lease") func (c *FakeLeases) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Lease, err error) { emptyResult := &v1.Lease{} obj, err := c.Fake. - Invokes(testing.NewGetAction(leasesResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(leasesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeLeases) Get(ctx context.Context, name string, options metav1.GetOpt func (c *FakeLeases) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LeaseList, err error) { emptyResult := &v1.LeaseList{} obj, err := c.Fake. - Invokes(testing.NewListAction(leasesResource, leasesKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(leasesResource, leasesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeLeases) List(ctx context.Context, opts metav1.ListOptions) (result // Watch returns a watch.Interface that watches the requested leases. func (c *FakeLeases) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(leasesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(leasesResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeLeases) Watch(ctx context.Context, opts metav1.ListOptions) (watch. func (c *FakeLeases) Create(ctx context.Context, lease *v1.Lease, opts metav1.CreateOptions) (result *v1.Lease, err error) { emptyResult := &v1.Lease{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(leasesResource, c.ns, lease), emptyResult) + Invokes(testing.NewCreateActionWithOptions(leasesResource, c.ns, lease, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeLeases) Create(ctx context.Context, lease *v1.Lease, opts metav1.Cr func (c *FakeLeases) Update(ctx context.Context, lease *v1.Lease, opts metav1.UpdateOptions) (result *v1.Lease, err error) { emptyResult := &v1.Lease{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(leasesResource, c.ns, lease), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(leasesResource, c.ns, lease, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeLeases) Delete(ctx context.Context, name string, opts metav1.Delete // DeleteCollection deletes a collection of objects. func (c *FakeLeases) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(leasesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(leasesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.LeaseList{}) return err @@ -128,7 +128,7 @@ func (c *FakeLeases) DeleteCollection(ctx context.Context, opts metav1.DeleteOpt func (c *FakeLeases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Lease, err error) { emptyResult := &v1.Lease{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(leasesResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(leasesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeLeases) Apply(ctx context.Context, lease *coordinationv1.LeaseApply } emptyResult := &v1.Lease{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(leasesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(leasesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/coordination/v1beta1/fake/fake_lease.go b/kubernetes/typed/coordination/v1beta1/fake/fake_lease.go index e15737b067..112784af94 100644 --- a/kubernetes/typed/coordination/v1beta1/fake/fake_lease.go +++ b/kubernetes/typed/coordination/v1beta1/fake/fake_lease.go @@ -46,7 +46,7 @@ var leasesKind = v1beta1.SchemeGroupVersion.WithKind("Lease") func (c *FakeLeases) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Lease, err error) { emptyResult := &v1beta1.Lease{} obj, err := c.Fake. - Invokes(testing.NewGetAction(leasesResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(leasesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeLeases) Get(ctx context.Context, name string, options v1.GetOptions func (c *FakeLeases) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.LeaseList, err error) { emptyResult := &v1beta1.LeaseList{} obj, err := c.Fake. - Invokes(testing.NewListAction(leasesResource, leasesKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(leasesResource, leasesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeLeases) List(ctx context.Context, opts v1.ListOptions) (result *v1b // Watch returns a watch.Interface that watches the requested leases. func (c *FakeLeases) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(leasesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(leasesResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeLeases) Watch(ctx context.Context, opts v1.ListOptions) (watch.Inte func (c *FakeLeases) Create(ctx context.Context, lease *v1beta1.Lease, opts v1.CreateOptions) (result *v1beta1.Lease, err error) { emptyResult := &v1beta1.Lease{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(leasesResource, c.ns, lease), emptyResult) + Invokes(testing.NewCreateActionWithOptions(leasesResource, c.ns, lease, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeLeases) Create(ctx context.Context, lease *v1beta1.Lease, opts v1.C func (c *FakeLeases) Update(ctx context.Context, lease *v1beta1.Lease, opts v1.UpdateOptions) (result *v1beta1.Lease, err error) { emptyResult := &v1beta1.Lease{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(leasesResource, c.ns, lease), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(leasesResource, c.ns, lease, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeLeases) Delete(ctx context.Context, name string, opts v1.DeleteOpti // DeleteCollection deletes a collection of objects. func (c *FakeLeases) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(leasesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(leasesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.LeaseList{}) return err @@ -128,7 +128,7 @@ func (c *FakeLeases) DeleteCollection(ctx context.Context, opts v1.DeleteOptions func (c *FakeLeases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Lease, err error) { emptyResult := &v1beta1.Lease{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(leasesResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(leasesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeLeases) Apply(ctx context.Context, lease *coordinationv1beta1.Lease } emptyResult := &v1beta1.Lease{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(leasesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(leasesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/core/v1/fake/fake_componentstatus.go b/kubernetes/typed/core/v1/fake/fake_componentstatus.go index 2d8cd6c19c..dbd305280b 100644 --- a/kubernetes/typed/core/v1/fake/fake_componentstatus.go +++ b/kubernetes/typed/core/v1/fake/fake_componentstatus.go @@ -45,7 +45,7 @@ var componentstatusesKind = v1.SchemeGroupVersion.WithKind("ComponentStatus") func (c *FakeComponentStatuses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ComponentStatus, err error) { emptyResult := &v1.ComponentStatus{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(componentstatusesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(componentstatusesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeComponentStatuses) Get(ctx context.Context, name string, options me func (c *FakeComponentStatuses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ComponentStatusList, err error) { emptyResult := &v1.ComponentStatusList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(componentstatusesResource, componentstatusesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(componentstatusesResource, componentstatusesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeComponentStatuses) List(ctx context.Context, opts metav1.ListOption // Watch returns a watch.Interface that watches the requested componentStatuses. func (c *FakeComponentStatuses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(componentstatusesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(componentstatusesResource, opts)) } // Create takes the representation of a componentStatus and creates it. Returns the server's representation of the componentStatus, and an error, if there is any. func (c *FakeComponentStatuses) Create(ctx context.Context, componentStatus *v1.ComponentStatus, opts metav1.CreateOptions) (result *v1.ComponentStatus, err error) { emptyResult := &v1.ComponentStatus{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(componentstatusesResource, componentStatus), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(componentstatusesResource, componentStatus, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeComponentStatuses) Create(ctx context.Context, componentStatus *v1. func (c *FakeComponentStatuses) Update(ctx context.Context, componentStatus *v1.ComponentStatus, opts metav1.UpdateOptions) (result *v1.ComponentStatus, err error) { emptyResult := &v1.ComponentStatus{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(componentstatusesResource, componentStatus), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(componentstatusesResource, componentStatus, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeComponentStatuses) Delete(ctx context.Context, name string, opts me // DeleteCollection deletes a collection of objects. func (c *FakeComponentStatuses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(componentstatusesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(componentstatusesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ComponentStatusList{}) return err @@ -121,7 +121,7 @@ func (c *FakeComponentStatuses) DeleteCollection(ctx context.Context, opts metav func (c *FakeComponentStatuses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ComponentStatus, err error) { emptyResult := &v1.ComponentStatus{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(componentstatusesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(componentstatusesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeComponentStatuses) Apply(ctx context.Context, componentStatus *core } emptyResult := &v1.ComponentStatus{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(componentstatusesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(componentstatusesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/core/v1/fake/fake_configmap.go b/kubernetes/typed/core/v1/fake/fake_configmap.go index 37ad42be68..ae760add7f 100644 --- a/kubernetes/typed/core/v1/fake/fake_configmap.go +++ b/kubernetes/typed/core/v1/fake/fake_configmap.go @@ -46,7 +46,7 @@ var configmapsKind = v1.SchemeGroupVersion.WithKind("ConfigMap") func (c *FakeConfigMaps) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ConfigMap, err error) { emptyResult := &v1.ConfigMap{} obj, err := c.Fake. - Invokes(testing.NewGetAction(configmapsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(configmapsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeConfigMaps) Get(ctx context.Context, name string, options metav1.Ge func (c *FakeConfigMaps) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ConfigMapList, err error) { emptyResult := &v1.ConfigMapList{} obj, err := c.Fake. - Invokes(testing.NewListAction(configmapsResource, configmapsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(configmapsResource, configmapsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeConfigMaps) List(ctx context.Context, opts metav1.ListOptions) (res // Watch returns a watch.Interface that watches the requested configMaps. func (c *FakeConfigMaps) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(configmapsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(configmapsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeConfigMaps) Watch(ctx context.Context, opts metav1.ListOptions) (wa func (c *FakeConfigMaps) Create(ctx context.Context, configMap *v1.ConfigMap, opts metav1.CreateOptions) (result *v1.ConfigMap, err error) { emptyResult := &v1.ConfigMap{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(configmapsResource, c.ns, configMap), emptyResult) + Invokes(testing.NewCreateActionWithOptions(configmapsResource, c.ns, configMap, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeConfigMaps) Create(ctx context.Context, configMap *v1.ConfigMap, op func (c *FakeConfigMaps) Update(ctx context.Context, configMap *v1.ConfigMap, opts metav1.UpdateOptions) (result *v1.ConfigMap, err error) { emptyResult := &v1.ConfigMap{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(configmapsResource, c.ns, configMap), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(configmapsResource, c.ns, configMap, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeConfigMaps) Delete(ctx context.Context, name string, opts metav1.De // DeleteCollection deletes a collection of objects. func (c *FakeConfigMaps) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(configmapsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(configmapsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ConfigMapList{}) return err @@ -128,7 +128,7 @@ func (c *FakeConfigMaps) DeleteCollection(ctx context.Context, opts metav1.Delet func (c *FakeConfigMaps) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ConfigMap, err error) { emptyResult := &v1.ConfigMap{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(configmapsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(configmapsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeConfigMaps) Apply(ctx context.Context, configMap *corev1.ConfigMapA } emptyResult := &v1.ConfigMap{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(configmapsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(configmapsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/core/v1/fake/fake_endpoints.go b/kubernetes/typed/core/v1/fake/fake_endpoints.go index aa221b2da8..7e2e91cfa6 100644 --- a/kubernetes/typed/core/v1/fake/fake_endpoints.go +++ b/kubernetes/typed/core/v1/fake/fake_endpoints.go @@ -46,7 +46,7 @@ var endpointsKind = v1.SchemeGroupVersion.WithKind("Endpoints") func (c *FakeEndpoints) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Endpoints, err error) { emptyResult := &v1.Endpoints{} obj, err := c.Fake. - Invokes(testing.NewGetAction(endpointsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(endpointsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeEndpoints) Get(ctx context.Context, name string, options metav1.Get func (c *FakeEndpoints) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointsList, err error) { emptyResult := &v1.EndpointsList{} obj, err := c.Fake. - Invokes(testing.NewListAction(endpointsResource, endpointsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(endpointsResource, endpointsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeEndpoints) List(ctx context.Context, opts metav1.ListOptions) (resu // Watch returns a watch.Interface that watches the requested endpoints. func (c *FakeEndpoints) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(endpointsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(endpointsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeEndpoints) Watch(ctx context.Context, opts metav1.ListOptions) (wat func (c *FakeEndpoints) Create(ctx context.Context, endpoints *v1.Endpoints, opts metav1.CreateOptions) (result *v1.Endpoints, err error) { emptyResult := &v1.Endpoints{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(endpointsResource, c.ns, endpoints), emptyResult) + Invokes(testing.NewCreateActionWithOptions(endpointsResource, c.ns, endpoints, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeEndpoints) Create(ctx context.Context, endpoints *v1.Endpoints, opt func (c *FakeEndpoints) Update(ctx context.Context, endpoints *v1.Endpoints, opts metav1.UpdateOptions) (result *v1.Endpoints, err error) { emptyResult := &v1.Endpoints{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(endpointsResource, c.ns, endpoints), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(endpointsResource, c.ns, endpoints, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeEndpoints) Delete(ctx context.Context, name string, opts metav1.Del // DeleteCollection deletes a collection of objects. func (c *FakeEndpoints) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(endpointsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(endpointsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.EndpointsList{}) return err @@ -128,7 +128,7 @@ func (c *FakeEndpoints) DeleteCollection(ctx context.Context, opts metav1.Delete func (c *FakeEndpoints) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Endpoints, err error) { emptyResult := &v1.Endpoints{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(endpointsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(endpointsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeEndpoints) Apply(ctx context.Context, endpoints *corev1.EndpointsAp } emptyResult := &v1.Endpoints{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(endpointsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(endpointsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/core/v1/fake/fake_event.go b/kubernetes/typed/core/v1/fake/fake_event.go index 9bb0f5fb23..a438ba4737 100644 --- a/kubernetes/typed/core/v1/fake/fake_event.go +++ b/kubernetes/typed/core/v1/fake/fake_event.go @@ -46,7 +46,7 @@ var eventsKind = v1.SchemeGroupVersion.WithKind("Event") func (c *FakeEvents) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Event, err error) { emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewGetAction(eventsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(eventsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeEvents) Get(ctx context.Context, name string, options metav1.GetOpt func (c *FakeEvents) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { emptyResult := &v1.EventList{} obj, err := c.Fake. - Invokes(testing.NewListAction(eventsResource, eventsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(eventsResource, eventsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeEvents) List(ctx context.Context, opts metav1.ListOptions) (result // Watch returns a watch.Interface that watches the requested events. func (c *FakeEvents) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(eventsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(eventsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeEvents) Watch(ctx context.Context, opts metav1.ListOptions) (watch. func (c *FakeEvents) Create(ctx context.Context, event *v1.Event, opts metav1.CreateOptions) (result *v1.Event, err error) { emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(eventsResource, c.ns, event), emptyResult) + Invokes(testing.NewCreateActionWithOptions(eventsResource, c.ns, event, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeEvents) Create(ctx context.Context, event *v1.Event, opts metav1.Cr func (c *FakeEvents) Update(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (result *v1.Event, err error) { emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(eventsResource, c.ns, event), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(eventsResource, c.ns, event, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeEvents) Delete(ctx context.Context, name string, opts metav1.Delete // DeleteCollection deletes a collection of objects. func (c *FakeEvents) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(eventsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(eventsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.EventList{}) return err @@ -128,7 +128,7 @@ func (c *FakeEvents) DeleteCollection(ctx context.Context, opts metav1.DeleteOpt func (c *FakeEvents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Event, err error) { emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(eventsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeEvents) Apply(ctx context.Context, event *corev1.EventApplyConfigur } emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(eventsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/core/v1/fake/fake_limitrange.go b/kubernetes/typed/core/v1/fake/fake_limitrange.go index 03b1ca032d..4cc36131ae 100644 --- a/kubernetes/typed/core/v1/fake/fake_limitrange.go +++ b/kubernetes/typed/core/v1/fake/fake_limitrange.go @@ -46,7 +46,7 @@ var limitrangesKind = v1.SchemeGroupVersion.WithKind("LimitRange") func (c *FakeLimitRanges) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.LimitRange, err error) { emptyResult := &v1.LimitRange{} obj, err := c.Fake. - Invokes(testing.NewGetAction(limitrangesResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(limitrangesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeLimitRanges) Get(ctx context.Context, name string, options metav1.G func (c *FakeLimitRanges) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LimitRangeList, err error) { emptyResult := &v1.LimitRangeList{} obj, err := c.Fake. - Invokes(testing.NewListAction(limitrangesResource, limitrangesKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(limitrangesResource, limitrangesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeLimitRanges) List(ctx context.Context, opts metav1.ListOptions) (re // Watch returns a watch.Interface that watches the requested limitRanges. func (c *FakeLimitRanges) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(limitrangesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(limitrangesResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeLimitRanges) Watch(ctx context.Context, opts metav1.ListOptions) (w func (c *FakeLimitRanges) Create(ctx context.Context, limitRange *v1.LimitRange, opts metav1.CreateOptions) (result *v1.LimitRange, err error) { emptyResult := &v1.LimitRange{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(limitrangesResource, c.ns, limitRange), emptyResult) + Invokes(testing.NewCreateActionWithOptions(limitrangesResource, c.ns, limitRange, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeLimitRanges) Create(ctx context.Context, limitRange *v1.LimitRange, func (c *FakeLimitRanges) Update(ctx context.Context, limitRange *v1.LimitRange, opts metav1.UpdateOptions) (result *v1.LimitRange, err error) { emptyResult := &v1.LimitRange{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(limitrangesResource, c.ns, limitRange), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(limitrangesResource, c.ns, limitRange, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeLimitRanges) Delete(ctx context.Context, name string, opts metav1.D // DeleteCollection deletes a collection of objects. func (c *FakeLimitRanges) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(limitrangesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(limitrangesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.LimitRangeList{}) return err @@ -128,7 +128,7 @@ func (c *FakeLimitRanges) DeleteCollection(ctx context.Context, opts metav1.Dele func (c *FakeLimitRanges) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LimitRange, err error) { emptyResult := &v1.LimitRange{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(limitrangesResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(limitrangesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeLimitRanges) Apply(ctx context.Context, limitRange *corev1.LimitRan } emptyResult := &v1.LimitRange{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(limitrangesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(limitrangesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/core/v1/fake/fake_namespace.go b/kubernetes/typed/core/v1/fake/fake_namespace.go index 7a28220d20..093990571f 100644 --- a/kubernetes/typed/core/v1/fake/fake_namespace.go +++ b/kubernetes/typed/core/v1/fake/fake_namespace.go @@ -45,7 +45,7 @@ var namespacesKind = v1.SchemeGroupVersion.WithKind("Namespace") func (c *FakeNamespaces) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Namespace, err error) { emptyResult := &v1.Namespace{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(namespacesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(namespacesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeNamespaces) Get(ctx context.Context, name string, options metav1.Ge func (c *FakeNamespaces) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NamespaceList, err error) { emptyResult := &v1.NamespaceList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(namespacesResource, namespacesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(namespacesResource, namespacesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeNamespaces) List(ctx context.Context, opts metav1.ListOptions) (res // Watch returns a watch.Interface that watches the requested namespaces. func (c *FakeNamespaces) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(namespacesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(namespacesResource, opts)) } // Create takes the representation of a namespace and creates it. Returns the server's representation of the namespace, and an error, if there is any. func (c *FakeNamespaces) Create(ctx context.Context, namespace *v1.Namespace, opts metav1.CreateOptions) (result *v1.Namespace, err error) { emptyResult := &v1.Namespace{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(namespacesResource, namespace), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(namespacesResource, namespace, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeNamespaces) Create(ctx context.Context, namespace *v1.Namespace, op func (c *FakeNamespaces) Update(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (result *v1.Namespace, err error) { emptyResult := &v1.Namespace{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(namespacesResource, namespace), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(namespacesResource, namespace, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -107,7 +107,7 @@ func (c *FakeNamespaces) Update(ctx context.Context, namespace *v1.Namespace, op func (c *FakeNamespaces) UpdateStatus(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (result *v1.Namespace, err error) { emptyResult := &v1.Namespace{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(namespacesResource, "status", namespace), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(namespacesResource, "status", namespace, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -125,7 +125,7 @@ func (c *FakeNamespaces) Delete(ctx context.Context, name string, opts metav1.De func (c *FakeNamespaces) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Namespace, err error) { emptyResult := &v1.Namespace{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(namespacesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(namespacesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -147,7 +147,7 @@ func (c *FakeNamespaces) Apply(ctx context.Context, namespace *corev1.NamespaceA } emptyResult := &v1.Namespace{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(namespacesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(namespacesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } @@ -170,7 +170,7 @@ func (c *FakeNamespaces) ApplyStatus(ctx context.Context, namespace *corev1.Name } emptyResult := &v1.Namespace{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(namespacesResource, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(namespacesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/core/v1/fake/fake_node.go b/kubernetes/typed/core/v1/fake/fake_node.go index 538f0ab0c5..451f992da1 100644 --- a/kubernetes/typed/core/v1/fake/fake_node.go +++ b/kubernetes/typed/core/v1/fake/fake_node.go @@ -45,7 +45,7 @@ var nodesKind = v1.SchemeGroupVersion.WithKind("Node") func (c *FakeNodes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Node, err error) { emptyResult := &v1.Node{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(nodesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(nodesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeNodes) Get(ctx context.Context, name string, options metav1.GetOpti func (c *FakeNodes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NodeList, err error) { emptyResult := &v1.NodeList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(nodesResource, nodesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(nodesResource, nodesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeNodes) List(ctx context.Context, opts metav1.ListOptions) (result * // Watch returns a watch.Interface that watches the requested nodes. func (c *FakeNodes) Watch(ctx context.Context, opts metav1.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 *v1.Node, opts metav1.CreateOptions) (result *v1.Node, err error) { emptyResult := &v1.Node{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(nodesResource, node), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(nodesResource, node, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeNodes) Create(ctx context.Context, node *v1.Node, opts metav1.Creat func (c *FakeNodes) Update(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (result *v1.Node, err error) { emptyResult := &v1.Node{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(nodesResource, node), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(nodesResource, node, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -107,7 +107,7 @@ func (c *FakeNodes) Update(ctx context.Context, node *v1.Node, opts metav1.Updat func (c *FakeNodes) UpdateStatus(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (result *v1.Node, err error) { emptyResult := &v1.Node{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(nodesResource, "status", node), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(nodesResource, "status", node, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -123,7 +123,7 @@ func (c *FakeNodes) Delete(ctx context.Context, name string, opts metav1.DeleteO // DeleteCollection deletes a collection of objects. func (c *FakeNodes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(nodesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(nodesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.NodeList{}) return err @@ -133,7 +133,7 @@ func (c *FakeNodes) DeleteCollection(ctx context.Context, opts metav1.DeleteOpti func (c *FakeNodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Node, err error) { emptyResult := &v1.Node{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(nodesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(nodesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -155,7 +155,7 @@ func (c *FakeNodes) Apply(ctx context.Context, node *corev1.NodeApplyConfigurati } emptyResult := &v1.Node{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(nodesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(nodesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } @@ -178,7 +178,7 @@ func (c *FakeNodes) ApplyStatus(ctx context.Context, node *corev1.NodeApplyConfi } emptyResult := &v1.Node{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(nodesResource, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(nodesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/core/v1/fake/fake_persistentvolume.go b/kubernetes/typed/core/v1/fake/fake_persistentvolume.go index 2d5b0714cf..16a1f2201a 100644 --- a/kubernetes/typed/core/v1/fake/fake_persistentvolume.go +++ b/kubernetes/typed/core/v1/fake/fake_persistentvolume.go @@ -45,7 +45,7 @@ var persistentvolumesKind = v1.SchemeGroupVersion.WithKind("PersistentVolume") func (c *FakePersistentVolumes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PersistentVolume, err error) { emptyResult := &v1.PersistentVolume{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(persistentvolumesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(persistentvolumesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakePersistentVolumes) Get(ctx context.Context, name string, options me func (c *FakePersistentVolumes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeList, err error) { emptyResult := &v1.PersistentVolumeList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(persistentvolumesResource, persistentvolumesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(persistentvolumesResource, persistentvolumesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakePersistentVolumes) List(ctx context.Context, opts metav1.ListOption // Watch returns a watch.Interface that watches the requested persistentVolumes. func (c *FakePersistentVolumes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(persistentvolumesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(persistentvolumesResource, opts)) } // Create takes the representation of a persistentVolume and creates it. Returns the server's representation of the persistentVolume, and an error, if there is any. func (c *FakePersistentVolumes) Create(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.CreateOptions) (result *v1.PersistentVolume, err error) { emptyResult := &v1.PersistentVolume{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(persistentvolumesResource, persistentVolume), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(persistentvolumesResource, persistentVolume, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakePersistentVolumes) Create(ctx context.Context, persistentVolume *v1 func (c *FakePersistentVolumes) Update(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.UpdateOptions) (result *v1.PersistentVolume, err error) { emptyResult := &v1.PersistentVolume{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(persistentvolumesResource, persistentVolume), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(persistentvolumesResource, persistentVolume, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -107,7 +107,7 @@ func (c *FakePersistentVolumes) Update(ctx context.Context, persistentVolume *v1 func (c *FakePersistentVolumes) UpdateStatus(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.UpdateOptions) (result *v1.PersistentVolume, err error) { emptyResult := &v1.PersistentVolume{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(persistentvolumesResource, "status", persistentVolume), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(persistentvolumesResource, "status", persistentVolume, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -123,7 +123,7 @@ func (c *FakePersistentVolumes) Delete(ctx context.Context, name string, opts me // DeleteCollection deletes a collection of objects. func (c *FakePersistentVolumes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(persistentvolumesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(persistentvolumesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.PersistentVolumeList{}) return err @@ -133,7 +133,7 @@ func (c *FakePersistentVolumes) DeleteCollection(ctx context.Context, opts metav func (c *FakePersistentVolumes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PersistentVolume, err error) { emptyResult := &v1.PersistentVolume{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(persistentvolumesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(persistentvolumesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -155,7 +155,7 @@ func (c *FakePersistentVolumes) Apply(ctx context.Context, persistentVolume *cor } emptyResult := &v1.PersistentVolume{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(persistentvolumesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(persistentvolumesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } @@ -178,7 +178,7 @@ func (c *FakePersistentVolumes) ApplyStatus(ctx context.Context, persistentVolum } emptyResult := &v1.PersistentVolume{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(persistentvolumesResource, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(persistentvolumesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go b/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go index 67295ce42d..12617c2432 100644 --- a/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go +++ b/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go @@ -46,7 +46,7 @@ var persistentvolumeclaimsKind = v1.SchemeGroupVersion.WithKind("PersistentVolum func (c *FakePersistentVolumeClaims) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PersistentVolumeClaim, err error) { emptyResult := &v1.PersistentVolumeClaim{} obj, err := c.Fake. - Invokes(testing.NewGetAction(persistentvolumeclaimsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(persistentvolumeclaimsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakePersistentVolumeClaims) Get(ctx context.Context, name string, optio func (c *FakePersistentVolumeClaims) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeClaimList, err error) { emptyResult := &v1.PersistentVolumeClaimList{} obj, err := c.Fake. - Invokes(testing.NewListAction(persistentvolumeclaimsResource, persistentvolumeclaimsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(persistentvolumeclaimsResource, persistentvolumeclaimsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakePersistentVolumeClaims) List(ctx context.Context, opts metav1.ListO // Watch returns a watch.Interface that watches the requested persistentVolumeClaims. func (c *FakePersistentVolumeClaims) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(persistentvolumeclaimsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(persistentvolumeclaimsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakePersistentVolumeClaims) Watch(ctx context.Context, opts metav1.List func (c *FakePersistentVolumeClaims) Create(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.CreateOptions) (result *v1.PersistentVolumeClaim, err error) { emptyResult := &v1.PersistentVolumeClaim{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(persistentvolumeclaimsResource, c.ns, persistentVolumeClaim), emptyResult) + Invokes(testing.NewCreateActionWithOptions(persistentvolumeclaimsResource, c.ns, persistentVolumeClaim, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakePersistentVolumeClaims) Create(ctx context.Context, persistentVolum func (c *FakePersistentVolumeClaims) Update(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.UpdateOptions) (result *v1.PersistentVolumeClaim, err error) { emptyResult := &v1.PersistentVolumeClaim{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(persistentvolumeclaimsResource, c.ns, persistentVolumeClaim), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(persistentvolumeclaimsResource, c.ns, persistentVolumeClaim, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakePersistentVolumeClaims) Update(ctx context.Context, persistentVolum func (c *FakePersistentVolumeClaims) UpdateStatus(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.UpdateOptions) (result *v1.PersistentVolumeClaim, err error) { emptyResult := &v1.PersistentVolumeClaim{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(persistentvolumeclaimsResource, "status", c.ns, persistentVolumeClaim), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(persistentvolumeclaimsResource, "status", c.ns, persistentVolumeClaim, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakePersistentVolumeClaims) Delete(ctx context.Context, name string, op // DeleteCollection deletes a collection of objects. func (c *FakePersistentVolumeClaims) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(persistentvolumeclaimsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(persistentvolumeclaimsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.PersistentVolumeClaimList{}) return err @@ -141,7 +141,7 @@ func (c *FakePersistentVolumeClaims) DeleteCollection(ctx context.Context, opts func (c *FakePersistentVolumeClaims) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PersistentVolumeClaim, err error) { emptyResult := &v1.PersistentVolumeClaim{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(persistentvolumeclaimsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(persistentvolumeclaimsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakePersistentVolumeClaims) Apply(ctx context.Context, persistentVolume } emptyResult := &v1.PersistentVolumeClaim{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(persistentvolumeclaimsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(persistentvolumeclaimsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakePersistentVolumeClaims) ApplyStatus(ctx context.Context, persistent } emptyResult := &v1.PersistentVolumeClaim{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(persistentvolumeclaimsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(persistentvolumeclaimsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/core/v1/fake/fake_pod.go b/kubernetes/typed/core/v1/fake/fake_pod.go index 839f985a73..d2b46e8e3a 100644 --- a/kubernetes/typed/core/v1/fake/fake_pod.go +++ b/kubernetes/typed/core/v1/fake/fake_pod.go @@ -46,7 +46,7 @@ var podsKind = v1.SchemeGroupVersion.WithKind("Pod") func (c *FakePods) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Pod, err error) { emptyResult := &v1.Pod{} obj, err := c.Fake. - Invokes(testing.NewGetAction(podsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(podsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakePods) Get(ctx context.Context, name string, options metav1.GetOptio func (c *FakePods) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodList, err error) { emptyResult := &v1.PodList{} obj, err := c.Fake. - Invokes(testing.NewListAction(podsResource, podsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(podsResource, podsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakePods) List(ctx context.Context, opts metav1.ListOptions) (result *v // Watch returns a watch.Interface that watches the requested pods. func (c *FakePods) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(podsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(podsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakePods) Watch(ctx context.Context, opts metav1.ListOptions) (watch.In func (c *FakePods) Create(ctx context.Context, pod *v1.Pod, opts metav1.CreateOptions) (result *v1.Pod, err error) { emptyResult := &v1.Pod{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(podsResource, c.ns, pod), emptyResult) + Invokes(testing.NewCreateActionWithOptions(podsResource, c.ns, pod, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakePods) Create(ctx context.Context, pod *v1.Pod, opts metav1.CreateOp func (c *FakePods) Update(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) { emptyResult := &v1.Pod{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(podsResource, c.ns, pod), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(podsResource, c.ns, pod, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakePods) Update(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOp func (c *FakePods) UpdateStatus(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) { emptyResult := &v1.Pod{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(podsResource, "status", c.ns, pod), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(podsResource, "status", c.ns, pod, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakePods) Delete(ctx context.Context, name string, opts metav1.DeleteOp // DeleteCollection deletes a collection of objects. func (c *FakePods) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(podsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(podsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.PodList{}) return err @@ -141,7 +141,7 @@ func (c *FakePods) DeleteCollection(ctx context.Context, opts metav1.DeleteOptio func (c *FakePods) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Pod, err error) { emptyResult := &v1.Pod{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(podsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(podsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakePods) Apply(ctx context.Context, pod *corev1.PodApplyConfiguration, } emptyResult := &v1.Pod{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(podsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(podsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakePods) ApplyStatus(ctx context.Context, pod *corev1.PodApplyConfigur } emptyResult := &v1.Pod{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(podsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(podsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err @@ -200,7 +200,7 @@ func (c *FakePods) ApplyStatus(ctx context.Context, pod *corev1.PodApplyConfigur func (c *FakePods) UpdateEphemeralContainers(ctx context.Context, podName string, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) { emptyResult := &v1.Pod{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(podsResource, "ephemeralcontainers", c.ns, pod), &v1.Pod{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(podsResource, "ephemeralcontainers", c.ns, pod, opts), &v1.Pod{}) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/core/v1/fake/fake_podtemplate.go b/kubernetes/typed/core/v1/fake/fake_podtemplate.go index 7f00b22f5d..dc9affdd06 100644 --- a/kubernetes/typed/core/v1/fake/fake_podtemplate.go +++ b/kubernetes/typed/core/v1/fake/fake_podtemplate.go @@ -46,7 +46,7 @@ var podtemplatesKind = v1.SchemeGroupVersion.WithKind("PodTemplate") func (c *FakePodTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PodTemplate, err error) { emptyResult := &v1.PodTemplate{} obj, err := c.Fake. - Invokes(testing.NewGetAction(podtemplatesResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(podtemplatesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakePodTemplates) Get(ctx context.Context, name string, options metav1. func (c *FakePodTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodTemplateList, err error) { emptyResult := &v1.PodTemplateList{} obj, err := c.Fake. - Invokes(testing.NewListAction(podtemplatesResource, podtemplatesKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(podtemplatesResource, podtemplatesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakePodTemplates) List(ctx context.Context, opts metav1.ListOptions) (r // Watch returns a watch.Interface that watches the requested podTemplates. func (c *FakePodTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(podtemplatesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(podtemplatesResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakePodTemplates) Watch(ctx context.Context, opts metav1.ListOptions) ( func (c *FakePodTemplates) Create(ctx context.Context, podTemplate *v1.PodTemplate, opts metav1.CreateOptions) (result *v1.PodTemplate, err error) { emptyResult := &v1.PodTemplate{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(podtemplatesResource, c.ns, podTemplate), emptyResult) + Invokes(testing.NewCreateActionWithOptions(podtemplatesResource, c.ns, podTemplate, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakePodTemplates) Create(ctx context.Context, podTemplate *v1.PodTempla func (c *FakePodTemplates) Update(ctx context.Context, podTemplate *v1.PodTemplate, opts metav1.UpdateOptions) (result *v1.PodTemplate, err error) { emptyResult := &v1.PodTemplate{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(podtemplatesResource, c.ns, podTemplate), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(podtemplatesResource, c.ns, podTemplate, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakePodTemplates) Delete(ctx context.Context, name string, opts metav1. // DeleteCollection deletes a collection of objects. func (c *FakePodTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(podtemplatesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(podtemplatesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.PodTemplateList{}) return err @@ -128,7 +128,7 @@ func (c *FakePodTemplates) DeleteCollection(ctx context.Context, opts metav1.Del func (c *FakePodTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodTemplate, err error) { emptyResult := &v1.PodTemplate{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(podtemplatesResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(podtemplatesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakePodTemplates) Apply(ctx context.Context, podTemplate *corev1.PodTem } emptyResult := &v1.PodTemplate{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(podtemplatesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(podtemplatesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go b/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go index 25d10d17bd..6b3497f089 100644 --- a/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go +++ b/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go @@ -47,7 +47,7 @@ var replicationcontrollersKind = v1.SchemeGroupVersion.WithKind("ReplicationCont func (c *FakeReplicationControllers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ReplicationController, err error) { emptyResult := &v1.ReplicationController{} obj, err := c.Fake. - Invokes(testing.NewGetAction(replicationcontrollersResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(replicationcontrollersResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -59,7 +59,7 @@ func (c *FakeReplicationControllers) Get(ctx context.Context, name string, optio func (c *FakeReplicationControllers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicationControllerList, err error) { emptyResult := &v1.ReplicationControllerList{} obj, err := c.Fake. - Invokes(testing.NewListAction(replicationcontrollersResource, replicationcontrollersKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(replicationcontrollersResource, replicationcontrollersKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -81,7 +81,7 @@ func (c *FakeReplicationControllers) List(ctx context.Context, opts metav1.ListO // Watch returns a watch.Interface that watches the requested replicationControllers. func (c *FakeReplicationControllers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(replicationcontrollersResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(replicationcontrollersResource, c.ns, opts)) } @@ -89,7 +89,7 @@ func (c *FakeReplicationControllers) Watch(ctx context.Context, opts metav1.List func (c *FakeReplicationControllers) Create(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.CreateOptions) (result *v1.ReplicationController, err error) { emptyResult := &v1.ReplicationController{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(replicationcontrollersResource, c.ns, replicationController), emptyResult) + Invokes(testing.NewCreateActionWithOptions(replicationcontrollersResource, c.ns, replicationController, opts), emptyResult) if obj == nil { return emptyResult, err @@ -101,7 +101,7 @@ func (c *FakeReplicationControllers) Create(ctx context.Context, replicationCont func (c *FakeReplicationControllers) Update(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.UpdateOptions) (result *v1.ReplicationController, err error) { emptyResult := &v1.ReplicationController{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(replicationcontrollersResource, c.ns, replicationController), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(replicationcontrollersResource, c.ns, replicationController, opts), emptyResult) if obj == nil { return emptyResult, err @@ -114,7 +114,7 @@ func (c *FakeReplicationControllers) Update(ctx context.Context, replicationCont func (c *FakeReplicationControllers) UpdateStatus(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.UpdateOptions) (result *v1.ReplicationController, err error) { emptyResult := &v1.ReplicationController{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(replicationcontrollersResource, "status", c.ns, replicationController), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(replicationcontrollersResource, "status", c.ns, replicationController, opts), emptyResult) if obj == nil { return emptyResult, err @@ -132,7 +132,7 @@ func (c *FakeReplicationControllers) Delete(ctx context.Context, name string, op // DeleteCollection deletes a collection of objects. func (c *FakeReplicationControllers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(replicationcontrollersResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(replicationcontrollersResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ReplicationControllerList{}) return err @@ -142,7 +142,7 @@ func (c *FakeReplicationControllers) DeleteCollection(ctx context.Context, opts func (c *FakeReplicationControllers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ReplicationController, err error) { emptyResult := &v1.ReplicationController{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicationcontrollersResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(replicationcontrollersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -165,7 +165,7 @@ func (c *FakeReplicationControllers) Apply(ctx context.Context, replicationContr } emptyResult := &v1.ReplicationController{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicationcontrollersResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(replicationcontrollersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -189,7 +189,7 @@ func (c *FakeReplicationControllers) ApplyStatus(ctx context.Context, replicatio } emptyResult := &v1.ReplicationController{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicationcontrollersResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(replicationcontrollersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err @@ -201,7 +201,7 @@ func (c *FakeReplicationControllers) ApplyStatus(ctx context.Context, replicatio func (c *FakeReplicationControllers) GetScale(ctx context.Context, replicationControllerName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewGetSubresourceAction(replicationcontrollersResource, c.ns, "scale", replicationControllerName), emptyResult) + Invokes(testing.NewGetSubresourceActionWithOptions(replicationcontrollersResource, c.ns, "scale", replicationControllerName, options), emptyResult) if obj == nil { return emptyResult, err @@ -213,7 +213,7 @@ func (c *FakeReplicationControllers) GetScale(ctx context.Context, replicationCo func (c *FakeReplicationControllers) UpdateScale(ctx context.Context, replicationControllerName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(replicationcontrollersResource, "scale", c.ns, scale), &autoscalingv1.Scale{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(replicationcontrollersResource, "scale", c.ns, scale, opts), &autoscalingv1.Scale{}) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/core/v1/fake/fake_resourcequota.go b/kubernetes/typed/core/v1/fake/fake_resourcequota.go index 298b155f9c..5e2e02afc1 100644 --- a/kubernetes/typed/core/v1/fake/fake_resourcequota.go +++ b/kubernetes/typed/core/v1/fake/fake_resourcequota.go @@ -46,7 +46,7 @@ var resourcequotasKind = v1.SchemeGroupVersion.WithKind("ResourceQuota") func (c *FakeResourceQuotas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ResourceQuota, err error) { emptyResult := &v1.ResourceQuota{} obj, err := c.Fake. - Invokes(testing.NewGetAction(resourcequotasResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(resourcequotasResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeResourceQuotas) Get(ctx context.Context, name string, options metav func (c *FakeResourceQuotas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ResourceQuotaList, err error) { emptyResult := &v1.ResourceQuotaList{} obj, err := c.Fake. - Invokes(testing.NewListAction(resourcequotasResource, resourcequotasKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(resourcequotasResource, resourcequotasKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeResourceQuotas) List(ctx context.Context, opts metav1.ListOptions) // Watch returns a watch.Interface that watches the requested resourceQuotas. func (c *FakeResourceQuotas) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(resourcequotasResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(resourcequotasResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeResourceQuotas) Watch(ctx context.Context, opts metav1.ListOptions) func (c *FakeResourceQuotas) Create(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.CreateOptions) (result *v1.ResourceQuota, err error) { emptyResult := &v1.ResourceQuota{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(resourcequotasResource, c.ns, resourceQuota), emptyResult) + Invokes(testing.NewCreateActionWithOptions(resourcequotasResource, c.ns, resourceQuota, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeResourceQuotas) Create(ctx context.Context, resourceQuota *v1.Resou func (c *FakeResourceQuotas) Update(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.UpdateOptions) (result *v1.ResourceQuota, err error) { emptyResult := &v1.ResourceQuota{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(resourcequotasResource, c.ns, resourceQuota), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(resourcequotasResource, c.ns, resourceQuota, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeResourceQuotas) Update(ctx context.Context, resourceQuota *v1.Resou func (c *FakeResourceQuotas) UpdateStatus(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.UpdateOptions) (result *v1.ResourceQuota, err error) { emptyResult := &v1.ResourceQuota{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(resourcequotasResource, "status", c.ns, resourceQuota), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(resourcequotasResource, "status", c.ns, resourceQuota, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakeResourceQuotas) Delete(ctx context.Context, name string, opts metav // DeleteCollection deletes a collection of objects. func (c *FakeResourceQuotas) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(resourcequotasResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(resourcequotasResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ResourceQuotaList{}) return err @@ -141,7 +141,7 @@ func (c *FakeResourceQuotas) DeleteCollection(ctx context.Context, opts metav1.D func (c *FakeResourceQuotas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ResourceQuota, err error) { emptyResult := &v1.ResourceQuota{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourcequotasResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(resourcequotasResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeResourceQuotas) Apply(ctx context.Context, resourceQuota *corev1.Re } emptyResult := &v1.ResourceQuota{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourcequotasResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(resourcequotasResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakeResourceQuotas) ApplyStatus(ctx context.Context, resourceQuota *cor } emptyResult := &v1.ResourceQuota{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourcequotasResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(resourcequotasResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/core/v1/fake/fake_secret.go b/kubernetes/typed/core/v1/fake/fake_secret.go index e5dbb6bf18..ec0fc65b5b 100644 --- a/kubernetes/typed/core/v1/fake/fake_secret.go +++ b/kubernetes/typed/core/v1/fake/fake_secret.go @@ -46,7 +46,7 @@ var secretsKind = v1.SchemeGroupVersion.WithKind("Secret") func (c *FakeSecrets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Secret, err error) { emptyResult := &v1.Secret{} obj, err := c.Fake. - Invokes(testing.NewGetAction(secretsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(secretsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeSecrets) Get(ctx context.Context, name string, options metav1.GetOp func (c *FakeSecrets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SecretList, err error) { emptyResult := &v1.SecretList{} obj, err := c.Fake. - Invokes(testing.NewListAction(secretsResource, secretsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(secretsResource, secretsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeSecrets) List(ctx context.Context, opts metav1.ListOptions) (result // Watch returns a watch.Interface that watches the requested secrets. func (c *FakeSecrets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(secretsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(secretsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeSecrets) Watch(ctx context.Context, opts metav1.ListOptions) (watch func (c *FakeSecrets) Create(ctx context.Context, secret *v1.Secret, opts metav1.CreateOptions) (result *v1.Secret, err error) { emptyResult := &v1.Secret{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(secretsResource, c.ns, secret), emptyResult) + Invokes(testing.NewCreateActionWithOptions(secretsResource, c.ns, secret, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeSecrets) Create(ctx context.Context, secret *v1.Secret, opts metav1 func (c *FakeSecrets) Update(ctx context.Context, secret *v1.Secret, opts metav1.UpdateOptions) (result *v1.Secret, err error) { emptyResult := &v1.Secret{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(secretsResource, c.ns, secret), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(secretsResource, c.ns, secret, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeSecrets) Delete(ctx context.Context, name string, opts metav1.Delet // DeleteCollection deletes a collection of objects. func (c *FakeSecrets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(secretsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(secretsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.SecretList{}) return err @@ -128,7 +128,7 @@ func (c *FakeSecrets) DeleteCollection(ctx context.Context, opts metav1.DeleteOp func (c *FakeSecrets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Secret, err error) { emptyResult := &v1.Secret{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(secretsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(secretsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeSecrets) Apply(ctx context.Context, secret *corev1.SecretApplyConfi } emptyResult := &v1.Secret{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(secretsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(secretsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/core/v1/fake/fake_service.go b/kubernetes/typed/core/v1/fake/fake_service.go index 064abc18fd..2a3cf45fbc 100644 --- a/kubernetes/typed/core/v1/fake/fake_service.go +++ b/kubernetes/typed/core/v1/fake/fake_service.go @@ -46,7 +46,7 @@ var servicesKind = v1.SchemeGroupVersion.WithKind("Service") func (c *FakeServices) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Service, err error) { emptyResult := &v1.Service{} obj, err := c.Fake. - Invokes(testing.NewGetAction(servicesResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(servicesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeServices) Get(ctx context.Context, name string, options metav1.GetO func (c *FakeServices) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceList, err error) { emptyResult := &v1.ServiceList{} obj, err := c.Fake. - Invokes(testing.NewListAction(servicesResource, servicesKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(servicesResource, servicesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeServices) List(ctx context.Context, opts metav1.ListOptions) (resul // Watch returns a watch.Interface that watches the requested services. func (c *FakeServices) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(servicesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(servicesResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeServices) Watch(ctx context.Context, opts metav1.ListOptions) (watc func (c *FakeServices) Create(ctx context.Context, service *v1.Service, opts metav1.CreateOptions) (result *v1.Service, err error) { emptyResult := &v1.Service{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(servicesResource, c.ns, service), emptyResult) + Invokes(testing.NewCreateActionWithOptions(servicesResource, c.ns, service, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeServices) Create(ctx context.Context, service *v1.Service, opts met func (c *FakeServices) Update(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (result *v1.Service, err error) { emptyResult := &v1.Service{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(servicesResource, c.ns, service), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(servicesResource, c.ns, service, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeServices) Update(ctx context.Context, service *v1.Service, opts met func (c *FakeServices) UpdateStatus(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (result *v1.Service, err error) { emptyResult := &v1.Service{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(servicesResource, "status", c.ns, service), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(servicesResource, "status", c.ns, service, opts), emptyResult) if obj == nil { return emptyResult, err @@ -133,7 +133,7 @@ func (c *FakeServices) Delete(ctx context.Context, name string, opts metav1.Dele func (c *FakeServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Service, err error) { emptyResult := &v1.Service{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(servicesResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(servicesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -156,7 +156,7 @@ func (c *FakeServices) Apply(ctx context.Context, service *corev1.ServiceApplyCo } emptyResult := &v1.Service{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(servicesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(servicesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -180,7 +180,7 @@ func (c *FakeServices) ApplyStatus(ctx context.Context, service *corev1.ServiceA } emptyResult := &v1.Service{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(servicesResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(servicesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/core/v1/fake/fake_serviceaccount.go b/kubernetes/typed/core/v1/fake/fake_serviceaccount.go index 1ff5bbcbaa..f3ad8d40f9 100644 --- a/kubernetes/typed/core/v1/fake/fake_serviceaccount.go +++ b/kubernetes/typed/core/v1/fake/fake_serviceaccount.go @@ -47,7 +47,7 @@ var serviceaccountsKind = v1.SchemeGroupVersion.WithKind("ServiceAccount") func (c *FakeServiceAccounts) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceAccount, err error) { emptyResult := &v1.ServiceAccount{} obj, err := c.Fake. - Invokes(testing.NewGetAction(serviceaccountsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(serviceaccountsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -59,7 +59,7 @@ func (c *FakeServiceAccounts) Get(ctx context.Context, name string, options meta func (c *FakeServiceAccounts) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceAccountList, err error) { emptyResult := &v1.ServiceAccountList{} obj, err := c.Fake. - Invokes(testing.NewListAction(serviceaccountsResource, serviceaccountsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(serviceaccountsResource, serviceaccountsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -81,7 +81,7 @@ func (c *FakeServiceAccounts) List(ctx context.Context, opts metav1.ListOptions) // Watch returns a watch.Interface that watches the requested serviceAccounts. func (c *FakeServiceAccounts) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(serviceaccountsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(serviceaccountsResource, c.ns, opts)) } @@ -89,7 +89,7 @@ func (c *FakeServiceAccounts) Watch(ctx context.Context, opts metav1.ListOptions func (c *FakeServiceAccounts) Create(ctx context.Context, serviceAccount *v1.ServiceAccount, opts metav1.CreateOptions) (result *v1.ServiceAccount, err error) { emptyResult := &v1.ServiceAccount{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(serviceaccountsResource, c.ns, serviceAccount), emptyResult) + Invokes(testing.NewCreateActionWithOptions(serviceaccountsResource, c.ns, serviceAccount, opts), emptyResult) if obj == nil { return emptyResult, err @@ -101,7 +101,7 @@ func (c *FakeServiceAccounts) Create(ctx context.Context, serviceAccount *v1.Ser func (c *FakeServiceAccounts) Update(ctx context.Context, serviceAccount *v1.ServiceAccount, opts metav1.UpdateOptions) (result *v1.ServiceAccount, err error) { emptyResult := &v1.ServiceAccount{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(serviceaccountsResource, c.ns, serviceAccount), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(serviceaccountsResource, c.ns, serviceAccount, opts), emptyResult) if obj == nil { return emptyResult, err @@ -119,7 +119,7 @@ func (c *FakeServiceAccounts) Delete(ctx context.Context, name string, opts meta // DeleteCollection deletes a collection of objects. func (c *FakeServiceAccounts) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(serviceaccountsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(serviceaccountsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ServiceAccountList{}) return err @@ -129,7 +129,7 @@ func (c *FakeServiceAccounts) DeleteCollection(ctx context.Context, opts metav1. func (c *FakeServiceAccounts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceAccount, err error) { emptyResult := &v1.ServiceAccount{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(serviceaccountsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(serviceaccountsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -152,7 +152,7 @@ func (c *FakeServiceAccounts) Apply(ctx context.Context, serviceAccount *corev1. } emptyResult := &v1.ServiceAccount{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(serviceaccountsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(serviceaccountsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeServiceAccounts) Apply(ctx context.Context, serviceAccount *corev1. func (c *FakeServiceAccounts) CreateToken(ctx context.Context, serviceAccountName string, tokenRequest *authenticationv1.TokenRequest, opts metav1.CreateOptions) (result *authenticationv1.TokenRequest, err error) { emptyResult := &authenticationv1.TokenRequest{} obj, err := c.Fake. - Invokes(testing.NewCreateSubresourceAction(serviceaccountsResource, serviceAccountName, "token", c.ns, tokenRequest), emptyResult) + Invokes(testing.NewCreateSubresourceActionWithOptions(serviceaccountsResource, serviceAccountName, "token", c.ns, tokenRequest, opts), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/discovery/v1/fake/fake_endpointslice.go b/kubernetes/typed/discovery/v1/fake/fake_endpointslice.go index 843e966062..6bbbde82ec 100644 --- a/kubernetes/typed/discovery/v1/fake/fake_endpointslice.go +++ b/kubernetes/typed/discovery/v1/fake/fake_endpointslice.go @@ -46,7 +46,7 @@ var endpointslicesKind = v1.SchemeGroupVersion.WithKind("EndpointSlice") func (c *FakeEndpointSlices) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.EndpointSlice, err error) { emptyResult := &v1.EndpointSlice{} obj, err := c.Fake. - Invokes(testing.NewGetAction(endpointslicesResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(endpointslicesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeEndpointSlices) Get(ctx context.Context, name string, options metav func (c *FakeEndpointSlices) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointSliceList, err error) { emptyResult := &v1.EndpointSliceList{} obj, err := c.Fake. - Invokes(testing.NewListAction(endpointslicesResource, endpointslicesKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(endpointslicesResource, endpointslicesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeEndpointSlices) List(ctx context.Context, opts metav1.ListOptions) // Watch returns a watch.Interface that watches the requested endpointSlices. func (c *FakeEndpointSlices) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(endpointslicesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(endpointslicesResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeEndpointSlices) Watch(ctx context.Context, opts metav1.ListOptions) func (c *FakeEndpointSlices) Create(ctx context.Context, endpointSlice *v1.EndpointSlice, opts metav1.CreateOptions) (result *v1.EndpointSlice, err error) { emptyResult := &v1.EndpointSlice{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(endpointslicesResource, c.ns, endpointSlice), emptyResult) + Invokes(testing.NewCreateActionWithOptions(endpointslicesResource, c.ns, endpointSlice, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeEndpointSlices) Create(ctx context.Context, endpointSlice *v1.Endpo func (c *FakeEndpointSlices) Update(ctx context.Context, endpointSlice *v1.EndpointSlice, opts metav1.UpdateOptions) (result *v1.EndpointSlice, err error) { emptyResult := &v1.EndpointSlice{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(endpointslicesResource, c.ns, endpointSlice), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(endpointslicesResource, c.ns, endpointSlice, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeEndpointSlices) Delete(ctx context.Context, name string, opts metav // DeleteCollection deletes a collection of objects. func (c *FakeEndpointSlices) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(endpointslicesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(endpointslicesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.EndpointSliceList{}) return err @@ -128,7 +128,7 @@ func (c *FakeEndpointSlices) DeleteCollection(ctx context.Context, opts metav1.D func (c *FakeEndpointSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.EndpointSlice, err error) { emptyResult := &v1.EndpointSlice{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(endpointslicesResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(endpointslicesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeEndpointSlices) Apply(ctx context.Context, endpointSlice *discovery } emptyResult := &v1.EndpointSlice{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(endpointslicesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(endpointslicesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/discovery/v1beta1/fake/fake_endpointslice.go b/kubernetes/typed/discovery/v1beta1/fake/fake_endpointslice.go index 48b2aa90af..65cf69b9dc 100644 --- a/kubernetes/typed/discovery/v1beta1/fake/fake_endpointslice.go +++ b/kubernetes/typed/discovery/v1beta1/fake/fake_endpointslice.go @@ -46,7 +46,7 @@ var endpointslicesKind = v1beta1.SchemeGroupVersion.WithKind("EndpointSlice") func (c *FakeEndpointSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.EndpointSlice, err error) { emptyResult := &v1beta1.EndpointSlice{} obj, err := c.Fake. - Invokes(testing.NewGetAction(endpointslicesResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(endpointslicesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeEndpointSlices) Get(ctx context.Context, name string, options v1.Ge func (c *FakeEndpointSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EndpointSliceList, err error) { emptyResult := &v1beta1.EndpointSliceList{} obj, err := c.Fake. - Invokes(testing.NewListAction(endpointslicesResource, endpointslicesKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(endpointslicesResource, endpointslicesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeEndpointSlices) List(ctx context.Context, opts v1.ListOptions) (res // Watch returns a watch.Interface that watches the requested endpointSlices. func (c *FakeEndpointSlices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(endpointslicesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(endpointslicesResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeEndpointSlices) Watch(ctx context.Context, opts v1.ListOptions) (wa func (c *FakeEndpointSlices) Create(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.CreateOptions) (result *v1beta1.EndpointSlice, err error) { emptyResult := &v1beta1.EndpointSlice{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(endpointslicesResource, c.ns, endpointSlice), emptyResult) + Invokes(testing.NewCreateActionWithOptions(endpointslicesResource, c.ns, endpointSlice, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeEndpointSlices) Create(ctx context.Context, endpointSlice *v1beta1. func (c *FakeEndpointSlices) Update(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.UpdateOptions) (result *v1beta1.EndpointSlice, err error) { emptyResult := &v1beta1.EndpointSlice{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(endpointslicesResource, c.ns, endpointSlice), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(endpointslicesResource, c.ns, endpointSlice, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeEndpointSlices) Delete(ctx context.Context, name string, opts v1.De // DeleteCollection deletes a collection of objects. func (c *FakeEndpointSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(endpointslicesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(endpointslicesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.EndpointSliceList{}) return err @@ -128,7 +128,7 @@ func (c *FakeEndpointSlices) DeleteCollection(ctx context.Context, opts v1.Delet func (c *FakeEndpointSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.EndpointSlice, err error) { emptyResult := &v1beta1.EndpointSlice{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(endpointslicesResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(endpointslicesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeEndpointSlices) Apply(ctx context.Context, endpointSlice *discovery } emptyResult := &v1beta1.EndpointSlice{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(endpointslicesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(endpointslicesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/events/v1/fake/fake_event.go b/kubernetes/typed/events/v1/fake/fake_event.go index 4207d2d6bf..1e79eb9845 100644 --- a/kubernetes/typed/events/v1/fake/fake_event.go +++ b/kubernetes/typed/events/v1/fake/fake_event.go @@ -46,7 +46,7 @@ var eventsKind = v1.SchemeGroupVersion.WithKind("Event") func (c *FakeEvents) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Event, err error) { emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewGetAction(eventsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(eventsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeEvents) Get(ctx context.Context, name string, options metav1.GetOpt func (c *FakeEvents) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { emptyResult := &v1.EventList{} obj, err := c.Fake. - Invokes(testing.NewListAction(eventsResource, eventsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(eventsResource, eventsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeEvents) List(ctx context.Context, opts metav1.ListOptions) (result // Watch returns a watch.Interface that watches the requested events. func (c *FakeEvents) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(eventsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(eventsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeEvents) Watch(ctx context.Context, opts metav1.ListOptions) (watch. func (c *FakeEvents) Create(ctx context.Context, event *v1.Event, opts metav1.CreateOptions) (result *v1.Event, err error) { emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(eventsResource, c.ns, event), emptyResult) + Invokes(testing.NewCreateActionWithOptions(eventsResource, c.ns, event, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeEvents) Create(ctx context.Context, event *v1.Event, opts metav1.Cr func (c *FakeEvents) Update(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (result *v1.Event, err error) { emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(eventsResource, c.ns, event), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(eventsResource, c.ns, event, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeEvents) Delete(ctx context.Context, name string, opts metav1.Delete // DeleteCollection deletes a collection of objects. func (c *FakeEvents) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(eventsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(eventsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.EventList{}) return err @@ -128,7 +128,7 @@ func (c *FakeEvents) DeleteCollection(ctx context.Context, opts metav1.DeleteOpt func (c *FakeEvents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Event, err error) { emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(eventsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeEvents) Apply(ctx context.Context, event *eventsv1.EventApplyConfig } emptyResult := &v1.Event{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(eventsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/events/v1beta1/fake/fake_event.go b/kubernetes/typed/events/v1beta1/fake/fake_event.go index cba8222970..b00f2126a5 100644 --- a/kubernetes/typed/events/v1beta1/fake/fake_event.go +++ b/kubernetes/typed/events/v1beta1/fake/fake_event.go @@ -46,7 +46,7 @@ var eventsKind = v1beta1.SchemeGroupVersion.WithKind("Event") func (c *FakeEvents) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Event, err error) { emptyResult := &v1beta1.Event{} obj, err := c.Fake. - Invokes(testing.NewGetAction(eventsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(eventsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeEvents) Get(ctx context.Context, name string, options v1.GetOptions func (c *FakeEvents) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EventList, err error) { emptyResult := &v1beta1.EventList{} obj, err := c.Fake. - Invokes(testing.NewListAction(eventsResource, eventsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(eventsResource, eventsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeEvents) List(ctx context.Context, opts v1.ListOptions) (result *v1b // Watch returns a watch.Interface that watches the requested events. func (c *FakeEvents) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(eventsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(eventsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeEvents) Watch(ctx context.Context, opts v1.ListOptions) (watch.Inte func (c *FakeEvents) Create(ctx context.Context, event *v1beta1.Event, opts v1.CreateOptions) (result *v1beta1.Event, err error) { emptyResult := &v1beta1.Event{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(eventsResource, c.ns, event), emptyResult) + Invokes(testing.NewCreateActionWithOptions(eventsResource, c.ns, event, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeEvents) Create(ctx context.Context, event *v1beta1.Event, opts v1.C func (c *FakeEvents) Update(ctx context.Context, event *v1beta1.Event, opts v1.UpdateOptions) (result *v1beta1.Event, err error) { emptyResult := &v1beta1.Event{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(eventsResource, c.ns, event), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(eventsResource, c.ns, event, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeEvents) Delete(ctx context.Context, name string, opts v1.DeleteOpti // DeleteCollection deletes a collection of objects. func (c *FakeEvents) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(eventsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(eventsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.EventList{}) return err @@ -128,7 +128,7 @@ func (c *FakeEvents) DeleteCollection(ctx context.Context, opts v1.DeleteOptions func (c *FakeEvents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Event, err error) { emptyResult := &v1beta1.Event{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(eventsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeEvents) Apply(ctx context.Context, event *eventsv1beta1.EventApplyC } emptyResult := &v1beta1.Event{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(eventsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go b/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go index 3bedb4264d..f14943082d 100644 --- a/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go +++ b/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go @@ -46,7 +46,7 @@ var daemonsetsKind = v1beta1.SchemeGroupVersion.WithKind("DaemonSet") func (c *FakeDaemonSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.DaemonSet, err error) { emptyResult := &v1beta1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewGetAction(daemonsetsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(daemonsetsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeDaemonSets) Get(ctx context.Context, name string, options v1.GetOpt func (c *FakeDaemonSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DaemonSetList, err error) { emptyResult := &v1beta1.DaemonSetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(daemonsetsResource, daemonsetsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(daemonsetsResource, daemonsetsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ 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)) } @@ -88,7 +88,7 @@ func (c *FakeDaemonSets) Watch(ctx context.Context, opts v1.ListOptions) (watch. func (c *FakeDaemonSets) Create(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.CreateOptions) (result *v1beta1.DaemonSet, err error) { emptyResult := &v1beta1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(daemonsetsResource, c.ns, daemonSet), emptyResult) + Invokes(testing.NewCreateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeDaemonSets) Create(ctx context.Context, daemonSet *v1beta1.DaemonSe func (c *FakeDaemonSets) Update(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (result *v1beta1.DaemonSet, err error) { emptyResult := &v1beta1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeDaemonSets) Update(ctx context.Context, daemonSet *v1beta1.DaemonSe func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (result *v1beta1.DaemonSet, err error) { emptyResult := &v1beta1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(daemonsetsResource, "status", c.ns, daemonSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,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, &v1beta1.DaemonSetList{}) return err @@ -141,7 +141,7 @@ func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, opts v1.DeleteOpt func (c *FakeDaemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.DaemonSet, err error) { emptyResult := &v1beta1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeDaemonSets) Apply(ctx context.Context, daemonSet *extensionsv1beta1 } emptyResult := &v1beta1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakeDaemonSets) ApplyStatus(ctx context.Context, daemonSet *extensionsv } emptyResult := &v1beta1.DaemonSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go b/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go index 16be81f40f..ea41524d49 100644 --- a/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go +++ b/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go @@ -46,7 +46,7 @@ var deploymentsKind = v1beta1.SchemeGroupVersion.WithKind("Deployment") func (c *FakeDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Deployment, err error) { emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(deploymentsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeDeployments) Get(ctx context.Context, name string, options v1.GetOp func (c *FakeDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { emptyResult := &v1beta1.DeploymentList{} obj, err := c.Fake. - Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeDeployments) List(ctx context.Context, opts v1.ListOptions) (result // Watch returns a watch.Interface that watches the requested deployments. func (c *FakeDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(deploymentsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(deploymentsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch func (c *FakeDeployments) Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (result *v1beta1.Deployment, err error) { emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), emptyResult) + Invokes(testing.NewCreateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeDeployments) Create(ctx context.Context, deployment *v1beta1.Deploy func (c *FakeDeployments) Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeDeployments) Update(ctx context.Context, deployment *v1beta1.Deploy func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(deploymentsResource, "status", c.ns, deployment, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakeDeployments) Delete(ctx context.Context, name string, opts v1.Delet // DeleteCollection deletes a collection of objects. func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(deploymentsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.DeploymentList{}) return err @@ -141,7 +141,7 @@ func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOp func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Deployment, err error) { emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeDeployments) Apply(ctx context.Context, deployment *extensionsv1bet } emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *extension } emptyResult := &v1beta1.Deployment{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err @@ -200,7 +200,7 @@ func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *extension func (c *FakeDeployments) GetScale(ctx context.Context, deploymentName string, options v1.GetOptions) (result *v1beta1.Scale, err error) { emptyResult := &v1beta1.Scale{} obj, err := c.Fake. - Invokes(testing.NewGetSubresourceAction(deploymentsResource, c.ns, "scale", deploymentName), emptyResult) + Invokes(testing.NewGetSubresourceActionWithOptions(deploymentsResource, c.ns, "scale", deploymentName, options), emptyResult) if obj == nil { return emptyResult, err @@ -212,7 +212,7 @@ func (c *FakeDeployments) GetScale(ctx context.Context, deploymentName string, o func (c *FakeDeployments) UpdateScale(ctx context.Context, deploymentName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (result *v1beta1.Scale, err error) { emptyResult := &v1beta1.Scale{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "scale", c.ns, scale), &v1beta1.Scale{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(deploymentsResource, "scale", c.ns, scale, opts), &v1beta1.Scale{}) if obj == nil { return emptyResult, err @@ -232,7 +232,7 @@ func (c *FakeDeployments) ApplyScale(ctx context.Context, deploymentName string, } emptyResult := &v1beta1.Scale{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, deploymentName, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, deploymentName, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go b/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go index 69f3dc9ba9..ae95682fc1 100644 --- a/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go +++ b/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go @@ -46,7 +46,7 @@ var ingressesKind = v1beta1.SchemeGroupVersion.WithKind("Ingress") func (c *FakeIngresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Ingress, err error) { emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewGetAction(ingressesResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(ingressesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeIngresses) Get(ctx context.Context, name string, options v1.GetOpti func (c *FakeIngresses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { emptyResult := &v1beta1.IngressList{} obj, err := c.Fake. - Invokes(testing.NewListAction(ingressesResource, ingressesKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(ingressesResource, ingressesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeIngresses) List(ctx context.Context, opts v1.ListOptions) (result * // Watch returns a watch.Interface that watches the requested ingresses. func (c *FakeIngresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(ingressesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(ingressesResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeIngresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.I func (c *FakeIngresses) Create(ctx context.Context, ingress *v1beta1.Ingress, opts v1.CreateOptions) (result *v1beta1.Ingress, err error) { emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(ingressesResource, c.ns, ingress), emptyResult) + Invokes(testing.NewCreateActionWithOptions(ingressesResource, c.ns, ingress, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeIngresses) Create(ctx context.Context, ingress *v1beta1.Ingress, op func (c *FakeIngresses) Update(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(ingressesResource, c.ns, ingress), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(ingressesResource, c.ns, ingress, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeIngresses) Update(ctx context.Context, ingress *v1beta1.Ingress, op func (c *FakeIngresses) UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(ingressesResource, "status", c.ns, ingress), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(ingressesResource, "status", c.ns, ingress, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakeIngresses) Delete(ctx context.Context, name string, opts v1.DeleteO // DeleteCollection deletes a collection of objects. func (c *FakeIngresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(ingressesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(ingressesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.IngressList{}) return err @@ -141,7 +141,7 @@ func (c *FakeIngresses) DeleteCollection(ctx context.Context, opts v1.DeleteOpti func (c *FakeIngresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Ingress, err error) { emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeIngresses) Apply(ctx context.Context, ingress *extensionsv1beta1.In } emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakeIngresses) ApplyStatus(ctx context.Context, ingress *extensionsv1be } emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/extensions/v1beta1/fake/fake_networkpolicy.go b/kubernetes/typed/extensions/v1beta1/fake/fake_networkpolicy.go index 8e36b10275..d829a0c638 100644 --- a/kubernetes/typed/extensions/v1beta1/fake/fake_networkpolicy.go +++ b/kubernetes/typed/extensions/v1beta1/fake/fake_networkpolicy.go @@ -46,7 +46,7 @@ var networkpoliciesKind = v1beta1.SchemeGroupVersion.WithKind("NetworkPolicy") func (c *FakeNetworkPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.NetworkPolicy, err error) { emptyResult := &v1beta1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewGetAction(networkpoliciesResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(networkpoliciesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeNetworkPolicies) Get(ctx context.Context, name string, options v1.G func (c *FakeNetworkPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.NetworkPolicyList, err error) { emptyResult := &v1beta1.NetworkPolicyList{} obj, err := c.Fake. - Invokes(testing.NewListAction(networkpoliciesResource, networkpoliciesKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(networkpoliciesResource, networkpoliciesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ 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)) } @@ -88,7 +88,7 @@ func (c *FakeNetworkPolicies) Watch(ctx context.Context, opts v1.ListOptions) (w func (c *FakeNetworkPolicies) Create(ctx context.Context, networkPolicy *v1beta1.NetworkPolicy, opts v1.CreateOptions) (result *v1beta1.NetworkPolicy, err error) { emptyResult := &v1beta1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(networkpoliciesResource, c.ns, networkPolicy), emptyResult) + Invokes(testing.NewCreateActionWithOptions(networkpoliciesResource, c.ns, networkPolicy, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeNetworkPolicies) Create(ctx context.Context, networkPolicy *v1beta1 func (c *FakeNetworkPolicies) Update(ctx context.Context, networkPolicy *v1beta1.NetworkPolicy, opts v1.UpdateOptions) (result *v1beta1.NetworkPolicy, err error) { emptyResult := &v1beta1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(networkpoliciesResource, c.ns, networkPolicy), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(networkpoliciesResource, c.ns, networkPolicy, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeNetworkPolicies) Delete(ctx context.Context, name string, opts v1.D // DeleteCollection deletes a collection of objects. func (c *FakeNetworkPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(networkpoliciesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(networkpoliciesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.NetworkPolicyList{}) return err @@ -128,7 +128,7 @@ func (c *FakeNetworkPolicies) DeleteCollection(ctx context.Context, opts v1.Dele func (c *FakeNetworkPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.NetworkPolicy, err error) { emptyResult := &v1beta1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(networkpoliciesResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(networkpoliciesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeNetworkPolicies) Apply(ctx context.Context, networkPolicy *extensio } emptyResult := &v1beta1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(networkpoliciesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(networkpoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go b/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go index b8031f709e..caa7935e90 100644 --- a/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go +++ b/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go @@ -46,7 +46,7 @@ var replicasetsKind = v1beta1.SchemeGroupVersion.WithKind("ReplicaSet") func (c *FakeReplicaSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ReplicaSet, err error) { emptyResult := &v1beta1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewGetAction(replicasetsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(replicasetsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeReplicaSets) Get(ctx context.Context, name string, options v1.GetOp func (c *FakeReplicaSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ReplicaSetList, err error) { emptyResult := &v1beta1.ReplicaSetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(replicasetsResource, replicasetsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(replicasetsResource, replicasetsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeReplicaSets) List(ctx context.Context, opts v1.ListOptions) (result // Watch returns a watch.Interface that watches the requested replicaSets. func (c *FakeReplicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(replicasetsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(replicasetsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeReplicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch func (c *FakeReplicaSets) Create(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.CreateOptions) (result *v1beta1.ReplicaSet, err error) { emptyResult := &v1beta1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(replicasetsResource, c.ns, replicaSet), emptyResult) + Invokes(testing.NewCreateActionWithOptions(replicasetsResource, c.ns, replicaSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeReplicaSets) Create(ctx context.Context, replicaSet *v1beta1.Replic func (c *FakeReplicaSets) Update(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.UpdateOptions) (result *v1beta1.ReplicaSet, err error) { emptyResult := &v1beta1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(replicasetsResource, c.ns, replicaSet), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(replicasetsResource, c.ns, replicaSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeReplicaSets) Update(ctx context.Context, replicaSet *v1beta1.Replic func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.UpdateOptions) (result *v1beta1.ReplicaSet, err error) { emptyResult := &v1beta1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(replicasetsResource, "status", c.ns, replicaSet, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakeReplicaSets) Delete(ctx context.Context, name string, opts v1.Delet // DeleteCollection deletes a collection of objects. func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(replicasetsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(replicasetsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.ReplicaSetList{}) return err @@ -141,7 +141,7 @@ func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOp func (c *FakeReplicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ReplicaSet, err error) { emptyResult := &v1beta1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeReplicaSets) Apply(ctx context.Context, replicaSet *extensionsv1bet } emptyResult := &v1beta1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakeReplicaSets) ApplyStatus(ctx context.Context, replicaSet *extension } emptyResult := &v1beta1.ReplicaSet{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err @@ -200,7 +200,7 @@ func (c *FakeReplicaSets) ApplyStatus(ctx context.Context, replicaSet *extension func (c *FakeReplicaSets) GetScale(ctx context.Context, replicaSetName string, options v1.GetOptions) (result *v1beta1.Scale, err error) { emptyResult := &v1beta1.Scale{} obj, err := c.Fake. - Invokes(testing.NewGetSubresourceAction(replicasetsResource, c.ns, "scale", replicaSetName), emptyResult) + Invokes(testing.NewGetSubresourceActionWithOptions(replicasetsResource, c.ns, "scale", replicaSetName, options), emptyResult) if obj == nil { return emptyResult, err @@ -212,7 +212,7 @@ func (c *FakeReplicaSets) GetScale(ctx context.Context, replicaSetName string, o func (c *FakeReplicaSets) UpdateScale(ctx context.Context, replicaSetName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (result *v1beta1.Scale, err error) { emptyResult := &v1beta1.Scale{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "scale", c.ns, scale), &v1beta1.Scale{}) + Invokes(testing.NewUpdateSubresourceActionWithOptions(replicasetsResource, "scale", c.ns, scale, opts), &v1beta1.Scale{}) if obj == nil { return emptyResult, err @@ -232,7 +232,7 @@ func (c *FakeReplicaSets) ApplyScale(ctx context.Context, replicaSetName string, } emptyResult := &v1beta1.Scale{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, replicaSetName, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, replicaSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/flowcontrol/v1/fake/fake_flowschema.go b/kubernetes/typed/flowcontrol/v1/fake/fake_flowschema.go index 20e9dbdb8f..bf2b63fb2d 100644 --- a/kubernetes/typed/flowcontrol/v1/fake/fake_flowschema.go +++ b/kubernetes/typed/flowcontrol/v1/fake/fake_flowschema.go @@ -45,7 +45,7 @@ var flowschemasKind = v1.SchemeGroupVersion.WithKind("FlowSchema") func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.FlowSchema, err error) { emptyResult := &v1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(flowschemasResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(flowschemasResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options metav1.G func (c *FakeFlowSchemas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FlowSchemaList, err error) { emptyResult := &v1.FlowSchemaList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(flowschemasResource, flowschemasKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(flowschemasResource, flowschemasKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeFlowSchemas) List(ctx context.Context, opts metav1.ListOptions) (re // Watch returns a watch.Interface that watches the requested flowSchemas. func (c *FakeFlowSchemas) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(flowschemasResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(flowschemasResource, opts)) } // Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.CreateOptions) (result *v1.FlowSchema, err error) { emptyResult := &v1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(flowschemasResource, flowSchema), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1.FlowSchema, func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (result *v1.FlowSchema, err error) { emptyResult := &v1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(flowschemasResource, flowSchema), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -107,7 +107,7 @@ func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1.FlowSchema, func (c *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (result *v1.FlowSchema, err error) { emptyResult := &v1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(flowschemasResource, "status", flowSchema), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(flowschemasResource, "status", flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -123,7 +123,7 @@ func (c *FakeFlowSchemas) Delete(ctx context.Context, name string, opts metav1.D // DeleteCollection deletes a collection of objects. func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(flowschemasResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(flowschemasResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.FlowSchemaList{}) return err @@ -133,7 +133,7 @@ func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts metav1.Dele func (c *FakeFlowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FlowSchema, err error) { emptyResult := &v1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -155,7 +155,7 @@ func (c *FakeFlowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1.F } emptyResult := &v1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } @@ -178,7 +178,7 @@ func (c *FakeFlowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontr } emptyResult := &v1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.go index 239a071361..053de56ed1 100644 --- a/kubernetes/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.go @@ -45,7 +45,7 @@ var prioritylevelconfigurationsKind = v1.SchemeGroupVersion.WithKind("PriorityLe func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PriorityLevelConfiguration, err error) { emptyResult := &v1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(prioritylevelconfigurationsResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(prioritylevelconfigurationsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityLevelConfigurationList, err error) { emptyResult := &v1.PriorityLevelConfigurationList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts metav1. // Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. func (c *FakePriorityLevelConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(prioritylevelconfigurationsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(prioritylevelconfigurationsResource, opts)) } // Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.CreateOptions) (result *v1.PriorityLevelConfiguration, err error) { emptyResult := &v1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLe func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (result *v1.PriorityLevelConfiguration, err error) { emptyResult := &v1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -107,7 +107,7 @@ func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLe func (c *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (result *v1.PriorityLevelConfiguration, err error) { emptyResult := &v1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -123,7 +123,7 @@ func (c *FakePriorityLevelConfigurations) Delete(ctx context.Context, name strin // DeleteCollection deletes a collection of objects. func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(prioritylevelconfigurationsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(prioritylevelconfigurationsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.PriorityLevelConfigurationList{}) return err @@ -133,7 +133,7 @@ func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, func (c *FakePriorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityLevelConfiguration, err error) { emptyResult := &v1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -155,7 +155,7 @@ func (c *FakePriorityLevelConfigurations) Apply(ctx context.Context, priorityLev } emptyResult := &v1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } @@ -178,7 +178,7 @@ func (c *FakePriorityLevelConfigurations) ApplyStatus(ctx context.Context, prior } emptyResult := &v1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/flowcontrol/v1beta1/fake/fake_flowschema.go b/kubernetes/typed/flowcontrol/v1beta1/fake/fake_flowschema.go index 9a94a0d340..8b4435a8ad 100644 --- a/kubernetes/typed/flowcontrol/v1beta1/fake/fake_flowschema.go +++ b/kubernetes/typed/flowcontrol/v1beta1/fake/fake_flowschema.go @@ -45,7 +45,7 @@ var flowschemasKind = v1beta1.SchemeGroupVersion.WithKind("FlowSchema") func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.FlowSchema, err error) { emptyResult := &v1beta1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(flowschemasResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(flowschemasResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options v1.GetOp func (c *FakeFlowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.FlowSchemaList, err error) { emptyResult := &v1beta1.FlowSchemaList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(flowschemasResource, flowschemasKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(flowschemasResource, flowschemasKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeFlowSchemas) List(ctx context.Context, opts v1.ListOptions) (result // Watch returns a watch.Interface that watches the requested flowSchemas. func (c *FakeFlowSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(flowschemasResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(flowschemasResource, opts)) } // Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1beta1.FlowSchema, opts v1.CreateOptions) (result *v1beta1.FlowSchema, err error) { emptyResult := &v1beta1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(flowschemasResource, flowSchema), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1beta1.FlowSc func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1beta1.FlowSchema, opts v1.UpdateOptions) (result *v1beta1.FlowSchema, err error) { emptyResult := &v1beta1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(flowschemasResource, flowSchema), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -107,7 +107,7 @@ func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1beta1.FlowSc func (c *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1beta1.FlowSchema, opts v1.UpdateOptions) (result *v1beta1.FlowSchema, err error) { emptyResult := &v1beta1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(flowschemasResource, "status", flowSchema), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(flowschemasResource, "status", flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -123,7 +123,7 @@ func (c *FakeFlowSchemas) Delete(ctx context.Context, name string, opts v1.Delet // DeleteCollection deletes a collection of objects. func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(flowschemasResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(flowschemasResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.FlowSchemaList{}) return err @@ -133,7 +133,7 @@ func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOp func (c *FakeFlowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.FlowSchema, err error) { emptyResult := &v1beta1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -155,7 +155,7 @@ func (c *FakeFlowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1be } emptyResult := &v1beta1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } @@ -178,7 +178,7 @@ func (c *FakeFlowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontr } emptyResult := &v1beta1.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/flowcontrol/v1beta1/fake/fake_prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1beta1/fake/fake_prioritylevelconfiguration.go index edacdaf250..e139e4dceb 100644 --- a/kubernetes/typed/flowcontrol/v1beta1/fake/fake_prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1beta1/fake/fake_prioritylevelconfiguration.go @@ -45,7 +45,7 @@ var prioritylevelconfigurationsKind = v1beta1.SchemeGroupVersion.WithKind("Prior func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { emptyResult := &v1beta1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(prioritylevelconfigurationsResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(prioritylevelconfigurationsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityLevelConfigurationList, err error) { emptyResult := &v1beta1.PriorityLevelConfigurationList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts v1.List // Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. func (c *FakePriorityLevelConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(prioritylevelconfigurationsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(prioritylevelconfigurationsResource, opts)) } // Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1beta1.PriorityLevelConfiguration, opts v1.CreateOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { emptyResult := &v1beta1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLe func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1beta1.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { emptyResult := &v1beta1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -107,7 +107,7 @@ func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLe func (c *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta1.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta1.PriorityLevelConfiguration, err error) { emptyResult := &v1beta1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -123,7 +123,7 @@ func (c *FakePriorityLevelConfigurations) Delete(ctx context.Context, name strin // DeleteCollection deletes a collection of objects. func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(prioritylevelconfigurationsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(prioritylevelconfigurationsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.PriorityLevelConfigurationList{}) return err @@ -133,7 +133,7 @@ func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, func (c *FakePriorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PriorityLevelConfiguration, err error) { emptyResult := &v1beta1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -155,7 +155,7 @@ func (c *FakePriorityLevelConfigurations) Apply(ctx context.Context, priorityLev } emptyResult := &v1beta1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } @@ -178,7 +178,7 @@ func (c *FakePriorityLevelConfigurations) ApplyStatus(ctx context.Context, prior } emptyResult := &v1beta1.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/flowcontrol/v1beta2/fake/fake_flowschema.go b/kubernetes/typed/flowcontrol/v1beta2/fake/fake_flowschema.go index 956becdc72..41cad9b7a1 100644 --- a/kubernetes/typed/flowcontrol/v1beta2/fake/fake_flowschema.go +++ b/kubernetes/typed/flowcontrol/v1beta2/fake/fake_flowschema.go @@ -45,7 +45,7 @@ var flowschemasKind = v1beta2.SchemeGroupVersion.WithKind("FlowSchema") func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.FlowSchema, err error) { emptyResult := &v1beta2.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(flowschemasResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(flowschemasResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options v1.GetOp func (c *FakeFlowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.FlowSchemaList, err error) { emptyResult := &v1beta2.FlowSchemaList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(flowschemasResource, flowschemasKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(flowschemasResource, flowschemasKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeFlowSchemas) List(ctx context.Context, opts v1.ListOptions) (result // Watch returns a watch.Interface that watches the requested flowSchemas. func (c *FakeFlowSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(flowschemasResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(flowschemasResource, opts)) } // Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.CreateOptions) (result *v1beta2.FlowSchema, err error) { emptyResult := &v1beta2.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(flowschemasResource, flowSchema), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1beta2.FlowSc func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.UpdateOptions) (result *v1beta2.FlowSchema, err error) { emptyResult := &v1beta2.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(flowschemasResource, flowSchema), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -107,7 +107,7 @@ func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1beta2.FlowSc func (c *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1beta2.FlowSchema, opts v1.UpdateOptions) (result *v1beta2.FlowSchema, err error) { emptyResult := &v1beta2.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(flowschemasResource, "status", flowSchema), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(flowschemasResource, "status", flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -123,7 +123,7 @@ func (c *FakeFlowSchemas) Delete(ctx context.Context, name string, opts v1.Delet // DeleteCollection deletes a collection of objects. func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(flowschemasResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(flowschemasResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta2.FlowSchemaList{}) return err @@ -133,7 +133,7 @@ func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOp func (c *FakeFlowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.FlowSchema, err error) { emptyResult := &v1beta2.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -155,7 +155,7 @@ func (c *FakeFlowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1be } emptyResult := &v1beta2.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } @@ -178,7 +178,7 @@ func (c *FakeFlowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontr } emptyResult := &v1beta2.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/flowcontrol/v1beta2/fake/fake_prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1beta2/fake/fake_prioritylevelconfiguration.go index 40c763ff57..f9eac85d51 100644 --- a/kubernetes/typed/flowcontrol/v1beta2/fake/fake_prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1beta2/fake/fake_prioritylevelconfiguration.go @@ -45,7 +45,7 @@ var prioritylevelconfigurationsKind = v1beta2.SchemeGroupVersion.WithKind("Prior func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { emptyResult := &v1beta2.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(prioritylevelconfigurationsResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(prioritylevelconfigurationsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.PriorityLevelConfigurationList, err error) { emptyResult := &v1beta2.PriorityLevelConfigurationList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts v1.List // Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. func (c *FakePriorityLevelConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(prioritylevelconfigurationsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(prioritylevelconfigurationsResource, opts)) } // Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.CreateOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { emptyResult := &v1beta2.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLe func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { emptyResult := &v1beta2.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -107,7 +107,7 @@ func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLe func (c *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta2.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta2.PriorityLevelConfiguration, err error) { emptyResult := &v1beta2.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -123,7 +123,7 @@ func (c *FakePriorityLevelConfigurations) Delete(ctx context.Context, name strin // DeleteCollection deletes a collection of objects. func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(prioritylevelconfigurationsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(prioritylevelconfigurationsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta2.PriorityLevelConfigurationList{}) return err @@ -133,7 +133,7 @@ func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, func (c *FakePriorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.PriorityLevelConfiguration, err error) { emptyResult := &v1beta2.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -155,7 +155,7 @@ func (c *FakePriorityLevelConfigurations) Apply(ctx context.Context, priorityLev } emptyResult := &v1beta2.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } @@ -178,7 +178,7 @@ func (c *FakePriorityLevelConfigurations) ApplyStatus(ctx context.Context, prior } emptyResult := &v1beta2.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/flowcontrol/v1beta3/fake/fake_flowschema.go b/kubernetes/typed/flowcontrol/v1beta3/fake/fake_flowschema.go index 9f632abcfe..70dca796a4 100644 --- a/kubernetes/typed/flowcontrol/v1beta3/fake/fake_flowschema.go +++ b/kubernetes/typed/flowcontrol/v1beta3/fake/fake_flowschema.go @@ -45,7 +45,7 @@ var flowschemasKind = v1beta3.SchemeGroupVersion.WithKind("FlowSchema") func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta3.FlowSchema, err error) { emptyResult := &v1beta3.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(flowschemasResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(flowschemasResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options v1.GetOp func (c *FakeFlowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta3.FlowSchemaList, err error) { emptyResult := &v1beta3.FlowSchemaList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(flowschemasResource, flowschemasKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(flowschemasResource, flowschemasKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeFlowSchemas) List(ctx context.Context, opts v1.ListOptions) (result // Watch returns a watch.Interface that watches the requested flowSchemas. func (c *FakeFlowSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(flowschemasResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(flowschemasResource, opts)) } // Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1beta3.FlowSchema, opts v1.CreateOptions) (result *v1beta3.FlowSchema, err error) { emptyResult := &v1beta3.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(flowschemasResource, flowSchema), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1beta3.FlowSc func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1beta3.FlowSchema, opts v1.UpdateOptions) (result *v1beta3.FlowSchema, err error) { emptyResult := &v1beta3.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(flowschemasResource, flowSchema), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(flowschemasResource, flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -107,7 +107,7 @@ func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1beta3.FlowSc func (c *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1beta3.FlowSchema, opts v1.UpdateOptions) (result *v1beta3.FlowSchema, err error) { emptyResult := &v1beta3.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(flowschemasResource, "status", flowSchema), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(flowschemasResource, "status", flowSchema, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -123,7 +123,7 @@ func (c *FakeFlowSchemas) Delete(ctx context.Context, name string, opts v1.Delet // DeleteCollection deletes a collection of objects. func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(flowschemasResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(flowschemasResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta3.FlowSchemaList{}) return err @@ -133,7 +133,7 @@ func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOp func (c *FakeFlowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta3.FlowSchema, err error) { emptyResult := &v1beta3.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -155,7 +155,7 @@ func (c *FakeFlowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1be } emptyResult := &v1beta3.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } @@ -178,7 +178,7 @@ func (c *FakeFlowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontr } emptyResult := &v1beta3.FlowSchema{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(flowschemasResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/flowcontrol/v1beta3/fake/fake_prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1beta3/fake/fake_prioritylevelconfiguration.go index 91205e85ac..45836a6453 100644 --- a/kubernetes/typed/flowcontrol/v1beta3/fake/fake_prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1beta3/fake/fake_prioritylevelconfiguration.go @@ -45,7 +45,7 @@ var prioritylevelconfigurationsKind = v1beta3.SchemeGroupVersion.WithKind("Prior func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { emptyResult := &v1beta3.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(prioritylevelconfigurationsResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(prioritylevelconfigurationsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta3.PriorityLevelConfigurationList, err error) { emptyResult := &v1beta3.PriorityLevelConfigurationList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts v1.List // Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. func (c *FakePriorityLevelConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(prioritylevelconfigurationsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(prioritylevelconfigurationsResource, opts)) } // Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1beta3.PriorityLevelConfiguration, opts v1.CreateOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { emptyResult := &v1beta3.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLe func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1beta3.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { emptyResult := &v1beta3.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(prioritylevelconfigurationsResource, priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -107,7 +107,7 @@ func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLe func (c *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1beta3.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1beta3.PriorityLevelConfiguration, err error) { emptyResult := &v1beta3.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -123,7 +123,7 @@ func (c *FakePriorityLevelConfigurations) Delete(ctx context.Context, name strin // DeleteCollection deletes a collection of objects. func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(prioritylevelconfigurationsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(prioritylevelconfigurationsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta3.PriorityLevelConfigurationList{}) return err @@ -133,7 +133,7 @@ func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, func (c *FakePriorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta3.PriorityLevelConfiguration, err error) { emptyResult := &v1beta3.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -155,7 +155,7 @@ func (c *FakePriorityLevelConfigurations) Apply(ctx context.Context, priorityLev } emptyResult := &v1beta3.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } @@ -178,7 +178,7 @@ func (c *FakePriorityLevelConfigurations) ApplyStatus(ctx context.Context, prior } emptyResult := &v1beta3.PriorityLevelConfiguration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/networking/v1/fake/fake_ingress.go b/kubernetes/typed/networking/v1/fake/fake_ingress.go index 49cded65b6..a9693338b5 100644 --- a/kubernetes/typed/networking/v1/fake/fake_ingress.go +++ b/kubernetes/typed/networking/v1/fake/fake_ingress.go @@ -46,7 +46,7 @@ var ingressesKind = v1.SchemeGroupVersion.WithKind("Ingress") func (c *FakeIngresses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Ingress, err error) { emptyResult := &v1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewGetAction(ingressesResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(ingressesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeIngresses) Get(ctx context.Context, name string, options metav1.Get func (c *FakeIngresses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressList, err error) { emptyResult := &v1.IngressList{} obj, err := c.Fake. - Invokes(testing.NewListAction(ingressesResource, ingressesKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(ingressesResource, ingressesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeIngresses) List(ctx context.Context, opts metav1.ListOptions) (resu // Watch returns a watch.Interface that watches the requested ingresses. func (c *FakeIngresses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(ingressesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(ingressesResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeIngresses) Watch(ctx context.Context, opts metav1.ListOptions) (wat func (c *FakeIngresses) Create(ctx context.Context, ingress *v1.Ingress, opts metav1.CreateOptions) (result *v1.Ingress, err error) { emptyResult := &v1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(ingressesResource, c.ns, ingress), emptyResult) + Invokes(testing.NewCreateActionWithOptions(ingressesResource, c.ns, ingress, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeIngresses) Create(ctx context.Context, ingress *v1.Ingress, opts me func (c *FakeIngresses) Update(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (result *v1.Ingress, err error) { emptyResult := &v1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(ingressesResource, c.ns, ingress), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(ingressesResource, c.ns, ingress, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeIngresses) Update(ctx context.Context, ingress *v1.Ingress, opts me func (c *FakeIngresses) UpdateStatus(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (result *v1.Ingress, err error) { emptyResult := &v1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(ingressesResource, "status", c.ns, ingress), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(ingressesResource, "status", c.ns, ingress, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakeIngresses) Delete(ctx context.Context, name string, opts metav1.Del // DeleteCollection deletes a collection of objects. func (c *FakeIngresses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(ingressesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(ingressesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.IngressList{}) return err @@ -141,7 +141,7 @@ func (c *FakeIngresses) DeleteCollection(ctx context.Context, opts metav1.Delete func (c *FakeIngresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Ingress, err error) { emptyResult := &v1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeIngresses) Apply(ctx context.Context, ingress *networkingv1.Ingress } emptyResult := &v1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakeIngresses) ApplyStatus(ctx context.Context, ingress *networkingv1.I } emptyResult := &v1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/networking/v1/fake/fake_ingressclass.go b/kubernetes/typed/networking/v1/fake/fake_ingressclass.go index 7d9cd478ad..cdbd594452 100644 --- a/kubernetes/typed/networking/v1/fake/fake_ingressclass.go +++ b/kubernetes/typed/networking/v1/fake/fake_ingressclass.go @@ -45,7 +45,7 @@ var ingressclassesKind = v1.SchemeGroupVersion.WithKind("IngressClass") func (c *FakeIngressClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.IngressClass, err error) { emptyResult := &v1.IngressClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(ingressclassesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(ingressclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeIngressClasses) Get(ctx context.Context, name string, options metav func (c *FakeIngressClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressClassList, err error) { emptyResult := &v1.IngressClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(ingressclassesResource, ingressclassesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(ingressclassesResource, ingressclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeIngressClasses) List(ctx context.Context, opts metav1.ListOptions) // Watch returns a watch.Interface that watches the requested ingressClasses. func (c *FakeIngressClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(ingressclassesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(ingressclassesResource, opts)) } // Create takes the representation of a ingressClass and creates it. Returns the server's representation of the ingressClass, and an error, if there is any. func (c *FakeIngressClasses) Create(ctx context.Context, ingressClass *v1.IngressClass, opts metav1.CreateOptions) (result *v1.IngressClass, err error) { emptyResult := &v1.IngressClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(ingressclassesResource, ingressClass), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(ingressclassesResource, ingressClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeIngressClasses) Create(ctx context.Context, ingressClass *v1.Ingres func (c *FakeIngressClasses) Update(ctx context.Context, ingressClass *v1.IngressClass, opts metav1.UpdateOptions) (result *v1.IngressClass, err error) { emptyResult := &v1.IngressClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(ingressclassesResource, ingressClass), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(ingressclassesResource, ingressClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeIngressClasses) Delete(ctx context.Context, name string, opts metav // DeleteCollection deletes a collection of objects. func (c *FakeIngressClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(ingressclassesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(ingressclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.IngressClassList{}) return err @@ -121,7 +121,7 @@ func (c *FakeIngressClasses) DeleteCollection(ctx context.Context, opts metav1.D func (c *FakeIngressClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.IngressClass, err error) { emptyResult := &v1.IngressClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(ingressclassesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(ingressclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeIngressClasses) Apply(ctx context.Context, ingressClass *networking } emptyResult := &v1.IngressClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(ingressclassesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(ingressclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go b/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go index 9b3e7c19f9..9098bf42e3 100644 --- a/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go +++ b/kubernetes/typed/networking/v1/fake/fake_networkpolicy.go @@ -46,7 +46,7 @@ var networkpoliciesKind = v1.SchemeGroupVersion.WithKind("NetworkPolicy") func (c *FakeNetworkPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.NetworkPolicy, err error) { emptyResult := &v1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewGetAction(networkpoliciesResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(networkpoliciesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeNetworkPolicies) Get(ctx context.Context, name string, options meta func (c *FakeNetworkPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NetworkPolicyList, err error) { emptyResult := &v1.NetworkPolicyList{} obj, err := c.Fake. - Invokes(testing.NewListAction(networkpoliciesResource, networkpoliciesKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(networkpoliciesResource, networkpoliciesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeNetworkPolicies) List(ctx context.Context, opts metav1.ListOptions) // Watch returns a watch.Interface that watches the requested networkPolicies. func (c *FakeNetworkPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(networkpoliciesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(networkpoliciesResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeNetworkPolicies) Watch(ctx context.Context, opts metav1.ListOptions func (c *FakeNetworkPolicies) Create(ctx context.Context, networkPolicy *v1.NetworkPolicy, opts metav1.CreateOptions) (result *v1.NetworkPolicy, err error) { emptyResult := &v1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(networkpoliciesResource, c.ns, networkPolicy), emptyResult) + Invokes(testing.NewCreateActionWithOptions(networkpoliciesResource, c.ns, networkPolicy, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeNetworkPolicies) Create(ctx context.Context, networkPolicy *v1.Netw func (c *FakeNetworkPolicies) Update(ctx context.Context, networkPolicy *v1.NetworkPolicy, opts metav1.UpdateOptions) (result *v1.NetworkPolicy, err error) { emptyResult := &v1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(networkpoliciesResource, c.ns, networkPolicy), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(networkpoliciesResource, c.ns, networkPolicy, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeNetworkPolicies) Delete(ctx context.Context, name string, opts meta // DeleteCollection deletes a collection of objects. func (c *FakeNetworkPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(networkpoliciesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(networkpoliciesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.NetworkPolicyList{}) return err @@ -128,7 +128,7 @@ func (c *FakeNetworkPolicies) DeleteCollection(ctx context.Context, opts metav1. func (c *FakeNetworkPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NetworkPolicy, err error) { emptyResult := &v1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(networkpoliciesResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(networkpoliciesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeNetworkPolicies) Apply(ctx context.Context, networkPolicy *networki } emptyResult := &v1.NetworkPolicy{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(networkpoliciesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(networkpoliciesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/networking/v1alpha1/fake/fake_ipaddress.go b/kubernetes/typed/networking/v1alpha1/fake/fake_ipaddress.go index cffe0d63de..6ce62b3313 100644 --- a/kubernetes/typed/networking/v1alpha1/fake/fake_ipaddress.go +++ b/kubernetes/typed/networking/v1alpha1/fake/fake_ipaddress.go @@ -45,7 +45,7 @@ var ipaddressesKind = v1alpha1.SchemeGroupVersion.WithKind("IPAddress") 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), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(ipaddressesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeIPAddresses) Get(ctx context.Context, name string, options v1.GetOp 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), emptyResult) + Invokes(testing.NewRootListActionWithOptions(ipaddressesResource, ipaddressesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ 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), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(ipaddressesResource, iPAddress, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeIPAddresses) Create(ctx context.Context, iPAddress *v1alpha1.IPAddr 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), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(ipaddressesResource, iPAddress, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,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 @@ -121,7 +121,7 @@ func (c *FakeIPAddresses) DeleteCollection(ctx context.Context, opts v1.DeleteOp 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...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(ipaddressesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeIPAddresses) Apply(ctx context.Context, iPAddress *networkingv1alph } emptyResult := &v1alpha1.IPAddress{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(ipaddressesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(ipaddressesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/networking/v1alpha1/fake/fake_servicecidr.go b/kubernetes/typed/networking/v1alpha1/fake/fake_servicecidr.go index 754985d167..27a78e1ba6 100644 --- a/kubernetes/typed/networking/v1alpha1/fake/fake_servicecidr.go +++ b/kubernetes/typed/networking/v1alpha1/fake/fake_servicecidr.go @@ -45,7 +45,7 @@ var servicecidrsKind = v1alpha1.SchemeGroupVersion.WithKind("ServiceCIDR") func (c *FakeServiceCIDRs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ServiceCIDR, err error) { emptyResult := &v1alpha1.ServiceCIDR{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(servicecidrsResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(servicecidrsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeServiceCIDRs) Get(ctx context.Context, name string, options v1.GetO func (c *FakeServiceCIDRs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ServiceCIDRList, err error) { emptyResult := &v1alpha1.ServiceCIDRList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(servicecidrsResource, servicecidrsKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(servicecidrsResource, servicecidrsKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeServiceCIDRs) List(ctx context.Context, opts v1.ListOptions) (resul // Watch returns a watch.Interface that watches the requested serviceCIDRs. func (c *FakeServiceCIDRs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(servicecidrsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(servicecidrsResource, opts)) } // Create takes the representation of a serviceCIDR and creates it. Returns the server's representation of the serviceCIDR, and an error, if there is any. func (c *FakeServiceCIDRs) Create(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.CreateOptions) (result *v1alpha1.ServiceCIDR, err error) { emptyResult := &v1alpha1.ServiceCIDR{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(servicecidrsResource, serviceCIDR), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(servicecidrsResource, serviceCIDR, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeServiceCIDRs) Create(ctx context.Context, serviceCIDR *v1alpha1.Ser func (c *FakeServiceCIDRs) Update(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (result *v1alpha1.ServiceCIDR, err error) { emptyResult := &v1alpha1.ServiceCIDR{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(servicecidrsResource, serviceCIDR), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(servicecidrsResource, serviceCIDR, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -107,7 +107,7 @@ func (c *FakeServiceCIDRs) Update(ctx context.Context, serviceCIDR *v1alpha1.Ser func (c *FakeServiceCIDRs) UpdateStatus(ctx context.Context, serviceCIDR *v1alpha1.ServiceCIDR, opts v1.UpdateOptions) (result *v1alpha1.ServiceCIDR, err error) { emptyResult := &v1alpha1.ServiceCIDR{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(servicecidrsResource, "status", serviceCIDR), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(servicecidrsResource, "status", serviceCIDR, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -123,7 +123,7 @@ func (c *FakeServiceCIDRs) Delete(ctx context.Context, name string, opts v1.Dele // DeleteCollection deletes a collection of objects. func (c *FakeServiceCIDRs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(servicecidrsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(servicecidrsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.ServiceCIDRList{}) return err @@ -133,7 +133,7 @@ func (c *FakeServiceCIDRs) DeleteCollection(ctx context.Context, opts v1.DeleteO func (c *FakeServiceCIDRs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ServiceCIDR, err error) { emptyResult := &v1alpha1.ServiceCIDR{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(servicecidrsResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(servicecidrsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -155,7 +155,7 @@ func (c *FakeServiceCIDRs) Apply(ctx context.Context, serviceCIDR *networkingv1a } emptyResult := &v1alpha1.ServiceCIDR{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(servicecidrsResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(servicecidrsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } @@ -178,7 +178,7 @@ func (c *FakeServiceCIDRs) ApplyStatus(ctx context.Context, serviceCIDR *network } emptyResult := &v1alpha1.ServiceCIDR{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(servicecidrsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(servicecidrsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/networking/v1beta1/fake/fake_ingress.go b/kubernetes/typed/networking/v1beta1/fake/fake_ingress.go index b2adf27b6c..59bf762a01 100644 --- a/kubernetes/typed/networking/v1beta1/fake/fake_ingress.go +++ b/kubernetes/typed/networking/v1beta1/fake/fake_ingress.go @@ -46,7 +46,7 @@ var ingressesKind = v1beta1.SchemeGroupVersion.WithKind("Ingress") func (c *FakeIngresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Ingress, err error) { emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewGetAction(ingressesResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(ingressesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeIngresses) Get(ctx context.Context, name string, options v1.GetOpti func (c *FakeIngresses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { emptyResult := &v1beta1.IngressList{} obj, err := c.Fake. - Invokes(testing.NewListAction(ingressesResource, ingressesKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(ingressesResource, ingressesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeIngresses) List(ctx context.Context, opts v1.ListOptions) (result * // Watch returns a watch.Interface that watches the requested ingresses. func (c *FakeIngresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(ingressesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(ingressesResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeIngresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.I func (c *FakeIngresses) Create(ctx context.Context, ingress *v1beta1.Ingress, opts v1.CreateOptions) (result *v1beta1.Ingress, err error) { emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(ingressesResource, c.ns, ingress), emptyResult) + Invokes(testing.NewCreateActionWithOptions(ingressesResource, c.ns, ingress, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeIngresses) Create(ctx context.Context, ingress *v1beta1.Ingress, op func (c *FakeIngresses) Update(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(ingressesResource, c.ns, ingress), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(ingressesResource, c.ns, ingress, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeIngresses) Update(ctx context.Context, ingress *v1beta1.Ingress, op func (c *FakeIngresses) UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(ingressesResource, "status", c.ns, ingress), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(ingressesResource, "status", c.ns, ingress, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakeIngresses) Delete(ctx context.Context, name string, opts v1.DeleteO // DeleteCollection deletes a collection of objects. func (c *FakeIngresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(ingressesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(ingressesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.IngressList{}) return err @@ -141,7 +141,7 @@ func (c *FakeIngresses) DeleteCollection(ctx context.Context, opts v1.DeleteOpti func (c *FakeIngresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Ingress, err error) { emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeIngresses) Apply(ctx context.Context, ingress *networkingv1beta1.In } emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakeIngresses) ApplyStatus(ctx context.Context, ingress *networkingv1be } emptyResult := &v1beta1.Ingress{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(ingressesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/networking/v1beta1/fake/fake_ingressclass.go b/kubernetes/typed/networking/v1beta1/fake/fake_ingressclass.go index 5a98f982b9..3001de8e42 100644 --- a/kubernetes/typed/networking/v1beta1/fake/fake_ingressclass.go +++ b/kubernetes/typed/networking/v1beta1/fake/fake_ingressclass.go @@ -45,7 +45,7 @@ var ingressclassesKind = v1beta1.SchemeGroupVersion.WithKind("IngressClass") func (c *FakeIngressClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.IngressClass, err error) { emptyResult := &v1beta1.IngressClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(ingressclassesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(ingressclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeIngressClasses) Get(ctx context.Context, name string, options v1.Ge func (c *FakeIngressClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressClassList, err error) { emptyResult := &v1beta1.IngressClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(ingressclassesResource, ingressclassesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(ingressclassesResource, ingressclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeIngressClasses) List(ctx context.Context, opts v1.ListOptions) (res // Watch returns a watch.Interface that watches the requested ingressClasses. func (c *FakeIngressClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(ingressclassesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(ingressclassesResource, opts)) } // Create takes the representation of a ingressClass and creates it. Returns the server's representation of the ingressClass, and an error, if there is any. func (c *FakeIngressClasses) Create(ctx context.Context, ingressClass *v1beta1.IngressClass, opts v1.CreateOptions) (result *v1beta1.IngressClass, err error) { emptyResult := &v1beta1.IngressClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(ingressclassesResource, ingressClass), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(ingressclassesResource, ingressClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeIngressClasses) Create(ctx context.Context, ingressClass *v1beta1.I func (c *FakeIngressClasses) Update(ctx context.Context, ingressClass *v1beta1.IngressClass, opts v1.UpdateOptions) (result *v1beta1.IngressClass, err error) { emptyResult := &v1beta1.IngressClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(ingressclassesResource, ingressClass), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(ingressclassesResource, ingressClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeIngressClasses) Delete(ctx context.Context, name string, opts v1.De // DeleteCollection deletes a collection of objects. func (c *FakeIngressClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(ingressclassesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(ingressclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.IngressClassList{}) return err @@ -121,7 +121,7 @@ func (c *FakeIngressClasses) DeleteCollection(ctx context.Context, opts v1.Delet func (c *FakeIngressClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.IngressClass, err error) { emptyResult := &v1beta1.IngressClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(ingressclassesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(ingressclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeIngressClasses) Apply(ctx context.Context, ingressClass *networking } emptyResult := &v1beta1.IngressClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(ingressclassesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(ingressclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/node/v1/fake/fake_runtimeclass.go b/kubernetes/typed/node/v1/fake/fake_runtimeclass.go index a512e9f09e..0a52706284 100644 --- a/kubernetes/typed/node/v1/fake/fake_runtimeclass.go +++ b/kubernetes/typed/node/v1/fake/fake_runtimeclass.go @@ -45,7 +45,7 @@ var runtimeclassesKind = v1.SchemeGroupVersion.WithKind("RuntimeClass") func (c *FakeRuntimeClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RuntimeClass, err error) { emptyResult := &v1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(runtimeclassesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(runtimeclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeRuntimeClasses) Get(ctx context.Context, name string, options metav func (c *FakeRuntimeClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RuntimeClassList, err error) { emptyResult := &v1.RuntimeClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(runtimeclassesResource, runtimeclassesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(runtimeclassesResource, runtimeclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeRuntimeClasses) List(ctx context.Context, opts metav1.ListOptions) // Watch returns a watch.Interface that watches the requested runtimeClasses. func (c *FakeRuntimeClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(runtimeclassesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(runtimeclassesResource, opts)) } // Create takes the representation of a runtimeClass and creates it. Returns the server's representation of the runtimeClass, and an error, if there is any. func (c *FakeRuntimeClasses) Create(ctx context.Context, runtimeClass *v1.RuntimeClass, opts metav1.CreateOptions) (result *v1.RuntimeClass, err error) { emptyResult := &v1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(runtimeclassesResource, runtimeClass), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(runtimeclassesResource, runtimeClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeRuntimeClasses) Create(ctx context.Context, runtimeClass *v1.Runtim func (c *FakeRuntimeClasses) Update(ctx context.Context, runtimeClass *v1.RuntimeClass, opts metav1.UpdateOptions) (result *v1.RuntimeClass, err error) { emptyResult := &v1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(runtimeclassesResource, runtimeClass), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(runtimeclassesResource, runtimeClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeRuntimeClasses) Delete(ctx context.Context, name string, opts metav // DeleteCollection deletes a collection of objects. func (c *FakeRuntimeClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(runtimeclassesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(runtimeclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.RuntimeClassList{}) return err @@ -121,7 +121,7 @@ func (c *FakeRuntimeClasses) DeleteCollection(ctx context.Context, opts metav1.D func (c *FakeRuntimeClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RuntimeClass, err error) { emptyResult := &v1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(runtimeclassesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(runtimeclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeRuntimeClasses) Apply(ctx context.Context, runtimeClass *nodev1.Run } emptyResult := &v1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(runtimeclassesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(runtimeclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/node/v1alpha1/fake/fake_runtimeclass.go b/kubernetes/typed/node/v1alpha1/fake/fake_runtimeclass.go index 808bd4d406..bcd261d003 100644 --- a/kubernetes/typed/node/v1alpha1/fake/fake_runtimeclass.go +++ b/kubernetes/typed/node/v1alpha1/fake/fake_runtimeclass.go @@ -45,7 +45,7 @@ var runtimeclassesKind = v1alpha1.SchemeGroupVersion.WithKind("RuntimeClass") func (c *FakeRuntimeClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RuntimeClass, err error) { emptyResult := &v1alpha1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(runtimeclassesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(runtimeclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeRuntimeClasses) Get(ctx context.Context, name string, options v1.Ge func (c *FakeRuntimeClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RuntimeClassList, err error) { emptyResult := &v1alpha1.RuntimeClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(runtimeclassesResource, runtimeclassesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(runtimeclassesResource, runtimeclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeRuntimeClasses) List(ctx context.Context, opts v1.ListOptions) (res // Watch returns a watch.Interface that watches the requested runtimeClasses. func (c *FakeRuntimeClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(runtimeclassesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(runtimeclassesResource, opts)) } // Create takes the representation of a runtimeClass and creates it. Returns the server's representation of the runtimeClass, and an error, if there is any. func (c *FakeRuntimeClasses) Create(ctx context.Context, runtimeClass *v1alpha1.RuntimeClass, opts v1.CreateOptions) (result *v1alpha1.RuntimeClass, err error) { emptyResult := &v1alpha1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(runtimeclassesResource, runtimeClass), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(runtimeclassesResource, runtimeClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeRuntimeClasses) Create(ctx context.Context, runtimeClass *v1alpha1. func (c *FakeRuntimeClasses) Update(ctx context.Context, runtimeClass *v1alpha1.RuntimeClass, opts v1.UpdateOptions) (result *v1alpha1.RuntimeClass, err error) { emptyResult := &v1alpha1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(runtimeclassesResource, runtimeClass), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(runtimeclassesResource, runtimeClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeRuntimeClasses) Delete(ctx context.Context, name string, opts v1.De // DeleteCollection deletes a collection of objects. func (c *FakeRuntimeClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(runtimeclassesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(runtimeclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.RuntimeClassList{}) return err @@ -121,7 +121,7 @@ func (c *FakeRuntimeClasses) DeleteCollection(ctx context.Context, opts v1.Delet func (c *FakeRuntimeClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RuntimeClass, err error) { emptyResult := &v1alpha1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(runtimeclassesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(runtimeclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeRuntimeClasses) Apply(ctx context.Context, runtimeClass *nodev1alph } emptyResult := &v1alpha1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(runtimeclassesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(runtimeclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/node/v1beta1/fake/fake_runtimeclass.go b/kubernetes/typed/node/v1beta1/fake/fake_runtimeclass.go index a450fb86a2..a3c8c018c5 100644 --- a/kubernetes/typed/node/v1beta1/fake/fake_runtimeclass.go +++ b/kubernetes/typed/node/v1beta1/fake/fake_runtimeclass.go @@ -45,7 +45,7 @@ var runtimeclassesKind = v1beta1.SchemeGroupVersion.WithKind("RuntimeClass") func (c *FakeRuntimeClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.RuntimeClass, err error) { emptyResult := &v1beta1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(runtimeclassesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(runtimeclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeRuntimeClasses) Get(ctx context.Context, name string, options v1.Ge func (c *FakeRuntimeClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RuntimeClassList, err error) { emptyResult := &v1beta1.RuntimeClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(runtimeclassesResource, runtimeclassesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(runtimeclassesResource, runtimeclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeRuntimeClasses) List(ctx context.Context, opts v1.ListOptions) (res // Watch returns a watch.Interface that watches the requested runtimeClasses. func (c *FakeRuntimeClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(runtimeclassesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(runtimeclassesResource, opts)) } // Create takes the representation of a runtimeClass and creates it. Returns the server's representation of the runtimeClass, and an error, if there is any. func (c *FakeRuntimeClasses) Create(ctx context.Context, runtimeClass *v1beta1.RuntimeClass, opts v1.CreateOptions) (result *v1beta1.RuntimeClass, err error) { emptyResult := &v1beta1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(runtimeclassesResource, runtimeClass), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(runtimeclassesResource, runtimeClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeRuntimeClasses) Create(ctx context.Context, runtimeClass *v1beta1.R func (c *FakeRuntimeClasses) Update(ctx context.Context, runtimeClass *v1beta1.RuntimeClass, opts v1.UpdateOptions) (result *v1beta1.RuntimeClass, err error) { emptyResult := &v1beta1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(runtimeclassesResource, runtimeClass), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(runtimeclassesResource, runtimeClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeRuntimeClasses) Delete(ctx context.Context, name string, opts v1.De // DeleteCollection deletes a collection of objects. func (c *FakeRuntimeClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(runtimeclassesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(runtimeclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.RuntimeClassList{}) return err @@ -121,7 +121,7 @@ func (c *FakeRuntimeClasses) DeleteCollection(ctx context.Context, opts v1.Delet func (c *FakeRuntimeClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.RuntimeClass, err error) { emptyResult := &v1beta1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(runtimeclassesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(runtimeclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeRuntimeClasses) Apply(ctx context.Context, runtimeClass *nodev1beta } emptyResult := &v1beta1.RuntimeClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(runtimeclassesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(runtimeclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/policy/v1/fake/fake_poddisruptionbudget.go b/kubernetes/typed/policy/v1/fake/fake_poddisruptionbudget.go index 1916b7d281..de2bcc1b09 100644 --- a/kubernetes/typed/policy/v1/fake/fake_poddisruptionbudget.go +++ b/kubernetes/typed/policy/v1/fake/fake_poddisruptionbudget.go @@ -46,7 +46,7 @@ var poddisruptionbudgetsKind = v1.SchemeGroupVersion.WithKind("PodDisruptionBudg func (c *FakePodDisruptionBudgets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PodDisruptionBudget, err error) { emptyResult := &v1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewGetAction(poddisruptionbudgetsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(poddisruptionbudgetsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakePodDisruptionBudgets) Get(ctx context.Context, name string, options func (c *FakePodDisruptionBudgets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodDisruptionBudgetList, err error) { emptyResult := &v1.PodDisruptionBudgetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(poddisruptionbudgetsResource, poddisruptionbudgetsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(poddisruptionbudgetsResource, poddisruptionbudgetsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakePodDisruptionBudgets) List(ctx context.Context, opts metav1.ListOpt // Watch returns a watch.Interface that watches the requested podDisruptionBudgets. func (c *FakePodDisruptionBudgets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(poddisruptionbudgetsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(poddisruptionbudgetsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakePodDisruptionBudgets) Watch(ctx context.Context, opts metav1.ListOp func (c *FakePodDisruptionBudgets) Create(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.CreateOptions) (result *v1.PodDisruptionBudget, err error) { emptyResult := &v1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(poddisruptionbudgetsResource, c.ns, podDisruptionBudget), emptyResult) + Invokes(testing.NewCreateActionWithOptions(poddisruptionbudgetsResource, c.ns, podDisruptionBudget, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakePodDisruptionBudgets) Create(ctx context.Context, podDisruptionBudg func (c *FakePodDisruptionBudgets) Update(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (result *v1.PodDisruptionBudget, err error) { emptyResult := &v1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(poddisruptionbudgetsResource, c.ns, podDisruptionBudget), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(poddisruptionbudgetsResource, c.ns, podDisruptionBudget, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakePodDisruptionBudgets) Update(ctx context.Context, podDisruptionBudg func (c *FakePodDisruptionBudgets) UpdateStatus(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (result *v1.PodDisruptionBudget, err error) { emptyResult := &v1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(poddisruptionbudgetsResource, "status", c.ns, podDisruptionBudget), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(poddisruptionbudgetsResource, "status", c.ns, podDisruptionBudget, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakePodDisruptionBudgets) Delete(ctx context.Context, name string, opts // DeleteCollection deletes a collection of objects. func (c *FakePodDisruptionBudgets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(poddisruptionbudgetsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(poddisruptionbudgetsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.PodDisruptionBudgetList{}) return err @@ -141,7 +141,7 @@ func (c *FakePodDisruptionBudgets) DeleteCollection(ctx context.Context, opts me func (c *FakePodDisruptionBudgets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodDisruptionBudget, err error) { emptyResult := &v1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(poddisruptionbudgetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakePodDisruptionBudgets) Apply(ctx context.Context, podDisruptionBudge } emptyResult := &v1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakePodDisruptionBudgets) ApplyStatus(ctx context.Context, podDisruptio } emptyResult := &v1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go b/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go index 6015f367b9..fbd9d01e07 100644 --- a/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go +++ b/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go @@ -46,7 +46,7 @@ var poddisruptionbudgetsKind = v1beta1.SchemeGroupVersion.WithKind("PodDisruptio func (c *FakePodDisruptionBudgets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PodDisruptionBudget, err error) { emptyResult := &v1beta1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewGetAction(poddisruptionbudgetsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(poddisruptionbudgetsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakePodDisruptionBudgets) Get(ctx context.Context, name string, options func (c *FakePodDisruptionBudgets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PodDisruptionBudgetList, err error) { emptyResult := &v1beta1.PodDisruptionBudgetList{} obj, err := c.Fake. - Invokes(testing.NewListAction(poddisruptionbudgetsResource, poddisruptionbudgetsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(poddisruptionbudgetsResource, poddisruptionbudgetsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakePodDisruptionBudgets) List(ctx context.Context, opts v1.ListOptions // Watch returns a watch.Interface that watches the requested podDisruptionBudgets. func (c *FakePodDisruptionBudgets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(poddisruptionbudgetsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(poddisruptionbudgetsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakePodDisruptionBudgets) Watch(ctx context.Context, opts v1.ListOption func (c *FakePodDisruptionBudgets) Create(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.CreateOptions) (result *v1beta1.PodDisruptionBudget, err error) { emptyResult := &v1beta1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(poddisruptionbudgetsResource, c.ns, podDisruptionBudget), emptyResult) + Invokes(testing.NewCreateActionWithOptions(poddisruptionbudgetsResource, c.ns, podDisruptionBudget, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakePodDisruptionBudgets) Create(ctx context.Context, podDisruptionBudg func (c *FakePodDisruptionBudgets) Update(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.UpdateOptions) (result *v1beta1.PodDisruptionBudget, err error) { emptyResult := &v1beta1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(poddisruptionbudgetsResource, c.ns, podDisruptionBudget), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(poddisruptionbudgetsResource, c.ns, podDisruptionBudget, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakePodDisruptionBudgets) Update(ctx context.Context, podDisruptionBudg func (c *FakePodDisruptionBudgets) UpdateStatus(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.UpdateOptions) (result *v1beta1.PodDisruptionBudget, err error) { emptyResult := &v1beta1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(poddisruptionbudgetsResource, "status", c.ns, podDisruptionBudget), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(poddisruptionbudgetsResource, "status", c.ns, podDisruptionBudget, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakePodDisruptionBudgets) Delete(ctx context.Context, name string, opts // DeleteCollection deletes a collection of objects. func (c *FakePodDisruptionBudgets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(poddisruptionbudgetsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(poddisruptionbudgetsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.PodDisruptionBudgetList{}) return err @@ -141,7 +141,7 @@ func (c *FakePodDisruptionBudgets) DeleteCollection(ctx context.Context, opts v1 func (c *FakePodDisruptionBudgets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PodDisruptionBudget, err error) { emptyResult := &v1beta1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(poddisruptionbudgetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakePodDisruptionBudgets) Apply(ctx context.Context, podDisruptionBudge } emptyResult := &v1beta1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakePodDisruptionBudgets) ApplyStatus(ctx context.Context, podDisruptio } emptyResult := &v1beta1.PodDisruptionBudget{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(poddisruptionbudgetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go b/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go index ef6c57d767..6df91b1a86 100644 --- a/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go +++ b/kubernetes/typed/rbac/v1/fake/fake_clusterrole.go @@ -45,7 +45,7 @@ var clusterrolesKind = v1.SchemeGroupVersion.WithKind("ClusterRole") func (c *FakeClusterRoles) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterRole, err error) { emptyResult := &v1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clusterrolesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(clusterrolesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeClusterRoles) Get(ctx context.Context, name string, options metav1. func (c *FakeClusterRoles) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleList, err error) { emptyResult := &v1.ClusterRoleList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(clusterrolesResource, clusterrolesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(clusterrolesResource, clusterrolesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeClusterRoles) List(ctx context.Context, opts metav1.ListOptions) (r // Watch returns a watch.Interface that watches the requested clusterRoles. func (c *FakeClusterRoles) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(clusterrolesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(clusterrolesResource, opts)) } // Create takes the representation of a clusterRole and creates it. Returns the server's representation of the clusterRole, and an error, if there is any. func (c *FakeClusterRoles) Create(ctx context.Context, clusterRole *v1.ClusterRole, opts metav1.CreateOptions) (result *v1.ClusterRole, err error) { emptyResult := &v1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clusterrolesResource, clusterRole), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(clusterrolesResource, clusterRole, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeClusterRoles) Create(ctx context.Context, clusterRole *v1.ClusterRo func (c *FakeClusterRoles) Update(ctx context.Context, clusterRole *v1.ClusterRole, opts metav1.UpdateOptions) (result *v1.ClusterRole, err error) { emptyResult := &v1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clusterrolesResource, clusterRole), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(clusterrolesResource, clusterRole, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeClusterRoles) Delete(ctx context.Context, name string, opts metav1. // DeleteCollection deletes a collection of objects. func (c *FakeClusterRoles) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clusterrolesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(clusterrolesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ClusterRoleList{}) return err @@ -121,7 +121,7 @@ func (c *FakeClusterRoles) DeleteCollection(ctx context.Context, opts metav1.Del func (c *FakeClusterRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterRole, err error) { emptyResult := &v1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeClusterRoles) Apply(ctx context.Context, clusterRole *rbacv1.Cluste } emptyResult := &v1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go b/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go index 5ffc0be3ea..6f3251408c 100644 --- a/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go +++ b/kubernetes/typed/rbac/v1/fake/fake_clusterrolebinding.go @@ -45,7 +45,7 @@ var clusterrolebindingsKind = v1.SchemeGroupVersion.WithKind("ClusterRoleBinding func (c *FakeClusterRoleBindings) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterRoleBinding, err error) { emptyResult := &v1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clusterrolebindingsResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(clusterrolebindingsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeClusterRoleBindings) Get(ctx context.Context, name string, options func (c *FakeClusterRoleBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleBindingList, err error) { emptyResult := &v1.ClusterRoleBindingList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(clusterrolebindingsResource, clusterrolebindingsKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(clusterrolebindingsResource, clusterrolebindingsKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeClusterRoleBindings) List(ctx context.Context, opts metav1.ListOpti // Watch returns a watch.Interface that watches the requested clusterRoleBindings. func (c *FakeClusterRoleBindings) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(clusterrolebindingsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(clusterrolebindingsResource, opts)) } // Create takes the representation of a clusterRoleBinding and creates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. func (c *FakeClusterRoleBindings) Create(ctx context.Context, clusterRoleBinding *v1.ClusterRoleBinding, opts metav1.CreateOptions) (result *v1.ClusterRoleBinding, err error) { emptyResult := &v1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clusterrolebindingsResource, clusterRoleBinding), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(clusterrolebindingsResource, clusterRoleBinding, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeClusterRoleBindings) Create(ctx context.Context, clusterRoleBinding func (c *FakeClusterRoleBindings) Update(ctx context.Context, clusterRoleBinding *v1.ClusterRoleBinding, opts metav1.UpdateOptions) (result *v1.ClusterRoleBinding, err error) { emptyResult := &v1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clusterrolebindingsResource, clusterRoleBinding), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(clusterrolebindingsResource, clusterRoleBinding, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeClusterRoleBindings) Delete(ctx context.Context, name string, opts // DeleteCollection deletes a collection of objects. func (c *FakeClusterRoleBindings) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clusterrolebindingsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(clusterrolebindingsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.ClusterRoleBindingList{}) return err @@ -121,7 +121,7 @@ func (c *FakeClusterRoleBindings) DeleteCollection(ctx context.Context, opts met func (c *FakeClusterRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterRoleBinding, err error) { emptyResult := &v1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolebindingsResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolebindingsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeClusterRoleBindings) Apply(ctx context.Context, clusterRoleBinding } emptyResult := &v1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolebindingsResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolebindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/rbac/v1/fake/fake_role.go b/kubernetes/typed/rbac/v1/fake/fake_role.go index ef5e736707..ba9161940b 100644 --- a/kubernetes/typed/rbac/v1/fake/fake_role.go +++ b/kubernetes/typed/rbac/v1/fake/fake_role.go @@ -46,7 +46,7 @@ var rolesKind = v1.SchemeGroupVersion.WithKind("Role") func (c *FakeRoles) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Role, err error) { emptyResult := &v1.Role{} obj, err := c.Fake. - Invokes(testing.NewGetAction(rolesResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(rolesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeRoles) Get(ctx context.Context, name string, options metav1.GetOpti func (c *FakeRoles) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleList, err error) { emptyResult := &v1.RoleList{} obj, err := c.Fake. - Invokes(testing.NewListAction(rolesResource, rolesKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(rolesResource, rolesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeRoles) List(ctx context.Context, opts metav1.ListOptions) (result * // Watch returns a watch.Interface that watches the requested roles. func (c *FakeRoles) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(rolesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(rolesResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeRoles) Watch(ctx context.Context, opts metav1.ListOptions) (watch.I func (c *FakeRoles) Create(ctx context.Context, role *v1.Role, opts metav1.CreateOptions) (result *v1.Role, err error) { emptyResult := &v1.Role{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(rolesResource, c.ns, role), emptyResult) + Invokes(testing.NewCreateActionWithOptions(rolesResource, c.ns, role, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeRoles) Create(ctx context.Context, role *v1.Role, opts metav1.Creat func (c *FakeRoles) Update(ctx context.Context, role *v1.Role, opts metav1.UpdateOptions) (result *v1.Role, err error) { emptyResult := &v1.Role{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(rolesResource, c.ns, role), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(rolesResource, c.ns, role, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeRoles) Delete(ctx context.Context, name string, opts metav1.DeleteO // DeleteCollection deletes a collection of objects. func (c *FakeRoles) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(rolesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(rolesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.RoleList{}) return err @@ -128,7 +128,7 @@ func (c *FakeRoles) DeleteCollection(ctx context.Context, opts metav1.DeleteOpti func (c *FakeRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Role, err error) { emptyResult := &v1.Role{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolesResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(rolesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeRoles) Apply(ctx context.Context, role *rbacv1.RoleApplyConfigurati } emptyResult := &v1.Role{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(rolesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go b/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go index e9624cd2e4..6d7d7d1933 100644 --- a/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go +++ b/kubernetes/typed/rbac/v1/fake/fake_rolebinding.go @@ -46,7 +46,7 @@ var rolebindingsKind = v1.SchemeGroupVersion.WithKind("RoleBinding") func (c *FakeRoleBindings) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RoleBinding, err error) { emptyResult := &v1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewGetAction(rolebindingsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(rolebindingsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeRoleBindings) Get(ctx context.Context, name string, options metav1. func (c *FakeRoleBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleBindingList, err error) { emptyResult := &v1.RoleBindingList{} obj, err := c.Fake. - Invokes(testing.NewListAction(rolebindingsResource, rolebindingsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(rolebindingsResource, rolebindingsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeRoleBindings) List(ctx context.Context, opts metav1.ListOptions) (r // Watch returns a watch.Interface that watches the requested roleBindings. func (c *FakeRoleBindings) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(rolebindingsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(rolebindingsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeRoleBindings) Watch(ctx context.Context, opts metav1.ListOptions) ( func (c *FakeRoleBindings) Create(ctx context.Context, roleBinding *v1.RoleBinding, opts metav1.CreateOptions) (result *v1.RoleBinding, err error) { emptyResult := &v1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(rolebindingsResource, c.ns, roleBinding), emptyResult) + Invokes(testing.NewCreateActionWithOptions(rolebindingsResource, c.ns, roleBinding, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeRoleBindings) Create(ctx context.Context, roleBinding *v1.RoleBindi func (c *FakeRoleBindings) Update(ctx context.Context, roleBinding *v1.RoleBinding, opts metav1.UpdateOptions) (result *v1.RoleBinding, err error) { emptyResult := &v1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(rolebindingsResource, c.ns, roleBinding), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(rolebindingsResource, c.ns, roleBinding, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeRoleBindings) Delete(ctx context.Context, name string, opts metav1. // DeleteCollection deletes a collection of objects. func (c *FakeRoleBindings) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(rolebindingsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(rolebindingsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.RoleBindingList{}) return err @@ -128,7 +128,7 @@ func (c *FakeRoleBindings) DeleteCollection(ctx context.Context, opts metav1.Del func (c *FakeRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RoleBinding, err error) { emptyResult := &v1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolebindingsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(rolebindingsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeRoleBindings) Apply(ctx context.Context, roleBinding *rbacv1.RoleBi } emptyResult := &v1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolebindingsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(rolebindingsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go b/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go index f953a91c67..34c9a853ea 100644 --- a/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go +++ b/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go @@ -45,7 +45,7 @@ var clusterrolesKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterRole") func (c *FakeClusterRoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterRole, err error) { emptyResult := &v1alpha1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clusterrolesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(clusterrolesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeClusterRoles) Get(ctx context.Context, name string, options v1.GetO func (c *FakeClusterRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleList, err error) { emptyResult := &v1alpha1.ClusterRoleList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(clusterrolesResource, clusterrolesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(clusterrolesResource, clusterrolesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeClusterRoles) List(ctx context.Context, opts v1.ListOptions) (resul // Watch returns a watch.Interface that watches the requested clusterRoles. func (c *FakeClusterRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(clusterrolesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(clusterrolesResource, opts)) } // Create takes the representation of a clusterRole and creates it. Returns the server's representation of the clusterRole, and an error, if there is any. func (c *FakeClusterRoles) Create(ctx context.Context, clusterRole *v1alpha1.ClusterRole, opts v1.CreateOptions) (result *v1alpha1.ClusterRole, err error) { emptyResult := &v1alpha1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clusterrolesResource, clusterRole), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(clusterrolesResource, clusterRole, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeClusterRoles) Create(ctx context.Context, clusterRole *v1alpha1.Clu func (c *FakeClusterRoles) Update(ctx context.Context, clusterRole *v1alpha1.ClusterRole, opts v1.UpdateOptions) (result *v1alpha1.ClusterRole, err error) { emptyResult := &v1alpha1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clusterrolesResource, clusterRole), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(clusterrolesResource, clusterRole, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeClusterRoles) Delete(ctx context.Context, name string, opts v1.Dele // DeleteCollection deletes a collection of objects. func (c *FakeClusterRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clusterrolesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(clusterrolesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.ClusterRoleList{}) return err @@ -121,7 +121,7 @@ func (c *FakeClusterRoles) DeleteCollection(ctx context.Context, opts v1.DeleteO func (c *FakeClusterRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterRole, err error) { emptyResult := &v1alpha1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeClusterRoles) Apply(ctx context.Context, clusterRole *rbacv1alpha1. } emptyResult := &v1alpha1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go b/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go index 7b0ee96c79..d42f763421 100644 --- a/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go +++ b/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go @@ -45,7 +45,7 @@ var clusterrolebindingsKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterRoleB func (c *FakeClusterRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterRoleBinding, err error) { emptyResult := &v1alpha1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clusterrolebindingsResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(clusterrolebindingsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeClusterRoleBindings) Get(ctx context.Context, name string, options func (c *FakeClusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleBindingList, err error) { emptyResult := &v1alpha1.ClusterRoleBindingList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(clusterrolebindingsResource, clusterrolebindingsKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(clusterrolebindingsResource, clusterrolebindingsKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeClusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) // Watch returns a watch.Interface that watches the requested clusterRoleBindings. func (c *FakeClusterRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(clusterrolebindingsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(clusterrolebindingsResource, opts)) } // Create takes the representation of a clusterRoleBinding and creates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. func (c *FakeClusterRoleBindings) Create(ctx context.Context, clusterRoleBinding *v1alpha1.ClusterRoleBinding, opts v1.CreateOptions) (result *v1alpha1.ClusterRoleBinding, err error) { emptyResult := &v1alpha1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clusterrolebindingsResource, clusterRoleBinding), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(clusterrolebindingsResource, clusterRoleBinding, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeClusterRoleBindings) Create(ctx context.Context, clusterRoleBinding func (c *FakeClusterRoleBindings) Update(ctx context.Context, clusterRoleBinding *v1alpha1.ClusterRoleBinding, opts v1.UpdateOptions) (result *v1alpha1.ClusterRoleBinding, err error) { emptyResult := &v1alpha1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clusterrolebindingsResource, clusterRoleBinding), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(clusterrolebindingsResource, clusterRoleBinding, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeClusterRoleBindings) Delete(ctx context.Context, name string, opts // DeleteCollection deletes a collection of objects. func (c *FakeClusterRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clusterrolebindingsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(clusterrolebindingsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.ClusterRoleBindingList{}) return err @@ -121,7 +121,7 @@ func (c *FakeClusterRoleBindings) DeleteCollection(ctx context.Context, opts v1. func (c *FakeClusterRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterRoleBinding, err error) { emptyResult := &v1alpha1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolebindingsResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolebindingsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeClusterRoleBindings) Apply(ctx context.Context, clusterRoleBinding } emptyResult := &v1alpha1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolebindingsResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolebindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go b/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go index 738180ce85..9b0ba7cac6 100644 --- a/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go +++ b/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go @@ -46,7 +46,7 @@ var rolesKind = v1alpha1.SchemeGroupVersion.WithKind("Role") func (c *FakeRoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Role, err error) { emptyResult := &v1alpha1.Role{} obj, err := c.Fake. - Invokes(testing.NewGetAction(rolesResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(rolesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeRoles) Get(ctx context.Context, name string, options v1.GetOptions) func (c *FakeRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleList, err error) { emptyResult := &v1alpha1.RoleList{} obj, err := c.Fake. - Invokes(testing.NewListAction(rolesResource, rolesKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(rolesResource, rolesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1al // Watch returns a watch.Interface that watches the requested roles. func (c *FakeRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(rolesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(rolesResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Inter func (c *FakeRoles) Create(ctx context.Context, role *v1alpha1.Role, opts v1.CreateOptions) (result *v1alpha1.Role, err error) { emptyResult := &v1alpha1.Role{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(rolesResource, c.ns, role), emptyResult) + Invokes(testing.NewCreateActionWithOptions(rolesResource, c.ns, role, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeRoles) Create(ctx context.Context, role *v1alpha1.Role, opts v1.Cre func (c *FakeRoles) Update(ctx context.Context, role *v1alpha1.Role, opts v1.UpdateOptions) (result *v1alpha1.Role, err error) { emptyResult := &v1alpha1.Role{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(rolesResource, c.ns, role), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(rolesResource, c.ns, role, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptio // DeleteCollection deletes a collection of objects. func (c *FakeRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(rolesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(rolesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.RoleList{}) return err @@ -128,7 +128,7 @@ func (c *FakeRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, func (c *FakeRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Role, err error) { emptyResult := &v1alpha1.Role{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolesResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(rolesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeRoles) Apply(ctx context.Context, role *rbacv1alpha1.RoleApplyConfi } emptyResult := &v1alpha1.Role{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(rolesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go b/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go index 3fb9549b8d..f572945aca 100644 --- a/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go +++ b/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go @@ -46,7 +46,7 @@ var rolebindingsKind = v1alpha1.SchemeGroupVersion.WithKind("RoleBinding") func (c *FakeRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RoleBinding, err error) { emptyResult := &v1alpha1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewGetAction(rolebindingsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(rolebindingsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeRoleBindings) Get(ctx context.Context, name string, options v1.GetO func (c *FakeRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleBindingList, err error) { emptyResult := &v1alpha1.RoleBindingList{} obj, err := c.Fake. - Invokes(testing.NewListAction(rolebindingsResource, rolebindingsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(rolebindingsResource, rolebindingsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeRoleBindings) List(ctx context.Context, opts v1.ListOptions) (resul // Watch returns a watch.Interface that watches the requested roleBindings. func (c *FakeRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(rolebindingsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(rolebindingsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watc func (c *FakeRoleBindings) Create(ctx context.Context, roleBinding *v1alpha1.RoleBinding, opts v1.CreateOptions) (result *v1alpha1.RoleBinding, err error) { emptyResult := &v1alpha1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(rolebindingsResource, c.ns, roleBinding), emptyResult) + Invokes(testing.NewCreateActionWithOptions(rolebindingsResource, c.ns, roleBinding, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeRoleBindings) Create(ctx context.Context, roleBinding *v1alpha1.Rol func (c *FakeRoleBindings) Update(ctx context.Context, roleBinding *v1alpha1.RoleBinding, opts v1.UpdateOptions) (result *v1alpha1.RoleBinding, err error) { emptyResult := &v1alpha1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(rolebindingsResource, c.ns, roleBinding), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(rolebindingsResource, c.ns, roleBinding, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeRoleBindings) Delete(ctx context.Context, name string, opts v1.Dele // DeleteCollection deletes a collection of objects. func (c *FakeRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(rolebindingsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(rolebindingsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.RoleBindingList{}) return err @@ -128,7 +128,7 @@ func (c *FakeRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteO func (c *FakeRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RoleBinding, err error) { emptyResult := &v1alpha1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolebindingsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(rolebindingsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeRoleBindings) Apply(ctx context.Context, roleBinding *rbacv1alpha1. } emptyResult := &v1alpha1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolebindingsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(rolebindingsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go b/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go index da45ac6f0f..b7996c106f 100644 --- a/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go +++ b/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrole.go @@ -45,7 +45,7 @@ var clusterrolesKind = v1beta1.SchemeGroupVersion.WithKind("ClusterRole") func (c *FakeClusterRoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterRole, err error) { emptyResult := &v1beta1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clusterrolesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(clusterrolesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeClusterRoles) Get(ctx context.Context, name string, options v1.GetO func (c *FakeClusterRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleList, err error) { emptyResult := &v1beta1.ClusterRoleList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(clusterrolesResource, clusterrolesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(clusterrolesResource, clusterrolesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeClusterRoles) List(ctx context.Context, opts v1.ListOptions) (resul // Watch returns a watch.Interface that watches the requested clusterRoles. func (c *FakeClusterRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(clusterrolesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(clusterrolesResource, opts)) } // Create takes the representation of a clusterRole and creates it. Returns the server's representation of the clusterRole, and an error, if there is any. func (c *FakeClusterRoles) Create(ctx context.Context, clusterRole *v1beta1.ClusterRole, opts v1.CreateOptions) (result *v1beta1.ClusterRole, err error) { emptyResult := &v1beta1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clusterrolesResource, clusterRole), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(clusterrolesResource, clusterRole, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeClusterRoles) Create(ctx context.Context, clusterRole *v1beta1.Clus func (c *FakeClusterRoles) Update(ctx context.Context, clusterRole *v1beta1.ClusterRole, opts v1.UpdateOptions) (result *v1beta1.ClusterRole, err error) { emptyResult := &v1beta1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clusterrolesResource, clusterRole), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(clusterrolesResource, clusterRole, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeClusterRoles) Delete(ctx context.Context, name string, opts v1.Dele // DeleteCollection deletes a collection of objects. func (c *FakeClusterRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clusterrolesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(clusterrolesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.ClusterRoleList{}) return err @@ -121,7 +121,7 @@ func (c *FakeClusterRoles) DeleteCollection(ctx context.Context, opts v1.DeleteO func (c *FakeClusterRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterRole, err error) { emptyResult := &v1beta1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeClusterRoles) Apply(ctx context.Context, clusterRole *rbacv1beta1.C } emptyResult := &v1beta1.ClusterRole{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go b/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go index fc7de1d683..8843757ace 100644 --- a/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go +++ b/kubernetes/typed/rbac/v1beta1/fake/fake_clusterrolebinding.go @@ -45,7 +45,7 @@ var clusterrolebindingsKind = v1beta1.SchemeGroupVersion.WithKind("ClusterRoleBi func (c *FakeClusterRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterRoleBinding, err error) { emptyResult := &v1beta1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clusterrolebindingsResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(clusterrolebindingsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeClusterRoleBindings) Get(ctx context.Context, name string, options func (c *FakeClusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleBindingList, err error) { emptyResult := &v1beta1.ClusterRoleBindingList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(clusterrolebindingsResource, clusterrolebindingsKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(clusterrolebindingsResource, clusterrolebindingsKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeClusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) // Watch returns a watch.Interface that watches the requested clusterRoleBindings. func (c *FakeClusterRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(clusterrolebindingsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(clusterrolebindingsResource, opts)) } // Create takes the representation of a clusterRoleBinding and creates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. func (c *FakeClusterRoleBindings) Create(ctx context.Context, clusterRoleBinding *v1beta1.ClusterRoleBinding, opts v1.CreateOptions) (result *v1beta1.ClusterRoleBinding, err error) { emptyResult := &v1beta1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clusterrolebindingsResource, clusterRoleBinding), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(clusterrolebindingsResource, clusterRoleBinding, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeClusterRoleBindings) Create(ctx context.Context, clusterRoleBinding func (c *FakeClusterRoleBindings) Update(ctx context.Context, clusterRoleBinding *v1beta1.ClusterRoleBinding, opts v1.UpdateOptions) (result *v1beta1.ClusterRoleBinding, err error) { emptyResult := &v1beta1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clusterrolebindingsResource, clusterRoleBinding), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(clusterrolebindingsResource, clusterRoleBinding, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeClusterRoleBindings) Delete(ctx context.Context, name string, opts // DeleteCollection deletes a collection of objects. func (c *FakeClusterRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clusterrolebindingsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(clusterrolebindingsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.ClusterRoleBindingList{}) return err @@ -121,7 +121,7 @@ func (c *FakeClusterRoleBindings) DeleteCollection(ctx context.Context, opts v1. func (c *FakeClusterRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterRoleBinding, err error) { emptyResult := &v1beta1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolebindingsResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolebindingsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeClusterRoleBindings) Apply(ctx context.Context, clusterRoleBinding } emptyResult := &v1beta1.ClusterRoleBinding{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterrolebindingsResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterrolebindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/rbac/v1beta1/fake/fake_role.go b/kubernetes/typed/rbac/v1beta1/fake/fake_role.go index 6f7b59c2c1..aa0fe28a13 100644 --- a/kubernetes/typed/rbac/v1beta1/fake/fake_role.go +++ b/kubernetes/typed/rbac/v1beta1/fake/fake_role.go @@ -46,7 +46,7 @@ var rolesKind = v1beta1.SchemeGroupVersion.WithKind("Role") func (c *FakeRoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Role, err error) { emptyResult := &v1beta1.Role{} obj, err := c.Fake. - Invokes(testing.NewGetAction(rolesResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(rolesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeRoles) Get(ctx context.Context, name string, options v1.GetOptions) func (c *FakeRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleList, err error) { emptyResult := &v1beta1.RoleList{} obj, err := c.Fake. - Invokes(testing.NewListAction(rolesResource, rolesKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(rolesResource, rolesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1be // Watch returns a watch.Interface that watches the requested roles. func (c *FakeRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(rolesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(rolesResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Inter func (c *FakeRoles) Create(ctx context.Context, role *v1beta1.Role, opts v1.CreateOptions) (result *v1beta1.Role, err error) { emptyResult := &v1beta1.Role{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(rolesResource, c.ns, role), emptyResult) + Invokes(testing.NewCreateActionWithOptions(rolesResource, c.ns, role, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeRoles) Create(ctx context.Context, role *v1beta1.Role, opts v1.Crea func (c *FakeRoles) Update(ctx context.Context, role *v1beta1.Role, opts v1.UpdateOptions) (result *v1beta1.Role, err error) { emptyResult := &v1beta1.Role{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(rolesResource, c.ns, role), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(rolesResource, c.ns, role, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptio // DeleteCollection deletes a collection of objects. func (c *FakeRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(rolesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(rolesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.RoleList{}) return err @@ -128,7 +128,7 @@ func (c *FakeRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, func (c *FakeRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Role, err error) { emptyResult := &v1beta1.Role{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolesResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(rolesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeRoles) Apply(ctx context.Context, role *rbacv1beta1.RoleApplyConfig } emptyResult := &v1beta1.Role{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(rolesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go b/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go index 7bbf5aceff..26c3c80458 100644 --- a/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go +++ b/kubernetes/typed/rbac/v1beta1/fake/fake_rolebinding.go @@ -46,7 +46,7 @@ var rolebindingsKind = v1beta1.SchemeGroupVersion.WithKind("RoleBinding") func (c *FakeRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.RoleBinding, err error) { emptyResult := &v1beta1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewGetAction(rolebindingsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(rolebindingsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeRoleBindings) Get(ctx context.Context, name string, options v1.GetO func (c *FakeRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleBindingList, err error) { emptyResult := &v1beta1.RoleBindingList{} obj, err := c.Fake. - Invokes(testing.NewListAction(rolebindingsResource, rolebindingsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(rolebindingsResource, rolebindingsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeRoleBindings) List(ctx context.Context, opts v1.ListOptions) (resul // Watch returns a watch.Interface that watches the requested roleBindings. func (c *FakeRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(rolebindingsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(rolebindingsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watc func (c *FakeRoleBindings) Create(ctx context.Context, roleBinding *v1beta1.RoleBinding, opts v1.CreateOptions) (result *v1beta1.RoleBinding, err error) { emptyResult := &v1beta1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(rolebindingsResource, c.ns, roleBinding), emptyResult) + Invokes(testing.NewCreateActionWithOptions(rolebindingsResource, c.ns, roleBinding, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeRoleBindings) Create(ctx context.Context, roleBinding *v1beta1.Role func (c *FakeRoleBindings) Update(ctx context.Context, roleBinding *v1beta1.RoleBinding, opts v1.UpdateOptions) (result *v1beta1.RoleBinding, err error) { emptyResult := &v1beta1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(rolebindingsResource, c.ns, roleBinding), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(rolebindingsResource, c.ns, roleBinding, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeRoleBindings) Delete(ctx context.Context, name string, opts v1.Dele // DeleteCollection deletes a collection of objects. func (c *FakeRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(rolebindingsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(rolebindingsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.RoleBindingList{}) return err @@ -128,7 +128,7 @@ func (c *FakeRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteO func (c *FakeRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.RoleBinding, err error) { emptyResult := &v1beta1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolebindingsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(rolebindingsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeRoleBindings) Apply(ctx context.Context, roleBinding *rbacv1beta1.R } emptyResult := &v1beta1.RoleBinding{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(rolebindingsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(rolebindingsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_podschedulingcontext.go b/kubernetes/typed/resource/v1alpha2/fake/fake_podschedulingcontext.go index 6fda8c53a2..b208415522 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_podschedulingcontext.go +++ b/kubernetes/typed/resource/v1alpha2/fake/fake_podschedulingcontext.go @@ -46,7 +46,7 @@ var podschedulingcontextsKind = v1alpha2.SchemeGroupVersion.WithKind("PodSchedul func (c *FakePodSchedulingContexts) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.PodSchedulingContext, err error) { emptyResult := &v1alpha2.PodSchedulingContext{} obj, err := c.Fake. - Invokes(testing.NewGetAction(podschedulingcontextsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(podschedulingcontextsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakePodSchedulingContexts) Get(ctx context.Context, name string, option func (c *FakePodSchedulingContexts) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.PodSchedulingContextList, err error) { emptyResult := &v1alpha2.PodSchedulingContextList{} obj, err := c.Fake. - Invokes(testing.NewListAction(podschedulingcontextsResource, podschedulingcontextsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(podschedulingcontextsResource, podschedulingcontextsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakePodSchedulingContexts) List(ctx context.Context, opts v1.ListOption // Watch returns a watch.Interface that watches the requested podSchedulingContexts. func (c *FakePodSchedulingContexts) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(podschedulingcontextsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(podschedulingcontextsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakePodSchedulingContexts) Watch(ctx context.Context, opts v1.ListOptio func (c *FakePodSchedulingContexts) Create(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.CreateOptions) (result *v1alpha2.PodSchedulingContext, err error) { emptyResult := &v1alpha2.PodSchedulingContext{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(podschedulingcontextsResource, c.ns, podSchedulingContext), emptyResult) + Invokes(testing.NewCreateActionWithOptions(podschedulingcontextsResource, c.ns, podSchedulingContext, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakePodSchedulingContexts) Create(ctx context.Context, podSchedulingCon func (c *FakePodSchedulingContexts) Update(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.UpdateOptions) (result *v1alpha2.PodSchedulingContext, err error) { emptyResult := &v1alpha2.PodSchedulingContext{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(podschedulingcontextsResource, c.ns, podSchedulingContext), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(podschedulingcontextsResource, c.ns, podSchedulingContext, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakePodSchedulingContexts) Update(ctx context.Context, podSchedulingCon func (c *FakePodSchedulingContexts) UpdateStatus(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.UpdateOptions) (result *v1alpha2.PodSchedulingContext, err error) { emptyResult := &v1alpha2.PodSchedulingContext{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(podschedulingcontextsResource, "status", c.ns, podSchedulingContext), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(podschedulingcontextsResource, "status", c.ns, podSchedulingContext, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakePodSchedulingContexts) Delete(ctx context.Context, name string, opt // DeleteCollection deletes a collection of objects. func (c *FakePodSchedulingContexts) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(podschedulingcontextsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(podschedulingcontextsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha2.PodSchedulingContextList{}) return err @@ -141,7 +141,7 @@ func (c *FakePodSchedulingContexts) DeleteCollection(ctx context.Context, opts v func (c *FakePodSchedulingContexts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.PodSchedulingContext, err error) { emptyResult := &v1alpha2.PodSchedulingContext{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(podschedulingcontextsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(podschedulingcontextsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakePodSchedulingContexts) Apply(ctx context.Context, podSchedulingCont } emptyResult := &v1alpha2.PodSchedulingContext{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(podschedulingcontextsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(podschedulingcontextsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakePodSchedulingContexts) ApplyStatus(ctx context.Context, podScheduli } emptyResult := &v1alpha2.PodSchedulingContext{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(podschedulingcontextsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(podschedulingcontextsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaim.go b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaim.go index 30fb78ce80..f0d028ba27 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaim.go +++ b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaim.go @@ -46,7 +46,7 @@ var resourceclaimsKind = v1alpha2.SchemeGroupVersion.WithKind("ResourceClaim") func (c *FakeResourceClaims) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClaim, err error) { emptyResult := &v1alpha2.ResourceClaim{} obj, err := c.Fake. - Invokes(testing.NewGetAction(resourceclaimsResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(resourceclaimsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeResourceClaims) Get(ctx context.Context, name string, options v1.Ge func (c *FakeResourceClaims) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimList, err error) { emptyResult := &v1alpha2.ResourceClaimList{} obj, err := c.Fake. - Invokes(testing.NewListAction(resourceclaimsResource, resourceclaimsKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(resourceclaimsResource, resourceclaimsKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeResourceClaims) List(ctx context.Context, opts v1.ListOptions) (res // Watch returns a watch.Interface that watches the requested resourceClaims. func (c *FakeResourceClaims) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(resourceclaimsResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(resourceclaimsResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeResourceClaims) Watch(ctx context.Context, opts v1.ListOptions) (wa func (c *FakeResourceClaims) Create(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.CreateOptions) (result *v1alpha2.ResourceClaim, err error) { emptyResult := &v1alpha2.ResourceClaim{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(resourceclaimsResource, c.ns, resourceClaim), emptyResult) + Invokes(testing.NewCreateActionWithOptions(resourceclaimsResource, c.ns, resourceClaim, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeResourceClaims) Create(ctx context.Context, resourceClaim *v1alpha2 func (c *FakeResourceClaims) Update(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.UpdateOptions) (result *v1alpha2.ResourceClaim, err error) { emptyResult := &v1alpha2.ResourceClaim{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(resourceclaimsResource, c.ns, resourceClaim), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(resourceclaimsResource, c.ns, resourceClaim, opts), emptyResult) if obj == nil { return emptyResult, err @@ -113,7 +113,7 @@ func (c *FakeResourceClaims) Update(ctx context.Context, resourceClaim *v1alpha2 func (c *FakeResourceClaims) UpdateStatus(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.UpdateOptions) (result *v1alpha2.ResourceClaim, err error) { emptyResult := &v1alpha2.ResourceClaim{} obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(resourceclaimsResource, "status", c.ns, resourceClaim), emptyResult) + Invokes(testing.NewUpdateSubresourceActionWithOptions(resourceclaimsResource, "status", c.ns, resourceClaim, opts), emptyResult) if obj == nil { return emptyResult, err @@ -131,7 +131,7 @@ func (c *FakeResourceClaims) Delete(ctx context.Context, name string, opts v1.De // DeleteCollection deletes a collection of objects. func (c *FakeResourceClaims) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(resourceclaimsResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(resourceclaimsResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha2.ResourceClaimList{}) return err @@ -141,7 +141,7 @@ func (c *FakeResourceClaims) DeleteCollection(ctx context.Context, opts v1.Delet func (c *FakeResourceClaims) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClaim, err error) { emptyResult := &v1alpha2.ResourceClaim{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourceclaimsResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -164,7 +164,7 @@ func (c *FakeResourceClaims) Apply(ctx context.Context, resourceClaim *resourcev } emptyResult := &v1alpha2.ResourceClaim{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourceclaimsResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err @@ -188,7 +188,7 @@ func (c *FakeResourceClaims) ApplyStatus(ctx context.Context, resourceClaim *res } emptyResult := &v1alpha2.ResourceClaim{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourceclaimsResource, c.ns, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimparameters.go b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimparameters.go index 0bd86e4f85..e141835ac0 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimparameters.go +++ b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimparameters.go @@ -46,7 +46,7 @@ var resourceclaimparametersKind = v1alpha2.SchemeGroupVersion.WithKind("Resource func (c *FakeResourceClaimParameters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClaimParameters, err error) { emptyResult := &v1alpha2.ResourceClaimParameters{} obj, err := c.Fake. - Invokes(testing.NewGetAction(resourceclaimparametersResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(resourceclaimparametersResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeResourceClaimParameters) Get(ctx context.Context, name string, opti func (c *FakeResourceClaimParameters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimParametersList, err error) { emptyResult := &v1alpha2.ResourceClaimParametersList{} obj, err := c.Fake. - Invokes(testing.NewListAction(resourceclaimparametersResource, resourceclaimparametersKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(resourceclaimparametersResource, resourceclaimparametersKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeResourceClaimParameters) List(ctx context.Context, opts v1.ListOpti // Watch returns a watch.Interface that watches the requested resourceClaimParameters. func (c *FakeResourceClaimParameters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(resourceclaimparametersResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(resourceclaimparametersResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeResourceClaimParameters) Watch(ctx context.Context, opts v1.ListOpt func (c *FakeResourceClaimParameters) Create(ctx context.Context, resourceClaimParameters *v1alpha2.ResourceClaimParameters, opts v1.CreateOptions) (result *v1alpha2.ResourceClaimParameters, err error) { emptyResult := &v1alpha2.ResourceClaimParameters{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(resourceclaimparametersResource, c.ns, resourceClaimParameters), emptyResult) + Invokes(testing.NewCreateActionWithOptions(resourceclaimparametersResource, c.ns, resourceClaimParameters, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeResourceClaimParameters) Create(ctx context.Context, resourceClaimP func (c *FakeResourceClaimParameters) Update(ctx context.Context, resourceClaimParameters *v1alpha2.ResourceClaimParameters, opts v1.UpdateOptions) (result *v1alpha2.ResourceClaimParameters, err error) { emptyResult := &v1alpha2.ResourceClaimParameters{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(resourceclaimparametersResource, c.ns, resourceClaimParameters), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(resourceclaimparametersResource, c.ns, resourceClaimParameters, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeResourceClaimParameters) Delete(ctx context.Context, name string, o // DeleteCollection deletes a collection of objects. func (c *FakeResourceClaimParameters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(resourceclaimparametersResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(resourceclaimparametersResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha2.ResourceClaimParametersList{}) return err @@ -128,7 +128,7 @@ func (c *FakeResourceClaimParameters) DeleteCollection(ctx context.Context, opts func (c *FakeResourceClaimParameters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClaimParameters, err error) { emptyResult := &v1alpha2.ResourceClaimParameters{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourceclaimparametersResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimparametersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeResourceClaimParameters) Apply(ctx context.Context, resourceClaimPa } emptyResult := &v1alpha2.ResourceClaimParameters{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourceclaimparametersResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimparametersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimtemplate.go b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimtemplate.go index 014356091e..f3bca1991b 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimtemplate.go +++ b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimtemplate.go @@ -46,7 +46,7 @@ var resourceclaimtemplatesKind = v1alpha2.SchemeGroupVersion.WithKind("ResourceC func (c *FakeResourceClaimTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClaimTemplate, err error) { emptyResult := &v1alpha2.ResourceClaimTemplate{} obj, err := c.Fake. - Invokes(testing.NewGetAction(resourceclaimtemplatesResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(resourceclaimtemplatesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeResourceClaimTemplates) Get(ctx context.Context, name string, optio func (c *FakeResourceClaimTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimTemplateList, err error) { emptyResult := &v1alpha2.ResourceClaimTemplateList{} obj, err := c.Fake. - Invokes(testing.NewListAction(resourceclaimtemplatesResource, resourceclaimtemplatesKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(resourceclaimtemplatesResource, resourceclaimtemplatesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeResourceClaimTemplates) List(ctx context.Context, opts v1.ListOptio // Watch returns a watch.Interface that watches the requested resourceClaimTemplates. func (c *FakeResourceClaimTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(resourceclaimtemplatesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(resourceclaimtemplatesResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeResourceClaimTemplates) Watch(ctx context.Context, opts v1.ListOpti func (c *FakeResourceClaimTemplates) Create(ctx context.Context, resourceClaimTemplate *v1alpha2.ResourceClaimTemplate, opts v1.CreateOptions) (result *v1alpha2.ResourceClaimTemplate, err error) { emptyResult := &v1alpha2.ResourceClaimTemplate{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(resourceclaimtemplatesResource, c.ns, resourceClaimTemplate), emptyResult) + Invokes(testing.NewCreateActionWithOptions(resourceclaimtemplatesResource, c.ns, resourceClaimTemplate, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeResourceClaimTemplates) Create(ctx context.Context, resourceClaimTe func (c *FakeResourceClaimTemplates) Update(ctx context.Context, resourceClaimTemplate *v1alpha2.ResourceClaimTemplate, opts v1.UpdateOptions) (result *v1alpha2.ResourceClaimTemplate, err error) { emptyResult := &v1alpha2.ResourceClaimTemplate{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(resourceclaimtemplatesResource, c.ns, resourceClaimTemplate), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(resourceclaimtemplatesResource, c.ns, resourceClaimTemplate, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeResourceClaimTemplates) Delete(ctx context.Context, name string, op // DeleteCollection deletes a collection of objects. func (c *FakeResourceClaimTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(resourceclaimtemplatesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(resourceclaimtemplatesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha2.ResourceClaimTemplateList{}) return err @@ -128,7 +128,7 @@ func (c *FakeResourceClaimTemplates) DeleteCollection(ctx context.Context, opts func (c *FakeResourceClaimTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClaimTemplate, err error) { emptyResult := &v1alpha2.ResourceClaimTemplate{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourceclaimtemplatesResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimtemplatesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeResourceClaimTemplates) Apply(ctx context.Context, resourceClaimTem } emptyResult := &v1alpha2.ResourceClaimTemplate{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourceclaimtemplatesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimtemplatesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclass.go b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclass.go index 6c4ea1045f..660f7c7f1d 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclass.go +++ b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclass.go @@ -45,7 +45,7 @@ var resourceclassesKind = v1alpha2.SchemeGroupVersion.WithKind("ResourceClass") func (c *FakeResourceClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClass, err error) { emptyResult := &v1alpha2.ResourceClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(resourceclassesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(resourceclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeResourceClasses) Get(ctx context.Context, name string, options v1.G func (c *FakeResourceClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassList, err error) { emptyResult := &v1alpha2.ResourceClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(resourceclassesResource, resourceclassesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(resourceclassesResource, resourceclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeResourceClasses) List(ctx context.Context, opts v1.ListOptions) (re // Watch returns a watch.Interface that watches the requested resourceClasses. func (c *FakeResourceClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(resourceclassesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(resourceclassesResource, opts)) } // Create takes the representation of a resourceClass and creates it. Returns the server's representation of the resourceClass, and an error, if there is any. func (c *FakeResourceClasses) Create(ctx context.Context, resourceClass *v1alpha2.ResourceClass, opts v1.CreateOptions) (result *v1alpha2.ResourceClass, err error) { emptyResult := &v1alpha2.ResourceClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(resourceclassesResource, resourceClass), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(resourceclassesResource, resourceClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeResourceClasses) Create(ctx context.Context, resourceClass *v1alpha func (c *FakeResourceClasses) Update(ctx context.Context, resourceClass *v1alpha2.ResourceClass, opts v1.UpdateOptions) (result *v1alpha2.ResourceClass, err error) { emptyResult := &v1alpha2.ResourceClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(resourceclassesResource, resourceClass), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(resourceclassesResource, resourceClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeResourceClasses) Delete(ctx context.Context, name string, opts v1.D // DeleteCollection deletes a collection of objects. func (c *FakeResourceClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(resourceclassesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(resourceclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha2.ResourceClassList{}) return err @@ -121,7 +121,7 @@ func (c *FakeResourceClasses) DeleteCollection(ctx context.Context, opts v1.Dele func (c *FakeResourceClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClass, err error) { emptyResult := &v1alpha2.ResourceClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(resourceclassesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(resourceclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeResourceClasses) Apply(ctx context.Context, resourceClass *resource } emptyResult := &v1alpha2.ResourceClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(resourceclassesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(resourceclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclassparameters.go b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclassparameters.go index e07d43fa89..b58eedeca8 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclassparameters.go +++ b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclassparameters.go @@ -46,7 +46,7 @@ var resourceclassparametersKind = v1alpha2.SchemeGroupVersion.WithKind("Resource func (c *FakeResourceClassParameters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClassParameters, err error) { emptyResult := &v1alpha2.ResourceClassParameters{} obj, err := c.Fake. - Invokes(testing.NewGetAction(resourceclassparametersResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(resourceclassparametersResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeResourceClassParameters) Get(ctx context.Context, name string, opti func (c *FakeResourceClassParameters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassParametersList, err error) { emptyResult := &v1alpha2.ResourceClassParametersList{} obj, err := c.Fake. - Invokes(testing.NewListAction(resourceclassparametersResource, resourceclassparametersKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(resourceclassparametersResource, resourceclassparametersKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeResourceClassParameters) List(ctx context.Context, opts v1.ListOpti // Watch returns a watch.Interface that watches the requested resourceClassParameters. func (c *FakeResourceClassParameters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(resourceclassparametersResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(resourceclassparametersResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeResourceClassParameters) Watch(ctx context.Context, opts v1.ListOpt func (c *FakeResourceClassParameters) Create(ctx context.Context, resourceClassParameters *v1alpha2.ResourceClassParameters, opts v1.CreateOptions) (result *v1alpha2.ResourceClassParameters, err error) { emptyResult := &v1alpha2.ResourceClassParameters{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(resourceclassparametersResource, c.ns, resourceClassParameters), emptyResult) + Invokes(testing.NewCreateActionWithOptions(resourceclassparametersResource, c.ns, resourceClassParameters, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeResourceClassParameters) Create(ctx context.Context, resourceClassP func (c *FakeResourceClassParameters) Update(ctx context.Context, resourceClassParameters *v1alpha2.ResourceClassParameters, opts v1.UpdateOptions) (result *v1alpha2.ResourceClassParameters, err error) { emptyResult := &v1alpha2.ResourceClassParameters{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(resourceclassparametersResource, c.ns, resourceClassParameters), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(resourceclassparametersResource, c.ns, resourceClassParameters, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeResourceClassParameters) Delete(ctx context.Context, name string, o // DeleteCollection deletes a collection of objects. func (c *FakeResourceClassParameters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(resourceclassparametersResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(resourceclassparametersResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha2.ResourceClassParametersList{}) return err @@ -128,7 +128,7 @@ func (c *FakeResourceClassParameters) DeleteCollection(ctx context.Context, opts func (c *FakeResourceClassParameters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClassParameters, err error) { emptyResult := &v1alpha2.ResourceClassParameters{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourceclassparametersResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclassparametersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeResourceClassParameters) Apply(ctx context.Context, resourceClassPa } emptyResult := &v1alpha2.ResourceClassParameters{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(resourceclassparametersResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclassparametersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceslice.go b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceslice.go index 713f0ef575..7890e8af49 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceslice.go +++ b/kubernetes/typed/resource/v1alpha2/fake/fake_resourceslice.go @@ -45,7 +45,7 @@ var resourceslicesKind = v1alpha2.SchemeGroupVersion.WithKind("ResourceSlice") func (c *FakeResourceSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceSlice, err error) { emptyResult := &v1alpha2.ResourceSlice{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(resourceslicesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(resourceslicesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeResourceSlices) Get(ctx context.Context, name string, options v1.Ge func (c *FakeResourceSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceSliceList, err error) { emptyResult := &v1alpha2.ResourceSliceList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(resourceslicesResource, resourceslicesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(resourceslicesResource, resourceslicesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeResourceSlices) List(ctx context.Context, opts v1.ListOptions) (res // Watch returns a watch.Interface that watches the requested resourceSlices. func (c *FakeResourceSlices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(resourceslicesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(resourceslicesResource, opts)) } // Create takes the representation of a resourceSlice and creates it. Returns the server's representation of the resourceSlice, and an error, if there is any. func (c *FakeResourceSlices) Create(ctx context.Context, resourceSlice *v1alpha2.ResourceSlice, opts v1.CreateOptions) (result *v1alpha2.ResourceSlice, err error) { emptyResult := &v1alpha2.ResourceSlice{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(resourceslicesResource, resourceSlice), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(resourceslicesResource, resourceSlice, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeResourceSlices) Create(ctx context.Context, resourceSlice *v1alpha2 func (c *FakeResourceSlices) Update(ctx context.Context, resourceSlice *v1alpha2.ResourceSlice, opts v1.UpdateOptions) (result *v1alpha2.ResourceSlice, err error) { emptyResult := &v1alpha2.ResourceSlice{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(resourceslicesResource, resourceSlice), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(resourceslicesResource, resourceSlice, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeResourceSlices) Delete(ctx context.Context, name string, opts v1.De // DeleteCollection deletes a collection of objects. func (c *FakeResourceSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(resourceslicesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(resourceslicesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha2.ResourceSliceList{}) return err @@ -121,7 +121,7 @@ func (c *FakeResourceSlices) DeleteCollection(ctx context.Context, opts v1.Delet func (c *FakeResourceSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceSlice, err error) { emptyResult := &v1alpha2.ResourceSlice{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(resourceslicesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(resourceslicesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeResourceSlices) Apply(ctx context.Context, resourceSlice *resourcev } emptyResult := &v1alpha2.ResourceSlice{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(resourceslicesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(resourceslicesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/scheduling/v1/fake/fake_priorityclass.go b/kubernetes/typed/scheduling/v1/fake/fake_priorityclass.go index b966592266..92847184bc 100644 --- a/kubernetes/typed/scheduling/v1/fake/fake_priorityclass.go +++ b/kubernetes/typed/scheduling/v1/fake/fake_priorityclass.go @@ -45,7 +45,7 @@ var priorityclassesKind = v1.SchemeGroupVersion.WithKind("PriorityClass") func (c *FakePriorityClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PriorityClass, err error) { emptyResult := &v1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(priorityclassesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(priorityclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakePriorityClasses) Get(ctx context.Context, name string, options meta func (c *FakePriorityClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityClassList, err error) { emptyResult := &v1.PriorityClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(priorityclassesResource, priorityclassesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(priorityclassesResource, priorityclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakePriorityClasses) List(ctx context.Context, opts metav1.ListOptions) // Watch returns a watch.Interface that watches the requested priorityClasses. func (c *FakePriorityClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(priorityclassesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(priorityclassesResource, opts)) } // Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any. func (c *FakePriorityClasses) Create(ctx context.Context, priorityClass *v1.PriorityClass, opts metav1.CreateOptions) (result *v1.PriorityClass, err error) { emptyResult := &v1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(priorityclassesResource, priorityClass), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(priorityclassesResource, priorityClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakePriorityClasses) Create(ctx context.Context, priorityClass *v1.Prio func (c *FakePriorityClasses) Update(ctx context.Context, priorityClass *v1.PriorityClass, opts metav1.UpdateOptions) (result *v1.PriorityClass, err error) { emptyResult := &v1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(priorityclassesResource, priorityClass), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(priorityclassesResource, priorityClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakePriorityClasses) Delete(ctx context.Context, name string, opts meta // DeleteCollection deletes a collection of objects. func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(priorityclassesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(priorityclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.PriorityClassList{}) return err @@ -121,7 +121,7 @@ func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, opts metav1. func (c *FakePriorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityClass, err error) { emptyResult := &v1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(priorityclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakePriorityClasses) Apply(ctx context.Context, priorityClass *scheduli } emptyResult := &v1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(priorityclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go b/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go index c76820cb1c..055d458a3c 100644 --- a/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go +++ b/kubernetes/typed/scheduling/v1alpha1/fake/fake_priorityclass.go @@ -45,7 +45,7 @@ var priorityclassesKind = v1alpha1.SchemeGroupVersion.WithKind("PriorityClass") func (c *FakePriorityClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PriorityClass, err error) { emptyResult := &v1alpha1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(priorityclassesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(priorityclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakePriorityClasses) Get(ctx context.Context, name string, options v1.G func (c *FakePriorityClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PriorityClassList, err error) { emptyResult := &v1alpha1.PriorityClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(priorityclassesResource, priorityclassesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(priorityclassesResource, priorityclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakePriorityClasses) List(ctx context.Context, opts v1.ListOptions) (re // Watch returns a watch.Interface that watches the requested priorityClasses. func (c *FakePriorityClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(priorityclassesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(priorityclassesResource, opts)) } // Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any. func (c *FakePriorityClasses) Create(ctx context.Context, priorityClass *v1alpha1.PriorityClass, opts v1.CreateOptions) (result *v1alpha1.PriorityClass, err error) { emptyResult := &v1alpha1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(priorityclassesResource, priorityClass), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(priorityclassesResource, priorityClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakePriorityClasses) Create(ctx context.Context, priorityClass *v1alpha func (c *FakePriorityClasses) Update(ctx context.Context, priorityClass *v1alpha1.PriorityClass, opts v1.UpdateOptions) (result *v1alpha1.PriorityClass, err error) { emptyResult := &v1alpha1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(priorityclassesResource, priorityClass), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(priorityclassesResource, priorityClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakePriorityClasses) Delete(ctx context.Context, name string, opts v1.D // DeleteCollection deletes a collection of objects. func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(priorityclassesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(priorityclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.PriorityClassList{}) return err @@ -121,7 +121,7 @@ func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, opts v1.Dele func (c *FakePriorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PriorityClass, err error) { emptyResult := &v1alpha1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(priorityclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakePriorityClasses) Apply(ctx context.Context, priorityClass *scheduli } emptyResult := &v1alpha1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(priorityclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/scheduling/v1beta1/fake/fake_priorityclass.go b/kubernetes/typed/scheduling/v1beta1/fake/fake_priorityclass.go index 0ca92e2155..49d82a7ed9 100644 --- a/kubernetes/typed/scheduling/v1beta1/fake/fake_priorityclass.go +++ b/kubernetes/typed/scheduling/v1beta1/fake/fake_priorityclass.go @@ -45,7 +45,7 @@ var priorityclassesKind = v1beta1.SchemeGroupVersion.WithKind("PriorityClass") func (c *FakePriorityClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PriorityClass, err error) { emptyResult := &v1beta1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(priorityclassesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(priorityclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakePriorityClasses) Get(ctx context.Context, name string, options v1.G func (c *FakePriorityClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityClassList, err error) { emptyResult := &v1beta1.PriorityClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(priorityclassesResource, priorityclassesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(priorityclassesResource, priorityclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakePriorityClasses) List(ctx context.Context, opts v1.ListOptions) (re // Watch returns a watch.Interface that watches the requested priorityClasses. func (c *FakePriorityClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(priorityclassesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(priorityclassesResource, opts)) } // Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any. func (c *FakePriorityClasses) Create(ctx context.Context, priorityClass *v1beta1.PriorityClass, opts v1.CreateOptions) (result *v1beta1.PriorityClass, err error) { emptyResult := &v1beta1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(priorityclassesResource, priorityClass), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(priorityclassesResource, priorityClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakePriorityClasses) Create(ctx context.Context, priorityClass *v1beta1 func (c *FakePriorityClasses) Update(ctx context.Context, priorityClass *v1beta1.PriorityClass, opts v1.UpdateOptions) (result *v1beta1.PriorityClass, err error) { emptyResult := &v1beta1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(priorityclassesResource, priorityClass), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(priorityclassesResource, priorityClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakePriorityClasses) Delete(ctx context.Context, name string, opts v1.D // DeleteCollection deletes a collection of objects. func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(priorityclassesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(priorityclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.PriorityClassList{}) return err @@ -121,7 +121,7 @@ func (c *FakePriorityClasses) DeleteCollection(ctx context.Context, opts v1.Dele func (c *FakePriorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PriorityClass, err error) { emptyResult := &v1beta1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(priorityclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakePriorityClasses) Apply(ctx context.Context, priorityClass *scheduli } emptyResult := &v1beta1.PriorityClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(priorityclassesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(priorityclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/storage/v1/fake/fake_csidriver.go b/kubernetes/typed/storage/v1/fake/fake_csidriver.go index 27a795913a..1df7c034bb 100644 --- a/kubernetes/typed/storage/v1/fake/fake_csidriver.go +++ b/kubernetes/typed/storage/v1/fake/fake_csidriver.go @@ -45,7 +45,7 @@ var csidriversKind = v1.SchemeGroupVersion.WithKind("CSIDriver") func (c *FakeCSIDrivers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CSIDriver, err error) { emptyResult := &v1.CSIDriver{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(csidriversResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(csidriversResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeCSIDrivers) Get(ctx context.Context, name string, options metav1.Ge func (c *FakeCSIDrivers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CSIDriverList, err error) { emptyResult := &v1.CSIDriverList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(csidriversResource, csidriversKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(csidriversResource, csidriversKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeCSIDrivers) List(ctx context.Context, opts metav1.ListOptions) (res // Watch returns a watch.Interface that watches the requested cSIDrivers. func (c *FakeCSIDrivers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(csidriversResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(csidriversResource, opts)) } // Create takes the representation of a cSIDriver and creates it. Returns the server's representation of the cSIDriver, and an error, if there is any. func (c *FakeCSIDrivers) Create(ctx context.Context, cSIDriver *v1.CSIDriver, opts metav1.CreateOptions) (result *v1.CSIDriver, err error) { emptyResult := &v1.CSIDriver{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(csidriversResource, cSIDriver), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(csidriversResource, cSIDriver, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeCSIDrivers) Create(ctx context.Context, cSIDriver *v1.CSIDriver, op func (c *FakeCSIDrivers) Update(ctx context.Context, cSIDriver *v1.CSIDriver, opts metav1.UpdateOptions) (result *v1.CSIDriver, err error) { emptyResult := &v1.CSIDriver{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(csidriversResource, cSIDriver), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(csidriversResource, cSIDriver, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeCSIDrivers) Delete(ctx context.Context, name string, opts metav1.De // DeleteCollection deletes a collection of objects. func (c *FakeCSIDrivers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(csidriversResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(csidriversResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.CSIDriverList{}) return err @@ -121,7 +121,7 @@ func (c *FakeCSIDrivers) DeleteCollection(ctx context.Context, opts metav1.Delet func (c *FakeCSIDrivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSIDriver, err error) { emptyResult := &v1.CSIDriver{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(csidriversResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(csidriversResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeCSIDrivers) Apply(ctx context.Context, cSIDriver *storagev1.CSIDriv } emptyResult := &v1.CSIDriver{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(csidriversResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(csidriversResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/storage/v1/fake/fake_csinode.go b/kubernetes/typed/storage/v1/fake/fake_csinode.go index e8e48fce8b..e2b8e8cc8d 100644 --- a/kubernetes/typed/storage/v1/fake/fake_csinode.go +++ b/kubernetes/typed/storage/v1/fake/fake_csinode.go @@ -45,7 +45,7 @@ var csinodesKind = v1.SchemeGroupVersion.WithKind("CSINode") func (c *FakeCSINodes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CSINode, err error) { emptyResult := &v1.CSINode{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(csinodesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(csinodesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeCSINodes) Get(ctx context.Context, name string, options metav1.GetO func (c *FakeCSINodes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CSINodeList, err error) { emptyResult := &v1.CSINodeList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(csinodesResource, csinodesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(csinodesResource, csinodesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeCSINodes) List(ctx context.Context, opts metav1.ListOptions) (resul // Watch returns a watch.Interface that watches the requested cSINodes. func (c *FakeCSINodes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(csinodesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(csinodesResource, opts)) } // Create takes the representation of a cSINode and creates it. Returns the server's representation of the cSINode, and an error, if there is any. func (c *FakeCSINodes) Create(ctx context.Context, cSINode *v1.CSINode, opts metav1.CreateOptions) (result *v1.CSINode, err error) { emptyResult := &v1.CSINode{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(csinodesResource, cSINode), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(csinodesResource, cSINode, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeCSINodes) Create(ctx context.Context, cSINode *v1.CSINode, opts met func (c *FakeCSINodes) Update(ctx context.Context, cSINode *v1.CSINode, opts metav1.UpdateOptions) (result *v1.CSINode, err error) { emptyResult := &v1.CSINode{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(csinodesResource, cSINode), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(csinodesResource, cSINode, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeCSINodes) Delete(ctx context.Context, name string, opts metav1.Dele // DeleteCollection deletes a collection of objects. func (c *FakeCSINodes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(csinodesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(csinodesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.CSINodeList{}) return err @@ -121,7 +121,7 @@ func (c *FakeCSINodes) DeleteCollection(ctx context.Context, opts metav1.DeleteO func (c *FakeCSINodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSINode, err error) { emptyResult := &v1.CSINode{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(csinodesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(csinodesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeCSINodes) Apply(ctx context.Context, cSINode *storagev1.CSINodeAppl } emptyResult := &v1.CSINode{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(csinodesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(csinodesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/storage/v1/fake/fake_csistoragecapacity.go b/kubernetes/typed/storage/v1/fake/fake_csistoragecapacity.go index 8dd75b759a..a86014855e 100644 --- a/kubernetes/typed/storage/v1/fake/fake_csistoragecapacity.go +++ b/kubernetes/typed/storage/v1/fake/fake_csistoragecapacity.go @@ -46,7 +46,7 @@ var csistoragecapacitiesKind = v1.SchemeGroupVersion.WithKind("CSIStorageCapacit func (c *FakeCSIStorageCapacities) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CSIStorageCapacity, err error) { emptyResult := &v1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewGetAction(csistoragecapacitiesResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(csistoragecapacitiesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeCSIStorageCapacities) Get(ctx context.Context, name string, options func (c *FakeCSIStorageCapacities) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CSIStorageCapacityList, err error) { emptyResult := &v1.CSIStorageCapacityList{} obj, err := c.Fake. - Invokes(testing.NewListAction(csistoragecapacitiesResource, csistoragecapacitiesKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(csistoragecapacitiesResource, csistoragecapacitiesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeCSIStorageCapacities) List(ctx context.Context, opts metav1.ListOpt // Watch returns a watch.Interface that watches the requested cSIStorageCapacities. func (c *FakeCSIStorageCapacities) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(csistoragecapacitiesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(csistoragecapacitiesResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeCSIStorageCapacities) Watch(ctx context.Context, opts metav1.ListOp func (c *FakeCSIStorageCapacities) Create(ctx context.Context, cSIStorageCapacity *v1.CSIStorageCapacity, opts metav1.CreateOptions) (result *v1.CSIStorageCapacity, err error) { emptyResult := &v1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(csistoragecapacitiesResource, c.ns, cSIStorageCapacity), emptyResult) + Invokes(testing.NewCreateActionWithOptions(csistoragecapacitiesResource, c.ns, cSIStorageCapacity, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeCSIStorageCapacities) Create(ctx context.Context, cSIStorageCapacit func (c *FakeCSIStorageCapacities) Update(ctx context.Context, cSIStorageCapacity *v1.CSIStorageCapacity, opts metav1.UpdateOptions) (result *v1.CSIStorageCapacity, err error) { emptyResult := &v1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(csistoragecapacitiesResource, c.ns, cSIStorageCapacity), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(csistoragecapacitiesResource, c.ns, cSIStorageCapacity, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeCSIStorageCapacities) Delete(ctx context.Context, name string, opts // DeleteCollection deletes a collection of objects. func (c *FakeCSIStorageCapacities) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewDeleteCollectionAction(csistoragecapacitiesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(csistoragecapacitiesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.CSIStorageCapacityList{}) return err @@ -128,7 +128,7 @@ func (c *FakeCSIStorageCapacities) DeleteCollection(ctx context.Context, opts me func (c *FakeCSIStorageCapacities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSIStorageCapacity, err error) { emptyResult := &v1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(csistoragecapacitiesResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(csistoragecapacitiesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeCSIStorageCapacities) Apply(ctx context.Context, cSIStorageCapacity } emptyResult := &v1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(csistoragecapacitiesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(csistoragecapacitiesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/storage/v1/fake/fake_storageclass.go b/kubernetes/typed/storage/v1/fake/fake_storageclass.go index a44b58f427..8910be1db9 100644 --- a/kubernetes/typed/storage/v1/fake/fake_storageclass.go +++ b/kubernetes/typed/storage/v1/fake/fake_storageclass.go @@ -45,7 +45,7 @@ var storageclassesKind = v1.SchemeGroupVersion.WithKind("StorageClass") func (c *FakeStorageClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.StorageClass, err error) { emptyResult := &v1.StorageClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(storageclassesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(storageclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeStorageClasses) Get(ctx context.Context, name string, options metav func (c *FakeStorageClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.StorageClassList, err error) { emptyResult := &v1.StorageClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(storageclassesResource, storageclassesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(storageclassesResource, storageclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeStorageClasses) List(ctx context.Context, opts metav1.ListOptions) // Watch returns a watch.Interface that watches the requested storageClasses. func (c *FakeStorageClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(storageclassesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(storageclassesResource, opts)) } // Create takes the representation of a storageClass and creates it. Returns the server's representation of the storageClass, and an error, if there is any. func (c *FakeStorageClasses) Create(ctx context.Context, storageClass *v1.StorageClass, opts metav1.CreateOptions) (result *v1.StorageClass, err error) { emptyResult := &v1.StorageClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(storageclassesResource, storageClass), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(storageclassesResource, storageClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeStorageClasses) Create(ctx context.Context, storageClass *v1.Storag func (c *FakeStorageClasses) Update(ctx context.Context, storageClass *v1.StorageClass, opts metav1.UpdateOptions) (result *v1.StorageClass, err error) { emptyResult := &v1.StorageClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(storageclassesResource, storageClass), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(storageclassesResource, storageClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeStorageClasses) Delete(ctx context.Context, name string, opts metav // DeleteCollection deletes a collection of objects. func (c *FakeStorageClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(storageclassesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(storageclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.StorageClassList{}) return err @@ -121,7 +121,7 @@ func (c *FakeStorageClasses) DeleteCollection(ctx context.Context, opts metav1.D func (c *FakeStorageClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.StorageClass, err error) { emptyResult := &v1.StorageClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(storageclassesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeStorageClasses) Apply(ctx context.Context, storageClass *storagev1. } emptyResult := &v1.StorageClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(storageclassesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/storage/v1/fake/fake_volumeattachment.go b/kubernetes/typed/storage/v1/fake/fake_volumeattachment.go index d68b6782ff..3d3d71ec50 100644 --- a/kubernetes/typed/storage/v1/fake/fake_volumeattachment.go +++ b/kubernetes/typed/storage/v1/fake/fake_volumeattachment.go @@ -45,7 +45,7 @@ var volumeattachmentsKind = v1.SchemeGroupVersion.WithKind("VolumeAttachment") func (c *FakeVolumeAttachments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VolumeAttachment, err error) { emptyResult := &v1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(volumeattachmentsResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(volumeattachmentsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeVolumeAttachments) Get(ctx context.Context, name string, options me func (c *FakeVolumeAttachments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VolumeAttachmentList, err error) { emptyResult := &v1.VolumeAttachmentList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(volumeattachmentsResource, volumeattachmentsKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(volumeattachmentsResource, volumeattachmentsKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeVolumeAttachments) List(ctx context.Context, opts metav1.ListOption // Watch returns a watch.Interface that watches the requested volumeAttachments. func (c *FakeVolumeAttachments) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(volumeattachmentsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(volumeattachmentsResource, opts)) } // Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. func (c *FakeVolumeAttachments) Create(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.CreateOptions) (result *v1.VolumeAttachment, err error) { emptyResult := &v1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(volumeattachmentsResource, volumeAttachment), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(volumeattachmentsResource, volumeAttachment, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeVolumeAttachments) Create(ctx context.Context, volumeAttachment *v1 func (c *FakeVolumeAttachments) Update(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.UpdateOptions) (result *v1.VolumeAttachment, err error) { emptyResult := &v1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(volumeattachmentsResource, volumeAttachment), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(volumeattachmentsResource, volumeAttachment, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -107,7 +107,7 @@ func (c *FakeVolumeAttachments) Update(ctx context.Context, volumeAttachment *v1 func (c *FakeVolumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.UpdateOptions) (result *v1.VolumeAttachment, err error) { emptyResult := &v1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(volumeattachmentsResource, "status", volumeAttachment), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(volumeattachmentsResource, "status", volumeAttachment, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -123,7 +123,7 @@ func (c *FakeVolumeAttachments) Delete(ctx context.Context, name string, opts me // DeleteCollection deletes a collection of objects. func (c *FakeVolumeAttachments) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(volumeattachmentsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(volumeattachmentsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1.VolumeAttachmentList{}) return err @@ -133,7 +133,7 @@ func (c *FakeVolumeAttachments) DeleteCollection(ctx context.Context, opts metav func (c *FakeVolumeAttachments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VolumeAttachment, err error) { emptyResult := &v1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -155,7 +155,7 @@ func (c *FakeVolumeAttachments) Apply(ctx context.Context, volumeAttachment *sto } emptyResult := &v1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } @@ -178,7 +178,7 @@ func (c *FakeVolumeAttachments) ApplyStatus(ctx context.Context, volumeAttachmen } emptyResult := &v1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/storage/v1alpha1/fake/fake_csistoragecapacity.go b/kubernetes/typed/storage/v1alpha1/fake/fake_csistoragecapacity.go index 0099fd7717..0bcaccd208 100644 --- a/kubernetes/typed/storage/v1alpha1/fake/fake_csistoragecapacity.go +++ b/kubernetes/typed/storage/v1alpha1/fake/fake_csistoragecapacity.go @@ -46,7 +46,7 @@ var csistoragecapacitiesKind = v1alpha1.SchemeGroupVersion.WithKind("CSIStorageC func (c *FakeCSIStorageCapacities) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.CSIStorageCapacity, err error) { emptyResult := &v1alpha1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewGetAction(csistoragecapacitiesResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(csistoragecapacitiesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeCSIStorageCapacities) Get(ctx context.Context, name string, options func (c *FakeCSIStorageCapacities) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.CSIStorageCapacityList, err error) { emptyResult := &v1alpha1.CSIStorageCapacityList{} obj, err := c.Fake. - Invokes(testing.NewListAction(csistoragecapacitiesResource, csistoragecapacitiesKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(csistoragecapacitiesResource, csistoragecapacitiesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeCSIStorageCapacities) List(ctx context.Context, opts v1.ListOptions // Watch returns a watch.Interface that watches the requested cSIStorageCapacities. func (c *FakeCSIStorageCapacities) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(csistoragecapacitiesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(csistoragecapacitiesResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeCSIStorageCapacities) Watch(ctx context.Context, opts v1.ListOption func (c *FakeCSIStorageCapacities) Create(ctx context.Context, cSIStorageCapacity *v1alpha1.CSIStorageCapacity, opts v1.CreateOptions) (result *v1alpha1.CSIStorageCapacity, err error) { emptyResult := &v1alpha1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(csistoragecapacitiesResource, c.ns, cSIStorageCapacity), emptyResult) + Invokes(testing.NewCreateActionWithOptions(csistoragecapacitiesResource, c.ns, cSIStorageCapacity, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeCSIStorageCapacities) Create(ctx context.Context, cSIStorageCapacit func (c *FakeCSIStorageCapacities) Update(ctx context.Context, cSIStorageCapacity *v1alpha1.CSIStorageCapacity, opts v1.UpdateOptions) (result *v1alpha1.CSIStorageCapacity, err error) { emptyResult := &v1alpha1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(csistoragecapacitiesResource, c.ns, cSIStorageCapacity), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(csistoragecapacitiesResource, c.ns, cSIStorageCapacity, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeCSIStorageCapacities) Delete(ctx context.Context, name string, opts // DeleteCollection deletes a collection of objects. func (c *FakeCSIStorageCapacities) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(csistoragecapacitiesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(csistoragecapacitiesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.CSIStorageCapacityList{}) return err @@ -128,7 +128,7 @@ func (c *FakeCSIStorageCapacities) DeleteCollection(ctx context.Context, opts v1 func (c *FakeCSIStorageCapacities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.CSIStorageCapacity, err error) { emptyResult := &v1alpha1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(csistoragecapacitiesResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(csistoragecapacitiesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeCSIStorageCapacities) Apply(ctx context.Context, cSIStorageCapacity } emptyResult := &v1alpha1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(csistoragecapacitiesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(csistoragecapacitiesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go b/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go index 19ded07b80..a07247f8f3 100644 --- a/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go +++ b/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattachment.go @@ -45,7 +45,7 @@ var volumeattachmentsKind = v1alpha1.SchemeGroupVersion.WithKind("VolumeAttachme func (c *FakeVolumeAttachments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeAttachment, err error) { emptyResult := &v1alpha1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(volumeattachmentsResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(volumeattachmentsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeVolumeAttachments) Get(ctx context.Context, name string, options v1 func (c *FakeVolumeAttachments) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttachmentList, err error) { emptyResult := &v1alpha1.VolumeAttachmentList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(volumeattachmentsResource, volumeattachmentsKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(volumeattachmentsResource, volumeattachmentsKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeVolumeAttachments) List(ctx context.Context, opts v1.ListOptions) ( // Watch returns a watch.Interface that watches the requested volumeAttachments. func (c *FakeVolumeAttachments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(volumeattachmentsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(volumeattachmentsResource, opts)) } // Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. func (c *FakeVolumeAttachments) Create(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.CreateOptions) (result *v1alpha1.VolumeAttachment, err error) { emptyResult := &v1alpha1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(volumeattachmentsResource, volumeAttachment), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(volumeattachmentsResource, volumeAttachment, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeVolumeAttachments) Create(ctx context.Context, volumeAttachment *v1 func (c *FakeVolumeAttachments) Update(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttachment, err error) { emptyResult := &v1alpha1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(volumeattachmentsResource, volumeAttachment), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(volumeattachmentsResource, volumeAttachment, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -107,7 +107,7 @@ func (c *FakeVolumeAttachments) Update(ctx context.Context, volumeAttachment *v1 func (c *FakeVolumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttachment, err error) { emptyResult := &v1alpha1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(volumeattachmentsResource, "status", volumeAttachment), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(volumeattachmentsResource, "status", volumeAttachment, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -123,7 +123,7 @@ func (c *FakeVolumeAttachments) Delete(ctx context.Context, name string, opts v1 // DeleteCollection deletes a collection of objects. func (c *FakeVolumeAttachments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(volumeattachmentsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(volumeattachmentsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.VolumeAttachmentList{}) return err @@ -133,7 +133,7 @@ func (c *FakeVolumeAttachments) DeleteCollection(ctx context.Context, opts v1.De func (c *FakeVolumeAttachments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttachment, err error) { emptyResult := &v1alpha1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -155,7 +155,7 @@ func (c *FakeVolumeAttachments) Apply(ctx context.Context, volumeAttachment *sto } emptyResult := &v1alpha1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } @@ -178,7 +178,7 @@ func (c *FakeVolumeAttachments) ApplyStatus(ctx context.Context, volumeAttachmen } emptyResult := &v1alpha1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattributesclass.go b/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattributesclass.go index c3fd1eebac..0d7fe9aa8c 100644 --- a/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattributesclass.go +++ b/kubernetes/typed/storage/v1alpha1/fake/fake_volumeattributesclass.go @@ -45,7 +45,7 @@ var volumeattributesclassesKind = v1alpha1.SchemeGroupVersion.WithKind("VolumeAt func (c *FakeVolumeAttributesClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeAttributesClass, err error) { emptyResult := &v1alpha1.VolumeAttributesClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(volumeattributesclassesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(volumeattributesclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeVolumeAttributesClasses) Get(ctx context.Context, name string, opti func (c *FakeVolumeAttributesClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttributesClassList, err error) { emptyResult := &v1alpha1.VolumeAttributesClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(volumeattributesclassesResource, volumeattributesclassesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(volumeattributesclassesResource, volumeattributesclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeVolumeAttributesClasses) List(ctx context.Context, opts v1.ListOpti // Watch returns a watch.Interface that watches the requested volumeAttributesClasses. func (c *FakeVolumeAttributesClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(volumeattributesclassesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(volumeattributesclassesResource, opts)) } // Create takes the representation of a volumeAttributesClass and creates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. func (c *FakeVolumeAttributesClasses) Create(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.CreateOptions) (result *v1alpha1.VolumeAttributesClass, err error) { emptyResult := &v1alpha1.VolumeAttributesClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(volumeattributesclassesResource, volumeAttributesClass), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(volumeattributesclassesResource, volumeAttributesClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeVolumeAttributesClasses) Create(ctx context.Context, volumeAttribut func (c *FakeVolumeAttributesClasses) Update(ctx context.Context, volumeAttributesClass *v1alpha1.VolumeAttributesClass, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttributesClass, err error) { emptyResult := &v1alpha1.VolumeAttributesClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(volumeattributesclassesResource, volumeAttributesClass), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(volumeattributesclassesResource, volumeAttributesClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeVolumeAttributesClasses) Delete(ctx context.Context, name string, o // DeleteCollection deletes a collection of objects. func (c *FakeVolumeAttributesClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(volumeattributesclassesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(volumeattributesclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.VolumeAttributesClassList{}) return err @@ -121,7 +121,7 @@ func (c *FakeVolumeAttributesClasses) DeleteCollection(ctx context.Context, opts func (c *FakeVolumeAttributesClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttributesClass, err error) { emptyResult := &v1alpha1.VolumeAttributesClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattributesclassesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattributesclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeVolumeAttributesClasses) Apply(ctx context.Context, volumeAttribute } emptyResult := &v1alpha1.VolumeAttributesClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattributesclassesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattributesclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/storage/v1beta1/fake/fake_csidriver.go b/kubernetes/typed/storage/v1beta1/fake/fake_csidriver.go index c1a73310da..2b230707fe 100644 --- a/kubernetes/typed/storage/v1beta1/fake/fake_csidriver.go +++ b/kubernetes/typed/storage/v1beta1/fake/fake_csidriver.go @@ -45,7 +45,7 @@ var csidriversKind = v1beta1.SchemeGroupVersion.WithKind("CSIDriver") func (c *FakeCSIDrivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CSIDriver, err error) { emptyResult := &v1beta1.CSIDriver{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(csidriversResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(csidriversResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeCSIDrivers) Get(ctx context.Context, name string, options v1.GetOpt func (c *FakeCSIDrivers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIDriverList, err error) { emptyResult := &v1beta1.CSIDriverList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(csidriversResource, csidriversKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(csidriversResource, csidriversKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeCSIDrivers) List(ctx context.Context, opts v1.ListOptions) (result // Watch returns a watch.Interface that watches the requested cSIDrivers. func (c *FakeCSIDrivers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(csidriversResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(csidriversResource, opts)) } // Create takes the representation of a cSIDriver and creates it. Returns the server's representation of the cSIDriver, and an error, if there is any. func (c *FakeCSIDrivers) Create(ctx context.Context, cSIDriver *v1beta1.CSIDriver, opts v1.CreateOptions) (result *v1beta1.CSIDriver, err error) { emptyResult := &v1beta1.CSIDriver{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(csidriversResource, cSIDriver), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(csidriversResource, cSIDriver, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeCSIDrivers) Create(ctx context.Context, cSIDriver *v1beta1.CSIDrive func (c *FakeCSIDrivers) Update(ctx context.Context, cSIDriver *v1beta1.CSIDriver, opts v1.UpdateOptions) (result *v1beta1.CSIDriver, err error) { emptyResult := &v1beta1.CSIDriver{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(csidriversResource, cSIDriver), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(csidriversResource, cSIDriver, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeCSIDrivers) Delete(ctx context.Context, name string, opts v1.Delete // DeleteCollection deletes a collection of objects. func (c *FakeCSIDrivers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(csidriversResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(csidriversResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.CSIDriverList{}) return err @@ -121,7 +121,7 @@ func (c *FakeCSIDrivers) DeleteCollection(ctx context.Context, opts v1.DeleteOpt func (c *FakeCSIDrivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSIDriver, err error) { emptyResult := &v1beta1.CSIDriver{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(csidriversResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(csidriversResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeCSIDrivers) Apply(ctx context.Context, cSIDriver *storagev1beta1.CS } emptyResult := &v1beta1.CSIDriver{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(csidriversResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(csidriversResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/storage/v1beta1/fake/fake_csinode.go b/kubernetes/typed/storage/v1beta1/fake/fake_csinode.go index c37d82fc7c..c5c2b58250 100644 --- a/kubernetes/typed/storage/v1beta1/fake/fake_csinode.go +++ b/kubernetes/typed/storage/v1beta1/fake/fake_csinode.go @@ -45,7 +45,7 @@ var csinodesKind = v1beta1.SchemeGroupVersion.WithKind("CSINode") func (c *FakeCSINodes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CSINode, err error) { emptyResult := &v1beta1.CSINode{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(csinodesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(csinodesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeCSINodes) Get(ctx context.Context, name string, options v1.GetOptio func (c *FakeCSINodes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSINodeList, err error) { emptyResult := &v1beta1.CSINodeList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(csinodesResource, csinodesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(csinodesResource, csinodesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeCSINodes) List(ctx context.Context, opts v1.ListOptions) (result *v // Watch returns a watch.Interface that watches the requested cSINodes. func (c *FakeCSINodes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(csinodesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(csinodesResource, opts)) } // Create takes the representation of a cSINode and creates it. Returns the server's representation of the cSINode, and an error, if there is any. func (c *FakeCSINodes) Create(ctx context.Context, cSINode *v1beta1.CSINode, opts v1.CreateOptions) (result *v1beta1.CSINode, err error) { emptyResult := &v1beta1.CSINode{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(csinodesResource, cSINode), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(csinodesResource, cSINode, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeCSINodes) Create(ctx context.Context, cSINode *v1beta1.CSINode, opt func (c *FakeCSINodes) Update(ctx context.Context, cSINode *v1beta1.CSINode, opts v1.UpdateOptions) (result *v1beta1.CSINode, err error) { emptyResult := &v1beta1.CSINode{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(csinodesResource, cSINode), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(csinodesResource, cSINode, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeCSINodes) Delete(ctx context.Context, name string, opts v1.DeleteOp // DeleteCollection deletes a collection of objects. func (c *FakeCSINodes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(csinodesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(csinodesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.CSINodeList{}) return err @@ -121,7 +121,7 @@ func (c *FakeCSINodes) DeleteCollection(ctx context.Context, opts v1.DeleteOptio func (c *FakeCSINodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSINode, err error) { emptyResult := &v1beta1.CSINode{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(csinodesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(csinodesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeCSINodes) Apply(ctx context.Context, cSINode *storagev1beta1.CSINod } emptyResult := &v1beta1.CSINode{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(csinodesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(csinodesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/storage/v1beta1/fake/fake_csistoragecapacity.go b/kubernetes/typed/storage/v1beta1/fake/fake_csistoragecapacity.go index 77888e58a9..59a9aaf9df 100644 --- a/kubernetes/typed/storage/v1beta1/fake/fake_csistoragecapacity.go +++ b/kubernetes/typed/storage/v1beta1/fake/fake_csistoragecapacity.go @@ -46,7 +46,7 @@ var csistoragecapacitiesKind = v1beta1.SchemeGroupVersion.WithKind("CSIStorageCa func (c *FakeCSIStorageCapacities) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CSIStorageCapacity, err error) { emptyResult := &v1beta1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewGetAction(csistoragecapacitiesResource, c.ns, name), emptyResult) + Invokes(testing.NewGetActionWithOptions(csistoragecapacitiesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err @@ -58,7 +58,7 @@ func (c *FakeCSIStorageCapacities) Get(ctx context.Context, name string, options func (c *FakeCSIStorageCapacities) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIStorageCapacityList, err error) { emptyResult := &v1beta1.CSIStorageCapacityList{} obj, err := c.Fake. - Invokes(testing.NewListAction(csistoragecapacitiesResource, csistoragecapacitiesKind, c.ns, opts), emptyResult) + Invokes(testing.NewListActionWithOptions(csistoragecapacitiesResource, csistoragecapacitiesKind, c.ns, opts), emptyResult) if obj == nil { return emptyResult, err @@ -80,7 +80,7 @@ func (c *FakeCSIStorageCapacities) List(ctx context.Context, opts v1.ListOptions // Watch returns a watch.Interface that watches the requested cSIStorageCapacities. func (c *FakeCSIStorageCapacities) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewWatchAction(csistoragecapacitiesResource, c.ns, opts)) + InvokesWatch(testing.NewWatchActionWithOptions(csistoragecapacitiesResource, c.ns, opts)) } @@ -88,7 +88,7 @@ func (c *FakeCSIStorageCapacities) Watch(ctx context.Context, opts v1.ListOption func (c *FakeCSIStorageCapacities) Create(ctx context.Context, cSIStorageCapacity *v1beta1.CSIStorageCapacity, opts v1.CreateOptions) (result *v1beta1.CSIStorageCapacity, err error) { emptyResult := &v1beta1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewCreateAction(csistoragecapacitiesResource, c.ns, cSIStorageCapacity), emptyResult) + Invokes(testing.NewCreateActionWithOptions(csistoragecapacitiesResource, c.ns, cSIStorageCapacity, opts), emptyResult) if obj == nil { return emptyResult, err @@ -100,7 +100,7 @@ func (c *FakeCSIStorageCapacities) Create(ctx context.Context, cSIStorageCapacit func (c *FakeCSIStorageCapacities) Update(ctx context.Context, cSIStorageCapacity *v1beta1.CSIStorageCapacity, opts v1.UpdateOptions) (result *v1beta1.CSIStorageCapacity, err error) { emptyResult := &v1beta1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewUpdateAction(csistoragecapacitiesResource, c.ns, cSIStorageCapacity), emptyResult) + Invokes(testing.NewUpdateActionWithOptions(csistoragecapacitiesResource, c.ns, cSIStorageCapacity, opts), emptyResult) if obj == nil { return emptyResult, err @@ -118,7 +118,7 @@ func (c *FakeCSIStorageCapacities) Delete(ctx context.Context, name string, opts // DeleteCollection deletes a collection of objects. func (c *FakeCSIStorageCapacities) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(csistoragecapacitiesResource, c.ns, listOpts) + action := testing.NewDeleteCollectionActionWithOptions(csistoragecapacitiesResource, c.ns, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.CSIStorageCapacityList{}) return err @@ -128,7 +128,7 @@ func (c *FakeCSIStorageCapacities) DeleteCollection(ctx context.Context, opts v1 func (c *FakeCSIStorageCapacities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSIStorageCapacity, err error) { emptyResult := &v1beta1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(csistoragecapacitiesResource, c.ns, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(csistoragecapacitiesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err @@ -151,7 +151,7 @@ func (c *FakeCSIStorageCapacities) Apply(ctx context.Context, cSIStorageCapacity } emptyResult := &v1beta1.CSIStorageCapacity{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(csistoragecapacitiesResource, c.ns, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(csistoragecapacitiesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go b/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go index 594c4fa003..954a346081 100644 --- a/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go +++ b/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go @@ -45,7 +45,7 @@ var storageclassesKind = v1beta1.SchemeGroupVersion.WithKind("StorageClass") func (c *FakeStorageClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.StorageClass, err error) { emptyResult := &v1beta1.StorageClass{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(storageclassesResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(storageclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeStorageClasses) Get(ctx context.Context, name string, options v1.Ge func (c *FakeStorageClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StorageClassList, err error) { emptyResult := &v1beta1.StorageClassList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(storageclassesResource, storageclassesKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(storageclassesResource, storageclassesKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeStorageClasses) List(ctx context.Context, opts v1.ListOptions) (res // Watch returns a watch.Interface that watches the requested storageClasses. func (c *FakeStorageClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(storageclassesResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(storageclassesResource, opts)) } // Create takes the representation of a storageClass and creates it. Returns the server's representation of the storageClass, and an error, if there is any. func (c *FakeStorageClasses) Create(ctx context.Context, storageClass *v1beta1.StorageClass, opts v1.CreateOptions) (result *v1beta1.StorageClass, err error) { emptyResult := &v1beta1.StorageClass{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(storageclassesResource, storageClass), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(storageclassesResource, storageClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeStorageClasses) Create(ctx context.Context, storageClass *v1beta1.S func (c *FakeStorageClasses) Update(ctx context.Context, storageClass *v1beta1.StorageClass, opts v1.UpdateOptions) (result *v1beta1.StorageClass, err error) { emptyResult := &v1beta1.StorageClass{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(storageclassesResource, storageClass), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(storageclassesResource, storageClass, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -111,7 +111,7 @@ func (c *FakeStorageClasses) Delete(ctx context.Context, name string, opts v1.De // DeleteCollection deletes a collection of objects. func (c *FakeStorageClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(storageclassesResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(storageclassesResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.StorageClassList{}) return err @@ -121,7 +121,7 @@ func (c *FakeStorageClasses) DeleteCollection(ctx context.Context, opts v1.Delet func (c *FakeStorageClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StorageClass, err error) { emptyResult := &v1beta1.StorageClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(storageclassesResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -143,7 +143,7 @@ func (c *FakeStorageClasses) Apply(ctx context.Context, storageClass *storagev1b } emptyResult := &v1beta1.StorageClass{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(storageclassesResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/storage/v1beta1/fake/fake_volumeattachment.go b/kubernetes/typed/storage/v1beta1/fake/fake_volumeattachment.go index 41da92c1a3..247f7ca627 100644 --- a/kubernetes/typed/storage/v1beta1/fake/fake_volumeattachment.go +++ b/kubernetes/typed/storage/v1beta1/fake/fake_volumeattachment.go @@ -45,7 +45,7 @@ var volumeattachmentsKind = v1beta1.SchemeGroupVersion.WithKind("VolumeAttachmen func (c *FakeVolumeAttachments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeAttachment, err error) { emptyResult := &v1beta1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(volumeattachmentsResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(volumeattachmentsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeVolumeAttachments) Get(ctx context.Context, name string, options v1 func (c *FakeVolumeAttachments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeAttachmentList, err error) { emptyResult := &v1beta1.VolumeAttachmentList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(volumeattachmentsResource, volumeattachmentsKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(volumeattachmentsResource, volumeattachmentsKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeVolumeAttachments) List(ctx context.Context, opts v1.ListOptions) ( // Watch returns a watch.Interface that watches the requested volumeAttachments. func (c *FakeVolumeAttachments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(volumeattachmentsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(volumeattachmentsResource, opts)) } // Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. func (c *FakeVolumeAttachments) Create(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.CreateOptions) (result *v1beta1.VolumeAttachment, err error) { emptyResult := &v1beta1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(volumeattachmentsResource, volumeAttachment), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(volumeattachmentsResource, volumeAttachment, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeVolumeAttachments) Create(ctx context.Context, volumeAttachment *v1 func (c *FakeVolumeAttachments) Update(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.UpdateOptions) (result *v1beta1.VolumeAttachment, err error) { emptyResult := &v1beta1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(volumeattachmentsResource, volumeAttachment), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(volumeattachmentsResource, volumeAttachment, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -107,7 +107,7 @@ func (c *FakeVolumeAttachments) Update(ctx context.Context, volumeAttachment *v1 func (c *FakeVolumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.UpdateOptions) (result *v1beta1.VolumeAttachment, err error) { emptyResult := &v1beta1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(volumeattachmentsResource, "status", volumeAttachment), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(volumeattachmentsResource, "status", volumeAttachment, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -123,7 +123,7 @@ func (c *FakeVolumeAttachments) Delete(ctx context.Context, name string, opts v1 // DeleteCollection deletes a collection of objects. func (c *FakeVolumeAttachments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(volumeattachmentsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(volumeattachmentsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1beta1.VolumeAttachmentList{}) return err @@ -133,7 +133,7 @@ func (c *FakeVolumeAttachments) DeleteCollection(ctx context.Context, opts v1.De func (c *FakeVolumeAttachments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeAttachment, err error) { emptyResult := &v1beta1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -155,7 +155,7 @@ func (c *FakeVolumeAttachments) Apply(ctx context.Context, volumeAttachment *sto } emptyResult := &v1beta1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } @@ -178,7 +178,7 @@ func (c *FakeVolumeAttachments) ApplyStatus(ctx context.Context, volumeAttachmen } emptyResult := &v1beta1.VolumeAttachment{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(volumeattachmentsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattachmentsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } diff --git a/kubernetes/typed/storagemigration/v1alpha1/fake/fake_storageversionmigration.go b/kubernetes/typed/storagemigration/v1alpha1/fake/fake_storageversionmigration.go index ede21403a5..c3ff235912 100644 --- a/kubernetes/typed/storagemigration/v1alpha1/fake/fake_storageversionmigration.go +++ b/kubernetes/typed/storagemigration/v1alpha1/fake/fake_storageversionmigration.go @@ -45,7 +45,7 @@ var storageversionmigrationsKind = v1alpha1.SchemeGroupVersion.WithKind("Storage func (c *FakeStorageVersionMigrations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.StorageVersionMigration, err error) { emptyResult := &v1alpha1.StorageVersionMigration{} obj, err := c.Fake. - Invokes(testing.NewRootGetAction(storageversionmigrationsResource, name), emptyResult) + Invokes(testing.NewRootGetActionWithOptions(storageversionmigrationsResource, name, options), emptyResult) if obj == nil { return emptyResult, err } @@ -56,7 +56,7 @@ func (c *FakeStorageVersionMigrations) Get(ctx context.Context, name string, opt func (c *FakeStorageVersionMigrations) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionMigrationList, err error) { emptyResult := &v1alpha1.StorageVersionMigrationList{} obj, err := c.Fake. - Invokes(testing.NewRootListAction(storageversionmigrationsResource, storageversionmigrationsKind, opts), emptyResult) + Invokes(testing.NewRootListActionWithOptions(storageversionmigrationsResource, storageversionmigrationsKind, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -77,14 +77,14 @@ func (c *FakeStorageVersionMigrations) List(ctx context.Context, opts v1.ListOpt // Watch returns a watch.Interface that watches the requested storageVersionMigrations. func (c *FakeStorageVersionMigrations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(storageversionmigrationsResource, opts)) + InvokesWatch(testing.NewRootWatchActionWithOptions(storageversionmigrationsResource, opts)) } // Create takes the representation of a storageVersionMigration and creates it. Returns the server's representation of the storageVersionMigration, and an error, if there is any. func (c *FakeStorageVersionMigrations) Create(ctx context.Context, storageVersionMigration *v1alpha1.StorageVersionMigration, opts v1.CreateOptions) (result *v1alpha1.StorageVersionMigration, err error) { emptyResult := &v1alpha1.StorageVersionMigration{} obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(storageversionmigrationsResource, storageVersionMigration), emptyResult) + Invokes(testing.NewRootCreateActionWithOptions(storageversionmigrationsResource, storageVersionMigration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -95,7 +95,7 @@ func (c *FakeStorageVersionMigrations) Create(ctx context.Context, storageVersio func (c *FakeStorageVersionMigrations) Update(ctx context.Context, storageVersionMigration *v1alpha1.StorageVersionMigration, opts v1.UpdateOptions) (result *v1alpha1.StorageVersionMigration, err error) { emptyResult := &v1alpha1.StorageVersionMigration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(storageversionmigrationsResource, storageVersionMigration), emptyResult) + Invokes(testing.NewRootUpdateActionWithOptions(storageversionmigrationsResource, storageVersionMigration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -107,7 +107,7 @@ func (c *FakeStorageVersionMigrations) Update(ctx context.Context, storageVersio func (c *FakeStorageVersionMigrations) UpdateStatus(ctx context.Context, storageVersionMigration *v1alpha1.StorageVersionMigration, opts v1.UpdateOptions) (result *v1alpha1.StorageVersionMigration, err error) { emptyResult := &v1alpha1.StorageVersionMigration{} obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(storageversionmigrationsResource, "status", storageVersionMigration), emptyResult) + Invokes(testing.NewRootUpdateSubresourceActionWithOptions(storageversionmigrationsResource, "status", storageVersionMigration, opts), emptyResult) if obj == nil { return emptyResult, err } @@ -123,7 +123,7 @@ func (c *FakeStorageVersionMigrations) Delete(ctx context.Context, name string, // DeleteCollection deletes a collection of objects. func (c *FakeStorageVersionMigrations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(storageversionmigrationsResource, listOpts) + action := testing.NewRootDeleteCollectionActionWithOptions(storageversionmigrationsResource, opts, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.StorageVersionMigrationList{}) return err @@ -133,7 +133,7 @@ func (c *FakeStorageVersionMigrations) DeleteCollection(ctx context.Context, opt func (c *FakeStorageVersionMigrations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.StorageVersionMigration, err error) { emptyResult := &v1alpha1.StorageVersionMigration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(storageversionmigrationsResource, name, pt, data, subresources...), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageversionmigrationsResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } @@ -155,7 +155,7 @@ func (c *FakeStorageVersionMigrations) Apply(ctx context.Context, storageVersion } emptyResult := &v1alpha1.StorageVersionMigration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(storageversionmigrationsResource, *name, types.ApplyPatchType, data), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageversionmigrationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } @@ -178,7 +178,7 @@ func (c *FakeStorageVersionMigrations) ApplyStatus(ctx context.Context, storageV } emptyResult := &v1alpha1.StorageVersionMigration{} obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(storageversionmigrationsResource, *name, types.ApplyPatchType, data, "status"), emptyResult) + Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageversionmigrationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } From 2923011bfdd9a17a5e5d2371534ea194a6bb9033 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Mon, 24 Jun 2024 16:48:46 -0700 Subject: [PATCH 107/159] Merge pull request #125560 from jpbetz/apply-gen-fake Add field management support to fake client-go typed client Kubernetes-commit: d236a9127fe36317bb35854d63b275d7efdb399e --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 4fc2b570f7..5f8f05cbbc 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240620180645-9f6f03ff043b - k8s.io/apimachinery v0.0.0-20240620180412-04fe5186a7b1 + k8s.io/api v0.0.0-20240620180646-e09016fffd8e + k8s.io/apimachinery v0.0.0-20240624224638-0e02b52b8933 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b diff --git a/go.sum b/go.sum index d7604e6052..66ed1f591c 100644 --- a/go.sum +++ b/go.sum @@ -157,10 +157,10 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240620180645-9f6f03ff043b h1:MlO1MxAa8kX7fiaDMVyFJYqqancoCHGggG9UurjrKNc= -k8s.io/api v0.0.0-20240620180645-9f6f03ff043b/go.mod h1:1MT1m3FZiytU3Iz+RVL9/0UV96hiPGA1mPCSCgP0QTk= -k8s.io/apimachinery v0.0.0-20240620180412-04fe5186a7b1 h1:avzIPRkvVSlb207+JV7eZv498CJ0EBDMKvwmcTS3m2k= -k8s.io/apimachinery v0.0.0-20240620180412-04fe5186a7b1/go.mod h1:wKr/cy6yAwcKdBBcxyg2m/xTdMwHdCRNo7Wt2GxZEP8= +k8s.io/api v0.0.0-20240620180646-e09016fffd8e h1:sikgfs6oUZr6NPm/El/AQPSUb8OFsnI4Vkwch/o4l1g= +k8s.io/api v0.0.0-20240620180646-e09016fffd8e/go.mod h1:1MT1m3FZiytU3Iz+RVL9/0UV96hiPGA1mPCSCgP0QTk= +k8s.io/apimachinery v0.0.0-20240624224638-0e02b52b8933 h1:fsde6T4riRzZKW3G3hDHgPuUAGocYZt4NEGA5Q4HhmQ= +k8s.io/apimachinery v0.0.0-20240624224638-0e02b52b8933/go.mod h1:wKr/cy6yAwcKdBBcxyg2m/xTdMwHdCRNo7Wt2GxZEP8= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 91774658e7d41eb7ff356490028cb516ad0c92f6 Mon Sep 17 00:00:00 2001 From: Ben Luddy Date: Mon, 24 Jun 2024 09:49:40 -0400 Subject: [PATCH 108/159] Bump github.com/fxamacker/cbor/v2 to v2.7.0. Kubernetes-commit: dbe4c093d9f5b85fa509042556edf61fb6503b22 --- go.mod | 12 +++++++++--- go.sum | 16 ++++++++++------ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 5d49817e2b..bbe242394e 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.34.1 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240626062051-8d690604aff5 - k8s.io/apimachinery v0.0.0-20240626061443-e3238d482de2 + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -38,7 +38,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/go-restful/v3 v3.12.0 // indirect - github.com/fxamacker/cbor/v2 v2.7.0-beta // indirect + github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect @@ -62,3 +62,9 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace ( + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go +) diff --git a/go.sum b/go.sum index 2d69e7b2f6..1ba7d6de5d 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,8 @@ +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -7,8 +10,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/emicklei/go-restful/v3 v3.12.0 h1:y2DdzBAURM29NFF94q6RaY4vjIH1rtwDapwQtU84iWk= github.com/emicklei/go-restful/v3 v3.12.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/fxamacker/cbor/v2 v2.7.0-beta h1:m5bO941uTVpSms26QjzEJxUZaC3S/h1pSJexBCu4wAA= -github.com/fxamacker/cbor/v2 v2.7.0-beta/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= +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.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= @@ -91,6 +94,7 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= @@ -106,8 +110,10 @@ go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -142,6 +148,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -157,10 +164,7 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240626062051-8d690604aff5 h1:JvY8RSMS88eO22Dc/LYWoGDJOqZxmXLFCGfCYR8nmco= -k8s.io/api v0.0.0-20240626062051-8d690604aff5/go.mod h1:+jlyg3SLRsLkNHNualAKSdp9Ak1b9760IruFv7JEWLY= -k8s.io/apimachinery v0.0.0-20240626061443-e3238d482de2 h1:8aCIzmIFyMI4m61BszEsn7STkqSqaUyyeO6pO/xWU44= -k8s.io/apimachinery v0.0.0-20240626061443-e3238d482de2/go.mod h1:zUlpBgZTso9yGNGOs39ctT7fee2XtzDkdlylJNmsv98= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From dd940936eec9502227a9e9e95e55167d40cb363c Mon Sep 17 00:00:00 2001 From: Joe Betz Date: Tue, 25 Jun 2024 13:31:03 -0400 Subject: [PATCH 109/159] Remove test dependency on swwagger.json to fix client-go repo Kubernetes-commit: 1095af88e7d30198e13299ea90c5f81b95ec8a3b --- testing/fixture_test.go | 122 +++++++++++++++++++++++++++++++--------- 1 file changed, 96 insertions(+), 26 deletions(-) diff --git a/testing/fixture_test.go b/testing/fixture_test.go index efa6777c4f..e2a5ea8f35 100644 --- a/testing/fixture_test.go +++ b/testing/fixture_test.go @@ -17,13 +17,10 @@ limitations under the License. package testing import ( - "encoding/json" "fmt" "math/rand" - "os" - "path/filepath" + "sigs.k8s.io/structured-merge-diff/v4/typed" "strconv" - "strings" "sync" "testing" @@ -40,7 +37,6 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/managedfields" "k8s.io/apimachinery/pkg/watch" - "k8s.io/kube-openapi/pkg/validation/spec" "k8s.io/utils/ptr" ) @@ -289,7 +285,7 @@ func TestApplyCreate(t *testing.T) { scheme := runtime.NewScheme() scheme.AddKnownTypes(cmResource.GroupVersion(), &v1.ConfigMap{}) codecs := serializer.NewCodecFactory(scheme) - o := NewFieldManagedObjectTracker(scheme, codecs.UniversalDecoder(), fakeTypeConverter) + o := NewFieldManagedObjectTracker(scheme, codecs.UniversalDecoder(), configMapTypeConverter(scheme)) reaction := ObjectReaction(o) patch := []byte(`{"apiVersion": "v1", "kind": "ConfigMap", "metadata": {"name": "cm-1"}, "data": {"k": "v"}}`) @@ -309,7 +305,7 @@ func TestApplyUpdateMultipleFieldManagers(t *testing.T) { scheme := runtime.NewScheme() scheme.AddKnownTypes(cmResource.GroupVersion(), &v1.ConfigMap{}) codecs := serializer.NewCodecFactory(scheme) - o := NewFieldManagedObjectTracker(scheme, codecs.UniversalDecoder(), fakeTypeConverter) + o := NewFieldManagedObjectTracker(scheme, codecs.UniversalDecoder(), configMapTypeConverter(scheme)) reaction := ObjectReaction(o) action := NewCreateAction(cmResource, "default", &v1.ConfigMap{ @@ -549,24 +545,98 @@ func Test_resourceCovers(t *testing.T) { } } -var fakeTypeConverter = func() managedfields.TypeConverter { - data, err := os.ReadFile(filepath.Join(strings.Repeat(".."+string(filepath.Separator), 5), - "api", "openapi-spec", "swagger.json")) +func configMapTypeConverter(scheme *runtime.Scheme) managedfields.TypeConverter { + parser, err := typed.NewParser(configMapTypedSchema) if err != nil { - panic(err) + panic(fmt.Sprintf("Failed to parse schema: %v", err)) } - swag := spec.Swagger{} - if err := json.Unmarshal(data, &swag); err != nil { - panic(err) - } - convertedDefs := map[string]*spec.Schema{} - for k, v := range swag.Definitions { - vCopy := v - convertedDefs[k] = &vCopy - } - typeConverter, err := managedfields.NewTypeConverter(convertedDefs, false) - if err != nil { - panic(err) - } - return typeConverter -}() + + return TypeConverter{Scheme: scheme, TypeResolver: parser} +} + +var configMapTypedSchema = typed.YAMLObject(`types: +- name: io.k8s.api.core.v1.ConfigMap + map: + fields: + - name: apiVersion + type: + scalar: string + - name: data + type: + map: + elementType: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} +- name: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + map: + fields: + - name: creationTimestamp + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: managedFields + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry + elementRelationship: atomic + - name: name + type: + scalar: string + - name: namespace + type: + scalar: string +- name: io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry + map: + fields: + - name: apiVersion + type: + scalar: string + - name: fieldsType + type: + scalar: string + - name: fieldsV1 + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1 + - name: manager + type: + scalar: string + - name: operation + type: + scalar: string + - name: subresource + type: + scalar: string + - name: time + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time +- name: io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1 + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.apimachinery.pkg.apis.meta.v1.Time + scalar: untyped +- name: __untyped_deduced_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +`) From 6090471cca1b86ea0e1430425fe66003fa682e00 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Tue, 25 Jun 2024 14:18:33 -0700 Subject: [PATCH 110/159] Merge pull request #125669 from benluddy/cbor-bump-v2.7.0 KEP-4222: Bump github.com/fxamacker/cbor/v2 to v2.7.0. Kubernetes-commit: beb48b7f5df83cd56275f471e52ef588ba845093 --- go.mod | 10 ++-------- go.sum | 12 ++++-------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index bbe242394e..a1cbcfcdff 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.34.1 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0 - k8s.io/apimachinery v0.0.0 + k8s.io/api v0.0.0-20240626062052-149781fc54f5 + k8s.io/apimachinery v0.0.0-20240626061444-123bf3a82130 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -62,9 +62,3 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace ( - k8s.io/api => ../api - k8s.io/apimachinery => ../apimachinery - k8s.io/client-go => ../client-go -) diff --git a/go.sum b/go.sum index 1ba7d6de5d..5910236539 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,5 @@ -cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -94,7 +91,6 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= @@ -110,10 +106,8 @@ go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -148,7 +142,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -164,7 +157,10 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= +k8s.io/api v0.0.0-20240626062052-149781fc54f5 h1:yqS/8fRAivOgCF1sgfIwxp1A/S2VrPpudN0V3RfHj6M= +k8s.io/api v0.0.0-20240626062052-149781fc54f5/go.mod h1:WzXtjaoUCXrzbvJtK/lCWCih7nCdOFqgkgptCo1OH/w= +k8s.io/apimachinery v0.0.0-20240626061444-123bf3a82130 h1:+IEpG+qbdIp0hgdKL+AMPPAfM5PJ1PE8e/PAeNzocWU= +k8s.io/apimachinery v0.0.0-20240626061444-123bf3a82130/go.mod h1:WJc1RfanAukQew7I55uKC34w5zx50UFDD5qo/JD4dNE= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 0fbd594bc217b0c80da6a65d12fcaae48a94d27d Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Wed, 26 Jun 2024 14:13:33 +0000 Subject: [PATCH 111/159] Revert "update OpenTelemetry dependencies" This reverts commit 82e9ce79c763f1028f542b1246114082430e6b20. Kubernetes-commit: e94047c9002c17a3b76513c3cde2d53aed39b7fb --- go.mod | 18 ++++++++++++------ go.sum | 31 +++++++++++++++++-------------- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index 881541c9eb..61a1a3c0dc 100644 --- a/go.mod +++ b/go.mod @@ -11,22 +11,22 @@ require ( github.com/google/gnostic-models v0.6.8 github.com/google/go-cmp v0.6.0 github.com/google/gofuzz v1.2.0 - github.com/google/uuid v1.6.0 + github.com/google/uuid v1.3.1 github.com/gorilla/websocket v1.5.0 github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 github.com/imdario/mergo v0.3.6 github.com/peterbourgon/diskv v2.0.1+incompatible github.com/spf13/pflag v1.0.5 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.8.4 go.uber.org/goleak v1.3.0 golang.org/x/net v0.25.0 golang.org/x/oauth2 v0.20.0 golang.org/x/term v0.20.0 golang.org/x/time v0.3.0 - google.golang.org/protobuf v1.34.1 + google.golang.org/protobuf v1.33.0 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240626062052-149781fc54f5 - k8s.io/apimachinery v0.0.0-20240626061446-c225984b7bed + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -37,7 +37,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/emicklei/go-restful/v3 v3.12.0 // indirect + github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect @@ -62,3 +62,9 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace ( + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go +) diff --git a/go.sum b/go.sum index e5b5ea5985..727d841d84 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,15 @@ +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/emicklei/go-restful/v3 v3.12.0 h1:y2DdzBAURM29NFF94q6RaY4vjIH1rtwDapwQtU84iWk= -github.com/emicklei/go-restful/v3 v3.12.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +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/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.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= @@ -38,8 +41,8 @@ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM= github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -84,8 +87,8 @@ 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/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/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -95,8 +98,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= 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/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -106,8 +109,10 @@ go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -142,8 +147,9 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= -google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= 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= @@ -157,10 +163,7 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240626062052-149781fc54f5 h1:yqS/8fRAivOgCF1sgfIwxp1A/S2VrPpudN0V3RfHj6M= -k8s.io/api v0.0.0-20240626062052-149781fc54f5/go.mod h1:WzXtjaoUCXrzbvJtK/lCWCih7nCdOFqgkgptCo1OH/w= -k8s.io/apimachinery v0.0.0-20240626061446-c225984b7bed h1:uJ7kyuzfVNEOMtzKLgbR4aUBZ1a++mNQPgBOeNii610= -k8s.io/apimachinery v0.0.0-20240626061446-c225984b7bed/go.mod h1:WJc1RfanAukQew7I55uKC34w5zx50UFDD5qo/JD4dNE= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 88829a42b75c852edaa42013cd4c6ed75f0b17e8 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Wed, 26 Jun 2024 10:59:18 -0700 Subject: [PATCH 112/159] Merge pull request #125731 from dashpole/revert_otel Revert "Update opentelemetry dependencies to the latest release." Kubernetes-commit: a4b8d0faa8e7d3227cbdda39241998d38f1c294e --- go.mod | 10 ++-------- go.sum | 11 ++++------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 61a1a3c0dc..6a01f67c67 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0 - k8s.io/apimachinery v0.0.0 + k8s.io/api v0.0.0-20240626182217-e025325e26d9 + k8s.io/apimachinery v0.0.0-20240626181934-01e80c94aa3d k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -62,9 +62,3 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace ( - k8s.io/api => ../api - k8s.io/apimachinery => ../apimachinery - k8s.io/client-go => ../client-go -) diff --git a/go.sum b/go.sum index 727d841d84..53c9484981 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,5 @@ -cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -109,10 +106,8 @@ go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -147,7 +142,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -163,7 +157,10 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= +k8s.io/api v0.0.0-20240626182217-e025325e26d9 h1:X44rlrfL9raYAeTdQin9ml5opO0SAfsFMHs7TV0UWv4= +k8s.io/api v0.0.0-20240626182217-e025325e26d9/go.mod h1:aJpJykBcvFzrEmoawdT8TjyxAJrp996V2NHz/eKgvrg= +k8s.io/apimachinery v0.0.0-20240626181934-01e80c94aa3d h1:PI8ONv9r5xrdM//0BdiLwSsVJSoLXUK51CLPCQY5Ezw= +k8s.io/apimachinery v0.0.0-20240626181934-01e80c94aa3d/go.mod h1:fHtYPEGOJ0v5phs8kGMb2EX2tF8J3NvyWKNR745wW9o= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 11d68076037156eb19be85ddcb3514e956c02470 Mon Sep 17 00:00:00 2001 From: Benjamin Elder Date: Wed, 26 Jun 2024 12:27:14 -0700 Subject: [PATCH 113/159] bump github.com/moby/spdystream to v0.3.0 picks up fix for data-race in Ping Kubernetes-commit: c5aa8fdc711982dd589a9ac940b05297cc46b4a5 --- go.mod | 12 +++++++++--- go.sum | 15 +++++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 6a01f67c67..4ce1788e24 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240626182217-e025325e26d9 - k8s.io/apimachinery v0.0.0-20240626181934-01e80c94aa3d + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -47,7 +47,7 @@ require ( 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/moby/spdystream v0.2.0 // indirect + github.com/moby/spdystream v0.3.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 @@ -62,3 +62,9 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace ( + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go +) diff --git a/go.sum b/go.sum index 53c9484981..2e429ae568 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,8 @@ +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -62,8 +65,8 @@ 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/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= +github.com/moby/spdystream v0.3.0 h1:mxy9IuMvUApeQ00pOuFHxl1aCRFdj4P19jcZkdyixAs= +github.com/moby/spdystream v0.3.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= 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= @@ -106,8 +109,10 @@ go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -142,6 +147,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -157,10 +163,7 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240626182217-e025325e26d9 h1:X44rlrfL9raYAeTdQin9ml5opO0SAfsFMHs7TV0UWv4= -k8s.io/api v0.0.0-20240626182217-e025325e26d9/go.mod h1:aJpJykBcvFzrEmoawdT8TjyxAJrp996V2NHz/eKgvrg= -k8s.io/apimachinery v0.0.0-20240626181934-01e80c94aa3d h1:PI8ONv9r5xrdM//0BdiLwSsVJSoLXUK51CLPCQY5Ezw= -k8s.io/apimachinery v0.0.0-20240626181934-01e80c94aa3d/go.mod h1:fHtYPEGOJ0v5phs8kGMb2EX2tF8J3NvyWKNR745wW9o= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From b043b561b47b208a5f4e21f6e36b383beb3e320f Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Wed, 26 Jun 2024 15:15:41 -0700 Subject: [PATCH 114/159] Merge pull request #125745 from BenTheElder/ping-ping bump github.com/moby/spdystream to v0.3.0 Kubernetes-commit: 11446a394fb851d3496d31d96a67f8fcba6348e3 --- go.mod | 10 ++-------- go.sum | 11 ++++------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 4ce1788e24..e81c1a4718 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0 - k8s.io/apimachinery v0.0.0 + k8s.io/api v0.0.0-20240626222244-89b2da1f0aa2 + k8s.io/apimachinery v0.0.0-20240626221953-276559d39884 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -62,9 +62,3 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace ( - k8s.io/api => ../api - k8s.io/apimachinery => ../apimachinery - k8s.io/client-go => ../client-go -) diff --git a/go.sum b/go.sum index 2e429ae568..72056745c3 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,5 @@ -cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -109,10 +106,8 @@ go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -147,7 +142,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -163,7 +157,10 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= +k8s.io/api v0.0.0-20240626222244-89b2da1f0aa2 h1:QOw2QiBBiIG84mSsdmcQytk3iZNRA4MMTrfdxq6wMqM= +k8s.io/api v0.0.0-20240626222244-89b2da1f0aa2/go.mod h1:XZWSQ1mG1E6aV7roOnViE6A/NQzmDs3oLr1uEdTIgho= +k8s.io/apimachinery v0.0.0-20240626221953-276559d39884 h1:/TR/WnQHZvcTpgDyX8ekmTqXa5PsCgpEeuOVuFRqTtQ= +k8s.io/apimachinery v0.0.0-20240626221953-276559d39884/go.mod h1:FrtEnYmygkWHqq5eevqPc8AvY7pEqYQnNzaAFRnhgUI= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 66473c1f2b65e8de755ec91102aae0a146d1506c Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Thu, 27 Jun 2024 07:58:24 -0400 Subject: [PATCH 115/159] Bump `prometheus/common to` v0.55.0 Signed-off-by: Davanum Srinivas Kubernetes-commit: 35ccdc8b35f1c4346071d4ff0efecdd7a6bcdecc --- go.mod | 26 ++++++++++++++++---------- go.sum | 50 ++++++++++++++++++++++++++++---------------------- 2 files changed, 44 insertions(+), 32 deletions(-) diff --git a/go.mod b/go.mod index 90d2ec204c..6c3eff5bf2 100644 --- a/go.mod +++ b/go.mod @@ -17,16 +17,16 @@ require ( github.com/imdario/mergo v0.3.6 github.com/peterbourgon/diskv v2.0.1+incompatible github.com/spf13/pflag v1.0.5 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 go.uber.org/goleak v1.3.0 - golang.org/x/net v0.25.0 - golang.org/x/oauth2 v0.20.0 - golang.org/x/term v0.20.0 + golang.org/x/net v0.26.0 + golang.org/x/oauth2 v0.21.0 + golang.org/x/term v0.21.0 golang.org/x/time v0.3.0 - google.golang.org/protobuf v1.33.0 + google.golang.org/protobuf v1.34.2 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240628022219-236105ace257 - k8s.io/apimachinery v0.0.0-20240627221929-1dfa5d9369be + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -47,7 +47,7 @@ require ( 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/moby/spdystream v0.4.0 // indirect + github.com/moby/spdystream v0.3.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 @@ -56,9 +56,15 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/x448/float16 v0.8.4 // indirect - golang.org/x/sys v0.20.0 // indirect - golang.org/x/text v0.15.0 // indirect + golang.org/x/sys v0.21.0 // indirect + golang.org/x/text v0.16.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace ( + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go +) diff --git a/go.sum b/go.sum index 2eb576cbea..457c0ccc93 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,8 @@ +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -40,6 +43,7 @@ github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2 github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= @@ -61,8 +65,8 @@ 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/moby/spdystream v0.4.0 h1:Vy79D6mHeJJjiPdFEL2yku1kl0chZpJfZcPpb16BRl8= -github.com/moby/spdystream v0.4.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI= +github.com/moby/spdystream v0.3.0 h1:mxy9IuMvUApeQ00pOuFHxl1aCRFdj4P19jcZkdyixAs= +github.com/moby/spdystream v0.3.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= 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= @@ -90,12 +94,13 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= 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/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -105,44 +110,48 @@ go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo= -golang.org/x/oauth2 v0.20.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= +golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.21.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= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= -golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= +golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= -golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= -golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= 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= @@ -156,10 +165,7 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240628022219-236105ace257 h1:puFOIBc02LWUR4zXQa/XlZbJuLoaN510JI7XeWaInXI= -k8s.io/api v0.0.0-20240628022219-236105ace257/go.mod h1:0QPJgYT0HHTfhG4vPXwmQWIQES72tLiJH7hqx0MwCZM= -k8s.io/apimachinery v0.0.0-20240627221929-1dfa5d9369be h1:fM+zMY8GgcjMRZ1dmOdvumAPteKwaMr9+5a5+22A5+c= -k8s.io/apimachinery v0.0.0-20240627221929-1dfa5d9369be/go.mod h1:WQ51EHETbbJacI2EJKk06Vn3lV4xjNFuF7DlOAW8Bhg= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From a2665afaf686edca9cb7ed5f788f036262d60d95 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Thu, 27 Jun 2024 13:07:47 -0400 Subject: [PATCH 116/159] Update moby/spdystream to v0.4.0 Signed-off-by: Davanum Srinivas Kubernetes-commit: 377a3f7ec4dc2b5e09e0aadb651999d400c31538 --- go.mod | 12 +++++++++--- go.sum | 16 +++++++++------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 5e27358f4b..669aba00bc 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.33.0 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240627182225-77d4ad8e83c3 - k8s.io/apimachinery v0.0.0-20240627021949-65a3763a09c0 + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -47,7 +47,7 @@ require ( 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/moby/spdystream v0.3.0 // indirect + github.com/moby/spdystream v0.4.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 @@ -62,3 +62,9 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace ( + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go +) diff --git a/go.sum b/go.sum index f96185d0f9..73d6608d6f 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,8 @@ +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -40,7 +43,6 @@ github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2 github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= @@ -62,8 +64,8 @@ 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/moby/spdystream v0.3.0 h1:mxy9IuMvUApeQ00pOuFHxl1aCRFdj4P19jcZkdyixAs= -github.com/moby/spdystream v0.3.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= +github.com/moby/spdystream v0.4.0 h1:Vy79D6mHeJJjiPdFEL2yku1kl0chZpJfZcPpb16BRl8= +github.com/moby/spdystream v0.4.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI= github.com/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= @@ -106,8 +108,10 @@ go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -142,6 +146,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -157,10 +162,7 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240627182225-77d4ad8e83c3 h1:P7Op/rq70kcXXoojMkjY8VbOzIQaw5mEDLLieIez2L4= -k8s.io/api v0.0.0-20240627182225-77d4ad8e83c3/go.mod h1:ZQKk86qwk98AIUL9v2u4BNJzwSDpgqRGvk+S8YZUvS8= -k8s.io/apimachinery v0.0.0-20240627021949-65a3763a09c0 h1:17lF7vlxY6e+aHczjOO7gA/oF2zzI1u/oeOgPERcpH8= -k8s.io/apimachinery v0.0.0-20240627021949-65a3763a09c0/go.mod h1:FrtEnYmygkWHqq5eevqPc8AvY7pEqYQnNzaAFRnhgUI= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From acc5917341fd946dfa3c809c59d540bb35cfeb4a Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Fri, 28 Jun 2024 21:20:13 +0200 Subject: [PATCH 117/159] fix: enable empty and len rules from testifylint on pkg package Signed-off-by: Matthieu MOREL Co-authored-by: Patrick Ohly Kubernetes-commit: f014b754fb5925dfbca6e27a44d0c3968b157e14 --- discovery/cached/disk/cached_discovery_test.go | 4 ++-- discovery/cached/memory/memcache_test.go | 4 ++-- tools/cache/reflector_test.go | 2 +- .../list_data_consistency_detector_test.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/discovery/cached/disk/cached_discovery_test.go b/discovery/cached/disk/cached_discovery_test.go index f27f2a4331..e95eb13cb3 100644 --- a/discovery/cached/disk/cached_discovery_test.go +++ b/discovery/cached/disk/cached_discovery_test.go @@ -152,7 +152,7 @@ func TestOpenAPIDiskCache(t *testing.T) { require.NoError(t, err) defer fakeServer.HttpServer.Close() - require.Greater(t, len(fakeServer.ServedDocuments), 0) + require.NotEmpty(t, fakeServer.ServedDocuments) client, err := NewCachedDiscoveryClientForConfig( &restclient.Config{Host: fakeServer.HttpServer.URL}, @@ -175,7 +175,7 @@ func TestOpenAPIDiskCache(t *testing.T) { paths, err := openapiClient.Paths() require.NoError(t, err) assert.Equal(t, 1, fakeServer.RequestCounters["/openapi/v3"]) - require.Greater(t, len(paths), 0) + require.NotEmpty(t, paths) contentTypes := []string{ runtime.ContentTypeJSON, openapi.ContentTypeOpenAPIV3PB, diff --git a/discovery/cached/memory/memcache_test.go b/discovery/cached/memory/memcache_test.go index dbd7b46cde..3c8f1a17c2 100644 --- a/discovery/cached/memory/memcache_test.go +++ b/discovery/cached/memory/memcache_test.go @@ -411,7 +411,7 @@ func TestOpenAPIMemCache(t *testing.T) { require.NoError(t, err) defer fakeServer.HttpServer.Close() - require.Greater(t, len(fakeServer.ServedDocuments), 0) + require.NotEmpty(t, fakeServer.ServedDocuments) client := NewMemCacheClient( discovery.NewDiscoveryClientForConfigOrDie( @@ -604,7 +604,7 @@ func TestMemCacheGroupsAndMaybeResources(t *testing.T) { require.NoError(t, err) // "Unaggregated" discovery always returns nil for resources. assert.Nil(t, resourcesMap) - assert.True(t, len(failedGVs) == 0, "expected empty failed GroupVersions, got (%d)", len(failedGVs)) + assert.Emptyf(t, failedGVs, "expected empty failed GroupVersions, got (%d)", len(failedGVs)) assert.False(t, memClient.receivedAggregatedDiscovery) assert.True(t, memClient.Fresh()) // Test the expected groups are returned for the aggregated format. diff --git a/tools/cache/reflector_test.go b/tools/cache/reflector_test.go index 1b4904a627..e9b14b3a4b 100644 --- a/tools/cache/reflector_test.go +++ b/tools/cache/reflector_test.go @@ -194,7 +194,7 @@ func TestReflectorWatchStoppedAfter(t *testing.T) { err := target.watch(nil, stopCh, nil) require.NoError(t, err) - require.Equal(t, 1, len(watchers)) + require.Len(t, watchers, 1) require.True(t, watchers[0].IsStopped()) } diff --git a/util/consistencydetector/list_data_consistency_detector_test.go b/util/consistencydetector/list_data_consistency_detector_test.go index e0a250166d..a4bd8c9cdf 100644 --- a/util/consistencydetector/list_data_consistency_detector_test.go +++ b/util/consistencydetector/list_data_consistency_detector_test.go @@ -132,7 +132,7 @@ func TestCheckListFromCacheDataConsistencyIfRequestedInternalHappyPath(t *testin checkListFromCacheDataConsistencyIfRequestedInternal(ctx, "", fakeLister.List, listOptions, scenario.retrievedList) require.Equal(t, 1, fakeLister.counter) - require.Equal(t, 1, len(fakeLister.requestOptions)) + require.Len(t, fakeLister.requestOptions, 1) require.Equal(t, fakeLister.requestOptions[0], scenario.expectedRequestOptions) }) } From c45bc431c3357384b0e4b88d35e265638db1b8eb Mon Sep 17 00:00:00 2001 From: Feilian Xie Date: Thu, 4 Jul 2024 17:29:57 +0800 Subject: [PATCH 118/159] Return the error returned by Invokes so the FakeDiscovery client is able to simulate any error with reactors. Signed-off-by: Feilian Xie Kubernetes-commit: 33557a2f6c82d10fa6a459d2ebac56d6a2670492 --- discovery/fake/discovery.go | 12 ++++++--- discovery/fake/discovery_test.go | 45 ++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/discovery/fake/discovery.go b/discovery/fake/discovery.go index f8a78e1ef4..e5d9e7f800 100644 --- a/discovery/fake/discovery.go +++ b/discovery/fake/discovery.go @@ -47,7 +47,9 @@ func (c *FakeDiscovery) ServerResourcesForGroupVersion(groupVersion string) (*me Verb: "get", Resource: schema.GroupVersionResource{Resource: "resource"}, } - c.Invokes(action, nil) + if _, err := c.Invokes(action, nil); err != nil { + return nil, err + } for _, resourceList := range c.Resources { if resourceList.GroupVersion == groupVersion { return resourceList, nil @@ -77,7 +79,9 @@ func (c *FakeDiscovery) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav Verb: "get", Resource: schema.GroupVersionResource{Resource: "resource"}, } - c.Invokes(action, nil) + if _, err = c.Invokes(action, nil); err != nil { + return resultGroups, c.Resources, err + } return resultGroups, c.Resources, nil } @@ -100,7 +104,9 @@ func (c *FakeDiscovery) ServerGroups() (*metav1.APIGroupList, error) { Verb: "get", Resource: schema.GroupVersionResource{Resource: "group"}, } - c.Invokes(action, nil) + if _, err := c.Invokes(action, nil); err != nil { + return nil, err + } groups := map[string]*metav1.APIGroup{} diff --git a/discovery/fake/discovery_test.go b/discovery/fake/discovery_test.go index 946b484fab..44c5d74419 100644 --- a/discovery/fake/discovery_test.go +++ b/discovery/fake/discovery_test.go @@ -63,3 +63,48 @@ func TestFakingServerVersionWithError(t *testing.T) { t.Fatal("ServerVersion should return expected error, returned different error instead") } } + +func TestFakingServerResourcesForGroupVersionWithError(t *testing.T) { + expectedError := errors.New("an error occurred") + fakeClient := fakeclientset.NewClientset() + fakeClient.Discovery().(*fakediscovery.FakeDiscovery).PrependReactor("*", "*", func(action kubetesting.Action) (handled bool, ret runtime.Object, err error) { + return true, nil, expectedError + }) + + result, err := fakeClient.Discovery().ServerResourcesForGroupVersion("dummy.group.io/v1beta2") + if result != nil { + t.Errorf(`expect result to be nil but got "%v" instead`, result) + } + if !errors.Is(err, expectedError) { + t.Errorf(`expect error to be "%v" but got "%v" instead`, expectedError, err) + } +} + +func TestFakingServerGroupsWithError(t *testing.T) { + expectedError := errors.New("an error occurred") + fakeClient := fakeclientset.NewClientset() + fakeClient.Discovery().(*fakediscovery.FakeDiscovery).PrependReactor("*", "*", func(action kubetesting.Action) (handled bool, ret runtime.Object, err error) { + return true, nil, expectedError + }) + + result, err := fakeClient.Discovery().ServerGroups() + if result != nil { + t.Errorf(`expect result to be nil but got "%v" instead`, result) + } + if !errors.Is(err, expectedError) { + t.Errorf(`expect error to be "%v" but got "%v" instead`, expectedError, err) + } +} + +func TestFakingServerGroupsAndResourcesWithError(t *testing.T) { + expectedError := errors.New("an error occurred") + fakeClient := fakeclientset.NewClientset() + fakeClient.Discovery().(*fakediscovery.FakeDiscovery).PrependReactor("get", "resource", func(action kubetesting.Action) (handled bool, ret runtime.Object, err error) { + return true, nil, expectedError + }) + + _, _, err := fakeClient.Discovery().ServerGroupsAndResources() + if !errors.Is(err, expectedError) { + t.Errorf(`expect error to be "%v" but got "%v" instead`, expectedError, err) + } +} From e57f1620317a22726ee5ab704d552c423475df26 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Fri, 5 Jul 2024 12:10:07 -0400 Subject: [PATCH 119/159] update OpenTelemetry dependencies and grpc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This update dropped the otelgrpc → cloud.google.com/go/compute dependency, among others. This dropped out because genproto cleaned up it's dependencies on google cloud libraries, and otel updated - details in #113366. Signed-off-by: Davanum Srinivas Co-Authored-By: David Ashpole Kubernetes-commit: ff7942be83ed0c0aaa8c258e8e2b9965d383935c --- go.mod | 14 ++++++++++---- go.sum | 25 +++++++++++++++---------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index b10ef44498..ed72ce35c7 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/google/gnostic-models v0.6.8 github.com/google/go-cmp v0.6.0 github.com/google/gofuzz v1.2.0 - github.com/google/uuid v1.3.1 + github.com/google/uuid v1.6.0 github.com/gorilla/websocket v1.5.0 github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 github.com/imdario/mergo v0.3.6 @@ -25,8 +25,8 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.34.2 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240630182222-e7b4471d3970 - k8s.io/apimachinery v0.0.0-20240706120253-f813d2809226 + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b @@ -39,7 +39,7 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.4 // indirect @@ -62,3 +62,9 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace ( + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go +) diff --git a/go.sum b/go.sum index fc714cbdac..063ac556cc 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,8 @@ +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -9,8 +12,8 @@ github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxER github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= 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.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= 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/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= @@ -38,8 +41,8 @@ github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM= github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= -github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= -github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= @@ -83,13 +86,14 @@ 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/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= @@ -105,8 +109,10 @@ go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -118,6 +124,7 @@ golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbht 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= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -141,6 +148,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -156,10 +164,7 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240630182222-e7b4471d3970 h1:rml67zMN0uvq6wSHy0DeI6jGjOm/saaA8kIKY1kIOmY= -k8s.io/api v0.0.0-20240630182222-e7b4471d3970/go.mod h1:4FMNrXJxgv377lr0HMOJOqwqiNREPvoveZYRveA//xU= -k8s.io/apimachinery v0.0.0-20240706120253-f813d2809226 h1:pN3A5pOLKKsMIiqH2q+vgPCDY7UfhGFiQ5hlUwRM4A8= -k8s.io/apimachinery v0.0.0-20240706120253-f813d2809226/go.mod h1:HaB7jl7MnnH0C8g+t13Fw226p3U88ZDog/Dt8pQRZUI= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 127e4c3902e38f980890a46b94c37cf602fadedd Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Sat, 6 Jul 2024 15:31:50 -0700 Subject: [PATCH 120/159] Merge pull request #125887 from fxierh/fakediscovery-fix [client-go] Enable FakeDiscovery client to simulate errors by fixing error handling Kubernetes-commit: 40225a788c299352346db3751ecd48a333d98fd0 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 24bd4447c9..b10ef44498 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( google.golang.org/protobuf v1.34.2 gopkg.in/evanphx/json-patch.v4 v4.12.0 k8s.io/api v0.0.0-20240630182222-e7b4471d3970 - k8s.io/apimachinery v0.0.0-20240628175805-ef4453d2613f + k8s.io/apimachinery v0.0.0-20240706120253-f813d2809226 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b diff --git a/go.sum b/go.sum index ecc25d29e6..fc714cbdac 100644 --- a/go.sum +++ b/go.sum @@ -158,8 +158,8 @@ 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.0.0-20240630182222-e7b4471d3970 h1:rml67zMN0uvq6wSHy0DeI6jGjOm/saaA8kIKY1kIOmY= k8s.io/api v0.0.0-20240630182222-e7b4471d3970/go.mod h1:4FMNrXJxgv377lr0HMOJOqwqiNREPvoveZYRveA//xU= -k8s.io/apimachinery v0.0.0-20240628175805-ef4453d2613f h1:LFzF3OPvEFldgFy9gpdsniTeVpaOCkjl38RVt9o7YkY= -k8s.io/apimachinery v0.0.0-20240628175805-ef4453d2613f/go.mod h1:HaB7jl7MnnH0C8g+t13Fw226p3U88ZDog/Dt8pQRZUI= +k8s.io/apimachinery v0.0.0-20240706120253-f813d2809226 h1:pN3A5pOLKKsMIiqH2q+vgPCDY7UfhGFiQ5hlUwRM4A8= +k8s.io/apimachinery v0.0.0-20240706120253-f813d2809226/go.mod h1:HaB7jl7MnnH0C8g+t13Fw226p3U88ZDog/Dt8pQRZUI= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 55c0e2c777943613e2776629a089c88e4396cbc1 Mon Sep 17 00:00:00 2001 From: Timo Furrer Date: Mon, 8 Jul 2024 07:52:38 +0200 Subject: [PATCH 121/159] Fix typo in type name of watch decode error Kubernetes-commit: fed49d06aac3f003f7b2df35ffed6b2f16ef2548 --- rest/watch/decoder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest/watch/decoder.go b/rest/watch/decoder.go index e95c020b2e..9e1e04d14e 100644 --- a/rest/watch/decoder.go +++ b/rest/watch/decoder.go @@ -51,7 +51,7 @@ func (d *Decoder) Decode() (watch.EventType, runtime.Object, error) { return "", nil, err } if res != &got { - return "", nil, fmt.Errorf("unable to decode to metav1.Event") + return "", nil, fmt.Errorf("unable to decode to metav1.WatchEvent") } switch got.Type { case string(watch.Added), string(watch.Modified), string(watch.Deleted), string(watch.Error), string(watch.Bookmark): From 7f36d816ee9968bd5f92c5a44da3d4e06c44d1a7 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Wed, 10 Jul 2024 09:02:50 -0700 Subject: [PATCH 122/159] Merge pull request #125944 from timofurrer/fix/error-msg-type Fix typo in type name of watch decode error Kubernetes-commit: 6a45c8b7d1ea6e7ea8677e6fb7ee9394b21d808d --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2ef6fb1504..32afd0174b 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( google.golang.org/protobuf v1.34.2 gopkg.in/evanphx/json-patch.v4 v4.12.0 k8s.io/api v0.0.0-20240707022826-2cf4612580d3 - k8s.io/apimachinery v0.0.0-20240707022528-c1f240355706 + k8s.io/apimachinery v0.0.0-20240708182526-e126c655b814 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b diff --git a/go.sum b/go.sum index 7913a462e7..c8c5fd7097 100644 --- a/go.sum +++ b/go.sum @@ -158,8 +158,8 @@ 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.0.0-20240707022826-2cf4612580d3 h1:2bHi5SAn7dRf6oJGO29yFEtMyIN9oCD86In1R70UnXA= k8s.io/api v0.0.0-20240707022826-2cf4612580d3/go.mod h1:TeZW9JsLR2mmT3LA7JsD/4i5g40HHrREIdaD0QCEP1Y= -k8s.io/apimachinery v0.0.0-20240707022528-c1f240355706 h1:17r0OQj+n4pHLABJJ5Sb5GeSSZy4NF0YSaEy2qsPLLY= -k8s.io/apimachinery v0.0.0-20240707022528-c1f240355706/go.mod h1:Et4EUFrefx1K28ZwNXpkHUqq7fSML2FROj79Ku7Lj1w= +k8s.io/apimachinery v0.0.0-20240708182526-e126c655b814 h1:ymYj8RTEwPL3rUcV3lJtdARYZIHdHC20YLXqVrpcT8o= +k8s.io/apimachinery v0.0.0-20240708182526-e126c655b814/go.mod h1:Et4EUFrefx1K28ZwNXpkHUqq7fSML2FROj79Ku7Lj1w= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From fa8c68e9865b951859e4bb023af54dfe2f6c9489 Mon Sep 17 00:00:00 2001 From: Lan Liang Date: Thu, 16 May 2024 08:36:27 +0000 Subject: [PATCH 123/159] make PodIP.IP and HostIP.IP required. Fields used as map keys must be required or defaulted when used in a CRD schema. see https://github.com/kubernetes/kubernetes/issues/124540 Signed-off-by: Lan Liang Kubernetes-commit: 73613b48c6472c71eb6cb6ff12a0d5acb1beadcc --- applyconfigurations/internal/internal.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 0b04331415..8c1bcf6743 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -5665,6 +5665,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: ip type: scalar: string + default: "" - name: io.k8s.api.core.v1.HostPathVolumeSource map: fields: @@ -6770,6 +6771,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: ip type: scalar: string + default: "" - name: io.k8s.api.core.v1.PodOS map: fields: From 732dd289a0b3c34a4a5860f934457dcac85c470e Mon Sep 17 00:00:00 2001 From: Lukasz Szaszkiewicz Date: Thu, 11 Jul 2024 13:49:29 +0200 Subject: [PATCH 124/159] dynamic client: add support for API streaming Kubernetes-commit: d778356bc6a057ae41bee4577e568293a25fce9b --- dynamic/client_test.go | 169 +++++++++++++++++++++++++++++++++++++++++ dynamic/simple.go | 43 +++++++++-- 2 files changed, 207 insertions(+), 5 deletions(-) diff --git a/dynamic/client_test.go b/dynamic/client_test.go index 2f16abb88c..c812b01646 100644 --- a/dynamic/client_test.go +++ b/dynamic/client_test.go @@ -27,6 +27,8 @@ import ( "strings" "testing" + "github.com/google/go-cmp/cmp" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" @@ -34,6 +36,8 @@ import ( "k8s.io/apimachinery/pkg/runtime/serializer/streaming" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" + clientfeatures "k8s.io/client-go/features" + clientfeaturestesting "k8s.io/client-go/features/testing" restclient "k8s.io/client-go/rest" restclientwatch "k8s.io/client-go/rest/watch" ) @@ -148,6 +152,171 @@ func TestList(t *testing.T) { } } +func TestWatchList(t *testing.T) { + clientfeaturestesting.SetFeatureDuringTest(t, clientfeatures.WatchListClient, true) + + type requestParam struct { + Path string + Query string + } + + scenarios := []struct { + name string + namespace string + watchResponse []watch.Event + listResponse []byte + + expectedRequestParams []requestParam + expectedList *unstructured.UnstructuredList + }{ + { + name: "watch-list request for cluster wide resource", + watchResponse: []watch.Event{ + {Type: watch.Added, Object: getObject("gtest/vTest", "rTest", "item1")}, + {Type: watch.Added, Object: getObject("gtest/vTest", "rTest", "item2")}, + {Type: watch.Bookmark, Object: func() runtime.Object { + obj := getObject("gtest/vTest", "rTest", "item2") + obj.SetResourceVersion("10") + obj.SetAnnotations(map[string]string{metav1.InitialEventsAnnotationKey: "true"}) + return obj + }()}, + }, + expectedRequestParams: []requestParam{ + { + Path: "/apis/gtest/vtest/rtest", + Query: "allowWatchBookmarks=true&resourceVersionMatch=NotOlderThan&sendInitialEvents=true&watch=true", + }, + }, + expectedList: &unstructured.UnstructuredList{ + Object: map[string]interface{}{ + "apiVersion": "", + "kind": "UnstructuredList", + "metadata": map[string]interface{}{ + "resourceVersion": "10", + }, + }, + Items: []unstructured.Unstructured{ + *getObject("gtest/vTest", "rTest", "item1"), + *getObject("gtest/vTest", "rTest", "item2"), + }, + }, + }, + { + name: "watch-list request for namespaced watch resource", + namespace: "nstest", + watchResponse: []watch.Event{ + {Type: watch.Added, Object: getObject("gtest/vTest", "rTest", "item1")}, + {Type: watch.Bookmark, Object: func() runtime.Object { + obj := getObject("gtest/vTest", "rTest", "item2") + obj.SetResourceVersion("39") + obj.SetAnnotations(map[string]string{metav1.InitialEventsAnnotationKey: "true"}) + return obj + }()}, + }, + expectedRequestParams: []requestParam{ + { + Path: "/apis/gtest/vtest/namespaces/nstest/rtest", + Query: "allowWatchBookmarks=true&resourceVersionMatch=NotOlderThan&sendInitialEvents=true&watch=true", + }, + }, + expectedList: &unstructured.UnstructuredList{ + Object: map[string]interface{}{ + "apiVersion": "", + "kind": "UnstructuredList", + "metadata": map[string]interface{}{ + "resourceVersion": "39", + }, + }, + Items: []unstructured.Unstructured{ + *getObject("gtest/vTest", "rTest", "item1"), + }, + }, + }, + { + name: "watch-list request falls back to standard list on any error", + namespace: "nstest", + // watchList method in client-go expect only watch.Add and watch.Bookmark events + // receiving watch.Error will cause this method to report an error which will + // trigger the fallback logic + watchResponse: []watch.Event{ + {Type: watch.Error, Object: getObject("gtest/vTest", "rTest", "item1")}, + }, + listResponse: getListJSON("vTest", "UnstructuredList", + getJSON("gtest/vTest", "rTest", "item1"), + getJSON("gtest/vTest", "rTest", "item2")), + expectedRequestParams: []requestParam{ + // a watch-list request first + { + Path: "/apis/gtest/vtest/namespaces/nstest/rtest", + Query: "allowWatchBookmarks=true&resourceVersionMatch=NotOlderThan&sendInitialEvents=true&watch=true", + }, + // a standard list request second + { + Path: "/apis/gtest/vtest/namespaces/nstest/rtest", + }, + }, + expectedList: &unstructured.UnstructuredList{ + Object: map[string]interface{}{ + "apiVersion": "vTest", + "kind": "UnstructuredList", + }, + Items: []unstructured.Unstructured{ + *getObject("gtest/vTest", "rTest", "item1"), + *getObject("gtest/vTest", "rTest", "item2"), + }, + }, + }, + } + for _, scenario := range scenarios { + t.Run(scenario.name, func(t *testing.T) { + var actualRequestParams []requestParam + resource := schema.GroupVersionResource{Group: "gtest", Version: "vtest", Resource: "rtest"} + cl, srv, err := getClientServer(func(w http.ResponseWriter, r *http.Request) { + if r.Method != "GET" { + t.Errorf("unexpected HTTP method %s. expected GET", r.Method) + } + actualRequestParams = append(actualRequestParams, requestParam{ + Path: r.URL.Path, + Query: r.URL.RawQuery, + }) + + w.Header().Set("Content-Type", runtime.ContentTypeJSON) + // handle LIST response + if len(scenario.listResponse) > 0 { + if _, err := w.Write(scenario.listResponse); err != nil { + t.Fatal(err) + } + return + } + + // handle WATCH response + enc := restclientwatch.NewEncoder(streaming.NewEncoder(w, unstructured.UnstructuredJSONScheme), unstructured.UnstructuredJSONScheme) + for _, e := range scenario.watchResponse { + if err := enc.Encode(&e); err != nil { + t.Fatal(err) + } + } + }) + if err != nil { + t.Fatalf("unexpected error when creating test client and server: %v", err) + } + defer srv.Close() + + actualList, err := cl.Resource(resource).Namespace(scenario.namespace).List(context.TODO(), metav1.ListOptions{}) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + + if !cmp.Equal(scenario.expectedRequestParams, actualRequestParams) { + t.Fatalf("unexpected request params: %v", cmp.Diff(scenario.expectedRequestParams, actualRequestParams)) + } + if !cmp.Equal(scenario.expectedList, actualList) { + t.Errorf("received expected list, diff: %s", cmp.Diff(scenario.expectedList, actualList)) + } + }) + } +} + func TestGet(t *testing.T) { tcs := []struct { resource string diff --git a/dynamic/simple.go b/dynamic/simple.go index 9ea8ef3694..326da7cbdf 100644 --- a/dynamic/simple.go +++ b/dynamic/simple.go @@ -20,6 +20,7 @@ import ( "context" "fmt" "net/http" + "time" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -30,6 +31,8 @@ import ( "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/rest" "k8s.io/client-go/util/consistencydetector" + "k8s.io/client-go/util/watchlist" + "k8s.io/klog/v2" ) type DynamicClient struct { @@ -293,13 +296,22 @@ func (c *dynamicResourceClient) Get(ctx context.Context, name string, opts metav return uncastObj.(*unstructured.Unstructured), nil } -func (c *dynamicResourceClient) List(ctx context.Context, opts metav1.ListOptions) (result *unstructured.UnstructuredList, err error) { - defer func() { +func (c *dynamicResourceClient) List(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) { + if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := watchlist.PrepareWatchListOptionsFromListOptions(opts); watchListOptionsErr != nil { + klog.Warningf("Failed preparing watchlist options for %v, falling back to the standard LIST semantics, err = %v", c.resource, watchListOptionsErr) + } else if hasWatchListOptionsPrepared { + result, err := c.watchList(ctx, watchListOptions) if err == nil { - consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, fmt.Sprintf("list request for %v", c.resource), c.list, opts, result) + consistencydetector.CheckWatchListFromCacheDataConsistencyIfRequested(ctx, fmt.Sprintf("watchlist request for %v", c.resource), c.list, opts, result) + return result, nil } - }() - return c.list(ctx, opts) + klog.Warningf("The watchlist request for %v ended with an error, falling back to the standard LIST semantics, err = %v", c.resource, err) + } + result, err := c.list(ctx, opts) + if err == nil { + consistencydetector.CheckListFromCacheDataConsistencyIfRequested(ctx, fmt.Sprintf("list request for %v", c.resource), c.list, opts, result) + } + return result, err } func (c *dynamicResourceClient) list(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) { @@ -329,6 +341,27 @@ func (c *dynamicResourceClient) list(ctx context.Context, opts metav1.ListOption return list, nil } +// watchList establishes a watch stream with the server and returns an unstructured list. +func (c *dynamicResourceClient) watchList(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) { + if err := validateNamespaceWithOptionalName(c.namespace); err != nil { + return nil, err + } + + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + + result := &unstructured.UnstructuredList{} + err := c.client.client.Get().AbsPath(c.makeURLSegments("")...). + SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1). + Timeout(timeout). + WatchList(ctx). + Into(result) + + return result, err +} + func (c *dynamicResourceClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { opts.Watch = true if err := validateNamespaceWithOptionalName(c.namespace); err != nil { From 37c2760fd92d06362ce5fdf3b58aba6ede156fe2 Mon Sep 17 00:00:00 2001 From: Daman Arora Date: Fri, 12 Jul 2024 14:40:22 +0530 Subject: [PATCH 125/159] bump k8s.io/utils Signed-off-by: Daman Arora Kubernetes-commit: c6a129b715646163ef83f94245c3756cbc191c42 --- go.mod | 12 +++++++++--- go.sum | 17 +++++++++++------ 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 345699b433..96e52b2aa7 100644 --- a/go.mod +++ b/go.mod @@ -25,11 +25,11 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.34.2 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240713023210-8ea3a952c963 - k8s.io/apimachinery v0.0.0-20240713001654-07cb122d2891 + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 - k8s.io/utils v0.0.0-20230726121419-3b25d923346b + k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd sigs.k8s.io/structured-merge-diff/v4 v4.4.1 sigs.k8s.io/yaml v1.4.0 @@ -62,3 +62,9 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace ( + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go +) diff --git a/go.sum b/go.sum index 7a2b80f703..934bbdc0ea 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,8 @@ +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -90,6 +93,7 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= @@ -105,8 +109,10 @@ go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -118,6 +124,7 @@ golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbht 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= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -141,6 +148,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -156,16 +164,13 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240713023210-8ea3a952c963 h1:hB9PET6cHOSsgvtuGRjkeZMwAzJNZ8DI+7uwaSUv5kI= -k8s.io/api v0.0.0-20240713023210-8ea3a952c963/go.mod h1:vBLXX/4UEXgjBIwNl0ydYDSHZSsKHUBzqlzv4xJ2ICY= -k8s.io/apimachinery v0.0.0-20240713001654-07cb122d2891 h1:UIwXjVxPRb3V7TgM7xFXg1UARuevg84C8Ivkoe5mbFg= -k8s.io/apimachinery v0.0.0-20240713001654-07cb122d2891/go.mod h1:Et4EUFrefx1K28ZwNXpkHUqq7fSML2FROj79Ku7Lj1w= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= 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-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= -k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +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/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= From b6a1b42a2421c025e70287c42c1a1b59c5cf72cd Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Fri, 12 Jul 2024 17:17:01 -0700 Subject: [PATCH 126/159] Merge pull request #126057 from thockin/make-pod-ip-host-ip-required make PodIP.IP and HostIP.IP required. Kubernetes-commit: a87612b6676723b34a5b3d2d80ab4e04552221ae --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 9c338c837d..345699b433 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.34.2 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240712023323-4badb3333d55 - k8s.io/apimachinery v0.0.0-20240711222537-4524748494bf + k8s.io/api v0.0.0-20240713023210-8ea3a952c963 + k8s.io/apimachinery v0.0.0-20240713001654-07cb122d2891 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20230726121419-3b25d923346b diff --git a/go.sum b/go.sum index 0b4bec8ee6..7a2b80f703 100644 --- a/go.sum +++ b/go.sum @@ -156,10 +156,10 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240712023323-4badb3333d55 h1:n44Qr23IUW2bPIMGrDScIdqmu1u+XUHqdd0O0hTj2pM= -k8s.io/api v0.0.0-20240712023323-4badb3333d55/go.mod h1:O8LAmMgsWzumSE9wGhqSdC+9HFxJ3Bh+NuDzms9R/D4= -k8s.io/apimachinery v0.0.0-20240711222537-4524748494bf h1:BO1LyfoftoDsAxaqL9zPspuFZPuY2mq8vH4qqqoAodc= -k8s.io/apimachinery v0.0.0-20240711222537-4524748494bf/go.mod h1:Et4EUFrefx1K28ZwNXpkHUqq7fSML2FROj79Ku7Lj1w= +k8s.io/api v0.0.0-20240713023210-8ea3a952c963 h1:hB9PET6cHOSsgvtuGRjkeZMwAzJNZ8DI+7uwaSUv5kI= +k8s.io/api v0.0.0-20240713023210-8ea3a952c963/go.mod h1:vBLXX/4UEXgjBIwNl0ydYDSHZSsKHUBzqlzv4xJ2ICY= +k8s.io/apimachinery v0.0.0-20240713001654-07cb122d2891 h1:UIwXjVxPRb3V7TgM7xFXg1UARuevg84C8Ivkoe5mbFg= +k8s.io/apimachinery v0.0.0-20240713001654-07cb122d2891/go.mod h1:Et4EUFrefx1K28ZwNXpkHUqq7fSML2FROj79Ku7Lj1w= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 21b1828b057b7755b3371fa9c7b0579f145b0cc4 Mon Sep 17 00:00:00 2001 From: Peter Hunt Date: Fri, 31 May 2024 13:30:45 -0400 Subject: [PATCH 127/159] api: add user namespaces field to NodeRuntimeHandlerFeatures Signed-off-by: Sohan Kunkerkar Kubernetes-commit: 86240aaca17e0bfbdbaec78bf2604f8623c73615 --- .../core/v1/noderuntimehandlerfeatures.go | 9 +++++++++ applyconfigurations/internal/internal.go | 3 +++ 2 files changed, 12 insertions(+) diff --git a/applyconfigurations/core/v1/noderuntimehandlerfeatures.go b/applyconfigurations/core/v1/noderuntimehandlerfeatures.go index d6273ceb1b..a295b60969 100644 --- a/applyconfigurations/core/v1/noderuntimehandlerfeatures.go +++ b/applyconfigurations/core/v1/noderuntimehandlerfeatures.go @@ -22,6 +22,7 @@ package v1 // with apply. type NodeRuntimeHandlerFeaturesApplyConfiguration struct { RecursiveReadOnlyMounts *bool `json:"recursiveReadOnlyMounts,omitempty"` + UserNamespaces *bool `json:"userNamespaces,omitempty"` } // NodeRuntimeHandlerFeaturesApplyConfiguration constructs a declarative configuration of the NodeRuntimeHandlerFeatures type for use with @@ -37,3 +38,11 @@ func (b *NodeRuntimeHandlerFeaturesApplyConfiguration) WithRecursiveReadOnlyMoun b.RecursiveReadOnlyMounts = &value return b } + +// WithUserNamespaces sets the UserNamespaces field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UserNamespaces field is set to the value of the last call. +func (b *NodeRuntimeHandlerFeaturesApplyConfiguration) WithUserNamespaces(value bool) *NodeRuntimeHandlerFeaturesApplyConfiguration { + b.UserNamespaces = &value + return b +} diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 8c1bcf6743..04563c1bf0 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -6119,6 +6119,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: recursiveReadOnlyMounts type: scalar: boolean + - name: userNamespaces + type: + scalar: boolean - name: io.k8s.api.core.v1.NodeSelector map: fields: From 59ef8e11c6d41cf3b782219069f9094cfc895010 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Mon, 15 Jul 2024 16:41:17 -0700 Subject: [PATCH 128/159] Merge pull request #126034 from sohankunkerkar/add-usernamespaces api: add user namespaces field to NodeRuntimeHandlerFeatures Kubernetes-commit: f36a821de828372a5f99528d21f309f75e17d043 --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 28d2501177..cae7feedc8 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.34.2 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240713182828-fc8a03c10db3 - k8s.io/apimachinery v0.0.0-20240713182533-d7e1c5311169 + k8s.io/api v0.0.0-20240716022838-4fec4748bbfc + k8s.io/apimachinery v0.0.0-20240715201109-ab0686929a37 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 diff --git a/go.sum b/go.sum index 89784f7f9e..c6f1784cf8 100644 --- a/go.sum +++ b/go.sum @@ -156,10 +156,10 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240713182828-fc8a03c10db3 h1:/HdJNMoAomKcMa1p3ei3yF65O36bO3+9VzcZMU1Xn6o= -k8s.io/api v0.0.0-20240713182828-fc8a03c10db3/go.mod h1:P1YOh3DKAaEYfUIAqsGSOKkLqz7k6Z8eORxlNIDQD0E= -k8s.io/apimachinery v0.0.0-20240713182533-d7e1c5311169 h1:uUu5XUsiHPkOU48Bn2d2DoqUQDG9Y02fD43VqYbagPI= -k8s.io/apimachinery v0.0.0-20240713182533-d7e1c5311169/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/api v0.0.0-20240716022838-4fec4748bbfc h1:zsMqkmIr5rJf4tirT6RUpG+ZbvdNwuruoh4mKzkrZEY= +k8s.io/api v0.0.0-20240716022838-4fec4748bbfc/go.mod h1:2UcZQyUkPm7CMfP50V/oCVagw0chxcTd2M0sBNxxM9E= +k8s.io/apimachinery v0.0.0-20240715201109-ab0686929a37 h1:vG4p9Dp1oF1azqq+OvpzZjVtlKqo91bRDoZ2MfgoUaw= +k8s.io/apimachinery v0.0.0-20240715201109-ab0686929a37/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 1ea671aac47de2fee1a9cc07f6e2732805c29179 Mon Sep 17 00:00:00 2001 From: Shingo Omura Date: Sat, 22 Jun 2024 18:43:31 +0900 Subject: [PATCH 129/159] KEP-3619: API: add NodeFeatures.SupplementalGroupsPolicy in NodeStatus KEP-3619: don't capitalize comment in K8S API KEP-3619: fix typos and grammatical ones in K8s API KEP-3619: rephrase NodeFeatures, NodeHandlerFeatures in K8s API Kubernetes-commit: 5d75660dc11ff443ebab2551aed8e56a54cc218d --- applyconfigurations/core/v1/nodefeatures.go | 39 +++++++++++++++++++++ applyconfigurations/core/v1/nodestatus.go | 9 +++++ applyconfigurations/internal/internal.go | 9 +++++ applyconfigurations/utils.go | 2 ++ 4 files changed, 59 insertions(+) create mode 100644 applyconfigurations/core/v1/nodefeatures.go diff --git a/applyconfigurations/core/v1/nodefeatures.go b/applyconfigurations/core/v1/nodefeatures.go new file mode 100644 index 0000000000..678b0e36d6 --- /dev/null +++ b/applyconfigurations/core/v1/nodefeatures.go @@ -0,0 +1,39 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// NodeFeaturesApplyConfiguration represents a declarative configuration of the NodeFeatures type for use +// with apply. +type NodeFeaturesApplyConfiguration struct { + SupplementalGroupsPolicy *bool `json:"supplementalGroupsPolicy,omitempty"` +} + +// NodeFeaturesApplyConfiguration constructs a declarative configuration of the NodeFeatures type for use with +// apply. +func NodeFeatures() *NodeFeaturesApplyConfiguration { + return &NodeFeaturesApplyConfiguration{} +} + +// WithSupplementalGroupsPolicy sets the SupplementalGroupsPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SupplementalGroupsPolicy field is set to the value of the last call. +func (b *NodeFeaturesApplyConfiguration) WithSupplementalGroupsPolicy(value bool) *NodeFeaturesApplyConfiguration { + b.SupplementalGroupsPolicy = &value + return b +} diff --git a/applyconfigurations/core/v1/nodestatus.go b/applyconfigurations/core/v1/nodestatus.go index 43dea7e576..8411c57ac0 100644 --- a/applyconfigurations/core/v1/nodestatus.go +++ b/applyconfigurations/core/v1/nodestatus.go @@ -37,6 +37,7 @@ type NodeStatusApplyConfiguration struct { VolumesAttached []AttachedVolumeApplyConfiguration `json:"volumesAttached,omitempty"` Config *NodeConfigStatusApplyConfiguration `json:"config,omitempty"` RuntimeHandlers []NodeRuntimeHandlerApplyConfiguration `json:"runtimeHandlers,omitempty"` + Features *NodeFeaturesApplyConfiguration `json:"features,omitempty"` } // NodeStatusApplyConfiguration constructs a declarative configuration of the NodeStatus type for use with @@ -167,3 +168,11 @@ func (b *NodeStatusApplyConfiguration) WithRuntimeHandlers(values ...*NodeRuntim } return b } + +// WithFeatures sets the Features field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Features field is set to the value of the last call. +func (b *NodeStatusApplyConfiguration) WithFeatures(value *NodeFeaturesApplyConfiguration) *NodeStatusApplyConfiguration { + b.Features = value + return b +} diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 04563c1bf0..ebaa3a15e5 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -6103,6 +6103,12 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.api.core.v1.DaemonEndpoint default: {} +- name: io.k8s.api.core.v1.NodeFeatures + map: + fields: + - name: supplementalGroupsPolicy + type: + scalar: boolean - name: io.k8s.api.core.v1.NodeRuntimeHandler map: fields: @@ -6231,6 +6237,9 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.api.core.v1.NodeDaemonEndpoints default: {} + - name: features + type: + namedType: io.k8s.api.core.v1.NodeFeatures - name: images type: list: diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index 7672fb0917..7633e84f04 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -806,6 +806,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationscorev1.NodeConfigStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeDaemonEndpoints"): return &applyconfigurationscorev1.NodeDaemonEndpointsApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeFeatures"): + return &applyconfigurationscorev1.NodeFeaturesApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeRuntimeHandler"): return &applyconfigurationscorev1.NodeRuntimeHandlerApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("NodeRuntimeHandlerFeatures"): From 485ae13a5886240de3aad457e44dd5152a78e42e Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Mon, 24 Jun 2024 10:34:43 +0200 Subject: [PATCH 130/159] Add ImageVolumeSource API Adding the required Kubernetes API so that the kubelet can start using it. This patch also adds the corresponding alpha feature gate as outlined in KEP 4639. Signed-off-by: Sascha Grunert Kubernetes-commit: f7ca3131e0922563a561134b4ed9eed8d2bdd2c4 --- .../core/v1/imagevolumesource.go | 52 +++++++++++++++++++ applyconfigurations/core/v1/volume.go | 8 +++ applyconfigurations/core/v1/volumesource.go | 9 ++++ applyconfigurations/internal/internal.go | 12 +++++ applyconfigurations/utils.go | 2 + 5 files changed, 83 insertions(+) create mode 100644 applyconfigurations/core/v1/imagevolumesource.go diff --git a/applyconfigurations/core/v1/imagevolumesource.go b/applyconfigurations/core/v1/imagevolumesource.go new file mode 100644 index 0000000000..340f150400 --- /dev/null +++ b/applyconfigurations/core/v1/imagevolumesource.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// ImageVolumeSourceApplyConfiguration represents a declarative configuration of the ImageVolumeSource type for use +// with apply. +type ImageVolumeSourceApplyConfiguration struct { + Reference *string `json:"reference,omitempty"` + PullPolicy *v1.PullPolicy `json:"pullPolicy,omitempty"` +} + +// ImageVolumeSourceApplyConfiguration constructs a declarative configuration of the ImageVolumeSource type for use with +// apply. +func ImageVolumeSource() *ImageVolumeSourceApplyConfiguration { + return &ImageVolumeSourceApplyConfiguration{} +} + +// WithReference sets the Reference field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reference field is set to the value of the last call. +func (b *ImageVolumeSourceApplyConfiguration) WithReference(value string) *ImageVolumeSourceApplyConfiguration { + b.Reference = &value + return b +} + +// WithPullPolicy sets the PullPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PullPolicy field is set to the value of the last call. +func (b *ImageVolumeSourceApplyConfiguration) WithPullPolicy(value v1.PullPolicy) *ImageVolumeSourceApplyConfiguration { + b.PullPolicy = &value + return b +} diff --git a/applyconfigurations/core/v1/volume.go b/applyconfigurations/core/v1/volume.go index 25de1fac9b..9a48f83497 100644 --- a/applyconfigurations/core/v1/volume.go +++ b/applyconfigurations/core/v1/volume.go @@ -270,3 +270,11 @@ func (b *VolumeApplyConfiguration) WithEphemeral(value *EphemeralVolumeSourceApp b.Ephemeral = value return b } + +// WithImage sets the Image field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Image field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithImage(value *ImageVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.Image = value + return b +} diff --git a/applyconfigurations/core/v1/volumesource.go b/applyconfigurations/core/v1/volumesource.go index 59fc805aea..aeead953cf 100644 --- a/applyconfigurations/core/v1/volumesource.go +++ b/applyconfigurations/core/v1/volumesource.go @@ -50,6 +50,7 @@ type VolumeSourceApplyConfiguration struct { StorageOS *StorageOSVolumeSourceApplyConfiguration `json:"storageos,omitempty"` CSI *CSIVolumeSourceApplyConfiguration `json:"csi,omitempty"` Ephemeral *EphemeralVolumeSourceApplyConfiguration `json:"ephemeral,omitempty"` + Image *ImageVolumeSourceApplyConfiguration `json:"image,omitempty"` } // VolumeSourceApplyConfiguration constructs a declarative configuration of the VolumeSource type for use with @@ -289,3 +290,11 @@ func (b *VolumeSourceApplyConfiguration) WithEphemeral(value *EphemeralVolumeSou b.Ephemeral = value return b } + +// WithImage sets the Image field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Image field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithImage(value *ImageVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.Image = value + return b +} diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index ebaa3a15e5..21adbdc481 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -5762,6 +5762,15 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" +- name: io.k8s.api.core.v1.ImageVolumeSource + map: + fields: + - name: pullPolicy + type: + scalar: string + - name: reference + type: + scalar: string - name: io.k8s.api.core.v1.KeyToPath map: fields: @@ -8209,6 +8218,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: hostPath type: namedType: io.k8s.api.core.v1.HostPathVolumeSource + - name: image + type: + namedType: io.k8s.api.core.v1.ImageVolumeSource - name: iscsi type: namedType: io.k8s.api.core.v1.ISCSIVolumeSource diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index 7633e84f04..a086500ff5 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -754,6 +754,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationscorev1.HTTPGetActionApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("HTTPHeader"): return &applyconfigurationscorev1.HTTPHeaderApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ImageVolumeSource"): + return &applyconfigurationscorev1.ImageVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ISCSIPersistentVolumeSource"): return &applyconfigurationscorev1.ISCSIPersistentVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ISCSIVolumeSource"): From 9ab93c077780970b9de4cd08e6ac4d0d00afabb0 Mon Sep 17 00:00:00 2001 From: Morlay Date: Fri, 28 Jun 2024 23:16:51 +0800 Subject: [PATCH 131/159] Remove json:",omitempty" where json:",inline" specified. Signed-off-by: Morlay Kubernetes-commit: f9b69ce10847a31626c364d3d86bf361b16456b2 --- applyconfigurations/extensions/v1beta1/ingressrule.go | 2 +- applyconfigurations/networking/v1/ingressrule.go | 2 +- applyconfigurations/networking/v1beta1/ingressrule.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/applyconfigurations/extensions/v1beta1/ingressrule.go b/applyconfigurations/extensions/v1beta1/ingressrule.go index dc0f93aaaf..dc676f7b60 100644 --- a/applyconfigurations/extensions/v1beta1/ingressrule.go +++ b/applyconfigurations/extensions/v1beta1/ingressrule.go @@ -22,7 +22,7 @@ package v1beta1 // with apply. type IngressRuleApplyConfiguration struct { Host *string `json:"host,omitempty"` - IngressRuleValueApplyConfiguration `json:",omitempty,inline"` + IngressRuleValueApplyConfiguration `json:",inline"` } // IngressRuleApplyConfiguration constructs a declarative configuration of the IngressRule type for use with diff --git a/applyconfigurations/networking/v1/ingressrule.go b/applyconfigurations/networking/v1/ingressrule.go index a8c83f8e90..4ef871f077 100644 --- a/applyconfigurations/networking/v1/ingressrule.go +++ b/applyconfigurations/networking/v1/ingressrule.go @@ -22,7 +22,7 @@ package v1 // with apply. type IngressRuleApplyConfiguration struct { Host *string `json:"host,omitempty"` - IngressRuleValueApplyConfiguration `json:",omitempty,inline"` + IngressRuleValueApplyConfiguration `json:",inline"` } // IngressRuleApplyConfiguration constructs a declarative configuration of the IngressRule type for use with diff --git a/applyconfigurations/networking/v1beta1/ingressrule.go b/applyconfigurations/networking/v1beta1/ingressrule.go index dc0f93aaaf..dc676f7b60 100644 --- a/applyconfigurations/networking/v1beta1/ingressrule.go +++ b/applyconfigurations/networking/v1beta1/ingressrule.go @@ -22,7 +22,7 @@ package v1beta1 // with apply. type IngressRuleApplyConfiguration struct { Host *string `json:"host,omitempty"` - IngressRuleValueApplyConfiguration `json:",omitempty,inline"` + IngressRuleValueApplyConfiguration `json:",inline"` } // IngressRuleApplyConfiguration constructs a declarative configuration of the IngressRule type for use with From eab51c4031d866a553f9d5c58d4aad8e65122e46 Mon Sep 17 00:00:00 2001 From: Amir Alavi Date: Sat, 13 Jul 2024 12:23:02 -0400 Subject: [PATCH 132/159] fix: fake clientset ApplyScale subresource from 'status' to 'scale' Signed-off-by: Amir Alavi Kubernetes-commit: 872c3442501ca479f399d2f9060b72d228234b30 --- kubernetes/typed/apps/v1/fake/fake_deployment.go | 2 +- kubernetes/typed/apps/v1/fake/fake_replicaset.go | 2 +- kubernetes/typed/apps/v1/fake/fake_statefulset.go | 2 +- kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go | 2 +- kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go | 2 +- kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kubernetes/typed/apps/v1/fake/fake_deployment.go b/kubernetes/typed/apps/v1/fake/fake_deployment.go index 8d5a77ec46..8ed8432883 100644 --- a/kubernetes/typed/apps/v1/fake/fake_deployment.go +++ b/kubernetes/typed/apps/v1/fake/fake_deployment.go @@ -234,7 +234,7 @@ func (c *FakeDeployments) ApplyScale(ctx context.Context, deploymentName string, } emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, deploymentName, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, deploymentName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/apps/v1/fake/fake_replicaset.go b/kubernetes/typed/apps/v1/fake/fake_replicaset.go index d5bf2cda05..942a4e64a3 100644 --- a/kubernetes/typed/apps/v1/fake/fake_replicaset.go +++ b/kubernetes/typed/apps/v1/fake/fake_replicaset.go @@ -234,7 +234,7 @@ func (c *FakeReplicaSets) ApplyScale(ctx context.Context, replicaSetName string, } emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, replicaSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, replicaSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/apps/v1/fake/fake_statefulset.go b/kubernetes/typed/apps/v1/fake/fake_statefulset.go index f970e1d0c6..ae4e811fb7 100644 --- a/kubernetes/typed/apps/v1/fake/fake_statefulset.go +++ b/kubernetes/typed/apps/v1/fake/fake_statefulset.go @@ -234,7 +234,7 @@ func (c *FakeStatefulSets) ApplyScale(ctx context.Context, statefulSetName strin } emptyResult := &autoscalingv1.Scale{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go b/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go index 5a32eba21c..ac8945aa77 100644 --- a/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go +++ b/kubernetes/typed/apps/v1beta2/fake/fake_statefulset.go @@ -232,7 +232,7 @@ func (c *FakeStatefulSets) ApplyScale(ctx context.Context, statefulSetName strin } emptyResult := &v1beta2.Scale{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go b/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go index ea41524d49..b81d4a96c4 100644 --- a/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go +++ b/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go @@ -232,7 +232,7 @@ func (c *FakeDeployments) ApplyScale(ctx context.Context, deploymentName string, } emptyResult := &v1beta1.Scale{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, deploymentName, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, deploymentName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult) if obj == nil { return emptyResult, err diff --git a/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go b/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go index caa7935e90..5d94ba73b0 100644 --- a/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go +++ b/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go @@ -232,7 +232,7 @@ func (c *FakeReplicaSets) ApplyScale(ctx context.Context, replicaSetName string, } emptyResult := &v1beta1.Scale{} obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, replicaSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) + Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, replicaSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult) if obj == nil { return emptyResult, err From 37121f3f0017c2039231cb3e8568d1d69600b694 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Tue, 16 Jul 2024 13:57:06 -0700 Subject: [PATCH 133/159] Merge pull request #125470 from everpeace/kep-3619-SupplementalGroupsPolicy-e2e KEP-3619: Add NodeStatus.Features.SupplementalGroupsPolicy API and e2e Kubernetes-commit: fc3abdaf2dbb11c84033635b1d26f12fe12ef001 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index cae7feedc8..cc53de6a50 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.34.2 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240716022838-4fec4748bbfc + k8s.io/api v0.0.0-20240716223232-b1818c55a2cf k8s.io/apimachinery v0.0.0-20240715201109-ab0686929a37 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 diff --git a/go.sum b/go.sum index c6f1784cf8..5226579447 100644 --- a/go.sum +++ b/go.sum @@ -156,8 +156,8 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240716022838-4fec4748bbfc h1:zsMqkmIr5rJf4tirT6RUpG+ZbvdNwuruoh4mKzkrZEY= -k8s.io/api v0.0.0-20240716022838-4fec4748bbfc/go.mod h1:2UcZQyUkPm7CMfP50V/oCVagw0chxcTd2M0sBNxxM9E= +k8s.io/api v0.0.0-20240716223232-b1818c55a2cf h1:cbzpVluJQA7itGwCQfOtrN7lC0zyraDcNEUeSNR8JuA= +k8s.io/api v0.0.0-20240716223232-b1818c55a2cf/go.mod h1:2UcZQyUkPm7CMfP50V/oCVagw0chxcTd2M0sBNxxM9E= k8s.io/apimachinery v0.0.0-20240715201109-ab0686929a37 h1:vG4p9Dp1oF1azqq+OvpzZjVtlKqo91bRDoZ2MfgoUaw= k8s.io/apimachinery v0.0.0-20240715201109-ab0686929a37/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= From cd892da09ff06bc82cfe55d7426f809f9e489eec Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Thu, 18 Jul 2024 10:31:37 -0700 Subject: [PATCH 134/159] Make ServiceBackendPort an atomic struct This allows different actors to force ownership of it without having to explicitly unset the other field. Kubernetes-commit: 7313990f61881c676c1f5d68365144a1d77cced3 --- applyconfigurations/internal/internal.go | 1 + 1 file changed, 1 insertion(+) diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 21adbdc481..40dd7efa57 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -11003,6 +11003,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: number type: scalar: numeric + elementRelationship: atomic - name: io.k8s.api.networking.v1alpha1.IPAddress map: fields: From 8108d4122f3849d1bc3ed62d21fee684568701ad Mon Sep 17 00:00:00 2001 From: Sean Sullivan Date: Fri, 19 Jul 2024 12:04:41 -0700 Subject: [PATCH 135/159] Falls back to SPDY for gorilla/websocket https proxy error Kubernetes-commit: 9d560540c5268e0e2aebf5306907494cf522c260 --- tools/portforward/fallback_dialer_test.go | 17 ++- tools/remotecommand/fallback_test.go | 176 ++++++++++++++++++++++ tools/remotecommand/websocket_test.go | 37 +++++ 3 files changed, 228 insertions(+), 2 deletions(-) diff --git a/tools/portforward/fallback_dialer_test.go b/tools/portforward/fallback_dialer_test.go index 1a6805f122..70583958ea 100644 --- a/tools/portforward/fallback_dialer_test.go +++ b/tools/portforward/fallback_dialer_test.go @@ -17,10 +17,12 @@ limitations under the License. package portforward import ( + "errors" "fmt" "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/util/httpstream" ) @@ -36,7 +38,7 @@ func TestFallbackDialer(t *testing.T) { assert.True(t, primary.dialed, "no fallback; primary should have dialed") assert.False(t, secondary.dialed, "no fallback; secondary should *not* have dialed") assert.Equal(t, primaryProtocol, negotiated, "primary negotiated protocol returned") - assert.Nil(t, err, "error from primary dialer should be nil") + require.NoError(t, err, "error from primary dialer should be nil") // If primary dialer error is upgrade error, then fallback returning secondary dial response. primary = &fakeDialer{dialed: false, negotiatedProtocol: primaryProtocol, err: &httpstream.UpgradeFailureError{}} secondary = &fakeDialer{dialed: false, negotiatedProtocol: secondaryProtocol} @@ -45,7 +47,18 @@ func TestFallbackDialer(t *testing.T) { assert.True(t, primary.dialed, "fallback; primary should have dialed") assert.True(t, secondary.dialed, "fallback; secondary should have dialed") assert.Equal(t, secondaryProtocol, negotiated, "negotiated protocol is from secondary dialer") - assert.Nil(t, err, "error from secondary dialer should be nil") + require.NoError(t, err, "error from secondary dialer should be nil") + // If primary dialer error is https proxy dialing error, then fallback returning secondary dial response. + primary = &fakeDialer{negotiatedProtocol: primaryProtocol, err: errors.New("proxy: unknown scheme: https")} + secondary = &fakeDialer{negotiatedProtocol: secondaryProtocol} + fallbackDialer = NewFallbackDialer(primary, secondary, func(err error) bool { + return httpstream.IsUpgradeFailure(err) || httpstream.IsHTTPSProxyError(err) + }) + _, negotiated, err = fallbackDialer.Dial(protocols...) + assert.True(t, primary.dialed, "fallback; primary should have dialed") + assert.True(t, secondary.dialed, "fallback; secondary should have dialed") + assert.Equal(t, secondaryProtocol, negotiated, "negotiated protocol is from secondary dialer") + require.NoError(t, err, "error from secondary dialer should be nil") // If primary dialer returns non-upgrade error, then primary error is returned. nonUpgradeErr := fmt.Errorf("This is a non-upgrade error") primary = &fakeDialer{dialed: false, err: nonUpgradeErr} diff --git a/tools/remotecommand/fallback_test.go b/tools/remotecommand/fallback_test.go index 52e1f7b160..0dcca20634 100644 --- a/tools/remotecommand/fallback_test.go +++ b/tools/remotecommand/fallback_test.go @@ -20,15 +20,19 @@ import ( "bytes" "context" "crypto/rand" + "crypto/tls" "io" "net/http" "net/http/httptest" "net/url" + "sync/atomic" "testing" "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "k8s.io/apimachinery/pkg/util/httpstream" + utilnettesting "k8s.io/apimachinery/pkg/util/net/testing" "k8s.io/apimachinery/pkg/util/remotecommand" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/rest" @@ -165,6 +169,178 @@ func TestFallbackClient_SPDYSecondarySucceeds(t *testing.T) { } } +// localhostCert was generated from crypto/tls/generate_cert.go with the following command: +// +// go run generate_cert.go --rsa-bits 2048 --host 127.0.0.1,::1,example.com --ca --start-date "Jan 1 00:00:00 1970" --duration=1000000h +var localhostCert = []byte(`-----BEGIN CERTIFICATE----- +MIIDGTCCAgGgAwIBAgIRALL5AZcefF4kkYV1SEG6YrMwDQYJKoZIhvcNAQELBQAw +EjEQMA4GA1UEChMHQWNtZSBDbzAgFw03MDAxMDEwMDAwMDBaGA8yMDg0MDEyOTE2 +MDAwMFowEjEQMA4GA1UEChMHQWNtZSBDbzCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBALQ/FHcyVwdFHxARbbD2KBtDUT7Eni+8ioNdjtGcmtXqBv45EC1C +JOqqGJTroFGJ6Q9kQIZ9FqH5IJR2fOOJD9kOTueG4Vt1JY1rj1Kbpjefu8XleZ5L +SBwIWVnN/lEsEbuKmj7N2gLt5AH3zMZiBI1mg1u9Z5ZZHYbCiTpBrwsq6cTlvR9g +dyo1YkM5hRESCzsrL0aUByoo0qRMD8ZsgANJwgsiO0/M6idbxDwv1BnGwGmRYvOE +Hxpy3v0Jg7GJYrvnpnifJTs4nw91N5X9pXxR7FFzi/6HTYDWRljvTb0w6XciKYAz +bWZ0+cJr5F7wB7ovlbm7HrQIR7z7EIIu2d8CAwEAAaNoMGYwDgYDVR0PAQH/BAQD +AgKkMBMGA1UdJQQMMAoGCCsGAQUFBwMBMA8GA1UdEwEB/wQFMAMBAf8wLgYDVR0R +BCcwJYILZXhhbXBsZS5jb22HBH8AAAGHEAAAAAAAAAAAAAAAAAAAAAEwDQYJKoZI +hvcNAQELBQADggEBAFPPWopNEJtIA2VFAQcqN6uJK+JVFOnjGRoCrM6Xgzdm0wxY +XCGjsxY5dl+V7KzdGqu858rCaq5osEBqypBpYAnS9C38VyCDA1vPS1PsN8SYv48z +DyBwj+7R2qar0ADBhnhWxvYO9M72lN/wuCqFKYMeFSnJdQLv3AsrrHe9lYqOa36s +8wxSwVTFTYXBzljPEnSaaJMPqFD8JXaZK1ryJPkO5OsCNQNGtatNiWAf3DcmwHAT +MGYMzP0u4nw47aRz9shB8w+taPKHx2BVwE1m/yp3nHVioOjXqA1fwRQVGclCJSH1 +D2iq3hWVHRENgjTjANBPICLo9AZ4JfN6PH19mnU= +-----END CERTIFICATE-----`) + +// localhostKey is the private key for localhostCert. +var localhostKey = []byte(`-----BEGIN RSA PRIVATE KEY----- +MIIEogIBAAKCAQEAtD8UdzJXB0UfEBFtsPYoG0NRPsSeL7yKg12O0Zya1eoG/jkQ +LUIk6qoYlOugUYnpD2RAhn0WofkglHZ844kP2Q5O54bhW3UljWuPUpumN5+7xeV5 +nktIHAhZWc3+USwRu4qaPs3aAu3kAffMxmIEjWaDW71nllkdhsKJOkGvCyrpxOW9 +H2B3KjViQzmFERILOysvRpQHKijSpEwPxmyAA0nCCyI7T8zqJ1vEPC/UGcbAaZFi +84QfGnLe/QmDsYliu+emeJ8lOzifD3U3lf2lfFHsUXOL/odNgNZGWO9NvTDpdyIp +gDNtZnT5wmvkXvAHui+VubsetAhHvPsQgi7Z3wIDAQABAoIBAGmw93IxjYCQ0ncc +kSKMJNZfsdtJdaxuNRZ0nNNirhQzR2h403iGaZlEpmdkhzxozsWcto1l+gh+SdFk +bTUK4MUZM8FlgO2dEqkLYh5BcMT7ICMZvSfJ4v21E5eqR68XVUqQKoQbNvQyxFk3 +EddeEGdNrkb0GDK8DKlBlzAW5ep4gjG85wSTjR+J+muUv3R0BgLBFSuQnIDM/IMB +LWqsja/QbtB7yppe7jL5u8UCFdZG8BBKT9fcvFIu5PRLO3MO0uOI7LTc8+W1Xm23 +uv+j3SY0+v+6POjK0UlJFFi/wkSPTFIfrQO1qFBkTDQHhQ6q/7GnILYYOiGbIRg2 +NNuP52ECgYEAzXEoy50wSYh8xfFaBuxbm3ruuG2W49jgop7ZfoFrPWwOQKAZS441 +VIwV4+e5IcA6KkuYbtGSdTYqK1SMkgnUyD/VevwAqH5TJoEIGu0pDuKGwVuwqioZ +frCIAV5GllKyUJ55VZNbRr2vY2fCsWbaCSCHETn6C16DNuTCe5C0JBECgYEA4JqY +5GpNbMG8fOt4H7hU0Fbm2yd6SHJcQ3/9iimef7xG6ajxsYrIhg1ft+3IPHMjVI0+ +9brwHDnWg4bOOx/VO4VJBt6Dm/F33bndnZRkuIjfSNpLM51P+EnRdaFVHOJHwKqx +uF69kihifCAG7YATgCveeXImzBUSyZUz9UrETu8CgYARNBimdFNG1RcdvEg9rC0/ +p9u1tfecvNySwZqU7WF9kz7eSonTueTdX521qAHowaAdSpdJMGODTTXaywm6cPhQ +jIfj9JZZhbqQzt1O4+08Qdvm9TamCUB5S28YLjza+bHU7nBaqixKkDfPqzCyilpX +yVGGL8SwjwmN3zop/sQXAQKBgC0JMsESQ6YcDsRpnrOVjYQc+LtW5iEitTdfsaID +iGGKihmOI7B66IxgoCHMTws39wycKdSyADVYr5e97xpR3rrJlgQHmBIrz+Iow7Q2 +LiAGaec8xjl6QK/DdXmFuQBKqyKJ14rljFODP4QuE9WJid94bGqjpf3j99ltznZP +4J8HAoGAJb4eb4lu4UGwifDzqfAPzLGCoi0fE1/hSx34lfuLcc1G+LEu9YDKoOVJ +9suOh0b5K/bfEy9KrVMBBriduvdaERSD8S3pkIQaitIz0B029AbE4FLFf9lKQpP2 +KR8NJEkK99Vh/tew6jAMll70xFrE7aF8VLXJVE7w4sQzuvHxl9Q= +-----END RSA PRIVATE KEY----- +`) + +// See (https://github.com/kubernetes/kubernetes/issues/126134). +func TestFallbackClient_WebSocketHTTPSProxyCausesSPDYFallback(t *testing.T) { + cert, err := tls.X509KeyPair(localhostCert, localhostKey) + if err != nil { + t.Errorf("https (valid hostname): proxy_test: %v", err) + } + + var proxyCalled atomic.Int64 + proxyHandler := utilnettesting.NewHTTPProxyHandler(t, func(req *http.Request) bool { + proxyCalled.Add(1) + return true + }) + defer proxyHandler.Wait() + + proxyServer := httptest.NewUnstartedServer(proxyHandler) + proxyServer.TLS = &tls.Config{Certificates: []tls.Certificate{cert}} + proxyServer.StartTLS() + defer proxyServer.Close() //nolint:errcheck + + proxyLocation, err := url.Parse(proxyServer.URL) + require.NoError(t, err) + + // Create fake SPDY server. Copy received STDIN data back onto STDOUT stream. + spdyServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + var stdin, stdout bytes.Buffer + ctx, err := createHTTPStreams(w, req, &StreamOptions{ + Stdin: &stdin, + Stdout: &stdout, + }) + if err != nil { + w.WriteHeader(http.StatusForbidden) + return + } + defer ctx.conn.Close() //nolint:errcheck + _, err = io.Copy(ctx.stdoutStream, ctx.stdinStream) + if err != nil { + t.Fatalf("error copying STDIN to STDOUT: %v", err) + } + })) + defer spdyServer.Close() //nolint:errcheck + + backendLocation, err := url.Parse(spdyServer.URL) + require.NoError(t, err) + + clientConfig := &rest.Config{ + Host: spdyServer.URL, + TLSClientConfig: rest.TLSClientConfig{CAData: localhostCert}, + Proxy: func(req *http.Request) (*url.URL, error) { + return proxyLocation, nil + }, + } + + // Websocket with https proxy will fail in dialing (falling back to SPDY). + websocketExecutor, err := NewWebSocketExecutor(clientConfig, "GET", backendLocation.String()) + require.NoError(t, err) + spdyExecutor, err := NewSPDYExecutor(clientConfig, "POST", backendLocation) + require.NoError(t, err) + // Fallback to spdyExecutor with websocket https proxy error; spdyExecutor succeeds against fake spdy server. + sawHTTPSProxyError := false + exec, err := NewFallbackExecutor(websocketExecutor, spdyExecutor, func(err error) bool { + if httpstream.IsUpgradeFailure(err) { + t.Errorf("saw upgrade failure: %v", err) + return true + } + if httpstream.IsHTTPSProxyError(err) { + sawHTTPSProxyError = true + t.Logf("saw https proxy error: %v", err) + return true + } + return false + }) + require.NoError(t, err) + + // Generate random data, and set it up to stream on STDIN. The data will be + // returned on the STDOUT buffer. + randomSize := 1024 * 1024 + randomData := make([]byte, randomSize) + if _, err := rand.Read(randomData); err != nil { + t.Errorf("unexpected error reading random data: %v", err) + } + var stdout bytes.Buffer + options := &StreamOptions{ + Stdin: bytes.NewReader(randomData), + Stdout: &stdout, + } + errorChan := make(chan error) + go func() { + errorChan <- exec.StreamWithContext(context.Background(), *options) + }() + + select { + case <-time.After(wait.ForeverTestTimeout): + t.Fatalf("expect stream to be closed after connection is closed.") + case err := <-errorChan: + if err != nil { + t.Errorf("unexpected error") + } + } + + data, err := io.ReadAll(bytes.NewReader(stdout.Bytes())) + if err != nil { + t.Errorf("error reading the stream: %v", err) + return + } + // Check the random data sent on STDIN was the same returned on STDOUT. + if !bytes.Equal(randomData, data) { + t.Errorf("unexpected data received: %d sent: %d", len(data), len(randomData)) + } + + // Ensure the https proxy error was observed + if !sawHTTPSProxyError { + t.Errorf("expected to see https proxy error") + } + // Ensure the proxy was called once + if e, a := int64(1), proxyCalled.Load(); e != a { + t.Errorf("expected %d proxy call, got %d", e, a) + } +} + func TestFallbackClient_PrimaryAndSecondaryFail(t *testing.T) { // Create fake WebSocket server. Copy received STDIN data back onto STDOUT stream. websocketServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { diff --git a/tools/remotecommand/websocket_test.go b/tools/remotecommand/websocket_test.go index 4a333b0b24..e1b69c0045 100644 --- a/tools/remotecommand/websocket_test.go +++ b/tools/remotecommand/websocket_test.go @@ -39,6 +39,7 @@ import ( v1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/apimachinery/pkg/util/httpstream/wsstream" "k8s.io/apimachinery/pkg/util/remotecommand" "k8s.io/apimachinery/pkg/util/wait" @@ -814,6 +815,42 @@ func TestWebSocketClient_BadHandshake(t *testing.T) { } } +// See (https://github.com/kubernetes/kubernetes/issues/126134). +func TestWebSocketClient_HTTPSProxyErrorExpected(t *testing.T) { + urlStr := "http://127.0.0.1/never-used" + "?" + "stdin=true" + "&" + "stdout=true" + websocketLocation, err := url.Parse(urlStr) + if err != nil { + t.Fatalf("Unable to parse WebSocket server URL: %s", urlStr) + } + // proxy url with https scheme will trigger websocket dialing error. + httpsProxyFunc := func(req *http.Request) (*url.URL, error) { return url.Parse("https://127.0.0.1") } + exec, err := NewWebSocketExecutor(&rest.Config{Host: websocketLocation.Host, Proxy: httpsProxyFunc}, "GET", urlStr) + if err != nil { + t.Errorf("unexpected error creating websocket executor: %v", err) + } + var stdout bytes.Buffer + options := &StreamOptions{ + Stdout: &stdout, + } + errorChan := make(chan error) + go func() { + // Start the streaming on the WebSocket "exec" client. + errorChan <- exec.StreamWithContext(context.Background(), *options) + }() + + select { + case <-time.After(wait.ForeverTestTimeout): + t.Fatalf("expect stream to be closed after connection is closed.") + case err := <-errorChan: + if err == nil { + t.Errorf("expected error but received none") + } + if !httpstream.IsHTTPSProxyError(err) { + t.Errorf("expected https proxy error, got (%s)", err) + } + } +} + // TestWebSocketClient_HeartbeatTimeout tests the heartbeat by forcing a // timeout by setting the ping period greater than the deadline. func TestWebSocketClient_HeartbeatTimeout(t *testing.T) { From 6e31289fcffafa5f77383ee62632a7bca716922d Mon Sep 17 00:00:00 2001 From: Sean Sullivan Date: Sat, 20 Jul 2024 05:29:57 -0700 Subject: [PATCH 136/159] moving for easier cherry-pick Kubernetes-commit: bc526472515e1a01d41e5a94db2b74462545c984 --- tools/remotecommand/fallback_test.go | 122 +++++++++++++------------- tools/remotecommand/websocket_test.go | 72 +++++++-------- 2 files changed, 97 insertions(+), 97 deletions(-) diff --git a/tools/remotecommand/fallback_test.go b/tools/remotecommand/fallback_test.go index 0dcca20634..b82c7bedf7 100644 --- a/tools/remotecommand/fallback_test.go +++ b/tools/remotecommand/fallback_test.go @@ -169,6 +169,67 @@ func TestFallbackClient_SPDYSecondarySucceeds(t *testing.T) { } } +func TestFallbackClient_PrimaryAndSecondaryFail(t *testing.T) { + // Create fake WebSocket server. Copy received STDIN data back onto STDOUT stream. + websocketServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { + conns, err := webSocketServerStreams(req, w, streamOptionsFromRequest(req)) + if err != nil { + w.WriteHeader(http.StatusForbidden) + return + } + defer conns.conn.Close() + // Loopback the STDIN stream onto the STDOUT stream. + _, err = io.Copy(conns.stdoutStream, conns.stdinStream) + require.NoError(t, err) + })) + defer websocketServer.Close() + + // Now create the fallback client (executor), and point it to the "websocketServer". + // Must add STDIN and STDOUT query params for the client request. + websocketServer.URL = websocketServer.URL + "?" + "stdin=true" + "&" + "stdout=true" + websocketLocation, err := url.Parse(websocketServer.URL) + require.NoError(t, err) + websocketExecutor, err := NewWebSocketExecutor(&rest.Config{Host: websocketLocation.Host}, "GET", websocketServer.URL) + require.NoError(t, err) + spdyExecutor, err := NewSPDYExecutor(&rest.Config{Host: websocketLocation.Host}, "POST", websocketLocation) + require.NoError(t, err) + // Always fallback to spdyExecutor, but spdyExecutor fails against websocket server. + exec, err := NewFallbackExecutor(websocketExecutor, spdyExecutor, func(error) bool { return true }) + require.NoError(t, err) + // Update the websocket executor to request remote command v4, which is unsupported. + fallbackExec, ok := exec.(*FallbackExecutor) + assert.True(t, ok, "error casting executor as FallbackExecutor") + websocketExec, ok := fallbackExec.primary.(*wsStreamExecutor) + assert.True(t, ok, "error casting executor as websocket executor") + // Set the attempted subprotocol version to V4; websocket server only accepts V5. + websocketExec.protocols = []string{remotecommand.StreamProtocolV4Name} + + // Generate random data, and set it up to stream on STDIN. The data will be + // returned on the STDOUT buffer. + randomSize := 1024 * 1024 + randomData := make([]byte, randomSize) + if _, err := rand.Read(randomData); err != nil { + t.Errorf("unexpected error reading random data: %v", err) + } + var stdout bytes.Buffer + options := &StreamOptions{ + Stdin: bytes.NewReader(randomData), + Stdout: &stdout, + } + errorChan := make(chan error) + go func() { + errorChan <- exec.StreamWithContext(context.Background(), *options) + }() + + select { + case <-time.After(wait.ForeverTestTimeout): + t.Fatalf("expect stream to be closed after connection is closed.") + case err := <-errorChan: + // Ensure secondary executor returned an error. + require.Error(t, err) + } +} + // localhostCert was generated from crypto/tls/generate_cert.go with the following command: // // go run generate_cert.go --rsa-bits 2048 --host 127.0.0.1,::1,example.com --ca --start-date "Jan 1 00:00:00 1970" --duration=1000000h @@ -340,64 +401,3 @@ func TestFallbackClient_WebSocketHTTPSProxyCausesSPDYFallback(t *testing.T) { t.Errorf("expected %d proxy call, got %d", e, a) } } - -func TestFallbackClient_PrimaryAndSecondaryFail(t *testing.T) { - // Create fake WebSocket server. Copy received STDIN data back onto STDOUT stream. - websocketServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { - conns, err := webSocketServerStreams(req, w, streamOptionsFromRequest(req)) - if err != nil { - w.WriteHeader(http.StatusForbidden) - return - } - defer conns.conn.Close() - // Loopback the STDIN stream onto the STDOUT stream. - _, err = io.Copy(conns.stdoutStream, conns.stdinStream) - require.NoError(t, err) - })) - defer websocketServer.Close() - - // Now create the fallback client (executor), and point it to the "websocketServer". - // Must add STDIN and STDOUT query params for the client request. - websocketServer.URL = websocketServer.URL + "?" + "stdin=true" + "&" + "stdout=true" - websocketLocation, err := url.Parse(websocketServer.URL) - require.NoError(t, err) - websocketExecutor, err := NewWebSocketExecutor(&rest.Config{Host: websocketLocation.Host}, "GET", websocketServer.URL) - require.NoError(t, err) - spdyExecutor, err := NewSPDYExecutor(&rest.Config{Host: websocketLocation.Host}, "POST", websocketLocation) - require.NoError(t, err) - // Always fallback to spdyExecutor, but spdyExecutor fails against websocket server. - exec, err := NewFallbackExecutor(websocketExecutor, spdyExecutor, func(error) bool { return true }) - require.NoError(t, err) - // Update the websocket executor to request remote command v4, which is unsupported. - fallbackExec, ok := exec.(*FallbackExecutor) - assert.True(t, ok, "error casting executor as FallbackExecutor") - websocketExec, ok := fallbackExec.primary.(*wsStreamExecutor) - assert.True(t, ok, "error casting executor as websocket executor") - // Set the attempted subprotocol version to V4; websocket server only accepts V5. - websocketExec.protocols = []string{remotecommand.StreamProtocolV4Name} - - // Generate random data, and set it up to stream on STDIN. The data will be - // returned on the STDOUT buffer. - randomSize := 1024 * 1024 - randomData := make([]byte, randomSize) - if _, err := rand.Read(randomData); err != nil { - t.Errorf("unexpected error reading random data: %v", err) - } - var stdout bytes.Buffer - options := &StreamOptions{ - Stdin: bytes.NewReader(randomData), - Stdout: &stdout, - } - errorChan := make(chan error) - go func() { - errorChan <- exec.StreamWithContext(context.Background(), *options) - }() - - select { - case <-time.After(wait.ForeverTestTimeout): - t.Fatalf("expect stream to be closed after connection is closed.") - case err := <-errorChan: - // Ensure secondary executor returned an error. - require.Error(t, err) - } -} diff --git a/tools/remotecommand/websocket_test.go b/tools/remotecommand/websocket_test.go index e1b69c0045..b70afcacbe 100644 --- a/tools/remotecommand/websocket_test.go +++ b/tools/remotecommand/websocket_test.go @@ -815,42 +815,6 @@ func TestWebSocketClient_BadHandshake(t *testing.T) { } } -// See (https://github.com/kubernetes/kubernetes/issues/126134). -func TestWebSocketClient_HTTPSProxyErrorExpected(t *testing.T) { - urlStr := "http://127.0.0.1/never-used" + "?" + "stdin=true" + "&" + "stdout=true" - websocketLocation, err := url.Parse(urlStr) - if err != nil { - t.Fatalf("Unable to parse WebSocket server URL: %s", urlStr) - } - // proxy url with https scheme will trigger websocket dialing error. - httpsProxyFunc := func(req *http.Request) (*url.URL, error) { return url.Parse("https://127.0.0.1") } - exec, err := NewWebSocketExecutor(&rest.Config{Host: websocketLocation.Host, Proxy: httpsProxyFunc}, "GET", urlStr) - if err != nil { - t.Errorf("unexpected error creating websocket executor: %v", err) - } - var stdout bytes.Buffer - options := &StreamOptions{ - Stdout: &stdout, - } - errorChan := make(chan error) - go func() { - // Start the streaming on the WebSocket "exec" client. - errorChan <- exec.StreamWithContext(context.Background(), *options) - }() - - select { - case <-time.After(wait.ForeverTestTimeout): - t.Fatalf("expect stream to be closed after connection is closed.") - case err := <-errorChan: - if err == nil { - t.Errorf("expected error but received none") - } - if !httpstream.IsHTTPSProxyError(err) { - t.Errorf("expected https proxy error, got (%s)", err) - } - } -} - // TestWebSocketClient_HeartbeatTimeout tests the heartbeat by forcing a // timeout by setting the ping period greater than the deadline. func TestWebSocketClient_HeartbeatTimeout(t *testing.T) { @@ -1377,3 +1341,39 @@ func createWebSocketStreams(req *http.Request, w http.ResponseWriter, opts *opti return wsStreams, nil } + +// See (https://github.com/kubernetes/kubernetes/issues/126134). +func TestWebSocketClient_HTTPSProxyErrorExpected(t *testing.T) { + urlStr := "http://127.0.0.1/never-used" + "?" + "stdin=true" + "&" + "stdout=true" + websocketLocation, err := url.Parse(urlStr) + if err != nil { + t.Fatalf("Unable to parse WebSocket server URL: %s", urlStr) + } + // proxy url with https scheme will trigger websocket dialing error. + httpsProxyFunc := func(req *http.Request) (*url.URL, error) { return url.Parse("https://127.0.0.1") } + exec, err := NewWebSocketExecutor(&rest.Config{Host: websocketLocation.Host, Proxy: httpsProxyFunc}, "GET", urlStr) + if err != nil { + t.Errorf("unexpected error creating websocket executor: %v", err) + } + var stdout bytes.Buffer + options := &StreamOptions{ + Stdout: &stdout, + } + errorChan := make(chan error) + go func() { + // Start the streaming on the WebSocket "exec" client. + errorChan <- exec.StreamWithContext(context.Background(), *options) + }() + + select { + case <-time.After(wait.ForeverTestTimeout): + t.Fatalf("expect stream to be closed after connection is closed.") + case err := <-errorChan: + if err == nil { + t.Errorf("expected error but received none") + } + if !httpstream.IsHTTPSProxyError(err) { + t.Errorf("expected https proxy error, got (%s)", err) + } + } +} From 82af755eff5441bb8db143861bf131c4208df403 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Sat, 20 Jul 2024 13:23:16 -0700 Subject: [PATCH 137/159] Merge pull request #126231 from seans3/websocket-https-proxy-fix Falls back to SPDY for gorilla/websocket https proxy error Kubernetes-commit: 90a84704d6e103c0a7b5cdaa8f6626a134079147 --- go.mod | 9 ++++++--- go.sum | 8 ++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 4b8ced4b95..5597df4a51 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.34.2 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240719062922-5c3f1a6b4201 - k8s.io/apimachinery v0.0.0-20240715201109-ab0686929a37 + k8s.io/api v0.0.0-20240720022854-7d5e5eaf3aef + k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 @@ -43,7 +43,9 @@ require ( github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.4 // indirect + github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/google/btree v1.0.1 // indirect + github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af // 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 @@ -52,12 +54,13 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect - github.com/onsi/gomega v1.33.1 // indirect + github.com/onsi/ginkgo/v2 v2.19.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/x448/float16 v0.8.4 // indirect golang.org/x/sys v0.21.0 // indirect golang.org/x/text v0.16.0 // indirect + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 2c530fa4d3..f6d4fed3a4 100644 --- a/go.sum +++ b/go.sum @@ -156,10 +156,10 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240719062922-5c3f1a6b4201 h1:gikkoCyTnd6ot9vlYY1Ew1i4hh9fzJJQ3JY5p5VY6po= -k8s.io/api v0.0.0-20240719062922-5c3f1a6b4201/go.mod h1:2UcZQyUkPm7CMfP50V/oCVagw0chxcTd2M0sBNxxM9E= -k8s.io/apimachinery v0.0.0-20240715201109-ab0686929a37 h1:vG4p9Dp1oF1azqq+OvpzZjVtlKqo91bRDoZ2MfgoUaw= -k8s.io/apimachinery v0.0.0-20240715201109-ab0686929a37/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/api v0.0.0-20240720022854-7d5e5eaf3aef h1:srEy4lds3ddDhT+cxFy68Uvt3GVRTo3fwnw+Us/Nqqs= +k8s.io/api v0.0.0-20240720022854-7d5e5eaf3aef/go.mod h1:SvpyE6bmVBf1ly5BaD4y6yym4ZpHrV2pa8tTRjcglaA= +k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe h1:V9MwpYUwbKlfLKVrhpVuKWiat/LBIhm1pGB9/xdHm5Q= +k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 91ff2f6ea59f611518d01a216239b35536e1d5f6 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Fri, 14 Jun 2024 12:40:48 +0200 Subject: [PATCH 138/159] DRA: bump API v1alpha2 -> v1alpha3 This is in preparation for revamping the resource.k8s.io completely. Because there will be no support for transitioning from v1alpha2 to v1alpha3, the roundtrip test data for that API in 1.29 and 1.30 gets removed. Repeating the version in the import name of the API packages is not really required. It was done for a while to support simpler grepping for usage of alpha APIs, but there are better ways for that now. So during this transition, "resourceapi" gets used instead of "resourcev1alpha3" and the version gets dropped from informer and lister imports. The advantage is that the next bump to v1beta1 will affect fewer source code lines. Only source code where the version really matters (like API registration) retains the versioned import. Kubernetes-commit: b51d68bb87ba4fa47eb760f8a5e0baf9cf7f5b53 --- applyconfigurations/internal/internal.go | 120 +++++++------- .../allocationresult.go | 2 +- .../allocationresultmodel.go | 2 +- .../driverallocationresult.go | 2 +- .../{v1alpha2 => v1alpha3}/driverrequests.go | 2 +- .../namedresourcesallocationresult.go | 2 +- .../namedresourcesattribute.go | 2 +- .../namedresourcesattributevalue.go | 2 +- .../namedresourcesfilter.go | 2 +- .../namedresourcesinstance.go | 2 +- .../namedresourcesintslice.go | 2 +- .../namedresourcesrequest.go | 2 +- .../namedresourcesresources.go | 2 +- .../namedresourcesstringslice.go | 2 +- .../podschedulingcontext.go | 16 +- .../podschedulingcontextspec.go | 2 +- .../podschedulingcontextstatus.go | 2 +- .../{v1alpha2 => v1alpha3}/resourceclaim.go | 16 +- .../resourceclaimconsumerreference.go | 2 +- .../resourceclaimparameters.go | 16 +- .../resourceclaimparametersreference.go | 2 +- .../resourceclaimschedulingstatus.go | 2 +- .../resourceclaimspec.go | 8 +- .../resourceclaimstatus.go | 2 +- .../resourceclaimtemplate.go | 16 +- .../resourceclaimtemplatespec.go | 2 +- .../{v1alpha2 => v1alpha3}/resourceclass.go | 16 +- .../resourceclassparameters.go | 16 +- .../resourceclassparametersreference.go | 2 +- .../{v1alpha2 => v1alpha3}/resourcefilter.go | 2 +- .../resourcefiltermodel.go | 2 +- .../{v1alpha2 => v1alpha3}/resourcehandle.go | 2 +- .../{v1alpha2 => v1alpha3}/resourcemodel.go | 2 +- .../{v1alpha2 => v1alpha3}/resourcerequest.go | 2 +- .../resourcerequestmodel.go | 2 +- .../{v1alpha2 => v1alpha3}/resourceslice.go | 16 +- .../structuredresourcehandle.go | 2 +- .../vendorparameters.go | 2 +- applyconfigurations/utils.go | 154 +++++++++--------- informers/generic.go | 32 ++-- informers/resource/interface.go | 12 +- .../{v1alpha2 => v1alpha3}/interface.go | 2 +- .../podschedulingcontext.go | 20 +-- .../{v1alpha2 => v1alpha3}/resourceclaim.go | 20 +-- .../resourceclaimparameters.go | 20 +-- .../resourceclaimtemplate.go | 20 +-- .../{v1alpha2 => v1alpha3}/resourceclass.go | 20 +-- .../resourceclassparameters.go | 20 +-- .../{v1alpha2 => v1alpha3}/resourceslice.go | 20 +-- kubernetes/clientset.go | 16 +- kubernetes/fake/clientset_generated.go | 10 +- kubernetes/fake/register.go | 4 +- kubernetes/scheme/register.go | 4 +- .../resource/{v1alpha2 => v1alpha3}/doc.go | 2 +- .../{v1alpha2 => v1alpha3}/fake/doc.go | 0 .../fake/fake_podschedulingcontext.go | 64 ++++---- .../fake/fake_resource_client.go | 20 +-- .../fake/fake_resourceclaim.go | 64 ++++---- .../fake/fake_resourceclaimparameters.go | 52 +++--- .../fake/fake_resourceclaimtemplate.go | 52 +++--- .../fake/fake_resourceclass.go | 52 +++--- .../fake/fake_resourceclassparameters.go | 52 +++--- .../fake/fake_resourceslice.go | 52 +++--- .../generated_expansion.go | 2 +- .../podschedulingcontext.go | 32 ++-- .../{v1alpha2 => v1alpha3}/resource_client.go | 48 +++--- .../{v1alpha2 => v1alpha3}/resourceclaim.go | 32 ++-- .../resourceclaimparameters.go | 28 ++-- .../resourceclaimtemplate.go | 28 ++-- .../{v1alpha2 => v1alpha3}/resourceclass.go | 28 ++-- .../resourceclassparameters.go | 28 ++-- .../{v1alpha2 => v1alpha3}/resourceslice.go | 28 ++-- .../expansion_generated.go | 2 +- .../podschedulingcontext.go | 18 +- .../{v1alpha2 => v1alpha3}/resourceclaim.go | 18 +- .../resourceclaimparameters.go | 18 +- .../resourceclaimtemplate.go | 18 +- .../{v1alpha2 => v1alpha3}/resourceclass.go | 12 +- .../resourceclassparameters.go | 18 +- .../{v1alpha2 => v1alpha3}/resourceslice.go | 12 +- 80 files changed, 726 insertions(+), 726 deletions(-) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/allocationresult.go (99%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/allocationresultmodel.go (99%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/driverallocationresult.go (99%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/driverrequests.go (99%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/namedresourcesallocationresult.go (98%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/namedresourcesattribute.go (99%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/namedresourcesattributevalue.go (99%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/namedresourcesfilter.go (98%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/namedresourcesinstance.go (99%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/namedresourcesintslice.go (98%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/namedresourcesrequest.go (98%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/namedresourcesresources.go (99%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/namedresourcesstringslice.go (98%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/podschedulingcontext.go (96%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/podschedulingcontextspec.go (99%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/podschedulingcontextstatus.go (99%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourceclaim.go (96%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourceclaimconsumerreference.go (99%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourceclaimparameters.go (97%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourceclaimparametersreference.go (99%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourceclaimschedulingstatus.go (99%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourceclaimspec.go (93%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourceclaimstatus.go (99%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourceclaimtemplate.go (96%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourceclaimtemplatespec.go (99%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourceclass.go (97%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourceclassparameters.go (97%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourceclassparametersreference.go (99%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourcefilter.go (99%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourcefiltermodel.go (98%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourcehandle.go (99%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourcemodel.go (98%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourcerequest.go (99%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourcerequestmodel.go (98%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/resourceslice.go (96%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/structuredresourcehandle.go (99%) rename applyconfigurations/resource/{v1alpha2 => v1alpha3}/vendorparameters.go (99%) rename informers/resource/{v1alpha2 => v1alpha3}/interface.go (99%) rename informers/resource/{v1alpha2 => v1alpha3}/podschedulingcontext.go (86%) rename informers/resource/{v1alpha2 => v1alpha3}/resourceclaim.go (85%) rename informers/resource/{v1alpha2 => v1alpha3}/resourceclaimparameters.go (86%) rename informers/resource/{v1alpha2 => v1alpha3}/resourceclaimtemplate.go (86%) rename informers/resource/{v1alpha2 => v1alpha3}/resourceclass.go (85%) rename informers/resource/{v1alpha2 => v1alpha3}/resourceclassparameters.go (86%) rename informers/resource/{v1alpha2 => v1alpha3}/resourceslice.go (85%) rename kubernetes/typed/resource/{v1alpha2 => v1alpha3}/doc.go (97%) rename kubernetes/typed/resource/{v1alpha2 => v1alpha3}/fake/doc.go (100%) rename kubernetes/typed/resource/{v1alpha2 => v1alpha3}/fake/fake_podschedulingcontext.go (74%) rename kubernetes/typed/resource/{v1alpha2 => v1alpha3}/fake/fake_resource_client.go (59%) rename kubernetes/typed/resource/{v1alpha2 => v1alpha3}/fake/fake_resourceclaim.go (75%) rename kubernetes/typed/resource/{v1alpha2 => v1alpha3}/fake/fake_resourceclaimparameters.go (75%) rename kubernetes/typed/resource/{v1alpha2 => v1alpha3}/fake/fake_resourceclaimtemplate.go (75%) rename kubernetes/typed/resource/{v1alpha2 => v1alpha3}/fake/fake_resourceclass.go (76%) rename kubernetes/typed/resource/{v1alpha2 => v1alpha3}/fake/fake_resourceclassparameters.go (75%) rename kubernetes/typed/resource/{v1alpha2 => v1alpha3}/fake/fake_resourceslice.go (75%) rename kubernetes/typed/resource/{v1alpha2 => v1alpha3}/generated_expansion.go (98%) rename kubernetes/typed/resource/{v1alpha2 => v1alpha3}/podschedulingcontext.go (66%) rename kubernetes/typed/resource/{v1alpha2 => v1alpha3}/resource_client.go (69%) rename kubernetes/typed/resource/{v1alpha2 => v1alpha3}/resourceclaim.go (63%) rename kubernetes/typed/resource/{v1alpha2 => v1alpha3}/resourceclaimparameters.go (66%) rename kubernetes/typed/resource/{v1alpha2 => v1alpha3}/resourceclaimtemplate.go (67%) rename kubernetes/typed/resource/{v1alpha2 => v1alpha3}/resourceclass.go (65%) rename kubernetes/typed/resource/{v1alpha2 => v1alpha3}/resourceclassparameters.go (66%) rename kubernetes/typed/resource/{v1alpha2 => v1alpha3}/resourceslice.go (65%) rename listers/resource/{v1alpha2 => v1alpha3}/expansion_generated.go (99%) rename listers/resource/{v1alpha2 => v1alpha3}/podschedulingcontext.go (81%) rename listers/resource/{v1alpha2 => v1alpha3}/resourceclaim.go (81%) rename listers/resource/{v1alpha2 => v1alpha3}/resourceclaimparameters.go (82%) rename listers/resource/{v1alpha2 => v1alpha3}/resourceclaimtemplate.go (82%) rename listers/resource/{v1alpha2 => v1alpha3}/resourceclass.go (80%) rename listers/resource/{v1alpha2 => v1alpha3}/resourceclassparameters.go (82%) rename listers/resource/{v1alpha2 => v1alpha3}/resourceslice.go (80%) diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 40dd7efa57..0a9b23bb23 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -12154,7 +12154,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: namespace type: scalar: string -- name: io.k8s.api.resource.v1alpha2.AllocationResult +- name: io.k8s.api.resource.v1alpha3.AllocationResult map: fields: - name: availableOnNodes @@ -12164,21 +12164,21 @@ var schemaYAML = typed.YAMLObject(`types: type: list: elementType: - namedType: io.k8s.api.resource.v1alpha2.ResourceHandle + namedType: io.k8s.api.resource.v1alpha3.ResourceHandle elementRelationship: atomic - name: shareable type: scalar: boolean -- name: io.k8s.api.resource.v1alpha2.DriverAllocationResult +- name: io.k8s.api.resource.v1alpha3.DriverAllocationResult map: fields: - name: namedResources type: - namedType: io.k8s.api.resource.v1alpha2.NamedResourcesAllocationResult + namedType: io.k8s.api.resource.v1alpha3.NamedResourcesAllocationResult - name: vendorRequestParameters type: namedType: __untyped_atomic_ -- name: io.k8s.api.resource.v1alpha2.DriverRequests +- name: io.k8s.api.resource.v1alpha3.DriverRequests map: fields: - name: driverName @@ -12188,19 +12188,19 @@ var schemaYAML = typed.YAMLObject(`types: type: list: elementType: - namedType: io.k8s.api.resource.v1alpha2.ResourceRequest + namedType: io.k8s.api.resource.v1alpha3.ResourceRequest elementRelationship: atomic - name: vendorParameters type: namedType: __untyped_atomic_ -- name: io.k8s.api.resource.v1alpha2.NamedResourcesAllocationResult +- name: io.k8s.api.resource.v1alpha3.NamedResourcesAllocationResult map: fields: - name: name type: scalar: string default: "" -- name: io.k8s.api.resource.v1alpha2.NamedResourcesAttribute +- name: io.k8s.api.resource.v1alpha3.NamedResourcesAttribute map: fields: - name: bool @@ -12211,7 +12211,7 @@ var schemaYAML = typed.YAMLObject(`types: scalar: numeric - name: intSlice type: - namedType: io.k8s.api.resource.v1alpha2.NamedResourcesIntSlice + namedType: io.k8s.api.resource.v1alpha3.NamedResourcesIntSlice - name: name type: scalar: string @@ -12224,31 +12224,31 @@ var schemaYAML = typed.YAMLObject(`types: scalar: string - name: stringSlice type: - namedType: io.k8s.api.resource.v1alpha2.NamedResourcesStringSlice + namedType: io.k8s.api.resource.v1alpha3.NamedResourcesStringSlice - name: version type: scalar: string -- name: io.k8s.api.resource.v1alpha2.NamedResourcesFilter +- name: io.k8s.api.resource.v1alpha3.NamedResourcesFilter map: fields: - name: selector type: scalar: string default: "" -- name: io.k8s.api.resource.v1alpha2.NamedResourcesInstance +- name: io.k8s.api.resource.v1alpha3.NamedResourcesInstance map: fields: - name: attributes type: list: elementType: - namedType: io.k8s.api.resource.v1alpha2.NamedResourcesAttribute + namedType: io.k8s.api.resource.v1alpha3.NamedResourcesAttribute elementRelationship: atomic - name: name type: scalar: string default: "" -- name: io.k8s.api.resource.v1alpha2.NamedResourcesIntSlice +- name: io.k8s.api.resource.v1alpha3.NamedResourcesIntSlice map: fields: - name: ints @@ -12257,23 +12257,23 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: numeric elementRelationship: atomic -- name: io.k8s.api.resource.v1alpha2.NamedResourcesRequest +- name: io.k8s.api.resource.v1alpha3.NamedResourcesRequest map: fields: - name: selector type: scalar: string default: "" -- name: io.k8s.api.resource.v1alpha2.NamedResourcesResources +- name: io.k8s.api.resource.v1alpha3.NamedResourcesResources map: fields: - name: instances type: list: elementType: - namedType: io.k8s.api.resource.v1alpha2.NamedResourcesInstance + namedType: io.k8s.api.resource.v1alpha3.NamedResourcesInstance elementRelationship: atomic -- name: io.k8s.api.resource.v1alpha2.NamedResourcesStringSlice +- name: io.k8s.api.resource.v1alpha3.NamedResourcesStringSlice map: fields: - name: strings @@ -12282,7 +12282,7 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: string elementRelationship: atomic -- name: io.k8s.api.resource.v1alpha2.PodSchedulingContext +- name: io.k8s.api.resource.v1alpha3.PodSchedulingContext map: fields: - name: apiVersion @@ -12297,13 +12297,13 @@ var schemaYAML = typed.YAMLObject(`types: default: {} - name: spec type: - namedType: io.k8s.api.resource.v1alpha2.PodSchedulingContextSpec + namedType: io.k8s.api.resource.v1alpha3.PodSchedulingContextSpec default: {} - name: status type: - namedType: io.k8s.api.resource.v1alpha2.PodSchedulingContextStatus + namedType: io.k8s.api.resource.v1alpha3.PodSchedulingContextStatus default: {} -- name: io.k8s.api.resource.v1alpha2.PodSchedulingContextSpec +- name: io.k8s.api.resource.v1alpha3.PodSchedulingContextSpec map: fields: - name: potentialNodes @@ -12315,18 +12315,18 @@ var schemaYAML = typed.YAMLObject(`types: - name: selectedNode type: scalar: string -- name: io.k8s.api.resource.v1alpha2.PodSchedulingContextStatus +- name: io.k8s.api.resource.v1alpha3.PodSchedulingContextStatus map: fields: - name: resourceClaims type: list: elementType: - namedType: io.k8s.api.resource.v1alpha2.ResourceClaimSchedulingStatus + namedType: io.k8s.api.resource.v1alpha3.ResourceClaimSchedulingStatus elementRelationship: associative keys: - name -- name: io.k8s.api.resource.v1alpha2.ResourceClaim +- name: io.k8s.api.resource.v1alpha3.ResourceClaim map: fields: - name: apiVersion @@ -12341,13 +12341,13 @@ var schemaYAML = typed.YAMLObject(`types: default: {} - name: spec type: - namedType: io.k8s.api.resource.v1alpha2.ResourceClaimSpec + namedType: io.k8s.api.resource.v1alpha3.ResourceClaimSpec default: {} - name: status type: - namedType: io.k8s.api.resource.v1alpha2.ResourceClaimStatus + namedType: io.k8s.api.resource.v1alpha3.ResourceClaimStatus default: {} -- name: io.k8s.api.resource.v1alpha2.ResourceClaimConsumerReference +- name: io.k8s.api.resource.v1alpha3.ResourceClaimConsumerReference map: fields: - name: apiGroup @@ -12365,7 +12365,7 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" -- name: io.k8s.api.resource.v1alpha2.ResourceClaimParameters +- name: io.k8s.api.resource.v1alpha3.ResourceClaimParameters map: fields: - name: apiVersion @@ -12375,11 +12375,11 @@ var schemaYAML = typed.YAMLObject(`types: type: list: elementType: - namedType: io.k8s.api.resource.v1alpha2.DriverRequests + namedType: io.k8s.api.resource.v1alpha3.DriverRequests elementRelationship: atomic - name: generatedFrom type: - namedType: io.k8s.api.resource.v1alpha2.ResourceClaimParametersReference + namedType: io.k8s.api.resource.v1alpha3.ResourceClaimParametersReference - name: kind type: scalar: string @@ -12390,7 +12390,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: shareable type: scalar: boolean -- name: io.k8s.api.resource.v1alpha2.ResourceClaimParametersReference +- name: io.k8s.api.resource.v1alpha3.ResourceClaimParametersReference map: fields: - name: apiGroup @@ -12404,7 +12404,7 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" -- name: io.k8s.api.resource.v1alpha2.ResourceClaimSchedulingStatus +- name: io.k8s.api.resource.v1alpha3.ResourceClaimSchedulingStatus map: fields: - name: name @@ -12416,7 +12416,7 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: string elementRelationship: atomic -- name: io.k8s.api.resource.v1alpha2.ResourceClaimSpec +- name: io.k8s.api.resource.v1alpha3.ResourceClaimSpec map: fields: - name: allocationMode @@ -12424,17 +12424,17 @@ var schemaYAML = typed.YAMLObject(`types: scalar: string - name: parametersRef type: - namedType: io.k8s.api.resource.v1alpha2.ResourceClaimParametersReference + namedType: io.k8s.api.resource.v1alpha3.ResourceClaimParametersReference - name: resourceClassName type: scalar: string default: "" -- name: io.k8s.api.resource.v1alpha2.ResourceClaimStatus +- name: io.k8s.api.resource.v1alpha3.ResourceClaimStatus map: fields: - name: allocation type: - namedType: io.k8s.api.resource.v1alpha2.AllocationResult + namedType: io.k8s.api.resource.v1alpha3.AllocationResult - name: deallocationRequested type: scalar: boolean @@ -12445,11 +12445,11 @@ var schemaYAML = typed.YAMLObject(`types: type: list: elementType: - namedType: io.k8s.api.resource.v1alpha2.ResourceClaimConsumerReference + namedType: io.k8s.api.resource.v1alpha3.ResourceClaimConsumerReference elementRelationship: associative keys: - uid -- name: io.k8s.api.resource.v1alpha2.ResourceClaimTemplate +- name: io.k8s.api.resource.v1alpha3.ResourceClaimTemplate map: fields: - name: apiVersion @@ -12464,9 +12464,9 @@ var schemaYAML = typed.YAMLObject(`types: default: {} - name: spec type: - namedType: io.k8s.api.resource.v1alpha2.ResourceClaimTemplateSpec + namedType: io.k8s.api.resource.v1alpha3.ResourceClaimTemplateSpec default: {} -- name: io.k8s.api.resource.v1alpha2.ResourceClaimTemplateSpec +- name: io.k8s.api.resource.v1alpha3.ResourceClaimTemplateSpec map: fields: - name: metadata @@ -12475,9 +12475,9 @@ var schemaYAML = typed.YAMLObject(`types: default: {} - name: spec type: - namedType: io.k8s.api.resource.v1alpha2.ResourceClaimSpec + namedType: io.k8s.api.resource.v1alpha3.ResourceClaimSpec default: {} -- name: io.k8s.api.resource.v1alpha2.ResourceClass +- name: io.k8s.api.resource.v1alpha3.ResourceClass map: fields: - name: apiVersion @@ -12496,14 +12496,14 @@ var schemaYAML = typed.YAMLObject(`types: default: {} - name: parametersRef type: - namedType: io.k8s.api.resource.v1alpha2.ResourceClassParametersReference + namedType: io.k8s.api.resource.v1alpha3.ResourceClassParametersReference - name: structuredParameters type: scalar: boolean - name: suitableNodes type: namedType: io.k8s.api.core.v1.NodeSelector -- name: io.k8s.api.resource.v1alpha2.ResourceClassParameters +- name: io.k8s.api.resource.v1alpha3.ResourceClassParameters map: fields: - name: apiVersion @@ -12513,11 +12513,11 @@ var schemaYAML = typed.YAMLObject(`types: type: list: elementType: - namedType: io.k8s.api.resource.v1alpha2.ResourceFilter + namedType: io.k8s.api.resource.v1alpha3.ResourceFilter elementRelationship: atomic - name: generatedFrom type: - namedType: io.k8s.api.resource.v1alpha2.ResourceClassParametersReference + namedType: io.k8s.api.resource.v1alpha3.ResourceClassParametersReference - name: kind type: scalar: string @@ -12529,9 +12529,9 @@ var schemaYAML = typed.YAMLObject(`types: type: list: elementType: - namedType: io.k8s.api.resource.v1alpha2.VendorParameters + namedType: io.k8s.api.resource.v1alpha3.VendorParameters elementRelationship: atomic -- name: io.k8s.api.resource.v1alpha2.ResourceClassParametersReference +- name: io.k8s.api.resource.v1alpha3.ResourceClassParametersReference map: fields: - name: apiGroup @@ -12548,7 +12548,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: namespace type: scalar: string -- name: io.k8s.api.resource.v1alpha2.ResourceFilter +- name: io.k8s.api.resource.v1alpha3.ResourceFilter map: fields: - name: driverName @@ -12556,8 +12556,8 @@ var schemaYAML = typed.YAMLObject(`types: scalar: string - name: namedResources type: - namedType: io.k8s.api.resource.v1alpha2.NamedResourcesFilter -- name: io.k8s.api.resource.v1alpha2.ResourceHandle + namedType: io.k8s.api.resource.v1alpha3.NamedResourcesFilter +- name: io.k8s.api.resource.v1alpha3.ResourceHandle map: fields: - name: data @@ -12569,17 +12569,17 @@ var schemaYAML = typed.YAMLObject(`types: default: "" - name: structuredData type: - namedType: io.k8s.api.resource.v1alpha2.StructuredResourceHandle -- name: io.k8s.api.resource.v1alpha2.ResourceRequest + namedType: io.k8s.api.resource.v1alpha3.StructuredResourceHandle +- name: io.k8s.api.resource.v1alpha3.ResourceRequest map: fields: - name: namedResources type: - namedType: io.k8s.api.resource.v1alpha2.NamedResourcesRequest + namedType: io.k8s.api.resource.v1alpha3.NamedResourcesRequest - name: vendorParameters type: namedType: __untyped_atomic_ -- name: io.k8s.api.resource.v1alpha2.ResourceSlice +- name: io.k8s.api.resource.v1alpha3.ResourceSlice map: fields: - name: apiVersion @@ -12598,11 +12598,11 @@ var schemaYAML = typed.YAMLObject(`types: default: {} - name: namedResources type: - namedType: io.k8s.api.resource.v1alpha2.NamedResourcesResources + namedType: io.k8s.api.resource.v1alpha3.NamedResourcesResources - name: nodeName type: scalar: string -- name: io.k8s.api.resource.v1alpha2.StructuredResourceHandle +- name: io.k8s.api.resource.v1alpha3.StructuredResourceHandle map: fields: - name: nodeName @@ -12612,7 +12612,7 @@ var schemaYAML = typed.YAMLObject(`types: type: list: elementType: - namedType: io.k8s.api.resource.v1alpha2.DriverAllocationResult + namedType: io.k8s.api.resource.v1alpha3.DriverAllocationResult elementRelationship: atomic - name: vendorClaimParameters type: @@ -12620,7 +12620,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: vendorClassParameters type: namedType: __untyped_atomic_ -- name: io.k8s.api.resource.v1alpha2.VendorParameters +- name: io.k8s.api.resource.v1alpha3.VendorParameters map: fields: - name: driverName diff --git a/applyconfigurations/resource/v1alpha2/allocationresult.go b/applyconfigurations/resource/v1alpha3/allocationresult.go similarity index 99% rename from applyconfigurations/resource/v1alpha2/allocationresult.go rename to applyconfigurations/resource/v1alpha3/allocationresult.go index 7eef384597..cf3cde948c 100644 --- a/applyconfigurations/resource/v1alpha2/allocationresult.go +++ b/applyconfigurations/resource/v1alpha3/allocationresult.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( v1 "k8s.io/client-go/applyconfigurations/core/v1" diff --git a/applyconfigurations/resource/v1alpha2/allocationresultmodel.go b/applyconfigurations/resource/v1alpha3/allocationresultmodel.go similarity index 99% rename from applyconfigurations/resource/v1alpha2/allocationresultmodel.go rename to applyconfigurations/resource/v1alpha3/allocationresultmodel.go index 3250fd5d11..197f882883 100644 --- a/applyconfigurations/resource/v1alpha2/allocationresultmodel.go +++ b/applyconfigurations/resource/v1alpha3/allocationresultmodel.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // AllocationResultModelApplyConfiguration represents a declarative configuration of the AllocationResultModel type for use // with apply. diff --git a/applyconfigurations/resource/v1alpha2/driverallocationresult.go b/applyconfigurations/resource/v1alpha3/driverallocationresult.go similarity index 99% rename from applyconfigurations/resource/v1alpha2/driverallocationresult.go rename to applyconfigurations/resource/v1alpha3/driverallocationresult.go index f44db7921c..787c02660c 100644 --- a/applyconfigurations/resource/v1alpha2/driverallocationresult.go +++ b/applyconfigurations/resource/v1alpha3/driverallocationresult.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( runtime "k8s.io/apimachinery/pkg/runtime" diff --git a/applyconfigurations/resource/v1alpha2/driverrequests.go b/applyconfigurations/resource/v1alpha3/driverrequests.go similarity index 99% rename from applyconfigurations/resource/v1alpha2/driverrequests.go rename to applyconfigurations/resource/v1alpha3/driverrequests.go index 79cc04c245..f322e7930a 100644 --- a/applyconfigurations/resource/v1alpha2/driverrequests.go +++ b/applyconfigurations/resource/v1alpha3/driverrequests.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( runtime "k8s.io/apimachinery/pkg/runtime" diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesallocationresult.go b/applyconfigurations/resource/v1alpha3/namedresourcesallocationresult.go similarity index 98% rename from applyconfigurations/resource/v1alpha2/namedresourcesallocationresult.go rename to applyconfigurations/resource/v1alpha3/namedresourcesallocationresult.go index 7baf9558de..89509eecb0 100644 --- a/applyconfigurations/resource/v1alpha2/namedresourcesallocationresult.go +++ b/applyconfigurations/resource/v1alpha3/namedresourcesallocationresult.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // NamedResourcesAllocationResultApplyConfiguration represents a declarative configuration of the NamedResourcesAllocationResult type for use // with apply. diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesattribute.go b/applyconfigurations/resource/v1alpha3/namedresourcesattribute.go similarity index 99% rename from applyconfigurations/resource/v1alpha2/namedresourcesattribute.go rename to applyconfigurations/resource/v1alpha3/namedresourcesattribute.go index 38df3195b1..5028597812 100644 --- a/applyconfigurations/resource/v1alpha2/namedresourcesattribute.go +++ b/applyconfigurations/resource/v1alpha3/namedresourcesattribute.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( resource "k8s.io/apimachinery/pkg/api/resource" diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesattributevalue.go b/applyconfigurations/resource/v1alpha3/namedresourcesattributevalue.go similarity index 99% rename from applyconfigurations/resource/v1alpha2/namedresourcesattributevalue.go rename to applyconfigurations/resource/v1alpha3/namedresourcesattributevalue.go index d9ef2682e3..8b6d90d50c 100644 --- a/applyconfigurations/resource/v1alpha2/namedresourcesattributevalue.go +++ b/applyconfigurations/resource/v1alpha3/namedresourcesattributevalue.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( resource "k8s.io/apimachinery/pkg/api/resource" diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesfilter.go b/applyconfigurations/resource/v1alpha3/namedresourcesfilter.go similarity index 98% rename from applyconfigurations/resource/v1alpha2/namedresourcesfilter.go rename to applyconfigurations/resource/v1alpha3/namedresourcesfilter.go index 439eb06635..3a47beada4 100644 --- a/applyconfigurations/resource/v1alpha2/namedresourcesfilter.go +++ b/applyconfigurations/resource/v1alpha3/namedresourcesfilter.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // NamedResourcesFilterApplyConfiguration represents a declarative configuration of the NamedResourcesFilter type for use // with apply. diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesinstance.go b/applyconfigurations/resource/v1alpha3/namedresourcesinstance.go similarity index 99% rename from applyconfigurations/resource/v1alpha2/namedresourcesinstance.go rename to applyconfigurations/resource/v1alpha3/namedresourcesinstance.go index 4ec6fd7ab6..ff028814db 100644 --- a/applyconfigurations/resource/v1alpha2/namedresourcesinstance.go +++ b/applyconfigurations/resource/v1alpha3/namedresourcesinstance.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // NamedResourcesInstanceApplyConfiguration represents a declarative configuration of the NamedResourcesInstance type for use // with apply. diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesintslice.go b/applyconfigurations/resource/v1alpha3/namedresourcesintslice.go similarity index 98% rename from applyconfigurations/resource/v1alpha2/namedresourcesintslice.go rename to applyconfigurations/resource/v1alpha3/namedresourcesintslice.go index f3d74e7b9c..fa336b4ae9 100644 --- a/applyconfigurations/resource/v1alpha2/namedresourcesintslice.go +++ b/applyconfigurations/resource/v1alpha3/namedresourcesintslice.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // NamedResourcesIntSliceApplyConfiguration represents a declarative configuration of the NamedResourcesIntSlice type for use // with apply. diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesrequest.go b/applyconfigurations/resource/v1alpha3/namedresourcesrequest.go similarity index 98% rename from applyconfigurations/resource/v1alpha2/namedresourcesrequest.go rename to applyconfigurations/resource/v1alpha3/namedresourcesrequest.go index b0722df48c..da6ac3efcf 100644 --- a/applyconfigurations/resource/v1alpha2/namedresourcesrequest.go +++ b/applyconfigurations/resource/v1alpha3/namedresourcesrequest.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // NamedResourcesRequestApplyConfiguration represents a declarative configuration of the NamedResourcesRequest type for use // with apply. diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesresources.go b/applyconfigurations/resource/v1alpha3/namedresourcesresources.go similarity index 99% rename from applyconfigurations/resource/v1alpha2/namedresourcesresources.go rename to applyconfigurations/resource/v1alpha3/namedresourcesresources.go index 0ef0565552..3e467922a4 100644 --- a/applyconfigurations/resource/v1alpha2/namedresourcesresources.go +++ b/applyconfigurations/resource/v1alpha3/namedresourcesresources.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // NamedResourcesResourcesApplyConfiguration represents a declarative configuration of the NamedResourcesResources type for use // with apply. diff --git a/applyconfigurations/resource/v1alpha2/namedresourcesstringslice.go b/applyconfigurations/resource/v1alpha3/namedresourcesstringslice.go similarity index 98% rename from applyconfigurations/resource/v1alpha2/namedresourcesstringslice.go rename to applyconfigurations/resource/v1alpha3/namedresourcesstringslice.go index 27295b8964..8f21f81905 100644 --- a/applyconfigurations/resource/v1alpha2/namedresourcesstringslice.go +++ b/applyconfigurations/resource/v1alpha3/namedresourcesstringslice.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // NamedResourcesStringSliceApplyConfiguration represents a declarative configuration of the NamedResourcesStringSlice type for use // with apply. diff --git a/applyconfigurations/resource/v1alpha2/podschedulingcontext.go b/applyconfigurations/resource/v1alpha3/podschedulingcontext.go similarity index 96% rename from applyconfigurations/resource/v1alpha2/podschedulingcontext.go rename to applyconfigurations/resource/v1alpha3/podschedulingcontext.go index 1eae9582dd..ee8e73ebe2 100644 --- a/applyconfigurations/resource/v1alpha2/podschedulingcontext.go +++ b/applyconfigurations/resource/v1alpha3/podschedulingcontext.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" @@ -43,7 +43,7 @@ func PodSchedulingContext(name, namespace string) *PodSchedulingContextApplyConf b.WithName(name) b.WithNamespace(namespace) b.WithKind("PodSchedulingContext") - b.WithAPIVersion("resource.k8s.io/v1alpha2") + b.WithAPIVersion("resource.k8s.io/v1alpha3") return b } @@ -58,20 +58,20 @@ func PodSchedulingContext(name, namespace string) *PodSchedulingContextApplyConf // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! -func ExtractPodSchedulingContext(podSchedulingContext *resourcev1alpha2.PodSchedulingContext, fieldManager string) (*PodSchedulingContextApplyConfiguration, error) { +func ExtractPodSchedulingContext(podSchedulingContext *resourcev1alpha3.PodSchedulingContext, fieldManager string) (*PodSchedulingContextApplyConfiguration, error) { return extractPodSchedulingContext(podSchedulingContext, fieldManager, "") } // ExtractPodSchedulingContextStatus is the same as ExtractPodSchedulingContext except // that it extracts the status subresource applied configuration. // Experimental! -func ExtractPodSchedulingContextStatus(podSchedulingContext *resourcev1alpha2.PodSchedulingContext, fieldManager string) (*PodSchedulingContextApplyConfiguration, error) { +func ExtractPodSchedulingContextStatus(podSchedulingContext *resourcev1alpha3.PodSchedulingContext, fieldManager string) (*PodSchedulingContextApplyConfiguration, error) { return extractPodSchedulingContext(podSchedulingContext, fieldManager, "status") } -func extractPodSchedulingContext(podSchedulingContext *resourcev1alpha2.PodSchedulingContext, fieldManager string, subresource string) (*PodSchedulingContextApplyConfiguration, error) { +func extractPodSchedulingContext(podSchedulingContext *resourcev1alpha3.PodSchedulingContext, fieldManager string, subresource string) (*PodSchedulingContextApplyConfiguration, error) { b := &PodSchedulingContextApplyConfiguration{} - err := managedfields.ExtractInto(podSchedulingContext, internal.Parser().Type("io.k8s.api.resource.v1alpha2.PodSchedulingContext"), fieldManager, b, subresource) + err := managedfields.ExtractInto(podSchedulingContext, internal.Parser().Type("io.k8s.api.resource.v1alpha3.PodSchedulingContext"), fieldManager, b, subresource) if err != nil { return nil, err } @@ -79,7 +79,7 @@ func extractPodSchedulingContext(podSchedulingContext *resourcev1alpha2.PodSched b.WithNamespace(podSchedulingContext.Namespace) b.WithKind("PodSchedulingContext") - b.WithAPIVersion("resource.k8s.io/v1alpha2") + b.WithAPIVersion("resource.k8s.io/v1alpha3") return b, nil } diff --git a/applyconfigurations/resource/v1alpha2/podschedulingcontextspec.go b/applyconfigurations/resource/v1alpha3/podschedulingcontextspec.go similarity index 99% rename from applyconfigurations/resource/v1alpha2/podschedulingcontextspec.go rename to applyconfigurations/resource/v1alpha3/podschedulingcontextspec.go index 7cee78ec85..fd25df7a53 100644 --- a/applyconfigurations/resource/v1alpha2/podschedulingcontextspec.go +++ b/applyconfigurations/resource/v1alpha3/podschedulingcontextspec.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // PodSchedulingContextSpecApplyConfiguration represents a declarative configuration of the PodSchedulingContextSpec type for use // with apply. diff --git a/applyconfigurations/resource/v1alpha2/podschedulingcontextstatus.go b/applyconfigurations/resource/v1alpha3/podschedulingcontextstatus.go similarity index 99% rename from applyconfigurations/resource/v1alpha2/podschedulingcontextstatus.go rename to applyconfigurations/resource/v1alpha3/podschedulingcontextstatus.go index 4a8f00ffc0..a06e370cc3 100644 --- a/applyconfigurations/resource/v1alpha2/podschedulingcontextstatus.go +++ b/applyconfigurations/resource/v1alpha3/podschedulingcontextstatus.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // PodSchedulingContextStatusApplyConfiguration represents a declarative configuration of the PodSchedulingContextStatus type for use // with apply. diff --git a/applyconfigurations/resource/v1alpha2/resourceclaim.go b/applyconfigurations/resource/v1alpha3/resourceclaim.go similarity index 96% rename from applyconfigurations/resource/v1alpha2/resourceclaim.go rename to applyconfigurations/resource/v1alpha3/resourceclaim.go index 8ad61dfbd4..6161595588 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclaim.go +++ b/applyconfigurations/resource/v1alpha3/resourceclaim.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" @@ -43,7 +43,7 @@ func ResourceClaim(name, namespace string) *ResourceClaimApplyConfiguration { b.WithName(name) b.WithNamespace(namespace) b.WithKind("ResourceClaim") - b.WithAPIVersion("resource.k8s.io/v1alpha2") + b.WithAPIVersion("resource.k8s.io/v1alpha3") return b } @@ -58,20 +58,20 @@ func ResourceClaim(name, namespace string) *ResourceClaimApplyConfiguration { // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! -func ExtractResourceClaim(resourceClaim *resourcev1alpha2.ResourceClaim, fieldManager string) (*ResourceClaimApplyConfiguration, error) { +func ExtractResourceClaim(resourceClaim *resourcev1alpha3.ResourceClaim, fieldManager string) (*ResourceClaimApplyConfiguration, error) { return extractResourceClaim(resourceClaim, fieldManager, "") } // ExtractResourceClaimStatus is the same as ExtractResourceClaim except // that it extracts the status subresource applied configuration. // Experimental! -func ExtractResourceClaimStatus(resourceClaim *resourcev1alpha2.ResourceClaim, fieldManager string) (*ResourceClaimApplyConfiguration, error) { +func ExtractResourceClaimStatus(resourceClaim *resourcev1alpha3.ResourceClaim, fieldManager string) (*ResourceClaimApplyConfiguration, error) { return extractResourceClaim(resourceClaim, fieldManager, "status") } -func extractResourceClaim(resourceClaim *resourcev1alpha2.ResourceClaim, fieldManager string, subresource string) (*ResourceClaimApplyConfiguration, error) { +func extractResourceClaim(resourceClaim *resourcev1alpha3.ResourceClaim, fieldManager string, subresource string) (*ResourceClaimApplyConfiguration, error) { b := &ResourceClaimApplyConfiguration{} - err := managedfields.ExtractInto(resourceClaim, internal.Parser().Type("io.k8s.api.resource.v1alpha2.ResourceClaim"), fieldManager, b, subresource) + err := managedfields.ExtractInto(resourceClaim, internal.Parser().Type("io.k8s.api.resource.v1alpha3.ResourceClaim"), fieldManager, b, subresource) if err != nil { return nil, err } @@ -79,7 +79,7 @@ func extractResourceClaim(resourceClaim *resourcev1alpha2.ResourceClaim, fieldMa b.WithNamespace(resourceClaim.Namespace) b.WithKind("ResourceClaim") - b.WithAPIVersion("resource.k8s.io/v1alpha2") + b.WithAPIVersion("resource.k8s.io/v1alpha3") return b, nil } diff --git a/applyconfigurations/resource/v1alpha2/resourceclaimconsumerreference.go b/applyconfigurations/resource/v1alpha3/resourceclaimconsumerreference.go similarity index 99% rename from applyconfigurations/resource/v1alpha2/resourceclaimconsumerreference.go rename to applyconfigurations/resource/v1alpha3/resourceclaimconsumerreference.go index a383f461d7..96196d7c95 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclaimconsumerreference.go +++ b/applyconfigurations/resource/v1alpha3/resourceclaimconsumerreference.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( types "k8s.io/apimachinery/pkg/types" diff --git a/applyconfigurations/resource/v1alpha2/resourceclaimparameters.go b/applyconfigurations/resource/v1alpha3/resourceclaimparameters.go similarity index 97% rename from applyconfigurations/resource/v1alpha2/resourceclaimparameters.go rename to applyconfigurations/resource/v1alpha3/resourceclaimparameters.go index b3a2be9c84..ef29f99bfe 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclaimparameters.go +++ b/applyconfigurations/resource/v1alpha3/resourceclaimparameters.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" @@ -44,7 +44,7 @@ func ResourceClaimParameters(name, namespace string) *ResourceClaimParametersApp b.WithName(name) b.WithNamespace(namespace) b.WithKind("ResourceClaimParameters") - b.WithAPIVersion("resource.k8s.io/v1alpha2") + b.WithAPIVersion("resource.k8s.io/v1alpha3") return b } @@ -59,20 +59,20 @@ func ResourceClaimParameters(name, namespace string) *ResourceClaimParametersApp // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! -func ExtractResourceClaimParameters(resourceClaimParameters *resourcev1alpha2.ResourceClaimParameters, fieldManager string) (*ResourceClaimParametersApplyConfiguration, error) { +func ExtractResourceClaimParameters(resourceClaimParameters *resourcev1alpha3.ResourceClaimParameters, fieldManager string) (*ResourceClaimParametersApplyConfiguration, error) { return extractResourceClaimParameters(resourceClaimParameters, fieldManager, "") } // ExtractResourceClaimParametersStatus is the same as ExtractResourceClaimParameters except // that it extracts the status subresource applied configuration. // Experimental! -func ExtractResourceClaimParametersStatus(resourceClaimParameters *resourcev1alpha2.ResourceClaimParameters, fieldManager string) (*ResourceClaimParametersApplyConfiguration, error) { +func ExtractResourceClaimParametersStatus(resourceClaimParameters *resourcev1alpha3.ResourceClaimParameters, fieldManager string) (*ResourceClaimParametersApplyConfiguration, error) { return extractResourceClaimParameters(resourceClaimParameters, fieldManager, "status") } -func extractResourceClaimParameters(resourceClaimParameters *resourcev1alpha2.ResourceClaimParameters, fieldManager string, subresource string) (*ResourceClaimParametersApplyConfiguration, error) { +func extractResourceClaimParameters(resourceClaimParameters *resourcev1alpha3.ResourceClaimParameters, fieldManager string, subresource string) (*ResourceClaimParametersApplyConfiguration, error) { b := &ResourceClaimParametersApplyConfiguration{} - err := managedfields.ExtractInto(resourceClaimParameters, internal.Parser().Type("io.k8s.api.resource.v1alpha2.ResourceClaimParameters"), fieldManager, b, subresource) + err := managedfields.ExtractInto(resourceClaimParameters, internal.Parser().Type("io.k8s.api.resource.v1alpha3.ResourceClaimParameters"), fieldManager, b, subresource) if err != nil { return nil, err } @@ -80,7 +80,7 @@ func extractResourceClaimParameters(resourceClaimParameters *resourcev1alpha2.Re b.WithNamespace(resourceClaimParameters.Namespace) b.WithKind("ResourceClaimParameters") - b.WithAPIVersion("resource.k8s.io/v1alpha2") + b.WithAPIVersion("resource.k8s.io/v1alpha3") return b, nil } diff --git a/applyconfigurations/resource/v1alpha2/resourceclaimparametersreference.go b/applyconfigurations/resource/v1alpha3/resourceclaimparametersreference.go similarity index 99% rename from applyconfigurations/resource/v1alpha2/resourceclaimparametersreference.go rename to applyconfigurations/resource/v1alpha3/resourceclaimparametersreference.go index 7900152ca2..1d677011c1 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclaimparametersreference.go +++ b/applyconfigurations/resource/v1alpha3/resourceclaimparametersreference.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // ResourceClaimParametersReferenceApplyConfiguration represents a declarative configuration of the ResourceClaimParametersReference type for use // with apply. diff --git a/applyconfigurations/resource/v1alpha2/resourceclaimschedulingstatus.go b/applyconfigurations/resource/v1alpha3/resourceclaimschedulingstatus.go similarity index 99% rename from applyconfigurations/resource/v1alpha2/resourceclaimschedulingstatus.go rename to applyconfigurations/resource/v1alpha3/resourceclaimschedulingstatus.go index f9e07b7467..caab89acdb 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclaimschedulingstatus.go +++ b/applyconfigurations/resource/v1alpha3/resourceclaimschedulingstatus.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // ResourceClaimSchedulingStatusApplyConfiguration represents a declarative configuration of the ResourceClaimSchedulingStatus type for use // with apply. diff --git a/applyconfigurations/resource/v1alpha2/resourceclaimspec.go b/applyconfigurations/resource/v1alpha3/resourceclaimspec.go similarity index 93% rename from applyconfigurations/resource/v1alpha2/resourceclaimspec.go rename to applyconfigurations/resource/v1alpha3/resourceclaimspec.go index 2ecd95ec82..ea65036899 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclaimspec.go +++ b/applyconfigurations/resource/v1alpha3/resourceclaimspec.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" ) // ResourceClaimSpecApplyConfiguration represents a declarative configuration of the ResourceClaimSpec type for use @@ -27,7 +27,7 @@ import ( type ResourceClaimSpecApplyConfiguration struct { ResourceClassName *string `json:"resourceClassName,omitempty"` ParametersRef *ResourceClaimParametersReferenceApplyConfiguration `json:"parametersRef,omitempty"` - AllocationMode *resourcev1alpha2.AllocationMode `json:"allocationMode,omitempty"` + AllocationMode *resourcev1alpha3.AllocationMode `json:"allocationMode,omitempty"` } // ResourceClaimSpecApplyConfiguration constructs a declarative configuration of the ResourceClaimSpec type for use with @@ -55,7 +55,7 @@ func (b *ResourceClaimSpecApplyConfiguration) WithParametersRef(value *ResourceC // WithAllocationMode sets the AllocationMode field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the AllocationMode field is set to the value of the last call. -func (b *ResourceClaimSpecApplyConfiguration) WithAllocationMode(value resourcev1alpha2.AllocationMode) *ResourceClaimSpecApplyConfiguration { +func (b *ResourceClaimSpecApplyConfiguration) WithAllocationMode(value resourcev1alpha3.AllocationMode) *ResourceClaimSpecApplyConfiguration { b.AllocationMode = &value return b } diff --git a/applyconfigurations/resource/v1alpha2/resourceclaimstatus.go b/applyconfigurations/resource/v1alpha3/resourceclaimstatus.go similarity index 99% rename from applyconfigurations/resource/v1alpha2/resourceclaimstatus.go rename to applyconfigurations/resource/v1alpha3/resourceclaimstatus.go index 635a4c4dc2..fa1545e52a 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclaimstatus.go +++ b/applyconfigurations/resource/v1alpha3/resourceclaimstatus.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // ResourceClaimStatusApplyConfiguration represents a declarative configuration of the ResourceClaimStatus type for use // with apply. diff --git a/applyconfigurations/resource/v1alpha2/resourceclaimtemplate.go b/applyconfigurations/resource/v1alpha3/resourceclaimtemplate.go similarity index 96% rename from applyconfigurations/resource/v1alpha2/resourceclaimtemplate.go rename to applyconfigurations/resource/v1alpha3/resourceclaimtemplate.go index 0ee0ae36e0..6f371d0c05 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclaimtemplate.go +++ b/applyconfigurations/resource/v1alpha3/resourceclaimtemplate.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" @@ -42,7 +42,7 @@ func ResourceClaimTemplate(name, namespace string) *ResourceClaimTemplateApplyCo b.WithName(name) b.WithNamespace(namespace) b.WithKind("ResourceClaimTemplate") - b.WithAPIVersion("resource.k8s.io/v1alpha2") + b.WithAPIVersion("resource.k8s.io/v1alpha3") return b } @@ -57,20 +57,20 @@ func ResourceClaimTemplate(name, namespace string) *ResourceClaimTemplateApplyCo // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! -func ExtractResourceClaimTemplate(resourceClaimTemplate *resourcev1alpha2.ResourceClaimTemplate, fieldManager string) (*ResourceClaimTemplateApplyConfiguration, error) { +func ExtractResourceClaimTemplate(resourceClaimTemplate *resourcev1alpha3.ResourceClaimTemplate, fieldManager string) (*ResourceClaimTemplateApplyConfiguration, error) { return extractResourceClaimTemplate(resourceClaimTemplate, fieldManager, "") } // ExtractResourceClaimTemplateStatus is the same as ExtractResourceClaimTemplate except // that it extracts the status subresource applied configuration. // Experimental! -func ExtractResourceClaimTemplateStatus(resourceClaimTemplate *resourcev1alpha2.ResourceClaimTemplate, fieldManager string) (*ResourceClaimTemplateApplyConfiguration, error) { +func ExtractResourceClaimTemplateStatus(resourceClaimTemplate *resourcev1alpha3.ResourceClaimTemplate, fieldManager string) (*ResourceClaimTemplateApplyConfiguration, error) { return extractResourceClaimTemplate(resourceClaimTemplate, fieldManager, "status") } -func extractResourceClaimTemplate(resourceClaimTemplate *resourcev1alpha2.ResourceClaimTemplate, fieldManager string, subresource string) (*ResourceClaimTemplateApplyConfiguration, error) { +func extractResourceClaimTemplate(resourceClaimTemplate *resourcev1alpha3.ResourceClaimTemplate, fieldManager string, subresource string) (*ResourceClaimTemplateApplyConfiguration, error) { b := &ResourceClaimTemplateApplyConfiguration{} - err := managedfields.ExtractInto(resourceClaimTemplate, internal.Parser().Type("io.k8s.api.resource.v1alpha2.ResourceClaimTemplate"), fieldManager, b, subresource) + err := managedfields.ExtractInto(resourceClaimTemplate, internal.Parser().Type("io.k8s.api.resource.v1alpha3.ResourceClaimTemplate"), fieldManager, b, subresource) if err != nil { return nil, err } @@ -78,7 +78,7 @@ func extractResourceClaimTemplate(resourceClaimTemplate *resourcev1alpha2.Resour b.WithNamespace(resourceClaimTemplate.Namespace) b.WithKind("ResourceClaimTemplate") - b.WithAPIVersion("resource.k8s.io/v1alpha2") + b.WithAPIVersion("resource.k8s.io/v1alpha3") return b, nil } diff --git a/applyconfigurations/resource/v1alpha2/resourceclaimtemplatespec.go b/applyconfigurations/resource/v1alpha3/resourceclaimtemplatespec.go similarity index 99% rename from applyconfigurations/resource/v1alpha2/resourceclaimtemplatespec.go rename to applyconfigurations/resource/v1alpha3/resourceclaimtemplatespec.go index 334de324e2..5b03ab7553 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclaimtemplatespec.go +++ b/applyconfigurations/resource/v1alpha3/resourceclaimtemplatespec.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/applyconfigurations/resource/v1alpha2/resourceclass.go b/applyconfigurations/resource/v1alpha3/resourceclass.go similarity index 97% rename from applyconfigurations/resource/v1alpha2/resourceclass.go rename to applyconfigurations/resource/v1alpha3/resourceclass.go index cf559cfb22..a42ea74224 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclass.go +++ b/applyconfigurations/resource/v1alpha3/resourceclass.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" @@ -45,7 +45,7 @@ func ResourceClass(name string) *ResourceClassApplyConfiguration { b := &ResourceClassApplyConfiguration{} b.WithName(name) b.WithKind("ResourceClass") - b.WithAPIVersion("resource.k8s.io/v1alpha2") + b.WithAPIVersion("resource.k8s.io/v1alpha3") return b } @@ -60,27 +60,27 @@ func ResourceClass(name string) *ResourceClassApplyConfiguration { // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! -func ExtractResourceClass(resourceClass *resourcev1alpha2.ResourceClass, fieldManager string) (*ResourceClassApplyConfiguration, error) { +func ExtractResourceClass(resourceClass *resourcev1alpha3.ResourceClass, fieldManager string) (*ResourceClassApplyConfiguration, error) { return extractResourceClass(resourceClass, fieldManager, "") } // ExtractResourceClassStatus is the same as ExtractResourceClass except // that it extracts the status subresource applied configuration. // Experimental! -func ExtractResourceClassStatus(resourceClass *resourcev1alpha2.ResourceClass, fieldManager string) (*ResourceClassApplyConfiguration, error) { +func ExtractResourceClassStatus(resourceClass *resourcev1alpha3.ResourceClass, fieldManager string) (*ResourceClassApplyConfiguration, error) { return extractResourceClass(resourceClass, fieldManager, "status") } -func extractResourceClass(resourceClass *resourcev1alpha2.ResourceClass, fieldManager string, subresource string) (*ResourceClassApplyConfiguration, error) { +func extractResourceClass(resourceClass *resourcev1alpha3.ResourceClass, fieldManager string, subresource string) (*ResourceClassApplyConfiguration, error) { b := &ResourceClassApplyConfiguration{} - err := managedfields.ExtractInto(resourceClass, internal.Parser().Type("io.k8s.api.resource.v1alpha2.ResourceClass"), fieldManager, b, subresource) + err := managedfields.ExtractInto(resourceClass, internal.Parser().Type("io.k8s.api.resource.v1alpha3.ResourceClass"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(resourceClass.Name) b.WithKind("ResourceClass") - b.WithAPIVersion("resource.k8s.io/v1alpha2") + b.WithAPIVersion("resource.k8s.io/v1alpha3") return b, nil } diff --git a/applyconfigurations/resource/v1alpha2/resourceclassparameters.go b/applyconfigurations/resource/v1alpha3/resourceclassparameters.go similarity index 97% rename from applyconfigurations/resource/v1alpha2/resourceclassparameters.go rename to applyconfigurations/resource/v1alpha3/resourceclassparameters.go index e09b1ed4e0..7413fbfe7c 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclassparameters.go +++ b/applyconfigurations/resource/v1alpha3/resourceclassparameters.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" @@ -44,7 +44,7 @@ func ResourceClassParameters(name, namespace string) *ResourceClassParametersApp b.WithName(name) b.WithNamespace(namespace) b.WithKind("ResourceClassParameters") - b.WithAPIVersion("resource.k8s.io/v1alpha2") + b.WithAPIVersion("resource.k8s.io/v1alpha3") return b } @@ -59,20 +59,20 @@ func ResourceClassParameters(name, namespace string) *ResourceClassParametersApp // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! -func ExtractResourceClassParameters(resourceClassParameters *resourcev1alpha2.ResourceClassParameters, fieldManager string) (*ResourceClassParametersApplyConfiguration, error) { +func ExtractResourceClassParameters(resourceClassParameters *resourcev1alpha3.ResourceClassParameters, fieldManager string) (*ResourceClassParametersApplyConfiguration, error) { return extractResourceClassParameters(resourceClassParameters, fieldManager, "") } // ExtractResourceClassParametersStatus is the same as ExtractResourceClassParameters except // that it extracts the status subresource applied configuration. // Experimental! -func ExtractResourceClassParametersStatus(resourceClassParameters *resourcev1alpha2.ResourceClassParameters, fieldManager string) (*ResourceClassParametersApplyConfiguration, error) { +func ExtractResourceClassParametersStatus(resourceClassParameters *resourcev1alpha3.ResourceClassParameters, fieldManager string) (*ResourceClassParametersApplyConfiguration, error) { return extractResourceClassParameters(resourceClassParameters, fieldManager, "status") } -func extractResourceClassParameters(resourceClassParameters *resourcev1alpha2.ResourceClassParameters, fieldManager string, subresource string) (*ResourceClassParametersApplyConfiguration, error) { +func extractResourceClassParameters(resourceClassParameters *resourcev1alpha3.ResourceClassParameters, fieldManager string, subresource string) (*ResourceClassParametersApplyConfiguration, error) { b := &ResourceClassParametersApplyConfiguration{} - err := managedfields.ExtractInto(resourceClassParameters, internal.Parser().Type("io.k8s.api.resource.v1alpha2.ResourceClassParameters"), fieldManager, b, subresource) + err := managedfields.ExtractInto(resourceClassParameters, internal.Parser().Type("io.k8s.api.resource.v1alpha3.ResourceClassParameters"), fieldManager, b, subresource) if err != nil { return nil, err } @@ -80,7 +80,7 @@ func extractResourceClassParameters(resourceClassParameters *resourcev1alpha2.Re b.WithNamespace(resourceClassParameters.Namespace) b.WithKind("ResourceClassParameters") - b.WithAPIVersion("resource.k8s.io/v1alpha2") + b.WithAPIVersion("resource.k8s.io/v1alpha3") return b, nil } diff --git a/applyconfigurations/resource/v1alpha2/resourceclassparametersreference.go b/applyconfigurations/resource/v1alpha3/resourceclassparametersreference.go similarity index 99% rename from applyconfigurations/resource/v1alpha2/resourceclassparametersreference.go rename to applyconfigurations/resource/v1alpha3/resourceclassparametersreference.go index 052d7365e0..db469e5eec 100644 --- a/applyconfigurations/resource/v1alpha2/resourceclassparametersreference.go +++ b/applyconfigurations/resource/v1alpha3/resourceclassparametersreference.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // ResourceClassParametersReferenceApplyConfiguration represents a declarative configuration of the ResourceClassParametersReference type for use // with apply. diff --git a/applyconfigurations/resource/v1alpha2/resourcefilter.go b/applyconfigurations/resource/v1alpha3/resourcefilter.go similarity index 99% rename from applyconfigurations/resource/v1alpha2/resourcefilter.go rename to applyconfigurations/resource/v1alpha3/resourcefilter.go index 1617275f0e..4c5542692c 100644 --- a/applyconfigurations/resource/v1alpha2/resourcefilter.go +++ b/applyconfigurations/resource/v1alpha3/resourcefilter.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // ResourceFilterApplyConfiguration represents a declarative configuration of the ResourceFilter type for use // with apply. diff --git a/applyconfigurations/resource/v1alpha2/resourcefiltermodel.go b/applyconfigurations/resource/v1alpha3/resourcefiltermodel.go similarity index 98% rename from applyconfigurations/resource/v1alpha2/resourcefiltermodel.go rename to applyconfigurations/resource/v1alpha3/resourcefiltermodel.go index 648d319d46..0de3f12f67 100644 --- a/applyconfigurations/resource/v1alpha2/resourcefiltermodel.go +++ b/applyconfigurations/resource/v1alpha3/resourcefiltermodel.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // ResourceFilterModelApplyConfiguration represents a declarative configuration of the ResourceFilterModel type for use // with apply. diff --git a/applyconfigurations/resource/v1alpha2/resourcehandle.go b/applyconfigurations/resource/v1alpha3/resourcehandle.go similarity index 99% rename from applyconfigurations/resource/v1alpha2/resourcehandle.go rename to applyconfigurations/resource/v1alpha3/resourcehandle.go index 9a8410d9ed..6c8a697fa1 100644 --- a/applyconfigurations/resource/v1alpha2/resourcehandle.go +++ b/applyconfigurations/resource/v1alpha3/resourcehandle.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // ResourceHandleApplyConfiguration represents a declarative configuration of the ResourceHandle type for use // with apply. diff --git a/applyconfigurations/resource/v1alpha2/resourcemodel.go b/applyconfigurations/resource/v1alpha3/resourcemodel.go similarity index 98% rename from applyconfigurations/resource/v1alpha2/resourcemodel.go rename to applyconfigurations/resource/v1alpha3/resourcemodel.go index b3c8540d4f..2999d447df 100644 --- a/applyconfigurations/resource/v1alpha2/resourcemodel.go +++ b/applyconfigurations/resource/v1alpha3/resourcemodel.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // ResourceModelApplyConfiguration represents a declarative configuration of the ResourceModel type for use // with apply. diff --git a/applyconfigurations/resource/v1alpha2/resourcerequest.go b/applyconfigurations/resource/v1alpha3/resourcerequest.go similarity index 99% rename from applyconfigurations/resource/v1alpha2/resourcerequest.go rename to applyconfigurations/resource/v1alpha3/resourcerequest.go index b93ed85402..d0d047e752 100644 --- a/applyconfigurations/resource/v1alpha2/resourcerequest.go +++ b/applyconfigurations/resource/v1alpha3/resourcerequest.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( runtime "k8s.io/apimachinery/pkg/runtime" diff --git a/applyconfigurations/resource/v1alpha2/resourcerequestmodel.go b/applyconfigurations/resource/v1alpha3/resourcerequestmodel.go similarity index 98% rename from applyconfigurations/resource/v1alpha2/resourcerequestmodel.go rename to applyconfigurations/resource/v1alpha3/resourcerequestmodel.go index b0e86483eb..35d1825319 100644 --- a/applyconfigurations/resource/v1alpha2/resourcerequestmodel.go +++ b/applyconfigurations/resource/v1alpha3/resourcerequestmodel.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // ResourceRequestModelApplyConfiguration represents a declarative configuration of the ResourceRequestModel type for use // with apply. diff --git a/applyconfigurations/resource/v1alpha2/resourceslice.go b/applyconfigurations/resource/v1alpha3/resourceslice.go similarity index 96% rename from applyconfigurations/resource/v1alpha2/resourceslice.go rename to applyconfigurations/resource/v1alpha3/resourceslice.go index 90cde67d7b..7486e75c82 100644 --- a/applyconfigurations/resource/v1alpha2/resourceslice.go +++ b/applyconfigurations/resource/v1alpha3/resourceslice.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" managedfields "k8s.io/apimachinery/pkg/util/managedfields" @@ -43,7 +43,7 @@ func ResourceSlice(name string) *ResourceSliceApplyConfiguration { b := &ResourceSliceApplyConfiguration{} b.WithName(name) b.WithKind("ResourceSlice") - b.WithAPIVersion("resource.k8s.io/v1alpha2") + b.WithAPIVersion("resource.k8s.io/v1alpha3") return b } @@ -58,27 +58,27 @@ func ResourceSlice(name string) *ResourceSliceApplyConfiguration { // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! -func ExtractResourceSlice(resourceSlice *resourcev1alpha2.ResourceSlice, fieldManager string) (*ResourceSliceApplyConfiguration, error) { +func ExtractResourceSlice(resourceSlice *resourcev1alpha3.ResourceSlice, fieldManager string) (*ResourceSliceApplyConfiguration, error) { return extractResourceSlice(resourceSlice, fieldManager, "") } // ExtractResourceSliceStatus is the same as ExtractResourceSlice except // that it extracts the status subresource applied configuration. // Experimental! -func ExtractResourceSliceStatus(resourceSlice *resourcev1alpha2.ResourceSlice, fieldManager string) (*ResourceSliceApplyConfiguration, error) { +func ExtractResourceSliceStatus(resourceSlice *resourcev1alpha3.ResourceSlice, fieldManager string) (*ResourceSliceApplyConfiguration, error) { return extractResourceSlice(resourceSlice, fieldManager, "status") } -func extractResourceSlice(resourceSlice *resourcev1alpha2.ResourceSlice, fieldManager string, subresource string) (*ResourceSliceApplyConfiguration, error) { +func extractResourceSlice(resourceSlice *resourcev1alpha3.ResourceSlice, fieldManager string, subresource string) (*ResourceSliceApplyConfiguration, error) { b := &ResourceSliceApplyConfiguration{} - err := managedfields.ExtractInto(resourceSlice, internal.Parser().Type("io.k8s.api.resource.v1alpha2.ResourceSlice"), fieldManager, b, subresource) + err := managedfields.ExtractInto(resourceSlice, internal.Parser().Type("io.k8s.api.resource.v1alpha3.ResourceSlice"), fieldManager, b, subresource) if err != nil { return nil, err } b.WithName(resourceSlice.Name) b.WithKind("ResourceSlice") - b.WithAPIVersion("resource.k8s.io/v1alpha2") + b.WithAPIVersion("resource.k8s.io/v1alpha3") return b, nil } diff --git a/applyconfigurations/resource/v1alpha2/structuredresourcehandle.go b/applyconfigurations/resource/v1alpha3/structuredresourcehandle.go similarity index 99% rename from applyconfigurations/resource/v1alpha2/structuredresourcehandle.go rename to applyconfigurations/resource/v1alpha3/structuredresourcehandle.go index 10794f81f2..0d58994c94 100644 --- a/applyconfigurations/resource/v1alpha2/structuredresourcehandle.go +++ b/applyconfigurations/resource/v1alpha3/structuredresourcehandle.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( runtime "k8s.io/apimachinery/pkg/runtime" diff --git a/applyconfigurations/resource/v1alpha2/vendorparameters.go b/applyconfigurations/resource/v1alpha3/vendorparameters.go similarity index 99% rename from applyconfigurations/resource/v1alpha2/vendorparameters.go rename to applyconfigurations/resource/v1alpha3/vendorparameters.go index 851c7cdfba..71f86a159c 100644 --- a/applyconfigurations/resource/v1alpha2/vendorparameters.go +++ b/applyconfigurations/resource/v1alpha3/vendorparameters.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( runtime "k8s.io/apimachinery/pkg/runtime" diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index a086500ff5..0bc1607a42 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -59,7 +59,7 @@ import ( rbacv1 "k8s.io/api/rbac/v1" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" rbacv1beta1 "k8s.io/api/rbac/v1beta1" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" schedulingv1 "k8s.io/api/scheduling/v1" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" @@ -112,7 +112,7 @@ import ( applyconfigurationsrbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1" applyconfigurationsrbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1" applyconfigurationsrbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" applyconfigurationsschedulingv1 "k8s.io/client-go/applyconfigurations/scheduling/v1" applyconfigurationsschedulingv1alpha1 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha1" applyconfigurationsschedulingv1beta1 "k8s.io/client-go/applyconfigurations/scheduling/v1beta1" @@ -1553,81 +1553,81 @@ func ForKind(kind schema.GroupVersionKind) interface{} { case rbacv1beta1.SchemeGroupVersion.WithKind("Subject"): return &applyconfigurationsrbacv1beta1.SubjectApplyConfiguration{} - // Group=resource.k8s.io, Version=v1alpha2 - case v1alpha2.SchemeGroupVersion.WithKind("AllocationResult"): - return &resourcev1alpha2.AllocationResultApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("AllocationResultModel"): - return &resourcev1alpha2.AllocationResultModelApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("DriverAllocationResult"): - return &resourcev1alpha2.DriverAllocationResultApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("DriverRequests"): - return &resourcev1alpha2.DriverRequestsApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesAllocationResult"): - return &resourcev1alpha2.NamedResourcesAllocationResultApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesAttribute"): - return &resourcev1alpha2.NamedResourcesAttributeApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesAttributeValue"): - return &resourcev1alpha2.NamedResourcesAttributeValueApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesFilter"): - return &resourcev1alpha2.NamedResourcesFilterApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesInstance"): - return &resourcev1alpha2.NamedResourcesInstanceApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesIntSlice"): - return &resourcev1alpha2.NamedResourcesIntSliceApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesRequest"): - return &resourcev1alpha2.NamedResourcesRequestApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesResources"): - return &resourcev1alpha2.NamedResourcesResourcesApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("NamedResourcesStringSlice"): - return &resourcev1alpha2.NamedResourcesStringSliceApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("PodSchedulingContext"): - return &resourcev1alpha2.PodSchedulingContextApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("PodSchedulingContextSpec"): - return &resourcev1alpha2.PodSchedulingContextSpecApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("PodSchedulingContextStatus"): - return &resourcev1alpha2.PodSchedulingContextStatusApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClaim"): - return &resourcev1alpha2.ResourceClaimApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimConsumerReference"): - return &resourcev1alpha2.ResourceClaimConsumerReferenceApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimParameters"): - return &resourcev1alpha2.ResourceClaimParametersApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimParametersReference"): - return &resourcev1alpha2.ResourceClaimParametersReferenceApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimSchedulingStatus"): - return &resourcev1alpha2.ResourceClaimSchedulingStatusApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimSpec"): - return &resourcev1alpha2.ResourceClaimSpecApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimStatus"): - return &resourcev1alpha2.ResourceClaimStatusApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimTemplate"): - return &resourcev1alpha2.ResourceClaimTemplateApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimTemplateSpec"): - return &resourcev1alpha2.ResourceClaimTemplateSpecApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClass"): - return &resourcev1alpha2.ResourceClassApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClassParameters"): - return &resourcev1alpha2.ResourceClassParametersApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceClassParametersReference"): - return &resourcev1alpha2.ResourceClassParametersReferenceApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceFilter"): - return &resourcev1alpha2.ResourceFilterApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceFilterModel"): - return &resourcev1alpha2.ResourceFilterModelApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceHandle"): - return &resourcev1alpha2.ResourceHandleApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceModel"): - return &resourcev1alpha2.ResourceModelApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceRequest"): - return &resourcev1alpha2.ResourceRequestApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceRequestModel"): - return &resourcev1alpha2.ResourceRequestModelApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("ResourceSlice"): - return &resourcev1alpha2.ResourceSliceApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("StructuredResourceHandle"): - return &resourcev1alpha2.StructuredResourceHandleApplyConfiguration{} - case v1alpha2.SchemeGroupVersion.WithKind("VendorParameters"): - return &resourcev1alpha2.VendorParametersApplyConfiguration{} + // Group=resource.k8s.io, Version=v1alpha3 + case v1alpha3.SchemeGroupVersion.WithKind("AllocationResult"): + return &resourcev1alpha3.AllocationResultApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("AllocationResultModel"): + return &resourcev1alpha3.AllocationResultModelApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DriverAllocationResult"): + return &resourcev1alpha3.DriverAllocationResultApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DriverRequests"): + return &resourcev1alpha3.DriverRequestsApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("NamedResourcesAllocationResult"): + return &resourcev1alpha3.NamedResourcesAllocationResultApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("NamedResourcesAttribute"): + return &resourcev1alpha3.NamedResourcesAttributeApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("NamedResourcesAttributeValue"): + return &resourcev1alpha3.NamedResourcesAttributeValueApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("NamedResourcesFilter"): + return &resourcev1alpha3.NamedResourcesFilterApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("NamedResourcesInstance"): + return &resourcev1alpha3.NamedResourcesInstanceApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("NamedResourcesIntSlice"): + return &resourcev1alpha3.NamedResourcesIntSliceApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("NamedResourcesRequest"): + return &resourcev1alpha3.NamedResourcesRequestApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("NamedResourcesResources"): + return &resourcev1alpha3.NamedResourcesResourcesApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("NamedResourcesStringSlice"): + return &resourcev1alpha3.NamedResourcesStringSliceApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("PodSchedulingContext"): + return &resourcev1alpha3.PodSchedulingContextApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("PodSchedulingContextSpec"): + return &resourcev1alpha3.PodSchedulingContextSpecApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("PodSchedulingContextStatus"): + return &resourcev1alpha3.PodSchedulingContextStatusApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaim"): + return &resourcev1alpha3.ResourceClaimApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimConsumerReference"): + return &resourcev1alpha3.ResourceClaimConsumerReferenceApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimParameters"): + return &resourcev1alpha3.ResourceClaimParametersApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimParametersReference"): + return &resourcev1alpha3.ResourceClaimParametersReferenceApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimSchedulingStatus"): + return &resourcev1alpha3.ResourceClaimSchedulingStatusApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimSpec"): + return &resourcev1alpha3.ResourceClaimSpecApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimStatus"): + return &resourcev1alpha3.ResourceClaimStatusApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimTemplate"): + return &resourcev1alpha3.ResourceClaimTemplateApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimTemplateSpec"): + return &resourcev1alpha3.ResourceClaimTemplateSpecApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceClass"): + return &resourcev1alpha3.ResourceClassApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceClassParameters"): + return &resourcev1alpha3.ResourceClassParametersApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceClassParametersReference"): + return &resourcev1alpha3.ResourceClassParametersReferenceApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceFilter"): + return &resourcev1alpha3.ResourceFilterApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceFilterModel"): + return &resourcev1alpha3.ResourceFilterModelApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceHandle"): + return &resourcev1alpha3.ResourceHandleApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceModel"): + return &resourcev1alpha3.ResourceModelApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceRequest"): + return &resourcev1alpha3.ResourceRequestApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceRequestModel"): + return &resourcev1alpha3.ResourceRequestModelApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceSlice"): + return &resourcev1alpha3.ResourceSliceApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("StructuredResourceHandle"): + return &resourcev1alpha3.StructuredResourceHandleApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("VendorParameters"): + return &resourcev1alpha3.VendorParametersApplyConfiguration{} // Group=scheduling.k8s.io, Version=v1 case schedulingv1.SchemeGroupVersion.WithKind("PriorityClass"): diff --git a/informers/generic.go b/informers/generic.go index db1eb4a833..42c8f22aab 100644 --- a/informers/generic.go +++ b/informers/generic.go @@ -60,7 +60,7 @@ import ( rbacv1 "k8s.io/api/rbac/v1" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" rbacv1beta1 "k8s.io/api/rbac/v1beta1" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" schedulingv1 "k8s.io/api/scheduling/v1" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" @@ -366,21 +366,21 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case rbacv1beta1.SchemeGroupVersion.WithResource("rolebindings"): return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1beta1().RoleBindings().Informer()}, nil - // Group=resource.k8s.io, Version=v1alpha2 - case v1alpha2.SchemeGroupVersion.WithResource("podschedulingcontexts"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().PodSchedulingContexts().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("resourceclaims"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceClaims().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("resourceclaimparameters"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceClaimParameters().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("resourceclaimtemplates"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceClaimTemplates().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("resourceclasses"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceClasses().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("resourceclassparameters"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceClassParameters().Informer()}, nil - case v1alpha2.SchemeGroupVersion.WithResource("resourceslices"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha2().ResourceSlices().Informer()}, nil + // Group=resource.k8s.io, Version=v1alpha3 + case v1alpha3.SchemeGroupVersion.WithResource("podschedulingcontexts"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().PodSchedulingContexts().Informer()}, nil + case v1alpha3.SchemeGroupVersion.WithResource("resourceclaims"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourceClaims().Informer()}, nil + case v1alpha3.SchemeGroupVersion.WithResource("resourceclaimparameters"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourceClaimParameters().Informer()}, nil + case v1alpha3.SchemeGroupVersion.WithResource("resourceclaimtemplates"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourceClaimTemplates().Informer()}, nil + case v1alpha3.SchemeGroupVersion.WithResource("resourceclasses"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourceClasses().Informer()}, nil + case v1alpha3.SchemeGroupVersion.WithResource("resourceclassparameters"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourceClassParameters().Informer()}, nil + case v1alpha3.SchemeGroupVersion.WithResource("resourceslices"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourceSlices().Informer()}, nil // Group=scheduling.k8s.io, Version=v1 case schedulingv1.SchemeGroupVersion.WithResource("priorityclasses"): diff --git a/informers/resource/interface.go b/informers/resource/interface.go index 3fcce8ae9d..170d29d808 100644 --- a/informers/resource/interface.go +++ b/informers/resource/interface.go @@ -20,13 +20,13 @@ package resource import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" - v1alpha2 "k8s.io/client-go/informers/resource/v1alpha2" + v1alpha3 "k8s.io/client-go/informers/resource/v1alpha3" ) // Interface provides access to each of this group's versions. type Interface interface { - // V1alpha2 provides access to shared informers for resources in V1alpha2. - V1alpha2() v1alpha2.Interface + // V1alpha3 provides access to shared informers for resources in V1alpha3. + V1alpha3() v1alpha3.Interface } type group struct { @@ -40,7 +40,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// V1alpha2 returns a new v1alpha2.Interface. -func (g *group) V1alpha2() v1alpha2.Interface { - return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions) +// V1alpha3 returns a new v1alpha3.Interface. +func (g *group) V1alpha3() v1alpha3.Interface { + return v1alpha3.New(g.factory, g.namespace, g.tweakListOptions) } diff --git a/informers/resource/v1alpha2/interface.go b/informers/resource/v1alpha3/interface.go similarity index 99% rename from informers/resource/v1alpha2/interface.go rename to informers/resource/v1alpha3/interface.go index aa4a5ae7dc..36b9f1c782 100644 --- a/informers/resource/v1alpha2/interface.go +++ b/informers/resource/v1alpha3/interface.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( internalinterfaces "k8s.io/client-go/informers/internalinterfaces" diff --git a/informers/resource/v1alpha2/podschedulingcontext.go b/informers/resource/v1alpha3/podschedulingcontext.go similarity index 86% rename from informers/resource/v1alpha2/podschedulingcontext.go rename to informers/resource/v1alpha3/podschedulingcontext.go index b4aabb3761..62fb3614fc 100644 --- a/informers/resource/v1alpha2/podschedulingcontext.go +++ b/informers/resource/v1alpha3/podschedulingcontext.go @@ -16,19 +16,19 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" time "time" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" - v1alpha2 "k8s.io/client-go/listers/resource/v1alpha2" + v1alpha3 "k8s.io/client-go/listers/resource/v1alpha3" cache "k8s.io/client-go/tools/cache" ) @@ -36,7 +36,7 @@ import ( // PodSchedulingContexts. type PodSchedulingContextInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.PodSchedulingContextLister + Lister() v1alpha3.PodSchedulingContextLister } type podSchedulingContextInformer struct { @@ -62,16 +62,16 @@ func NewFilteredPodSchedulingContextInformer(client kubernetes.Interface, namesp if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().PodSchedulingContexts(namespace).List(context.TODO(), options) + return client.ResourceV1alpha3().PodSchedulingContexts(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().PodSchedulingContexts(namespace).Watch(context.TODO(), options) + return client.ResourceV1alpha3().PodSchedulingContexts(namespace).Watch(context.TODO(), options) }, }, - &resourcev1alpha2.PodSchedulingContext{}, + &resourcev1alpha3.PodSchedulingContext{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *podSchedulingContextInformer) defaultInformer(client kubernetes.Interfa } func (f *podSchedulingContextInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&resourcev1alpha2.PodSchedulingContext{}, f.defaultInformer) + return f.factory.InformerFor(&resourcev1alpha3.PodSchedulingContext{}, f.defaultInformer) } -func (f *podSchedulingContextInformer) Lister() v1alpha2.PodSchedulingContextLister { - return v1alpha2.NewPodSchedulingContextLister(f.Informer().GetIndexer()) +func (f *podSchedulingContextInformer) Lister() v1alpha3.PodSchedulingContextLister { + return v1alpha3.NewPodSchedulingContextLister(f.Informer().GetIndexer()) } diff --git a/informers/resource/v1alpha2/resourceclaim.go b/informers/resource/v1alpha3/resourceclaim.go similarity index 85% rename from informers/resource/v1alpha2/resourceclaim.go rename to informers/resource/v1alpha3/resourceclaim.go index 3af9368919..fa644579b1 100644 --- a/informers/resource/v1alpha2/resourceclaim.go +++ b/informers/resource/v1alpha3/resourceclaim.go @@ -16,19 +16,19 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" time "time" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" - v1alpha2 "k8s.io/client-go/listers/resource/v1alpha2" + v1alpha3 "k8s.io/client-go/listers/resource/v1alpha3" cache "k8s.io/client-go/tools/cache" ) @@ -36,7 +36,7 @@ import ( // ResourceClaims. type ResourceClaimInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.ResourceClaimLister + Lister() v1alpha3.ResourceClaimLister } type resourceClaimInformer struct { @@ -62,16 +62,16 @@ func NewFilteredResourceClaimInformer(client kubernetes.Interface, namespace str if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceClaims(namespace).List(context.TODO(), options) + return client.ResourceV1alpha3().ResourceClaims(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceClaims(namespace).Watch(context.TODO(), options) + return client.ResourceV1alpha3().ResourceClaims(namespace).Watch(context.TODO(), options) }, }, - &resourcev1alpha2.ResourceClaim{}, + &resourcev1alpha3.ResourceClaim{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *resourceClaimInformer) defaultInformer(client kubernetes.Interface, res } func (f *resourceClaimInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&resourcev1alpha2.ResourceClaim{}, f.defaultInformer) + return f.factory.InformerFor(&resourcev1alpha3.ResourceClaim{}, f.defaultInformer) } -func (f *resourceClaimInformer) Lister() v1alpha2.ResourceClaimLister { - return v1alpha2.NewResourceClaimLister(f.Informer().GetIndexer()) +func (f *resourceClaimInformer) Lister() v1alpha3.ResourceClaimLister { + return v1alpha3.NewResourceClaimLister(f.Informer().GetIndexer()) } diff --git a/informers/resource/v1alpha2/resourceclaimparameters.go b/informers/resource/v1alpha3/resourceclaimparameters.go similarity index 86% rename from informers/resource/v1alpha2/resourceclaimparameters.go rename to informers/resource/v1alpha3/resourceclaimparameters.go index 3064ac9f55..86df716241 100644 --- a/informers/resource/v1alpha2/resourceclaimparameters.go +++ b/informers/resource/v1alpha3/resourceclaimparameters.go @@ -16,19 +16,19 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" time "time" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" - v1alpha2 "k8s.io/client-go/listers/resource/v1alpha2" + v1alpha3 "k8s.io/client-go/listers/resource/v1alpha3" cache "k8s.io/client-go/tools/cache" ) @@ -36,7 +36,7 @@ import ( // ResourceClaimParameters. type ResourceClaimParametersInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.ResourceClaimParametersLister + Lister() v1alpha3.ResourceClaimParametersLister } type resourceClaimParametersInformer struct { @@ -62,16 +62,16 @@ func NewFilteredResourceClaimParametersInformer(client kubernetes.Interface, nam if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceClaimParameters(namespace).List(context.TODO(), options) + return client.ResourceV1alpha3().ResourceClaimParameters(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceClaimParameters(namespace).Watch(context.TODO(), options) + return client.ResourceV1alpha3().ResourceClaimParameters(namespace).Watch(context.TODO(), options) }, }, - &resourcev1alpha2.ResourceClaimParameters{}, + &resourcev1alpha3.ResourceClaimParameters{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *resourceClaimParametersInformer) defaultInformer(client kubernetes.Inte } func (f *resourceClaimParametersInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&resourcev1alpha2.ResourceClaimParameters{}, f.defaultInformer) + return f.factory.InformerFor(&resourcev1alpha3.ResourceClaimParameters{}, f.defaultInformer) } -func (f *resourceClaimParametersInformer) Lister() v1alpha2.ResourceClaimParametersLister { - return v1alpha2.NewResourceClaimParametersLister(f.Informer().GetIndexer()) +func (f *resourceClaimParametersInformer) Lister() v1alpha3.ResourceClaimParametersLister { + return v1alpha3.NewResourceClaimParametersLister(f.Informer().GetIndexer()) } diff --git a/informers/resource/v1alpha2/resourceclaimtemplate.go b/informers/resource/v1alpha3/resourceclaimtemplate.go similarity index 86% rename from informers/resource/v1alpha2/resourceclaimtemplate.go rename to informers/resource/v1alpha3/resourceclaimtemplate.go index 13f4ad835c..294755661c 100644 --- a/informers/resource/v1alpha2/resourceclaimtemplate.go +++ b/informers/resource/v1alpha3/resourceclaimtemplate.go @@ -16,19 +16,19 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" time "time" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" - v1alpha2 "k8s.io/client-go/listers/resource/v1alpha2" + v1alpha3 "k8s.io/client-go/listers/resource/v1alpha3" cache "k8s.io/client-go/tools/cache" ) @@ -36,7 +36,7 @@ import ( // ResourceClaimTemplates. type ResourceClaimTemplateInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.ResourceClaimTemplateLister + Lister() v1alpha3.ResourceClaimTemplateLister } type resourceClaimTemplateInformer struct { @@ -62,16 +62,16 @@ func NewFilteredResourceClaimTemplateInformer(client kubernetes.Interface, names if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceClaimTemplates(namespace).List(context.TODO(), options) + return client.ResourceV1alpha3().ResourceClaimTemplates(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceClaimTemplates(namespace).Watch(context.TODO(), options) + return client.ResourceV1alpha3().ResourceClaimTemplates(namespace).Watch(context.TODO(), options) }, }, - &resourcev1alpha2.ResourceClaimTemplate{}, + &resourcev1alpha3.ResourceClaimTemplate{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *resourceClaimTemplateInformer) defaultInformer(client kubernetes.Interf } func (f *resourceClaimTemplateInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&resourcev1alpha2.ResourceClaimTemplate{}, f.defaultInformer) + return f.factory.InformerFor(&resourcev1alpha3.ResourceClaimTemplate{}, f.defaultInformer) } -func (f *resourceClaimTemplateInformer) Lister() v1alpha2.ResourceClaimTemplateLister { - return v1alpha2.NewResourceClaimTemplateLister(f.Informer().GetIndexer()) +func (f *resourceClaimTemplateInformer) Lister() v1alpha3.ResourceClaimTemplateLister { + return v1alpha3.NewResourceClaimTemplateLister(f.Informer().GetIndexer()) } diff --git a/informers/resource/v1alpha2/resourceclass.go b/informers/resource/v1alpha3/resourceclass.go similarity index 85% rename from informers/resource/v1alpha2/resourceclass.go rename to informers/resource/v1alpha3/resourceclass.go index cb76d78fe4..f63141a70e 100644 --- a/informers/resource/v1alpha2/resourceclass.go +++ b/informers/resource/v1alpha3/resourceclass.go @@ -16,19 +16,19 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" time "time" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" - v1alpha2 "k8s.io/client-go/listers/resource/v1alpha2" + v1alpha3 "k8s.io/client-go/listers/resource/v1alpha3" cache "k8s.io/client-go/tools/cache" ) @@ -36,7 +36,7 @@ import ( // ResourceClasses. type ResourceClassInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.ResourceClassLister + Lister() v1alpha3.ResourceClassLister } type resourceClassInformer struct { @@ -61,16 +61,16 @@ func NewFilteredResourceClassInformer(client kubernetes.Interface, resyncPeriod if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceClasses().List(context.TODO(), options) + return client.ResourceV1alpha3().ResourceClasses().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceClasses().Watch(context.TODO(), options) + return client.ResourceV1alpha3().ResourceClasses().Watch(context.TODO(), options) }, }, - &resourcev1alpha2.ResourceClass{}, + &resourcev1alpha3.ResourceClass{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *resourceClassInformer) defaultInformer(client kubernetes.Interface, res } func (f *resourceClassInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&resourcev1alpha2.ResourceClass{}, f.defaultInformer) + return f.factory.InformerFor(&resourcev1alpha3.ResourceClass{}, f.defaultInformer) } -func (f *resourceClassInformer) Lister() v1alpha2.ResourceClassLister { - return v1alpha2.NewResourceClassLister(f.Informer().GetIndexer()) +func (f *resourceClassInformer) Lister() v1alpha3.ResourceClassLister { + return v1alpha3.NewResourceClassLister(f.Informer().GetIndexer()) } diff --git a/informers/resource/v1alpha2/resourceclassparameters.go b/informers/resource/v1alpha3/resourceclassparameters.go similarity index 86% rename from informers/resource/v1alpha2/resourceclassparameters.go rename to informers/resource/v1alpha3/resourceclassparameters.go index 71fbefe162..cb2172f5c0 100644 --- a/informers/resource/v1alpha2/resourceclassparameters.go +++ b/informers/resource/v1alpha3/resourceclassparameters.go @@ -16,19 +16,19 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" time "time" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" - v1alpha2 "k8s.io/client-go/listers/resource/v1alpha2" + v1alpha3 "k8s.io/client-go/listers/resource/v1alpha3" cache "k8s.io/client-go/tools/cache" ) @@ -36,7 +36,7 @@ import ( // ResourceClassParameters. type ResourceClassParametersInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.ResourceClassParametersLister + Lister() v1alpha3.ResourceClassParametersLister } type resourceClassParametersInformer struct { @@ -62,16 +62,16 @@ func NewFilteredResourceClassParametersInformer(client kubernetes.Interface, nam if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceClassParameters(namespace).List(context.TODO(), options) + return client.ResourceV1alpha3().ResourceClassParameters(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceClassParameters(namespace).Watch(context.TODO(), options) + return client.ResourceV1alpha3().ResourceClassParameters(namespace).Watch(context.TODO(), options) }, }, - &resourcev1alpha2.ResourceClassParameters{}, + &resourcev1alpha3.ResourceClassParameters{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *resourceClassParametersInformer) defaultInformer(client kubernetes.Inte } func (f *resourceClassParametersInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&resourcev1alpha2.ResourceClassParameters{}, f.defaultInformer) + return f.factory.InformerFor(&resourcev1alpha3.ResourceClassParameters{}, f.defaultInformer) } -func (f *resourceClassParametersInformer) Lister() v1alpha2.ResourceClassParametersLister { - return v1alpha2.NewResourceClassParametersLister(f.Informer().GetIndexer()) +func (f *resourceClassParametersInformer) Lister() v1alpha3.ResourceClassParametersLister { + return v1alpha3.NewResourceClassParametersLister(f.Informer().GetIndexer()) } diff --git a/informers/resource/v1alpha2/resourceslice.go b/informers/resource/v1alpha3/resourceslice.go similarity index 85% rename from informers/resource/v1alpha2/resourceslice.go rename to informers/resource/v1alpha3/resourceslice.go index da9d2a0243..108083530c 100644 --- a/informers/resource/v1alpha2/resourceslice.go +++ b/informers/resource/v1alpha3/resourceslice.go @@ -16,19 +16,19 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" time "time" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" kubernetes "k8s.io/client-go/kubernetes" - v1alpha2 "k8s.io/client-go/listers/resource/v1alpha2" + v1alpha3 "k8s.io/client-go/listers/resource/v1alpha3" cache "k8s.io/client-go/tools/cache" ) @@ -36,7 +36,7 @@ import ( // ResourceSlices. type ResourceSliceInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha2.ResourceSliceLister + Lister() v1alpha3.ResourceSliceLister } type resourceSliceInformer struct { @@ -61,16 +61,16 @@ func NewFilteredResourceSliceInformer(client kubernetes.Interface, resyncPeriod if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceSlices().List(context.TODO(), options) + return client.ResourceV1alpha3().ResourceSlices().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha2().ResourceSlices().Watch(context.TODO(), options) + return client.ResourceV1alpha3().ResourceSlices().Watch(context.TODO(), options) }, }, - &resourcev1alpha2.ResourceSlice{}, + &resourcev1alpha3.ResourceSlice{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *resourceSliceInformer) defaultInformer(client kubernetes.Interface, res } func (f *resourceSliceInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&resourcev1alpha2.ResourceSlice{}, f.defaultInformer) + return f.factory.InformerFor(&resourcev1alpha3.ResourceSlice{}, f.defaultInformer) } -func (f *resourceSliceInformer) Lister() v1alpha2.ResourceSliceLister { - return v1alpha2.NewResourceSliceLister(f.Informer().GetIndexer()) +func (f *resourceSliceInformer) Lister() v1alpha3.ResourceSliceLister { + return v1alpha3.NewResourceSliceLister(f.Informer().GetIndexer()) } diff --git a/kubernetes/clientset.go b/kubernetes/clientset.go index eaa206ff65..ce17f8ed8e 100644 --- a/kubernetes/clientset.go +++ b/kubernetes/clientset.go @@ -67,7 +67,7 @@ import ( rbacv1 "k8s.io/client-go/kubernetes/typed/rbac/v1" rbacv1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1" rbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1" - resourcev1alpha2 "k8s.io/client-go/kubernetes/typed/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/kubernetes/typed/resource/v1alpha3" schedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1" schedulingv1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1" schedulingv1beta1 "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1" @@ -125,7 +125,7 @@ type Interface interface { RbacV1() rbacv1.RbacV1Interface RbacV1beta1() rbacv1beta1.RbacV1beta1Interface RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface - ResourceV1alpha2() resourcev1alpha2.ResourceV1alpha2Interface + ResourceV1alpha3() resourcev1alpha3.ResourceV1alpha3Interface SchedulingV1alpha1() schedulingv1alpha1.SchedulingV1alpha1Interface SchedulingV1beta1() schedulingv1beta1.SchedulingV1beta1Interface SchedulingV1() schedulingv1.SchedulingV1Interface @@ -182,7 +182,7 @@ type Clientset struct { rbacV1 *rbacv1.RbacV1Client rbacV1beta1 *rbacv1beta1.RbacV1beta1Client rbacV1alpha1 *rbacv1alpha1.RbacV1alpha1Client - resourceV1alpha2 *resourcev1alpha2.ResourceV1alpha2Client + resourceV1alpha3 *resourcev1alpha3.ResourceV1alpha3Client schedulingV1alpha1 *schedulingv1alpha1.SchedulingV1alpha1Client schedulingV1beta1 *schedulingv1beta1.SchedulingV1beta1Client schedulingV1 *schedulingv1.SchedulingV1Client @@ -412,9 +412,9 @@ func (c *Clientset) RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface { return c.rbacV1alpha1 } -// ResourceV1alpha2 retrieves the ResourceV1alpha2Client -func (c *Clientset) ResourceV1alpha2() resourcev1alpha2.ResourceV1alpha2Interface { - return c.resourceV1alpha2 +// ResourceV1alpha3 retrieves the ResourceV1alpha3Client +func (c *Clientset) ResourceV1alpha3() resourcev1alpha3.ResourceV1alpha3Interface { + return c.resourceV1alpha3 } // SchedulingV1alpha1 retrieves the SchedulingV1alpha1Client @@ -672,7 +672,7 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } - cs.resourceV1alpha2, err = resourcev1alpha2.NewForConfigAndClient(&configShallowCopy, httpClient) + cs.resourceV1alpha3, err = resourcev1alpha3.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err } @@ -769,7 +769,7 @@ func New(c rest.Interface) *Clientset { cs.rbacV1 = rbacv1.New(c) cs.rbacV1beta1 = rbacv1beta1.New(c) cs.rbacV1alpha1 = rbacv1alpha1.New(c) - cs.resourceV1alpha2 = resourcev1alpha2.New(c) + cs.resourceV1alpha3 = resourcev1alpha3.New(c) cs.schedulingV1alpha1 = schedulingv1alpha1.New(c) cs.schedulingV1beta1 = schedulingv1beta1.New(c) cs.schedulingV1 = schedulingv1.New(c) diff --git a/kubernetes/fake/clientset_generated.go b/kubernetes/fake/clientset_generated.go index 7808a94a2f..63f384b139 100644 --- a/kubernetes/fake/clientset_generated.go +++ b/kubernetes/fake/clientset_generated.go @@ -113,8 +113,8 @@ import ( fakerbacv1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake" rbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1" fakerbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake" - resourcev1alpha2 "k8s.io/client-go/kubernetes/typed/resource/v1alpha2" - fakeresourcev1alpha2 "k8s.io/client-go/kubernetes/typed/resource/v1alpha2/fake" + resourcev1alpha3 "k8s.io/client-go/kubernetes/typed/resource/v1alpha3" + fakeresourcev1alpha3 "k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake" schedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1" fakeschedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1/fake" schedulingv1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1" @@ -438,9 +438,9 @@ func (c *Clientset) RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface { return &fakerbacv1alpha1.FakeRbacV1alpha1{Fake: &c.Fake} } -// ResourceV1alpha2 retrieves the ResourceV1alpha2Client -func (c *Clientset) ResourceV1alpha2() resourcev1alpha2.ResourceV1alpha2Interface { - return &fakeresourcev1alpha2.FakeResourceV1alpha2{Fake: &c.Fake} +// ResourceV1alpha3 retrieves the ResourceV1alpha3Client +func (c *Clientset) ResourceV1alpha3() resourcev1alpha3.ResourceV1alpha3Interface { + return &fakeresourcev1alpha3.FakeResourceV1alpha3{Fake: &c.Fake} } // SchedulingV1alpha1 retrieves the SchedulingV1alpha1Client diff --git a/kubernetes/fake/register.go b/kubernetes/fake/register.go index 339983fe0a..2cd83ecb57 100644 --- a/kubernetes/fake/register.go +++ b/kubernetes/fake/register.go @@ -63,7 +63,7 @@ import ( rbacv1 "k8s.io/api/rbac/v1" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" rbacv1beta1 "k8s.io/api/rbac/v1beta1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" schedulingv1 "k8s.io/api/scheduling/v1" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" @@ -126,7 +126,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ rbacv1.AddToScheme, rbacv1beta1.AddToScheme, rbacv1alpha1.AddToScheme, - resourcev1alpha2.AddToScheme, + resourcev1alpha3.AddToScheme, schedulingv1alpha1.AddToScheme, schedulingv1beta1.AddToScheme, schedulingv1.AddToScheme, diff --git a/kubernetes/scheme/register.go b/kubernetes/scheme/register.go index 8ebfb7cea5..1b15a4f247 100644 --- a/kubernetes/scheme/register.go +++ b/kubernetes/scheme/register.go @@ -63,7 +63,7 @@ import ( rbacv1 "k8s.io/api/rbac/v1" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" rbacv1beta1 "k8s.io/api/rbac/v1beta1" - resourcev1alpha2 "k8s.io/api/resource/v1alpha2" + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" schedulingv1 "k8s.io/api/scheduling/v1" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" @@ -126,7 +126,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ rbacv1.AddToScheme, rbacv1beta1.AddToScheme, rbacv1alpha1.AddToScheme, - resourcev1alpha2.AddToScheme, + resourcev1alpha3.AddToScheme, schedulingv1alpha1.AddToScheme, schedulingv1beta1.AddToScheme, schedulingv1.AddToScheme, diff --git a/kubernetes/typed/resource/v1alpha2/doc.go b/kubernetes/typed/resource/v1alpha3/doc.go similarity index 97% rename from kubernetes/typed/resource/v1alpha2/doc.go rename to kubernetes/typed/resource/v1alpha3/doc.go index baaf2d9853..fdb23fd37c 100644 --- a/kubernetes/typed/resource/v1alpha2/doc.go +++ b/kubernetes/typed/resource/v1alpha3/doc.go @@ -17,4 +17,4 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. -package v1alpha2 +package v1alpha3 diff --git a/kubernetes/typed/resource/v1alpha2/fake/doc.go b/kubernetes/typed/resource/v1alpha3/fake/doc.go similarity index 100% rename from kubernetes/typed/resource/v1alpha2/fake/doc.go rename to kubernetes/typed/resource/v1alpha3/fake/doc.go diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_podschedulingcontext.go b/kubernetes/typed/resource/v1alpha3/fake/fake_podschedulingcontext.go similarity index 74% rename from kubernetes/typed/resource/v1alpha2/fake/fake_podschedulingcontext.go rename to kubernetes/typed/resource/v1alpha3/fake/fake_podschedulingcontext.go index b208415522..54898993e5 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_podschedulingcontext.go +++ b/kubernetes/typed/resource/v1alpha3/fake/fake_podschedulingcontext.go @@ -23,40 +23,40 @@ import ( json "encoding/json" "fmt" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" testing "k8s.io/client-go/testing" ) // FakePodSchedulingContexts implements PodSchedulingContextInterface type FakePodSchedulingContexts struct { - Fake *FakeResourceV1alpha2 + Fake *FakeResourceV1alpha3 ns string } -var podschedulingcontextsResource = v1alpha2.SchemeGroupVersion.WithResource("podschedulingcontexts") +var podschedulingcontextsResource = v1alpha3.SchemeGroupVersion.WithResource("podschedulingcontexts") -var podschedulingcontextsKind = v1alpha2.SchemeGroupVersion.WithKind("PodSchedulingContext") +var podschedulingcontextsKind = v1alpha3.SchemeGroupVersion.WithKind("PodSchedulingContext") // Get takes name of the podSchedulingContext, and returns the corresponding podSchedulingContext object, and an error if there is any. -func (c *FakePodSchedulingContexts) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.PodSchedulingContext, err error) { - emptyResult := &v1alpha2.PodSchedulingContext{} +func (c *FakePodSchedulingContexts) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.PodSchedulingContext, err error) { + emptyResult := &v1alpha3.PodSchedulingContext{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(podschedulingcontextsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.PodSchedulingContext), err + return obj.(*v1alpha3.PodSchedulingContext), err } // List takes label and field selectors, and returns the list of PodSchedulingContexts that match those selectors. -func (c *FakePodSchedulingContexts) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.PodSchedulingContextList, err error) { - emptyResult := &v1alpha2.PodSchedulingContextList{} +func (c *FakePodSchedulingContexts) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.PodSchedulingContextList, err error) { + emptyResult := &v1alpha3.PodSchedulingContextList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(podschedulingcontextsResource, podschedulingcontextsKind, c.ns, opts), emptyResult) @@ -68,8 +68,8 @@ func (c *FakePodSchedulingContexts) List(ctx context.Context, opts v1.ListOption if label == nil { label = labels.Everything() } - list := &v1alpha2.PodSchedulingContextList{ListMeta: obj.(*v1alpha2.PodSchedulingContextList).ListMeta} - for _, item := range obj.(*v1alpha2.PodSchedulingContextList).Items { + list := &v1alpha3.PodSchedulingContextList{ListMeta: obj.(*v1alpha3.PodSchedulingContextList).ListMeta} + for _, item := range obj.(*v1alpha3.PodSchedulingContextList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -85,46 +85,46 @@ func (c *FakePodSchedulingContexts) Watch(ctx context.Context, opts v1.ListOptio } // Create takes the representation of a podSchedulingContext and creates it. Returns the server's representation of the podSchedulingContext, and an error, if there is any. -func (c *FakePodSchedulingContexts) Create(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.CreateOptions) (result *v1alpha2.PodSchedulingContext, err error) { - emptyResult := &v1alpha2.PodSchedulingContext{} +func (c *FakePodSchedulingContexts) Create(ctx context.Context, podSchedulingContext *v1alpha3.PodSchedulingContext, opts v1.CreateOptions) (result *v1alpha3.PodSchedulingContext, err error) { + emptyResult := &v1alpha3.PodSchedulingContext{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(podschedulingcontextsResource, c.ns, podSchedulingContext, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.PodSchedulingContext), err + return obj.(*v1alpha3.PodSchedulingContext), err } // Update takes the representation of a podSchedulingContext and updates it. Returns the server's representation of the podSchedulingContext, and an error, if there is any. -func (c *FakePodSchedulingContexts) Update(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.UpdateOptions) (result *v1alpha2.PodSchedulingContext, err error) { - emptyResult := &v1alpha2.PodSchedulingContext{} +func (c *FakePodSchedulingContexts) Update(ctx context.Context, podSchedulingContext *v1alpha3.PodSchedulingContext, opts v1.UpdateOptions) (result *v1alpha3.PodSchedulingContext, err error) { + emptyResult := &v1alpha3.PodSchedulingContext{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(podschedulingcontextsResource, c.ns, podSchedulingContext, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.PodSchedulingContext), err + return obj.(*v1alpha3.PodSchedulingContext), 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 *FakePodSchedulingContexts) UpdateStatus(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.UpdateOptions) (result *v1alpha2.PodSchedulingContext, err error) { - emptyResult := &v1alpha2.PodSchedulingContext{} +func (c *FakePodSchedulingContexts) UpdateStatus(ctx context.Context, podSchedulingContext *v1alpha3.PodSchedulingContext, opts v1.UpdateOptions) (result *v1alpha3.PodSchedulingContext, err error) { + emptyResult := &v1alpha3.PodSchedulingContext{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(podschedulingcontextsResource, "status", c.ns, podSchedulingContext, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.PodSchedulingContext), err + return obj.(*v1alpha3.PodSchedulingContext), err } // Delete takes name of the podSchedulingContext and deletes it. Returns an error if one occurs. func (c *FakePodSchedulingContexts) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(podschedulingcontextsResource, c.ns, name, opts), &v1alpha2.PodSchedulingContext{}) + Invokes(testing.NewDeleteActionWithOptions(podschedulingcontextsResource, c.ns, name, opts), &v1alpha3.PodSchedulingContext{}) return err } @@ -133,24 +133,24 @@ func (c *FakePodSchedulingContexts) Delete(ctx context.Context, name string, opt func (c *FakePodSchedulingContexts) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(podschedulingcontextsResource, c.ns, opts, listOpts) - _, err := c.Fake.Invokes(action, &v1alpha2.PodSchedulingContextList{}) + _, err := c.Fake.Invokes(action, &v1alpha3.PodSchedulingContextList{}) return err } // Patch applies the patch and returns the patched podSchedulingContext. -func (c *FakePodSchedulingContexts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.PodSchedulingContext, err error) { - emptyResult := &v1alpha2.PodSchedulingContext{} +func (c *FakePodSchedulingContexts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.PodSchedulingContext, err error) { + emptyResult := &v1alpha3.PodSchedulingContext{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(podschedulingcontextsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.PodSchedulingContext), err + return obj.(*v1alpha3.PodSchedulingContext), err } // Apply takes the given apply declarative configuration, applies it and returns the applied podSchedulingContext. -func (c *FakePodSchedulingContexts) Apply(ctx context.Context, podSchedulingContext *resourcev1alpha2.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.PodSchedulingContext, err error) { +func (c *FakePodSchedulingContexts) Apply(ctx context.Context, podSchedulingContext *resourcev1alpha3.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.PodSchedulingContext, err error) { if podSchedulingContext == nil { return nil, fmt.Errorf("podSchedulingContext provided to Apply must not be nil") } @@ -162,19 +162,19 @@ func (c *FakePodSchedulingContexts) Apply(ctx context.Context, podSchedulingCont if name == nil { return nil, fmt.Errorf("podSchedulingContext.Name must be provided to Apply") } - emptyResult := &v1alpha2.PodSchedulingContext{} + emptyResult := &v1alpha3.PodSchedulingContext{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(podschedulingcontextsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.PodSchedulingContext), err + return obj.(*v1alpha3.PodSchedulingContext), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakePodSchedulingContexts) ApplyStatus(ctx context.Context, podSchedulingContext *resourcev1alpha2.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.PodSchedulingContext, err error) { +func (c *FakePodSchedulingContexts) ApplyStatus(ctx context.Context, podSchedulingContext *resourcev1alpha3.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.PodSchedulingContext, err error) { if podSchedulingContext == nil { return nil, fmt.Errorf("podSchedulingContext provided to Apply must not be nil") } @@ -186,12 +186,12 @@ func (c *FakePodSchedulingContexts) ApplyStatus(ctx context.Context, podScheduli if name == nil { return nil, fmt.Errorf("podSchedulingContext.Name must be provided to Apply") } - emptyResult := &v1alpha2.PodSchedulingContext{} + emptyResult := &v1alpha3.PodSchedulingContext{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(podschedulingcontextsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.PodSchedulingContext), err + return obj.(*v1alpha3.PodSchedulingContext), err } diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resource_client.go b/kubernetes/typed/resource/v1alpha3/fake/fake_resource_client.go similarity index 59% rename from kubernetes/typed/resource/v1alpha2/fake/fake_resource_client.go rename to kubernetes/typed/resource/v1alpha3/fake/fake_resource_client.go index 6f69d0fa79..d01b28c66a 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_resource_client.go +++ b/kubernetes/typed/resource/v1alpha3/fake/fake_resource_client.go @@ -19,46 +19,46 @@ limitations under the License. package fake import ( - v1alpha2 "k8s.io/client-go/kubernetes/typed/resource/v1alpha2" + v1alpha3 "k8s.io/client-go/kubernetes/typed/resource/v1alpha3" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) -type FakeResourceV1alpha2 struct { +type FakeResourceV1alpha3 struct { *testing.Fake } -func (c *FakeResourceV1alpha2) PodSchedulingContexts(namespace string) v1alpha2.PodSchedulingContextInterface { +func (c *FakeResourceV1alpha3) PodSchedulingContexts(namespace string) v1alpha3.PodSchedulingContextInterface { return &FakePodSchedulingContexts{c, namespace} } -func (c *FakeResourceV1alpha2) ResourceClaims(namespace string) v1alpha2.ResourceClaimInterface { +func (c *FakeResourceV1alpha3) ResourceClaims(namespace string) v1alpha3.ResourceClaimInterface { return &FakeResourceClaims{c, namespace} } -func (c *FakeResourceV1alpha2) ResourceClaimParameters(namespace string) v1alpha2.ResourceClaimParametersInterface { +func (c *FakeResourceV1alpha3) ResourceClaimParameters(namespace string) v1alpha3.ResourceClaimParametersInterface { return &FakeResourceClaimParameters{c, namespace} } -func (c *FakeResourceV1alpha2) ResourceClaimTemplates(namespace string) v1alpha2.ResourceClaimTemplateInterface { +func (c *FakeResourceV1alpha3) ResourceClaimTemplates(namespace string) v1alpha3.ResourceClaimTemplateInterface { return &FakeResourceClaimTemplates{c, namespace} } -func (c *FakeResourceV1alpha2) ResourceClasses() v1alpha2.ResourceClassInterface { +func (c *FakeResourceV1alpha3) ResourceClasses() v1alpha3.ResourceClassInterface { return &FakeResourceClasses{c} } -func (c *FakeResourceV1alpha2) ResourceClassParameters(namespace string) v1alpha2.ResourceClassParametersInterface { +func (c *FakeResourceV1alpha3) ResourceClassParameters(namespace string) v1alpha3.ResourceClassParametersInterface { return &FakeResourceClassParameters{c, namespace} } -func (c *FakeResourceV1alpha2) ResourceSlices() v1alpha2.ResourceSliceInterface { +func (c *FakeResourceV1alpha3) ResourceSlices() v1alpha3.ResourceSliceInterface { return &FakeResourceSlices{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeResourceV1alpha2) RESTClient() rest.Interface { +func (c *FakeResourceV1alpha3) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaim.go b/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaim.go similarity index 75% rename from kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaim.go rename to kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaim.go index f0d028ba27..db38b3d60c 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaim.go +++ b/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaim.go @@ -23,40 +23,40 @@ import ( json "encoding/json" "fmt" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" testing "k8s.io/client-go/testing" ) // FakeResourceClaims implements ResourceClaimInterface type FakeResourceClaims struct { - Fake *FakeResourceV1alpha2 + Fake *FakeResourceV1alpha3 ns string } -var resourceclaimsResource = v1alpha2.SchemeGroupVersion.WithResource("resourceclaims") +var resourceclaimsResource = v1alpha3.SchemeGroupVersion.WithResource("resourceclaims") -var resourceclaimsKind = v1alpha2.SchemeGroupVersion.WithKind("ResourceClaim") +var resourceclaimsKind = v1alpha3.SchemeGroupVersion.WithKind("ResourceClaim") // Get takes name of the resourceClaim, and returns the corresponding resourceClaim object, and an error if there is any. -func (c *FakeResourceClaims) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClaim, err error) { - emptyResult := &v1alpha2.ResourceClaim{} +func (c *FakeResourceClaims) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.ResourceClaim, err error) { + emptyResult := &v1alpha3.ResourceClaim{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(resourceclaimsResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaim), err + return obj.(*v1alpha3.ResourceClaim), err } // List takes label and field selectors, and returns the list of ResourceClaims that match those selectors. -func (c *FakeResourceClaims) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimList, err error) { - emptyResult := &v1alpha2.ResourceClaimList{} +func (c *FakeResourceClaims) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.ResourceClaimList, err error) { + emptyResult := &v1alpha3.ResourceClaimList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(resourceclaimsResource, resourceclaimsKind, c.ns, opts), emptyResult) @@ -68,8 +68,8 @@ func (c *FakeResourceClaims) List(ctx context.Context, opts v1.ListOptions) (res if label == nil { label = labels.Everything() } - list := &v1alpha2.ResourceClaimList{ListMeta: obj.(*v1alpha2.ResourceClaimList).ListMeta} - for _, item := range obj.(*v1alpha2.ResourceClaimList).Items { + list := &v1alpha3.ResourceClaimList{ListMeta: obj.(*v1alpha3.ResourceClaimList).ListMeta} + for _, item := range obj.(*v1alpha3.ResourceClaimList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -85,46 +85,46 @@ func (c *FakeResourceClaims) Watch(ctx context.Context, opts v1.ListOptions) (wa } // Create takes the representation of a resourceClaim and creates it. Returns the server's representation of the resourceClaim, and an error, if there is any. -func (c *FakeResourceClaims) Create(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.CreateOptions) (result *v1alpha2.ResourceClaim, err error) { - emptyResult := &v1alpha2.ResourceClaim{} +func (c *FakeResourceClaims) Create(ctx context.Context, resourceClaim *v1alpha3.ResourceClaim, opts v1.CreateOptions) (result *v1alpha3.ResourceClaim, err error) { + emptyResult := &v1alpha3.ResourceClaim{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(resourceclaimsResource, c.ns, resourceClaim, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaim), err + return obj.(*v1alpha3.ResourceClaim), err } // Update takes the representation of a resourceClaim and updates it. Returns the server's representation of the resourceClaim, and an error, if there is any. -func (c *FakeResourceClaims) Update(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.UpdateOptions) (result *v1alpha2.ResourceClaim, err error) { - emptyResult := &v1alpha2.ResourceClaim{} +func (c *FakeResourceClaims) Update(ctx context.Context, resourceClaim *v1alpha3.ResourceClaim, opts v1.UpdateOptions) (result *v1alpha3.ResourceClaim, err error) { + emptyResult := &v1alpha3.ResourceClaim{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(resourceclaimsResource, c.ns, resourceClaim, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaim), err + return obj.(*v1alpha3.ResourceClaim), 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 *FakeResourceClaims) UpdateStatus(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.UpdateOptions) (result *v1alpha2.ResourceClaim, err error) { - emptyResult := &v1alpha2.ResourceClaim{} +func (c *FakeResourceClaims) UpdateStatus(ctx context.Context, resourceClaim *v1alpha3.ResourceClaim, opts v1.UpdateOptions) (result *v1alpha3.ResourceClaim, err error) { + emptyResult := &v1alpha3.ResourceClaim{} obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceActionWithOptions(resourceclaimsResource, "status", c.ns, resourceClaim, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaim), err + return obj.(*v1alpha3.ResourceClaim), err } // Delete takes name of the resourceClaim and deletes it. Returns an error if one occurs. func (c *FakeResourceClaims) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(resourceclaimsResource, c.ns, name, opts), &v1alpha2.ResourceClaim{}) + Invokes(testing.NewDeleteActionWithOptions(resourceclaimsResource, c.ns, name, opts), &v1alpha3.ResourceClaim{}) return err } @@ -133,24 +133,24 @@ func (c *FakeResourceClaims) Delete(ctx context.Context, name string, opts v1.De func (c *FakeResourceClaims) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(resourceclaimsResource, c.ns, opts, listOpts) - _, err := c.Fake.Invokes(action, &v1alpha2.ResourceClaimList{}) + _, err := c.Fake.Invokes(action, &v1alpha3.ResourceClaimList{}) return err } // Patch applies the patch and returns the patched resourceClaim. -func (c *FakeResourceClaims) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClaim, err error) { - emptyResult := &v1alpha2.ResourceClaim{} +func (c *FakeResourceClaims) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClaim, err error) { + emptyResult := &v1alpha3.ResourceClaim{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaim), err + return obj.(*v1alpha3.ResourceClaim), err } // Apply takes the given apply declarative configuration, applies it and returns the applied resourceClaim. -func (c *FakeResourceClaims) Apply(ctx context.Context, resourceClaim *resourcev1alpha2.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClaim, err error) { +func (c *FakeResourceClaims) Apply(ctx context.Context, resourceClaim *resourcev1alpha3.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaim, err error) { if resourceClaim == nil { return nil, fmt.Errorf("resourceClaim provided to Apply must not be nil") } @@ -162,19 +162,19 @@ func (c *FakeResourceClaims) Apply(ctx context.Context, resourceClaim *resourcev if name == nil { return nil, fmt.Errorf("resourceClaim.Name must be provided to Apply") } - emptyResult := &v1alpha2.ResourceClaim{} + emptyResult := &v1alpha3.ResourceClaim{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaim), err + return obj.(*v1alpha3.ResourceClaim), err } // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *FakeResourceClaims) ApplyStatus(ctx context.Context, resourceClaim *resourcev1alpha2.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClaim, err error) { +func (c *FakeResourceClaims) ApplyStatus(ctx context.Context, resourceClaim *resourcev1alpha3.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaim, err error) { if resourceClaim == nil { return nil, fmt.Errorf("resourceClaim provided to Apply must not be nil") } @@ -186,12 +186,12 @@ func (c *FakeResourceClaims) ApplyStatus(ctx context.Context, resourceClaim *res if name == nil { return nil, fmt.Errorf("resourceClaim.Name must be provided to Apply") } - emptyResult := &v1alpha2.ResourceClaim{} + emptyResult := &v1alpha3.ResourceClaim{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaim), err + return obj.(*v1alpha3.ResourceClaim), err } diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimparameters.go b/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaimparameters.go similarity index 75% rename from kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimparameters.go rename to kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaimparameters.go index e141835ac0..1f646101e5 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimparameters.go +++ b/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaimparameters.go @@ -23,40 +23,40 @@ import ( json "encoding/json" "fmt" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" testing "k8s.io/client-go/testing" ) // FakeResourceClaimParameters implements ResourceClaimParametersInterface type FakeResourceClaimParameters struct { - Fake *FakeResourceV1alpha2 + Fake *FakeResourceV1alpha3 ns string } -var resourceclaimparametersResource = v1alpha2.SchemeGroupVersion.WithResource("resourceclaimparameters") +var resourceclaimparametersResource = v1alpha3.SchemeGroupVersion.WithResource("resourceclaimparameters") -var resourceclaimparametersKind = v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimParameters") +var resourceclaimparametersKind = v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimParameters") // Get takes name of the resourceClaimParameters, and returns the corresponding resourceClaimParameters object, and an error if there is any. -func (c *FakeResourceClaimParameters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClaimParameters, err error) { - emptyResult := &v1alpha2.ResourceClaimParameters{} +func (c *FakeResourceClaimParameters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.ResourceClaimParameters, err error) { + emptyResult := &v1alpha3.ResourceClaimParameters{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(resourceclaimparametersResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaimParameters), err + return obj.(*v1alpha3.ResourceClaimParameters), err } // List takes label and field selectors, and returns the list of ResourceClaimParameters that match those selectors. -func (c *FakeResourceClaimParameters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimParametersList, err error) { - emptyResult := &v1alpha2.ResourceClaimParametersList{} +func (c *FakeResourceClaimParameters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.ResourceClaimParametersList, err error) { + emptyResult := &v1alpha3.ResourceClaimParametersList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(resourceclaimparametersResource, resourceclaimparametersKind, c.ns, opts), emptyResult) @@ -68,8 +68,8 @@ func (c *FakeResourceClaimParameters) List(ctx context.Context, opts v1.ListOpti if label == nil { label = labels.Everything() } - list := &v1alpha2.ResourceClaimParametersList{ListMeta: obj.(*v1alpha2.ResourceClaimParametersList).ListMeta} - for _, item := range obj.(*v1alpha2.ResourceClaimParametersList).Items { + list := &v1alpha3.ResourceClaimParametersList{ListMeta: obj.(*v1alpha3.ResourceClaimParametersList).ListMeta} + for _, item := range obj.(*v1alpha3.ResourceClaimParametersList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -85,33 +85,33 @@ func (c *FakeResourceClaimParameters) Watch(ctx context.Context, opts v1.ListOpt } // Create takes the representation of a resourceClaimParameters and creates it. Returns the server's representation of the resourceClaimParameters, and an error, if there is any. -func (c *FakeResourceClaimParameters) Create(ctx context.Context, resourceClaimParameters *v1alpha2.ResourceClaimParameters, opts v1.CreateOptions) (result *v1alpha2.ResourceClaimParameters, err error) { - emptyResult := &v1alpha2.ResourceClaimParameters{} +func (c *FakeResourceClaimParameters) Create(ctx context.Context, resourceClaimParameters *v1alpha3.ResourceClaimParameters, opts v1.CreateOptions) (result *v1alpha3.ResourceClaimParameters, err error) { + emptyResult := &v1alpha3.ResourceClaimParameters{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(resourceclaimparametersResource, c.ns, resourceClaimParameters, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaimParameters), err + return obj.(*v1alpha3.ResourceClaimParameters), err } // Update takes the representation of a resourceClaimParameters and updates it. Returns the server's representation of the resourceClaimParameters, and an error, if there is any. -func (c *FakeResourceClaimParameters) Update(ctx context.Context, resourceClaimParameters *v1alpha2.ResourceClaimParameters, opts v1.UpdateOptions) (result *v1alpha2.ResourceClaimParameters, err error) { - emptyResult := &v1alpha2.ResourceClaimParameters{} +func (c *FakeResourceClaimParameters) Update(ctx context.Context, resourceClaimParameters *v1alpha3.ResourceClaimParameters, opts v1.UpdateOptions) (result *v1alpha3.ResourceClaimParameters, err error) { + emptyResult := &v1alpha3.ResourceClaimParameters{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(resourceclaimparametersResource, c.ns, resourceClaimParameters, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaimParameters), err + return obj.(*v1alpha3.ResourceClaimParameters), err } // Delete takes name of the resourceClaimParameters and deletes it. Returns an error if one occurs. func (c *FakeResourceClaimParameters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(resourceclaimparametersResource, c.ns, name, opts), &v1alpha2.ResourceClaimParameters{}) + Invokes(testing.NewDeleteActionWithOptions(resourceclaimparametersResource, c.ns, name, opts), &v1alpha3.ResourceClaimParameters{}) return err } @@ -120,24 +120,24 @@ func (c *FakeResourceClaimParameters) Delete(ctx context.Context, name string, o func (c *FakeResourceClaimParameters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(resourceclaimparametersResource, c.ns, opts, listOpts) - _, err := c.Fake.Invokes(action, &v1alpha2.ResourceClaimParametersList{}) + _, err := c.Fake.Invokes(action, &v1alpha3.ResourceClaimParametersList{}) return err } // Patch applies the patch and returns the patched resourceClaimParameters. -func (c *FakeResourceClaimParameters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClaimParameters, err error) { - emptyResult := &v1alpha2.ResourceClaimParameters{} +func (c *FakeResourceClaimParameters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClaimParameters, err error) { + emptyResult := &v1alpha3.ResourceClaimParameters{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimparametersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaimParameters), err + return obj.(*v1alpha3.ResourceClaimParameters), err } // Apply takes the given apply declarative configuration, applies it and returns the applied resourceClaimParameters. -func (c *FakeResourceClaimParameters) Apply(ctx context.Context, resourceClaimParameters *resourcev1alpha2.ResourceClaimParametersApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClaimParameters, err error) { +func (c *FakeResourceClaimParameters) Apply(ctx context.Context, resourceClaimParameters *resourcev1alpha3.ResourceClaimParametersApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaimParameters, err error) { if resourceClaimParameters == nil { return nil, fmt.Errorf("resourceClaimParameters provided to Apply must not be nil") } @@ -149,12 +149,12 @@ func (c *FakeResourceClaimParameters) Apply(ctx context.Context, resourceClaimPa if name == nil { return nil, fmt.Errorf("resourceClaimParameters.Name must be provided to Apply") } - emptyResult := &v1alpha2.ResourceClaimParameters{} + emptyResult := &v1alpha3.ResourceClaimParameters{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimparametersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaimParameters), err + return obj.(*v1alpha3.ResourceClaimParameters), err } diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimtemplate.go b/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaimtemplate.go similarity index 75% rename from kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimtemplate.go rename to kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaimtemplate.go index f3bca1991b..28db7261f9 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclaimtemplate.go +++ b/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaimtemplate.go @@ -23,40 +23,40 @@ import ( json "encoding/json" "fmt" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" testing "k8s.io/client-go/testing" ) // FakeResourceClaimTemplates implements ResourceClaimTemplateInterface type FakeResourceClaimTemplates struct { - Fake *FakeResourceV1alpha2 + Fake *FakeResourceV1alpha3 ns string } -var resourceclaimtemplatesResource = v1alpha2.SchemeGroupVersion.WithResource("resourceclaimtemplates") +var resourceclaimtemplatesResource = v1alpha3.SchemeGroupVersion.WithResource("resourceclaimtemplates") -var resourceclaimtemplatesKind = v1alpha2.SchemeGroupVersion.WithKind("ResourceClaimTemplate") +var resourceclaimtemplatesKind = v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimTemplate") // Get takes name of the resourceClaimTemplate, and returns the corresponding resourceClaimTemplate object, and an error if there is any. -func (c *FakeResourceClaimTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClaimTemplate, err error) { - emptyResult := &v1alpha2.ResourceClaimTemplate{} +func (c *FakeResourceClaimTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.ResourceClaimTemplate, err error) { + emptyResult := &v1alpha3.ResourceClaimTemplate{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(resourceclaimtemplatesResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaimTemplate), err + return obj.(*v1alpha3.ResourceClaimTemplate), err } // List takes label and field selectors, and returns the list of ResourceClaimTemplates that match those selectors. -func (c *FakeResourceClaimTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClaimTemplateList, err error) { - emptyResult := &v1alpha2.ResourceClaimTemplateList{} +func (c *FakeResourceClaimTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.ResourceClaimTemplateList, err error) { + emptyResult := &v1alpha3.ResourceClaimTemplateList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(resourceclaimtemplatesResource, resourceclaimtemplatesKind, c.ns, opts), emptyResult) @@ -68,8 +68,8 @@ func (c *FakeResourceClaimTemplates) List(ctx context.Context, opts v1.ListOptio if label == nil { label = labels.Everything() } - list := &v1alpha2.ResourceClaimTemplateList{ListMeta: obj.(*v1alpha2.ResourceClaimTemplateList).ListMeta} - for _, item := range obj.(*v1alpha2.ResourceClaimTemplateList).Items { + list := &v1alpha3.ResourceClaimTemplateList{ListMeta: obj.(*v1alpha3.ResourceClaimTemplateList).ListMeta} + for _, item := range obj.(*v1alpha3.ResourceClaimTemplateList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -85,33 +85,33 @@ func (c *FakeResourceClaimTemplates) Watch(ctx context.Context, opts v1.ListOpti } // Create takes the representation of a resourceClaimTemplate and creates it. Returns the server's representation of the resourceClaimTemplate, and an error, if there is any. -func (c *FakeResourceClaimTemplates) Create(ctx context.Context, resourceClaimTemplate *v1alpha2.ResourceClaimTemplate, opts v1.CreateOptions) (result *v1alpha2.ResourceClaimTemplate, err error) { - emptyResult := &v1alpha2.ResourceClaimTemplate{} +func (c *FakeResourceClaimTemplates) Create(ctx context.Context, resourceClaimTemplate *v1alpha3.ResourceClaimTemplate, opts v1.CreateOptions) (result *v1alpha3.ResourceClaimTemplate, err error) { + emptyResult := &v1alpha3.ResourceClaimTemplate{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(resourceclaimtemplatesResource, c.ns, resourceClaimTemplate, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaimTemplate), err + return obj.(*v1alpha3.ResourceClaimTemplate), err } // Update takes the representation of a resourceClaimTemplate and updates it. Returns the server's representation of the resourceClaimTemplate, and an error, if there is any. -func (c *FakeResourceClaimTemplates) Update(ctx context.Context, resourceClaimTemplate *v1alpha2.ResourceClaimTemplate, opts v1.UpdateOptions) (result *v1alpha2.ResourceClaimTemplate, err error) { - emptyResult := &v1alpha2.ResourceClaimTemplate{} +func (c *FakeResourceClaimTemplates) Update(ctx context.Context, resourceClaimTemplate *v1alpha3.ResourceClaimTemplate, opts v1.UpdateOptions) (result *v1alpha3.ResourceClaimTemplate, err error) { + emptyResult := &v1alpha3.ResourceClaimTemplate{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(resourceclaimtemplatesResource, c.ns, resourceClaimTemplate, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaimTemplate), err + return obj.(*v1alpha3.ResourceClaimTemplate), err } // Delete takes name of the resourceClaimTemplate and deletes it. Returns an error if one occurs. func (c *FakeResourceClaimTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(resourceclaimtemplatesResource, c.ns, name, opts), &v1alpha2.ResourceClaimTemplate{}) + Invokes(testing.NewDeleteActionWithOptions(resourceclaimtemplatesResource, c.ns, name, opts), &v1alpha3.ResourceClaimTemplate{}) return err } @@ -120,24 +120,24 @@ func (c *FakeResourceClaimTemplates) Delete(ctx context.Context, name string, op func (c *FakeResourceClaimTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(resourceclaimtemplatesResource, c.ns, opts, listOpts) - _, err := c.Fake.Invokes(action, &v1alpha2.ResourceClaimTemplateList{}) + _, err := c.Fake.Invokes(action, &v1alpha3.ResourceClaimTemplateList{}) return err } // Patch applies the patch and returns the patched resourceClaimTemplate. -func (c *FakeResourceClaimTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClaimTemplate, err error) { - emptyResult := &v1alpha2.ResourceClaimTemplate{} +func (c *FakeResourceClaimTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClaimTemplate, err error) { + emptyResult := &v1alpha3.ResourceClaimTemplate{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimtemplatesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaimTemplate), err + return obj.(*v1alpha3.ResourceClaimTemplate), err } // Apply takes the given apply declarative configuration, applies it and returns the applied resourceClaimTemplate. -func (c *FakeResourceClaimTemplates) Apply(ctx context.Context, resourceClaimTemplate *resourcev1alpha2.ResourceClaimTemplateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClaimTemplate, err error) { +func (c *FakeResourceClaimTemplates) Apply(ctx context.Context, resourceClaimTemplate *resourcev1alpha3.ResourceClaimTemplateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaimTemplate, err error) { if resourceClaimTemplate == nil { return nil, fmt.Errorf("resourceClaimTemplate provided to Apply must not be nil") } @@ -149,12 +149,12 @@ func (c *FakeResourceClaimTemplates) Apply(ctx context.Context, resourceClaimTem if name == nil { return nil, fmt.Errorf("resourceClaimTemplate.Name must be provided to Apply") } - emptyResult := &v1alpha2.ResourceClaimTemplate{} + emptyResult := &v1alpha3.ResourceClaimTemplate{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimtemplatesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClaimTemplate), err + return obj.(*v1alpha3.ResourceClaimTemplate), err } diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclass.go b/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclass.go similarity index 76% rename from kubernetes/typed/resource/v1alpha2/fake/fake_resourceclass.go rename to kubernetes/typed/resource/v1alpha3/fake/fake_resourceclass.go index 660f7c7f1d..7de1908865 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclass.go +++ b/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclass.go @@ -23,38 +23,38 @@ import ( json "encoding/json" "fmt" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" testing "k8s.io/client-go/testing" ) // FakeResourceClasses implements ResourceClassInterface type FakeResourceClasses struct { - Fake *FakeResourceV1alpha2 + Fake *FakeResourceV1alpha3 } -var resourceclassesResource = v1alpha2.SchemeGroupVersion.WithResource("resourceclasses") +var resourceclassesResource = v1alpha3.SchemeGroupVersion.WithResource("resourceclasses") -var resourceclassesKind = v1alpha2.SchemeGroupVersion.WithKind("ResourceClass") +var resourceclassesKind = v1alpha3.SchemeGroupVersion.WithKind("ResourceClass") // Get takes name of the resourceClass, and returns the corresponding resourceClass object, and an error if there is any. -func (c *FakeResourceClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClass, err error) { - emptyResult := &v1alpha2.ResourceClass{} +func (c *FakeResourceClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.ResourceClass, err error) { + emptyResult := &v1alpha3.ResourceClass{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(resourceclassesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClass), err + return obj.(*v1alpha3.ResourceClass), err } // List takes label and field selectors, and returns the list of ResourceClasses that match those selectors. -func (c *FakeResourceClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassList, err error) { - emptyResult := &v1alpha2.ResourceClassList{} +func (c *FakeResourceClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.ResourceClassList, err error) { + emptyResult := &v1alpha3.ResourceClassList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(resourceclassesResource, resourceclassesKind, opts), emptyResult) if obj == nil { @@ -65,8 +65,8 @@ func (c *FakeResourceClasses) List(ctx context.Context, opts v1.ListOptions) (re if label == nil { label = labels.Everything() } - list := &v1alpha2.ResourceClassList{ListMeta: obj.(*v1alpha2.ResourceClassList).ListMeta} - for _, item := range obj.(*v1alpha2.ResourceClassList).Items { + list := &v1alpha3.ResourceClassList{ListMeta: obj.(*v1alpha3.ResourceClassList).ListMeta} + for _, item := range obj.(*v1alpha3.ResourceClassList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -81,31 +81,31 @@ func (c *FakeResourceClasses) Watch(ctx context.Context, opts v1.ListOptions) (w } // Create takes the representation of a resourceClass and creates it. Returns the server's representation of the resourceClass, and an error, if there is any. -func (c *FakeResourceClasses) Create(ctx context.Context, resourceClass *v1alpha2.ResourceClass, opts v1.CreateOptions) (result *v1alpha2.ResourceClass, err error) { - emptyResult := &v1alpha2.ResourceClass{} +func (c *FakeResourceClasses) Create(ctx context.Context, resourceClass *v1alpha3.ResourceClass, opts v1.CreateOptions) (result *v1alpha3.ResourceClass, err error) { + emptyResult := &v1alpha3.ResourceClass{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(resourceclassesResource, resourceClass, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClass), err + return obj.(*v1alpha3.ResourceClass), err } // Update takes the representation of a resourceClass and updates it. Returns the server's representation of the resourceClass, and an error, if there is any. -func (c *FakeResourceClasses) Update(ctx context.Context, resourceClass *v1alpha2.ResourceClass, opts v1.UpdateOptions) (result *v1alpha2.ResourceClass, err error) { - emptyResult := &v1alpha2.ResourceClass{} +func (c *FakeResourceClasses) Update(ctx context.Context, resourceClass *v1alpha3.ResourceClass, opts v1.UpdateOptions) (result *v1alpha3.ResourceClass, err error) { + emptyResult := &v1alpha3.ResourceClass{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(resourceclassesResource, resourceClass, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClass), err + return obj.(*v1alpha3.ResourceClass), err } // Delete takes name of the resourceClass and deletes it. Returns an error if one occurs. func (c *FakeResourceClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(resourceclassesResource, name, opts), &v1alpha2.ResourceClass{}) + Invokes(testing.NewRootDeleteActionWithOptions(resourceclassesResource, name, opts), &v1alpha3.ResourceClass{}) return err } @@ -113,23 +113,23 @@ func (c *FakeResourceClasses) Delete(ctx context.Context, name string, opts v1.D func (c *FakeResourceClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(resourceclassesResource, opts, listOpts) - _, err := c.Fake.Invokes(action, &v1alpha2.ResourceClassList{}) + _, err := c.Fake.Invokes(action, &v1alpha3.ResourceClassList{}) return err } // Patch applies the patch and returns the patched resourceClass. -func (c *FakeResourceClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClass, err error) { - emptyResult := &v1alpha2.ResourceClass{} +func (c *FakeResourceClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClass, err error) { + emptyResult := &v1alpha3.ResourceClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(resourceclassesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClass), err + return obj.(*v1alpha3.ResourceClass), err } // Apply takes the given apply declarative configuration, applies it and returns the applied resourceClass. -func (c *FakeResourceClasses) Apply(ctx context.Context, resourceClass *resourcev1alpha2.ResourceClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClass, err error) { +func (c *FakeResourceClasses) Apply(ctx context.Context, resourceClass *resourcev1alpha3.ResourceClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClass, err error) { if resourceClass == nil { return nil, fmt.Errorf("resourceClass provided to Apply must not be nil") } @@ -141,11 +141,11 @@ func (c *FakeResourceClasses) Apply(ctx context.Context, resourceClass *resource if name == nil { return nil, fmt.Errorf("resourceClass.Name must be provided to Apply") } - emptyResult := &v1alpha2.ResourceClass{} + emptyResult := &v1alpha3.ResourceClass{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(resourceclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClass), err + return obj.(*v1alpha3.ResourceClass), err } diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclassparameters.go b/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclassparameters.go similarity index 75% rename from kubernetes/typed/resource/v1alpha2/fake/fake_resourceclassparameters.go rename to kubernetes/typed/resource/v1alpha3/fake/fake_resourceclassparameters.go index b58eedeca8..c61412de53 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceclassparameters.go +++ b/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclassparameters.go @@ -23,40 +23,40 @@ import ( json "encoding/json" "fmt" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" testing "k8s.io/client-go/testing" ) // FakeResourceClassParameters implements ResourceClassParametersInterface type FakeResourceClassParameters struct { - Fake *FakeResourceV1alpha2 + Fake *FakeResourceV1alpha3 ns string } -var resourceclassparametersResource = v1alpha2.SchemeGroupVersion.WithResource("resourceclassparameters") +var resourceclassparametersResource = v1alpha3.SchemeGroupVersion.WithResource("resourceclassparameters") -var resourceclassparametersKind = v1alpha2.SchemeGroupVersion.WithKind("ResourceClassParameters") +var resourceclassparametersKind = v1alpha3.SchemeGroupVersion.WithKind("ResourceClassParameters") // Get takes name of the resourceClassParameters, and returns the corresponding resourceClassParameters object, and an error if there is any. -func (c *FakeResourceClassParameters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceClassParameters, err error) { - emptyResult := &v1alpha2.ResourceClassParameters{} +func (c *FakeResourceClassParameters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.ResourceClassParameters, err error) { + emptyResult := &v1alpha3.ResourceClassParameters{} obj, err := c.Fake. Invokes(testing.NewGetActionWithOptions(resourceclassparametersResource, c.ns, name, options), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClassParameters), err + return obj.(*v1alpha3.ResourceClassParameters), err } // List takes label and field selectors, and returns the list of ResourceClassParameters that match those selectors. -func (c *FakeResourceClassParameters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceClassParametersList, err error) { - emptyResult := &v1alpha2.ResourceClassParametersList{} +func (c *FakeResourceClassParameters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.ResourceClassParametersList, err error) { + emptyResult := &v1alpha3.ResourceClassParametersList{} obj, err := c.Fake. Invokes(testing.NewListActionWithOptions(resourceclassparametersResource, resourceclassparametersKind, c.ns, opts), emptyResult) @@ -68,8 +68,8 @@ func (c *FakeResourceClassParameters) List(ctx context.Context, opts v1.ListOpti if label == nil { label = labels.Everything() } - list := &v1alpha2.ResourceClassParametersList{ListMeta: obj.(*v1alpha2.ResourceClassParametersList).ListMeta} - for _, item := range obj.(*v1alpha2.ResourceClassParametersList).Items { + list := &v1alpha3.ResourceClassParametersList{ListMeta: obj.(*v1alpha3.ResourceClassParametersList).ListMeta} + for _, item := range obj.(*v1alpha3.ResourceClassParametersList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -85,33 +85,33 @@ func (c *FakeResourceClassParameters) Watch(ctx context.Context, opts v1.ListOpt } // Create takes the representation of a resourceClassParameters and creates it. Returns the server's representation of the resourceClassParameters, and an error, if there is any. -func (c *FakeResourceClassParameters) Create(ctx context.Context, resourceClassParameters *v1alpha2.ResourceClassParameters, opts v1.CreateOptions) (result *v1alpha2.ResourceClassParameters, err error) { - emptyResult := &v1alpha2.ResourceClassParameters{} +func (c *FakeResourceClassParameters) Create(ctx context.Context, resourceClassParameters *v1alpha3.ResourceClassParameters, opts v1.CreateOptions) (result *v1alpha3.ResourceClassParameters, err error) { + emptyResult := &v1alpha3.ResourceClassParameters{} obj, err := c.Fake. Invokes(testing.NewCreateActionWithOptions(resourceclassparametersResource, c.ns, resourceClassParameters, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClassParameters), err + return obj.(*v1alpha3.ResourceClassParameters), err } // Update takes the representation of a resourceClassParameters and updates it. Returns the server's representation of the resourceClassParameters, and an error, if there is any. -func (c *FakeResourceClassParameters) Update(ctx context.Context, resourceClassParameters *v1alpha2.ResourceClassParameters, opts v1.UpdateOptions) (result *v1alpha2.ResourceClassParameters, err error) { - emptyResult := &v1alpha2.ResourceClassParameters{} +func (c *FakeResourceClassParameters) Update(ctx context.Context, resourceClassParameters *v1alpha3.ResourceClassParameters, opts v1.UpdateOptions) (result *v1alpha3.ResourceClassParameters, err error) { + emptyResult := &v1alpha3.ResourceClassParameters{} obj, err := c.Fake. Invokes(testing.NewUpdateActionWithOptions(resourceclassparametersResource, c.ns, resourceClassParameters, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClassParameters), err + return obj.(*v1alpha3.ResourceClassParameters), err } // Delete takes name of the resourceClassParameters and deletes it. Returns an error if one occurs. func (c *FakeResourceClassParameters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(resourceclassparametersResource, c.ns, name, opts), &v1alpha2.ResourceClassParameters{}) + Invokes(testing.NewDeleteActionWithOptions(resourceclassparametersResource, c.ns, name, opts), &v1alpha3.ResourceClassParameters{}) return err } @@ -120,24 +120,24 @@ func (c *FakeResourceClassParameters) Delete(ctx context.Context, name string, o func (c *FakeResourceClassParameters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionActionWithOptions(resourceclassparametersResource, c.ns, opts, listOpts) - _, err := c.Fake.Invokes(action, &v1alpha2.ResourceClassParametersList{}) + _, err := c.Fake.Invokes(action, &v1alpha3.ResourceClassParametersList{}) return err } // Patch applies the patch and returns the patched resourceClassParameters. -func (c *FakeResourceClassParameters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClassParameters, err error) { - emptyResult := &v1alpha2.ResourceClassParameters{} +func (c *FakeResourceClassParameters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClassParameters, err error) { + emptyResult := &v1alpha3.ResourceClassParameters{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclassparametersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClassParameters), err + return obj.(*v1alpha3.ResourceClassParameters), err } // Apply takes the given apply declarative configuration, applies it and returns the applied resourceClassParameters. -func (c *FakeResourceClassParameters) Apply(ctx context.Context, resourceClassParameters *resourcev1alpha2.ResourceClassParametersApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClassParameters, err error) { +func (c *FakeResourceClassParameters) Apply(ctx context.Context, resourceClassParameters *resourcev1alpha3.ResourceClassParametersApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClassParameters, err error) { if resourceClassParameters == nil { return nil, fmt.Errorf("resourceClassParameters provided to Apply must not be nil") } @@ -149,12 +149,12 @@ func (c *FakeResourceClassParameters) Apply(ctx context.Context, resourceClassPa if name == nil { return nil, fmt.Errorf("resourceClassParameters.Name must be provided to Apply") } - emptyResult := &v1alpha2.ResourceClassParameters{} + emptyResult := &v1alpha3.ResourceClassParameters{} obj, err := c.Fake. Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclassparametersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceClassParameters), err + return obj.(*v1alpha3.ResourceClassParameters), err } diff --git a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceslice.go b/kubernetes/typed/resource/v1alpha3/fake/fake_resourceslice.go similarity index 75% rename from kubernetes/typed/resource/v1alpha2/fake/fake_resourceslice.go rename to kubernetes/typed/resource/v1alpha3/fake/fake_resourceslice.go index 7890e8af49..c355fc454a 100644 --- a/kubernetes/typed/resource/v1alpha2/fake/fake_resourceslice.go +++ b/kubernetes/typed/resource/v1alpha3/fake/fake_resourceslice.go @@ -23,38 +23,38 @@ import ( json "encoding/json" "fmt" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" testing "k8s.io/client-go/testing" ) // FakeResourceSlices implements ResourceSliceInterface type FakeResourceSlices struct { - Fake *FakeResourceV1alpha2 + Fake *FakeResourceV1alpha3 } -var resourceslicesResource = v1alpha2.SchemeGroupVersion.WithResource("resourceslices") +var resourceslicesResource = v1alpha3.SchemeGroupVersion.WithResource("resourceslices") -var resourceslicesKind = v1alpha2.SchemeGroupVersion.WithKind("ResourceSlice") +var resourceslicesKind = v1alpha3.SchemeGroupVersion.WithKind("ResourceSlice") // Get takes name of the resourceSlice, and returns the corresponding resourceSlice object, and an error if there is any. -func (c *FakeResourceSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha2.ResourceSlice, err error) { - emptyResult := &v1alpha2.ResourceSlice{} +func (c *FakeResourceSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.ResourceSlice, err error) { + emptyResult := &v1alpha3.ResourceSlice{} obj, err := c.Fake. Invokes(testing.NewRootGetActionWithOptions(resourceslicesResource, name, options), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceSlice), err + return obj.(*v1alpha3.ResourceSlice), err } // List takes label and field selectors, and returns the list of ResourceSlices that match those selectors. -func (c *FakeResourceSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha2.ResourceSliceList, err error) { - emptyResult := &v1alpha2.ResourceSliceList{} +func (c *FakeResourceSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.ResourceSliceList, err error) { + emptyResult := &v1alpha3.ResourceSliceList{} obj, err := c.Fake. Invokes(testing.NewRootListActionWithOptions(resourceslicesResource, resourceslicesKind, opts), emptyResult) if obj == nil { @@ -65,8 +65,8 @@ func (c *FakeResourceSlices) List(ctx context.Context, opts v1.ListOptions) (res if label == nil { label = labels.Everything() } - list := &v1alpha2.ResourceSliceList{ListMeta: obj.(*v1alpha2.ResourceSliceList).ListMeta} - for _, item := range obj.(*v1alpha2.ResourceSliceList).Items { + list := &v1alpha3.ResourceSliceList{ListMeta: obj.(*v1alpha3.ResourceSliceList).ListMeta} + for _, item := range obj.(*v1alpha3.ResourceSliceList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -81,31 +81,31 @@ func (c *FakeResourceSlices) Watch(ctx context.Context, opts v1.ListOptions) (wa } // Create takes the representation of a resourceSlice and creates it. Returns the server's representation of the resourceSlice, and an error, if there is any. -func (c *FakeResourceSlices) Create(ctx context.Context, resourceSlice *v1alpha2.ResourceSlice, opts v1.CreateOptions) (result *v1alpha2.ResourceSlice, err error) { - emptyResult := &v1alpha2.ResourceSlice{} +func (c *FakeResourceSlices) Create(ctx context.Context, resourceSlice *v1alpha3.ResourceSlice, opts v1.CreateOptions) (result *v1alpha3.ResourceSlice, err error) { + emptyResult := &v1alpha3.ResourceSlice{} obj, err := c.Fake. Invokes(testing.NewRootCreateActionWithOptions(resourceslicesResource, resourceSlice, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceSlice), err + return obj.(*v1alpha3.ResourceSlice), err } // Update takes the representation of a resourceSlice and updates it. Returns the server's representation of the resourceSlice, and an error, if there is any. -func (c *FakeResourceSlices) Update(ctx context.Context, resourceSlice *v1alpha2.ResourceSlice, opts v1.UpdateOptions) (result *v1alpha2.ResourceSlice, err error) { - emptyResult := &v1alpha2.ResourceSlice{} +func (c *FakeResourceSlices) Update(ctx context.Context, resourceSlice *v1alpha3.ResourceSlice, opts v1.UpdateOptions) (result *v1alpha3.ResourceSlice, err error) { + emptyResult := &v1alpha3.ResourceSlice{} obj, err := c.Fake. Invokes(testing.NewRootUpdateActionWithOptions(resourceslicesResource, resourceSlice, opts), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceSlice), err + return obj.(*v1alpha3.ResourceSlice), err } // Delete takes name of the resourceSlice and deletes it. Returns an error if one occurs. func (c *FakeResourceSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(resourceslicesResource, name, opts), &v1alpha2.ResourceSlice{}) + Invokes(testing.NewRootDeleteActionWithOptions(resourceslicesResource, name, opts), &v1alpha3.ResourceSlice{}) return err } @@ -113,23 +113,23 @@ func (c *FakeResourceSlices) Delete(ctx context.Context, name string, opts v1.De func (c *FakeResourceSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewRootDeleteCollectionActionWithOptions(resourceslicesResource, opts, listOpts) - _, err := c.Fake.Invokes(action, &v1alpha2.ResourceSliceList{}) + _, err := c.Fake.Invokes(action, &v1alpha3.ResourceSliceList{}) return err } // Patch applies the patch and returns the patched resourceSlice. -func (c *FakeResourceSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceSlice, err error) { - emptyResult := &v1alpha2.ResourceSlice{} +func (c *FakeResourceSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceSlice, err error) { + emptyResult := &v1alpha3.ResourceSlice{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(resourceslicesResource, name, pt, data, opts, subresources...), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceSlice), err + return obj.(*v1alpha3.ResourceSlice), err } // Apply takes the given apply declarative configuration, applies it and returns the applied resourceSlice. -func (c *FakeResourceSlices) Apply(ctx context.Context, resourceSlice *resourcev1alpha2.ResourceSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceSlice, err error) { +func (c *FakeResourceSlices) Apply(ctx context.Context, resourceSlice *resourcev1alpha3.ResourceSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceSlice, err error) { if resourceSlice == nil { return nil, fmt.Errorf("resourceSlice provided to Apply must not be nil") } @@ -141,11 +141,11 @@ func (c *FakeResourceSlices) Apply(ctx context.Context, resourceSlice *resourcev if name == nil { return nil, fmt.Errorf("resourceSlice.Name must be provided to Apply") } - emptyResult := &v1alpha2.ResourceSlice{} + emptyResult := &v1alpha3.ResourceSlice{} obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceActionWithOptions(resourceslicesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) if obj == nil { return emptyResult, err } - return obj.(*v1alpha2.ResourceSlice), err + return obj.(*v1alpha3.ResourceSlice), err } diff --git a/kubernetes/typed/resource/v1alpha2/generated_expansion.go b/kubernetes/typed/resource/v1alpha3/generated_expansion.go similarity index 98% rename from kubernetes/typed/resource/v1alpha2/generated_expansion.go rename to kubernetes/typed/resource/v1alpha3/generated_expansion.go index d11410bb9b..2f5289dabf 100644 --- a/kubernetes/typed/resource/v1alpha2/generated_expansion.go +++ b/kubernetes/typed/resource/v1alpha3/generated_expansion.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 type PodSchedulingContextExpansion interface{} diff --git a/kubernetes/typed/resource/v1alpha2/podschedulingcontext.go b/kubernetes/typed/resource/v1alpha3/podschedulingcontext.go similarity index 66% rename from kubernetes/typed/resource/v1alpha2/podschedulingcontext.go rename to kubernetes/typed/resource/v1alpha3/podschedulingcontext.go index 0ffdc15013..af59843212 100644 --- a/kubernetes/typed/resource/v1alpha2/podschedulingcontext.go +++ b/kubernetes/typed/resource/v1alpha3/podschedulingcontext.go @@ -16,16 +16,16 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) @@ -38,36 +38,36 @@ type PodSchedulingContextsGetter interface { // PodSchedulingContextInterface has methods to work with PodSchedulingContext resources. type PodSchedulingContextInterface interface { - Create(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.CreateOptions) (*v1alpha2.PodSchedulingContext, error) - Update(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.UpdateOptions) (*v1alpha2.PodSchedulingContext, error) + Create(ctx context.Context, podSchedulingContext *v1alpha3.PodSchedulingContext, opts v1.CreateOptions) (*v1alpha3.PodSchedulingContext, error) + Update(ctx context.Context, podSchedulingContext *v1alpha3.PodSchedulingContext, opts v1.UpdateOptions) (*v1alpha3.PodSchedulingContext, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, podSchedulingContext *v1alpha2.PodSchedulingContext, opts v1.UpdateOptions) (*v1alpha2.PodSchedulingContext, error) + UpdateStatus(ctx context.Context, podSchedulingContext *v1alpha3.PodSchedulingContext, opts v1.UpdateOptions) (*v1alpha3.PodSchedulingContext, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.PodSchedulingContext, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.PodSchedulingContextList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha3.PodSchedulingContext, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.PodSchedulingContextList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.PodSchedulingContext, err error) - Apply(ctx context.Context, podSchedulingContext *resourcev1alpha2.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.PodSchedulingContext, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.PodSchedulingContext, err error) + Apply(ctx context.Context, podSchedulingContext *resourcev1alpha3.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.PodSchedulingContext, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). - ApplyStatus(ctx context.Context, podSchedulingContext *resourcev1alpha2.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.PodSchedulingContext, err error) + ApplyStatus(ctx context.Context, podSchedulingContext *resourcev1alpha3.PodSchedulingContextApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.PodSchedulingContext, err error) PodSchedulingContextExpansion } // podSchedulingContexts implements PodSchedulingContextInterface type podSchedulingContexts struct { - *gentype.ClientWithListAndApply[*v1alpha2.PodSchedulingContext, *v1alpha2.PodSchedulingContextList, *resourcev1alpha2.PodSchedulingContextApplyConfiguration] + *gentype.ClientWithListAndApply[*v1alpha3.PodSchedulingContext, *v1alpha3.PodSchedulingContextList, *resourcev1alpha3.PodSchedulingContextApplyConfiguration] } // newPodSchedulingContexts returns a PodSchedulingContexts -func newPodSchedulingContexts(c *ResourceV1alpha2Client, namespace string) *podSchedulingContexts { +func newPodSchedulingContexts(c *ResourceV1alpha3Client, namespace string) *podSchedulingContexts { return &podSchedulingContexts{ - gentype.NewClientWithListAndApply[*v1alpha2.PodSchedulingContext, *v1alpha2.PodSchedulingContextList, *resourcev1alpha2.PodSchedulingContextApplyConfiguration]( + gentype.NewClientWithListAndApply[*v1alpha3.PodSchedulingContext, *v1alpha3.PodSchedulingContextList, *resourcev1alpha3.PodSchedulingContextApplyConfiguration]( "podschedulingcontexts", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1alpha2.PodSchedulingContext { return &v1alpha2.PodSchedulingContext{} }, - func() *v1alpha2.PodSchedulingContextList { return &v1alpha2.PodSchedulingContextList{} }), + func() *v1alpha3.PodSchedulingContext { return &v1alpha3.PodSchedulingContext{} }, + func() *v1alpha3.PodSchedulingContextList { return &v1alpha3.PodSchedulingContextList{} }), } } diff --git a/kubernetes/typed/resource/v1alpha2/resource_client.go b/kubernetes/typed/resource/v1alpha3/resource_client.go similarity index 69% rename from kubernetes/typed/resource/v1alpha2/resource_client.go rename to kubernetes/typed/resource/v1alpha3/resource_client.go index 8e258b3e1c..4cc6238b16 100644 --- a/kubernetes/typed/resource/v1alpha2/resource_client.go +++ b/kubernetes/typed/resource/v1alpha3/resource_client.go @@ -16,17 +16,17 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "net/http" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) -type ResourceV1alpha2Interface interface { +type ResourceV1alpha3Interface interface { RESTClient() rest.Interface PodSchedulingContextsGetter ResourceClaimsGetter @@ -37,43 +37,43 @@ type ResourceV1alpha2Interface interface { ResourceSlicesGetter } -// ResourceV1alpha2Client is used to interact with features provided by the resource.k8s.io group. -type ResourceV1alpha2Client struct { +// ResourceV1alpha3Client is used to interact with features provided by the resource.k8s.io group. +type ResourceV1alpha3Client struct { restClient rest.Interface } -func (c *ResourceV1alpha2Client) PodSchedulingContexts(namespace string) PodSchedulingContextInterface { +func (c *ResourceV1alpha3Client) PodSchedulingContexts(namespace string) PodSchedulingContextInterface { return newPodSchedulingContexts(c, namespace) } -func (c *ResourceV1alpha2Client) ResourceClaims(namespace string) ResourceClaimInterface { +func (c *ResourceV1alpha3Client) ResourceClaims(namespace string) ResourceClaimInterface { return newResourceClaims(c, namespace) } -func (c *ResourceV1alpha2Client) ResourceClaimParameters(namespace string) ResourceClaimParametersInterface { +func (c *ResourceV1alpha3Client) ResourceClaimParameters(namespace string) ResourceClaimParametersInterface { return newResourceClaimParameters(c, namespace) } -func (c *ResourceV1alpha2Client) ResourceClaimTemplates(namespace string) ResourceClaimTemplateInterface { +func (c *ResourceV1alpha3Client) ResourceClaimTemplates(namespace string) ResourceClaimTemplateInterface { return newResourceClaimTemplates(c, namespace) } -func (c *ResourceV1alpha2Client) ResourceClasses() ResourceClassInterface { +func (c *ResourceV1alpha3Client) ResourceClasses() ResourceClassInterface { return newResourceClasses(c) } -func (c *ResourceV1alpha2Client) ResourceClassParameters(namespace string) ResourceClassParametersInterface { +func (c *ResourceV1alpha3Client) ResourceClassParameters(namespace string) ResourceClassParametersInterface { return newResourceClassParameters(c, namespace) } -func (c *ResourceV1alpha2Client) ResourceSlices() ResourceSliceInterface { +func (c *ResourceV1alpha3Client) ResourceSlices() ResourceSliceInterface { return newResourceSlices(c) } -// NewForConfig creates a new ResourceV1alpha2Client for the given config. +// NewForConfig creates a new ResourceV1alpha3Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*ResourceV1alpha2Client, error) { +func NewForConfig(c *rest.Config) (*ResourceV1alpha3Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -85,9 +85,9 @@ func NewForConfig(c *rest.Config) (*ResourceV1alpha2Client, error) { return NewForConfigAndClient(&config, httpClient) } -// NewForConfigAndClient creates a new ResourceV1alpha2Client for the given config and http client. +// NewForConfigAndClient creates a new ResourceV1alpha3Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ResourceV1alpha2Client, error) { +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ResourceV1alpha3Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -96,12 +96,12 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ResourceV1alpha2Cli if err != nil { return nil, err } - return &ResourceV1alpha2Client{client}, nil + return &ResourceV1alpha3Client{client}, nil } -// NewForConfigOrDie creates a new ResourceV1alpha2Client for the given config and +// NewForConfigOrDie creates a new ResourceV1alpha3Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *ResourceV1alpha2Client { +func NewForConfigOrDie(c *rest.Config) *ResourceV1alpha3Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -109,13 +109,13 @@ func NewForConfigOrDie(c *rest.Config) *ResourceV1alpha2Client { return client } -// New creates a new ResourceV1alpha2Client for the given RESTClient. -func New(c rest.Interface) *ResourceV1alpha2Client { - return &ResourceV1alpha2Client{c} +// New creates a new ResourceV1alpha3Client for the given RESTClient. +func New(c rest.Interface) *ResourceV1alpha3Client { + return &ResourceV1alpha3Client{c} } func setConfigDefaults(config *rest.Config) error { - gv := v1alpha2.SchemeGroupVersion + gv := v1alpha3.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() @@ -129,7 +129,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *ResourceV1alpha2Client) RESTClient() rest.Interface { +func (c *ResourceV1alpha3Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/kubernetes/typed/resource/v1alpha2/resourceclaim.go b/kubernetes/typed/resource/v1alpha3/resourceclaim.go similarity index 63% rename from kubernetes/typed/resource/v1alpha2/resourceclaim.go rename to kubernetes/typed/resource/v1alpha3/resourceclaim.go index 0f81e5008c..2ac65c005e 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceclaim.go +++ b/kubernetes/typed/resource/v1alpha3/resourceclaim.go @@ -16,16 +16,16 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) @@ -38,36 +38,36 @@ type ResourceClaimsGetter interface { // ResourceClaimInterface has methods to work with ResourceClaim resources. type ResourceClaimInterface interface { - Create(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.CreateOptions) (*v1alpha2.ResourceClaim, error) - Update(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.UpdateOptions) (*v1alpha2.ResourceClaim, error) + Create(ctx context.Context, resourceClaim *v1alpha3.ResourceClaim, opts v1.CreateOptions) (*v1alpha3.ResourceClaim, error) + Update(ctx context.Context, resourceClaim *v1alpha3.ResourceClaim, opts v1.UpdateOptions) (*v1alpha3.ResourceClaim, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, resourceClaim *v1alpha2.ResourceClaim, opts v1.UpdateOptions) (*v1alpha2.ResourceClaim, error) + UpdateStatus(ctx context.Context, resourceClaim *v1alpha3.ResourceClaim, opts v1.UpdateOptions) (*v1alpha3.ResourceClaim, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.ResourceClaim, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClaimList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha3.ResourceClaim, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.ResourceClaimList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClaim, err error) - Apply(ctx context.Context, resourceClaim *resourcev1alpha2.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClaim, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClaim, err error) + Apply(ctx context.Context, resourceClaim *resourcev1alpha3.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaim, err error) // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). - ApplyStatus(ctx context.Context, resourceClaim *resourcev1alpha2.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClaim, err error) + ApplyStatus(ctx context.Context, resourceClaim *resourcev1alpha3.ResourceClaimApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaim, err error) ResourceClaimExpansion } // resourceClaims implements ResourceClaimInterface type resourceClaims struct { - *gentype.ClientWithListAndApply[*v1alpha2.ResourceClaim, *v1alpha2.ResourceClaimList, *resourcev1alpha2.ResourceClaimApplyConfiguration] + *gentype.ClientWithListAndApply[*v1alpha3.ResourceClaim, *v1alpha3.ResourceClaimList, *resourcev1alpha3.ResourceClaimApplyConfiguration] } // newResourceClaims returns a ResourceClaims -func newResourceClaims(c *ResourceV1alpha2Client, namespace string) *resourceClaims { +func newResourceClaims(c *ResourceV1alpha3Client, namespace string) *resourceClaims { return &resourceClaims{ - gentype.NewClientWithListAndApply[*v1alpha2.ResourceClaim, *v1alpha2.ResourceClaimList, *resourcev1alpha2.ResourceClaimApplyConfiguration]( + gentype.NewClientWithListAndApply[*v1alpha3.ResourceClaim, *v1alpha3.ResourceClaimList, *resourcev1alpha3.ResourceClaimApplyConfiguration]( "resourceclaims", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1alpha2.ResourceClaim { return &v1alpha2.ResourceClaim{} }, - func() *v1alpha2.ResourceClaimList { return &v1alpha2.ResourceClaimList{} }), + func() *v1alpha3.ResourceClaim { return &v1alpha3.ResourceClaim{} }, + func() *v1alpha3.ResourceClaimList { return &v1alpha3.ResourceClaimList{} }), } } diff --git a/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go b/kubernetes/typed/resource/v1alpha3/resourceclaimparameters.go similarity index 66% rename from kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go rename to kubernetes/typed/resource/v1alpha3/resourceclaimparameters.go index e3fb474cd0..8ae3476f61 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceclaimparameters.go +++ b/kubernetes/typed/resource/v1alpha3/resourceclaimparameters.go @@ -16,16 +16,16 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) @@ -38,32 +38,32 @@ type ResourceClaimParametersGetter interface { // ResourceClaimParametersInterface has methods to work with ResourceClaimParameters resources. type ResourceClaimParametersInterface interface { - Create(ctx context.Context, resourceClaimParameters *v1alpha2.ResourceClaimParameters, opts v1.CreateOptions) (*v1alpha2.ResourceClaimParameters, error) - Update(ctx context.Context, resourceClaimParameters *v1alpha2.ResourceClaimParameters, opts v1.UpdateOptions) (*v1alpha2.ResourceClaimParameters, error) + Create(ctx context.Context, resourceClaimParameters *v1alpha3.ResourceClaimParameters, opts v1.CreateOptions) (*v1alpha3.ResourceClaimParameters, error) + Update(ctx context.Context, resourceClaimParameters *v1alpha3.ResourceClaimParameters, opts v1.UpdateOptions) (*v1alpha3.ResourceClaimParameters, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.ResourceClaimParameters, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClaimParametersList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha3.ResourceClaimParameters, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.ResourceClaimParametersList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClaimParameters, err error) - Apply(ctx context.Context, resourceClaimParameters *resourcev1alpha2.ResourceClaimParametersApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClaimParameters, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClaimParameters, err error) + Apply(ctx context.Context, resourceClaimParameters *resourcev1alpha3.ResourceClaimParametersApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaimParameters, err error) ResourceClaimParametersExpansion } // resourceClaimParameters implements ResourceClaimParametersInterface type resourceClaimParameters struct { - *gentype.ClientWithListAndApply[*v1alpha2.ResourceClaimParameters, *v1alpha2.ResourceClaimParametersList, *resourcev1alpha2.ResourceClaimParametersApplyConfiguration] + *gentype.ClientWithListAndApply[*v1alpha3.ResourceClaimParameters, *v1alpha3.ResourceClaimParametersList, *resourcev1alpha3.ResourceClaimParametersApplyConfiguration] } // newResourceClaimParameters returns a ResourceClaimParameters -func newResourceClaimParameters(c *ResourceV1alpha2Client, namespace string) *resourceClaimParameters { +func newResourceClaimParameters(c *ResourceV1alpha3Client, namespace string) *resourceClaimParameters { return &resourceClaimParameters{ - gentype.NewClientWithListAndApply[*v1alpha2.ResourceClaimParameters, *v1alpha2.ResourceClaimParametersList, *resourcev1alpha2.ResourceClaimParametersApplyConfiguration]( + gentype.NewClientWithListAndApply[*v1alpha3.ResourceClaimParameters, *v1alpha3.ResourceClaimParametersList, *resourcev1alpha3.ResourceClaimParametersApplyConfiguration]( "resourceclaimparameters", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1alpha2.ResourceClaimParameters { return &v1alpha2.ResourceClaimParameters{} }, - func() *v1alpha2.ResourceClaimParametersList { return &v1alpha2.ResourceClaimParametersList{} }), + func() *v1alpha3.ResourceClaimParameters { return &v1alpha3.ResourceClaimParameters{} }, + func() *v1alpha3.ResourceClaimParametersList { return &v1alpha3.ResourceClaimParametersList{} }), } } diff --git a/kubernetes/typed/resource/v1alpha2/resourceclaimtemplate.go b/kubernetes/typed/resource/v1alpha3/resourceclaimtemplate.go similarity index 67% rename from kubernetes/typed/resource/v1alpha2/resourceclaimtemplate.go rename to kubernetes/typed/resource/v1alpha3/resourceclaimtemplate.go index 3b6451a9a6..87997bfee5 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceclaimtemplate.go +++ b/kubernetes/typed/resource/v1alpha3/resourceclaimtemplate.go @@ -16,16 +16,16 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) @@ -38,32 +38,32 @@ type ResourceClaimTemplatesGetter interface { // ResourceClaimTemplateInterface has methods to work with ResourceClaimTemplate resources. type ResourceClaimTemplateInterface interface { - Create(ctx context.Context, resourceClaimTemplate *v1alpha2.ResourceClaimTemplate, opts v1.CreateOptions) (*v1alpha2.ResourceClaimTemplate, error) - Update(ctx context.Context, resourceClaimTemplate *v1alpha2.ResourceClaimTemplate, opts v1.UpdateOptions) (*v1alpha2.ResourceClaimTemplate, error) + Create(ctx context.Context, resourceClaimTemplate *v1alpha3.ResourceClaimTemplate, opts v1.CreateOptions) (*v1alpha3.ResourceClaimTemplate, error) + Update(ctx context.Context, resourceClaimTemplate *v1alpha3.ResourceClaimTemplate, opts v1.UpdateOptions) (*v1alpha3.ResourceClaimTemplate, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.ResourceClaimTemplate, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClaimTemplateList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha3.ResourceClaimTemplate, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.ResourceClaimTemplateList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClaimTemplate, err error) - Apply(ctx context.Context, resourceClaimTemplate *resourcev1alpha2.ResourceClaimTemplateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClaimTemplate, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClaimTemplate, err error) + Apply(ctx context.Context, resourceClaimTemplate *resourcev1alpha3.ResourceClaimTemplateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaimTemplate, err error) ResourceClaimTemplateExpansion } // resourceClaimTemplates implements ResourceClaimTemplateInterface type resourceClaimTemplates struct { - *gentype.ClientWithListAndApply[*v1alpha2.ResourceClaimTemplate, *v1alpha2.ResourceClaimTemplateList, *resourcev1alpha2.ResourceClaimTemplateApplyConfiguration] + *gentype.ClientWithListAndApply[*v1alpha3.ResourceClaimTemplate, *v1alpha3.ResourceClaimTemplateList, *resourcev1alpha3.ResourceClaimTemplateApplyConfiguration] } // newResourceClaimTemplates returns a ResourceClaimTemplates -func newResourceClaimTemplates(c *ResourceV1alpha2Client, namespace string) *resourceClaimTemplates { +func newResourceClaimTemplates(c *ResourceV1alpha3Client, namespace string) *resourceClaimTemplates { return &resourceClaimTemplates{ - gentype.NewClientWithListAndApply[*v1alpha2.ResourceClaimTemplate, *v1alpha2.ResourceClaimTemplateList, *resourcev1alpha2.ResourceClaimTemplateApplyConfiguration]( + gentype.NewClientWithListAndApply[*v1alpha3.ResourceClaimTemplate, *v1alpha3.ResourceClaimTemplateList, *resourcev1alpha3.ResourceClaimTemplateApplyConfiguration]( "resourceclaimtemplates", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1alpha2.ResourceClaimTemplate { return &v1alpha2.ResourceClaimTemplate{} }, - func() *v1alpha2.ResourceClaimTemplateList { return &v1alpha2.ResourceClaimTemplateList{} }), + func() *v1alpha3.ResourceClaimTemplate { return &v1alpha3.ResourceClaimTemplate{} }, + func() *v1alpha3.ResourceClaimTemplateList { return &v1alpha3.ResourceClaimTemplateList{} }), } } diff --git a/kubernetes/typed/resource/v1alpha2/resourceclass.go b/kubernetes/typed/resource/v1alpha3/resourceclass.go similarity index 65% rename from kubernetes/typed/resource/v1alpha2/resourceclass.go rename to kubernetes/typed/resource/v1alpha3/resourceclass.go index c4600d3475..0d88e96edf 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceclass.go +++ b/kubernetes/typed/resource/v1alpha3/resourceclass.go @@ -16,16 +16,16 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) @@ -38,32 +38,32 @@ type ResourceClassesGetter interface { // ResourceClassInterface has methods to work with ResourceClass resources. type ResourceClassInterface interface { - Create(ctx context.Context, resourceClass *v1alpha2.ResourceClass, opts v1.CreateOptions) (*v1alpha2.ResourceClass, error) - Update(ctx context.Context, resourceClass *v1alpha2.ResourceClass, opts v1.UpdateOptions) (*v1alpha2.ResourceClass, error) + Create(ctx context.Context, resourceClass *v1alpha3.ResourceClass, opts v1.CreateOptions) (*v1alpha3.ResourceClass, error) + Update(ctx context.Context, resourceClass *v1alpha3.ResourceClass, opts v1.UpdateOptions) (*v1alpha3.ResourceClass, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.ResourceClass, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClassList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha3.ResourceClass, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.ResourceClassList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClass, err error) - Apply(ctx context.Context, resourceClass *resourcev1alpha2.ResourceClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClass, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClass, err error) + Apply(ctx context.Context, resourceClass *resourcev1alpha3.ResourceClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClass, err error) ResourceClassExpansion } // resourceClasses implements ResourceClassInterface type resourceClasses struct { - *gentype.ClientWithListAndApply[*v1alpha2.ResourceClass, *v1alpha2.ResourceClassList, *resourcev1alpha2.ResourceClassApplyConfiguration] + *gentype.ClientWithListAndApply[*v1alpha3.ResourceClass, *v1alpha3.ResourceClassList, *resourcev1alpha3.ResourceClassApplyConfiguration] } // newResourceClasses returns a ResourceClasses -func newResourceClasses(c *ResourceV1alpha2Client) *resourceClasses { +func newResourceClasses(c *ResourceV1alpha3Client) *resourceClasses { return &resourceClasses{ - gentype.NewClientWithListAndApply[*v1alpha2.ResourceClass, *v1alpha2.ResourceClassList, *resourcev1alpha2.ResourceClassApplyConfiguration]( + gentype.NewClientWithListAndApply[*v1alpha3.ResourceClass, *v1alpha3.ResourceClassList, *resourcev1alpha3.ResourceClassApplyConfiguration]( "resourceclasses", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1alpha2.ResourceClass { return &v1alpha2.ResourceClass{} }, - func() *v1alpha2.ResourceClassList { return &v1alpha2.ResourceClassList{} }), + func() *v1alpha3.ResourceClass { return &v1alpha3.ResourceClass{} }, + func() *v1alpha3.ResourceClassList { return &v1alpha3.ResourceClassList{} }), } } diff --git a/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go b/kubernetes/typed/resource/v1alpha3/resourceclassparameters.go similarity index 66% rename from kubernetes/typed/resource/v1alpha2/resourceclassparameters.go rename to kubernetes/typed/resource/v1alpha3/resourceclassparameters.go index e7cdddce4d..42db8f7059 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceclassparameters.go +++ b/kubernetes/typed/resource/v1alpha3/resourceclassparameters.go @@ -16,16 +16,16 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) @@ -38,32 +38,32 @@ type ResourceClassParametersGetter interface { // ResourceClassParametersInterface has methods to work with ResourceClassParameters resources. type ResourceClassParametersInterface interface { - Create(ctx context.Context, resourceClassParameters *v1alpha2.ResourceClassParameters, opts v1.CreateOptions) (*v1alpha2.ResourceClassParameters, error) - Update(ctx context.Context, resourceClassParameters *v1alpha2.ResourceClassParameters, opts v1.UpdateOptions) (*v1alpha2.ResourceClassParameters, error) + Create(ctx context.Context, resourceClassParameters *v1alpha3.ResourceClassParameters, opts v1.CreateOptions) (*v1alpha3.ResourceClassParameters, error) + Update(ctx context.Context, resourceClassParameters *v1alpha3.ResourceClassParameters, opts v1.UpdateOptions) (*v1alpha3.ResourceClassParameters, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.ResourceClassParameters, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceClassParametersList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha3.ResourceClassParameters, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.ResourceClassParametersList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceClassParameters, err error) - Apply(ctx context.Context, resourceClassParameters *resourcev1alpha2.ResourceClassParametersApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceClassParameters, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClassParameters, err error) + Apply(ctx context.Context, resourceClassParameters *resourcev1alpha3.ResourceClassParametersApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClassParameters, err error) ResourceClassParametersExpansion } // resourceClassParameters implements ResourceClassParametersInterface type resourceClassParameters struct { - *gentype.ClientWithListAndApply[*v1alpha2.ResourceClassParameters, *v1alpha2.ResourceClassParametersList, *resourcev1alpha2.ResourceClassParametersApplyConfiguration] + *gentype.ClientWithListAndApply[*v1alpha3.ResourceClassParameters, *v1alpha3.ResourceClassParametersList, *resourcev1alpha3.ResourceClassParametersApplyConfiguration] } // newResourceClassParameters returns a ResourceClassParameters -func newResourceClassParameters(c *ResourceV1alpha2Client, namespace string) *resourceClassParameters { +func newResourceClassParameters(c *ResourceV1alpha3Client, namespace string) *resourceClassParameters { return &resourceClassParameters{ - gentype.NewClientWithListAndApply[*v1alpha2.ResourceClassParameters, *v1alpha2.ResourceClassParametersList, *resourcev1alpha2.ResourceClassParametersApplyConfiguration]( + gentype.NewClientWithListAndApply[*v1alpha3.ResourceClassParameters, *v1alpha3.ResourceClassParametersList, *resourcev1alpha3.ResourceClassParametersApplyConfiguration]( "resourceclassparameters", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1alpha2.ResourceClassParameters { return &v1alpha2.ResourceClassParameters{} }, - func() *v1alpha2.ResourceClassParametersList { return &v1alpha2.ResourceClassParametersList{} }), + func() *v1alpha3.ResourceClassParameters { return &v1alpha3.ResourceClassParameters{} }, + func() *v1alpha3.ResourceClassParametersList { return &v1alpha3.ResourceClassParametersList{} }), } } diff --git a/kubernetes/typed/resource/v1alpha2/resourceslice.go b/kubernetes/typed/resource/v1alpha3/resourceslice.go similarity index 65% rename from kubernetes/typed/resource/v1alpha2/resourceslice.go rename to kubernetes/typed/resource/v1alpha3/resourceslice.go index fafeab7061..0819041408 100644 --- a/kubernetes/typed/resource/v1alpha2/resourceslice.go +++ b/kubernetes/typed/resource/v1alpha3/resourceslice.go @@ -16,16 +16,16 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( "context" - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha2 "k8s.io/client-go/applyconfigurations/resource/v1alpha2" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" gentype "k8s.io/client-go/gentype" scheme "k8s.io/client-go/kubernetes/scheme" ) @@ -38,32 +38,32 @@ type ResourceSlicesGetter interface { // ResourceSliceInterface has methods to work with ResourceSlice resources. type ResourceSliceInterface interface { - Create(ctx context.Context, resourceSlice *v1alpha2.ResourceSlice, opts v1.CreateOptions) (*v1alpha2.ResourceSlice, error) - Update(ctx context.Context, resourceSlice *v1alpha2.ResourceSlice, opts v1.UpdateOptions) (*v1alpha2.ResourceSlice, error) + Create(ctx context.Context, resourceSlice *v1alpha3.ResourceSlice, opts v1.CreateOptions) (*v1alpha3.ResourceSlice, error) + Update(ctx context.Context, resourceSlice *v1alpha3.ResourceSlice, opts v1.UpdateOptions) (*v1alpha3.ResourceSlice, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha2.ResourceSlice, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha2.ResourceSliceList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha3.ResourceSlice, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.ResourceSliceList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha2.ResourceSlice, err error) - Apply(ctx context.Context, resourceSlice *resourcev1alpha2.ResourceSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha2.ResourceSlice, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceSlice, err error) + Apply(ctx context.Context, resourceSlice *resourcev1alpha3.ResourceSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceSlice, err error) ResourceSliceExpansion } // resourceSlices implements ResourceSliceInterface type resourceSlices struct { - *gentype.ClientWithListAndApply[*v1alpha2.ResourceSlice, *v1alpha2.ResourceSliceList, *resourcev1alpha2.ResourceSliceApplyConfiguration] + *gentype.ClientWithListAndApply[*v1alpha3.ResourceSlice, *v1alpha3.ResourceSliceList, *resourcev1alpha3.ResourceSliceApplyConfiguration] } // newResourceSlices returns a ResourceSlices -func newResourceSlices(c *ResourceV1alpha2Client) *resourceSlices { +func newResourceSlices(c *ResourceV1alpha3Client) *resourceSlices { return &resourceSlices{ - gentype.NewClientWithListAndApply[*v1alpha2.ResourceSlice, *v1alpha2.ResourceSliceList, *resourcev1alpha2.ResourceSliceApplyConfiguration]( + gentype.NewClientWithListAndApply[*v1alpha3.ResourceSlice, *v1alpha3.ResourceSliceList, *resourcev1alpha3.ResourceSliceApplyConfiguration]( "resourceslices", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1alpha2.ResourceSlice { return &v1alpha2.ResourceSlice{} }, - func() *v1alpha2.ResourceSliceList { return &v1alpha2.ResourceSliceList{} }), + func() *v1alpha3.ResourceSlice { return &v1alpha3.ResourceSlice{} }, + func() *v1alpha3.ResourceSliceList { return &v1alpha3.ResourceSliceList{} }), } } diff --git a/listers/resource/v1alpha2/expansion_generated.go b/listers/resource/v1alpha3/expansion_generated.go similarity index 99% rename from listers/resource/v1alpha2/expansion_generated.go rename to listers/resource/v1alpha3/expansion_generated.go index 68861832d9..bc580e3d23 100644 --- a/listers/resource/v1alpha2/expansion_generated.go +++ b/listers/resource/v1alpha3/expansion_generated.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 // PodSchedulingContextListerExpansion allows custom methods to be added to // PodSchedulingContextLister. diff --git a/listers/resource/v1alpha2/podschedulingcontext.go b/listers/resource/v1alpha3/podschedulingcontext.go similarity index 81% rename from listers/resource/v1alpha2/podschedulingcontext.go rename to listers/resource/v1alpha3/podschedulingcontext.go index 9aca7bfbf9..ed9b049432 100644 --- a/listers/resource/v1alpha2/podschedulingcontext.go +++ b/listers/resource/v1alpha3/podschedulingcontext.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" @@ -30,7 +30,7 @@ import ( type PodSchedulingContextLister interface { // List lists all PodSchedulingContexts in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.PodSchedulingContext, err error) + List(selector labels.Selector) (ret []*v1alpha3.PodSchedulingContext, err error) // PodSchedulingContexts returns an object that can list and get PodSchedulingContexts. PodSchedulingContexts(namespace string) PodSchedulingContextNamespaceLister PodSchedulingContextListerExpansion @@ -38,17 +38,17 @@ type PodSchedulingContextLister interface { // podSchedulingContextLister implements the PodSchedulingContextLister interface. type podSchedulingContextLister struct { - listers.ResourceIndexer[*v1alpha2.PodSchedulingContext] + listers.ResourceIndexer[*v1alpha3.PodSchedulingContext] } // NewPodSchedulingContextLister returns a new PodSchedulingContextLister. func NewPodSchedulingContextLister(indexer cache.Indexer) PodSchedulingContextLister { - return &podSchedulingContextLister{listers.New[*v1alpha2.PodSchedulingContext](indexer, v1alpha2.Resource("podschedulingcontext"))} + return &podSchedulingContextLister{listers.New[*v1alpha3.PodSchedulingContext](indexer, v1alpha3.Resource("podschedulingcontext"))} } // PodSchedulingContexts returns an object that can list and get PodSchedulingContexts. func (s *podSchedulingContextLister) PodSchedulingContexts(namespace string) PodSchedulingContextNamespaceLister { - return podSchedulingContextNamespaceLister{listers.NewNamespaced[*v1alpha2.PodSchedulingContext](s.ResourceIndexer, namespace)} + return podSchedulingContextNamespaceLister{listers.NewNamespaced[*v1alpha3.PodSchedulingContext](s.ResourceIndexer, namespace)} } // PodSchedulingContextNamespaceLister helps list and get PodSchedulingContexts. @@ -56,15 +56,15 @@ func (s *podSchedulingContextLister) PodSchedulingContexts(namespace string) Pod type PodSchedulingContextNamespaceLister interface { // List lists all PodSchedulingContexts in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.PodSchedulingContext, err error) + List(selector labels.Selector) (ret []*v1alpha3.PodSchedulingContext, err error) // Get retrieves the PodSchedulingContext from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.PodSchedulingContext, error) + Get(name string) (*v1alpha3.PodSchedulingContext, error) PodSchedulingContextNamespaceListerExpansion } // podSchedulingContextNamespaceLister implements the PodSchedulingContextNamespaceLister // interface. type podSchedulingContextNamespaceLister struct { - listers.ResourceIndexer[*v1alpha2.PodSchedulingContext] + listers.ResourceIndexer[*v1alpha3.PodSchedulingContext] } diff --git a/listers/resource/v1alpha2/resourceclaim.go b/listers/resource/v1alpha3/resourceclaim.go similarity index 81% rename from listers/resource/v1alpha2/resourceclaim.go rename to listers/resource/v1alpha3/resourceclaim.go index 8d789314db..ac6a3e1564 100644 --- a/listers/resource/v1alpha2/resourceclaim.go +++ b/listers/resource/v1alpha3/resourceclaim.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" @@ -30,7 +30,7 @@ import ( type ResourceClaimLister interface { // List lists all ResourceClaims in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ResourceClaim, err error) + List(selector labels.Selector) (ret []*v1alpha3.ResourceClaim, err error) // ResourceClaims returns an object that can list and get ResourceClaims. ResourceClaims(namespace string) ResourceClaimNamespaceLister ResourceClaimListerExpansion @@ -38,17 +38,17 @@ type ResourceClaimLister interface { // resourceClaimLister implements the ResourceClaimLister interface. type resourceClaimLister struct { - listers.ResourceIndexer[*v1alpha2.ResourceClaim] + listers.ResourceIndexer[*v1alpha3.ResourceClaim] } // NewResourceClaimLister returns a new ResourceClaimLister. func NewResourceClaimLister(indexer cache.Indexer) ResourceClaimLister { - return &resourceClaimLister{listers.New[*v1alpha2.ResourceClaim](indexer, v1alpha2.Resource("resourceclaim"))} + return &resourceClaimLister{listers.New[*v1alpha3.ResourceClaim](indexer, v1alpha3.Resource("resourceclaim"))} } // ResourceClaims returns an object that can list and get ResourceClaims. func (s *resourceClaimLister) ResourceClaims(namespace string) ResourceClaimNamespaceLister { - return resourceClaimNamespaceLister{listers.NewNamespaced[*v1alpha2.ResourceClaim](s.ResourceIndexer, namespace)} + return resourceClaimNamespaceLister{listers.NewNamespaced[*v1alpha3.ResourceClaim](s.ResourceIndexer, namespace)} } // ResourceClaimNamespaceLister helps list and get ResourceClaims. @@ -56,15 +56,15 @@ func (s *resourceClaimLister) ResourceClaims(namespace string) ResourceClaimName type ResourceClaimNamespaceLister interface { // List lists all ResourceClaims in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ResourceClaim, err error) + List(selector labels.Selector) (ret []*v1alpha3.ResourceClaim, err error) // Get retrieves the ResourceClaim from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.ResourceClaim, error) + Get(name string) (*v1alpha3.ResourceClaim, error) ResourceClaimNamespaceListerExpansion } // resourceClaimNamespaceLister implements the ResourceClaimNamespaceLister // interface. type resourceClaimNamespaceLister struct { - listers.ResourceIndexer[*v1alpha2.ResourceClaim] + listers.ResourceIndexer[*v1alpha3.ResourceClaim] } diff --git a/listers/resource/v1alpha2/resourceclaimparameters.go b/listers/resource/v1alpha3/resourceclaimparameters.go similarity index 82% rename from listers/resource/v1alpha2/resourceclaimparameters.go rename to listers/resource/v1alpha3/resourceclaimparameters.go index ad751a6cee..aa5636b33d 100644 --- a/listers/resource/v1alpha2/resourceclaimparameters.go +++ b/listers/resource/v1alpha3/resourceclaimparameters.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" @@ -30,7 +30,7 @@ import ( type ResourceClaimParametersLister interface { // List lists all ResourceClaimParameters in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ResourceClaimParameters, err error) + List(selector labels.Selector) (ret []*v1alpha3.ResourceClaimParameters, err error) // ResourceClaimParameters returns an object that can list and get ResourceClaimParameters. ResourceClaimParameters(namespace string) ResourceClaimParametersNamespaceLister ResourceClaimParametersListerExpansion @@ -38,17 +38,17 @@ type ResourceClaimParametersLister interface { // resourceClaimParametersLister implements the ResourceClaimParametersLister interface. type resourceClaimParametersLister struct { - listers.ResourceIndexer[*v1alpha2.ResourceClaimParameters] + listers.ResourceIndexer[*v1alpha3.ResourceClaimParameters] } // NewResourceClaimParametersLister returns a new ResourceClaimParametersLister. func NewResourceClaimParametersLister(indexer cache.Indexer) ResourceClaimParametersLister { - return &resourceClaimParametersLister{listers.New[*v1alpha2.ResourceClaimParameters](indexer, v1alpha2.Resource("resourceclaimparameters"))} + return &resourceClaimParametersLister{listers.New[*v1alpha3.ResourceClaimParameters](indexer, v1alpha3.Resource("resourceclaimparameters"))} } // ResourceClaimParameters returns an object that can list and get ResourceClaimParameters. func (s *resourceClaimParametersLister) ResourceClaimParameters(namespace string) ResourceClaimParametersNamespaceLister { - return resourceClaimParametersNamespaceLister{listers.NewNamespaced[*v1alpha2.ResourceClaimParameters](s.ResourceIndexer, namespace)} + return resourceClaimParametersNamespaceLister{listers.NewNamespaced[*v1alpha3.ResourceClaimParameters](s.ResourceIndexer, namespace)} } // ResourceClaimParametersNamespaceLister helps list and get ResourceClaimParameters. @@ -56,15 +56,15 @@ func (s *resourceClaimParametersLister) ResourceClaimParameters(namespace string type ResourceClaimParametersNamespaceLister interface { // List lists all ResourceClaimParameters in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ResourceClaimParameters, err error) + List(selector labels.Selector) (ret []*v1alpha3.ResourceClaimParameters, err error) // Get retrieves the ResourceClaimParameters from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.ResourceClaimParameters, error) + Get(name string) (*v1alpha3.ResourceClaimParameters, error) ResourceClaimParametersNamespaceListerExpansion } // resourceClaimParametersNamespaceLister implements the ResourceClaimParametersNamespaceLister // interface. type resourceClaimParametersNamespaceLister struct { - listers.ResourceIndexer[*v1alpha2.ResourceClaimParameters] + listers.ResourceIndexer[*v1alpha3.ResourceClaimParameters] } diff --git a/listers/resource/v1alpha2/resourceclaimtemplate.go b/listers/resource/v1alpha3/resourceclaimtemplate.go similarity index 82% rename from listers/resource/v1alpha2/resourceclaimtemplate.go rename to listers/resource/v1alpha3/resourceclaimtemplate.go index 7ad1c769fa..6c15f82bba 100644 --- a/listers/resource/v1alpha2/resourceclaimtemplate.go +++ b/listers/resource/v1alpha3/resourceclaimtemplate.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" @@ -30,7 +30,7 @@ import ( type ResourceClaimTemplateLister interface { // List lists all ResourceClaimTemplates in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ResourceClaimTemplate, err error) + List(selector labels.Selector) (ret []*v1alpha3.ResourceClaimTemplate, err error) // ResourceClaimTemplates returns an object that can list and get ResourceClaimTemplates. ResourceClaimTemplates(namespace string) ResourceClaimTemplateNamespaceLister ResourceClaimTemplateListerExpansion @@ -38,17 +38,17 @@ type ResourceClaimTemplateLister interface { // resourceClaimTemplateLister implements the ResourceClaimTemplateLister interface. type resourceClaimTemplateLister struct { - listers.ResourceIndexer[*v1alpha2.ResourceClaimTemplate] + listers.ResourceIndexer[*v1alpha3.ResourceClaimTemplate] } // NewResourceClaimTemplateLister returns a new ResourceClaimTemplateLister. func NewResourceClaimTemplateLister(indexer cache.Indexer) ResourceClaimTemplateLister { - return &resourceClaimTemplateLister{listers.New[*v1alpha2.ResourceClaimTemplate](indexer, v1alpha2.Resource("resourceclaimtemplate"))} + return &resourceClaimTemplateLister{listers.New[*v1alpha3.ResourceClaimTemplate](indexer, v1alpha3.Resource("resourceclaimtemplate"))} } // ResourceClaimTemplates returns an object that can list and get ResourceClaimTemplates. func (s *resourceClaimTemplateLister) ResourceClaimTemplates(namespace string) ResourceClaimTemplateNamespaceLister { - return resourceClaimTemplateNamespaceLister{listers.NewNamespaced[*v1alpha2.ResourceClaimTemplate](s.ResourceIndexer, namespace)} + return resourceClaimTemplateNamespaceLister{listers.NewNamespaced[*v1alpha3.ResourceClaimTemplate](s.ResourceIndexer, namespace)} } // ResourceClaimTemplateNamespaceLister helps list and get ResourceClaimTemplates. @@ -56,15 +56,15 @@ func (s *resourceClaimTemplateLister) ResourceClaimTemplates(namespace string) R type ResourceClaimTemplateNamespaceLister interface { // List lists all ResourceClaimTemplates in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ResourceClaimTemplate, err error) + List(selector labels.Selector) (ret []*v1alpha3.ResourceClaimTemplate, err error) // Get retrieves the ResourceClaimTemplate from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.ResourceClaimTemplate, error) + Get(name string) (*v1alpha3.ResourceClaimTemplate, error) ResourceClaimTemplateNamespaceListerExpansion } // resourceClaimTemplateNamespaceLister implements the ResourceClaimTemplateNamespaceLister // interface. type resourceClaimTemplateNamespaceLister struct { - listers.ResourceIndexer[*v1alpha2.ResourceClaimTemplate] + listers.ResourceIndexer[*v1alpha3.ResourceClaimTemplate] } diff --git a/listers/resource/v1alpha2/resourceclass.go b/listers/resource/v1alpha3/resourceclass.go similarity index 80% rename from listers/resource/v1alpha2/resourceclass.go rename to listers/resource/v1alpha3/resourceclass.go index ecbe18a767..0c911003b0 100644 --- a/listers/resource/v1alpha2/resourceclass.go +++ b/listers/resource/v1alpha3/resourceclass.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" @@ -30,19 +30,19 @@ import ( type ResourceClassLister interface { // List lists all ResourceClasses in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ResourceClass, err error) + List(selector labels.Selector) (ret []*v1alpha3.ResourceClass, err error) // Get retrieves the ResourceClass from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.ResourceClass, error) + Get(name string) (*v1alpha3.ResourceClass, error) ResourceClassListerExpansion } // resourceClassLister implements the ResourceClassLister interface. type resourceClassLister struct { - listers.ResourceIndexer[*v1alpha2.ResourceClass] + listers.ResourceIndexer[*v1alpha3.ResourceClass] } // NewResourceClassLister returns a new ResourceClassLister. func NewResourceClassLister(indexer cache.Indexer) ResourceClassLister { - return &resourceClassLister{listers.New[*v1alpha2.ResourceClass](indexer, v1alpha2.Resource("resourceclass"))} + return &resourceClassLister{listers.New[*v1alpha3.ResourceClass](indexer, v1alpha3.Resource("resourceclass"))} } diff --git a/listers/resource/v1alpha2/resourceclassparameters.go b/listers/resource/v1alpha3/resourceclassparameters.go similarity index 82% rename from listers/resource/v1alpha2/resourceclassparameters.go rename to listers/resource/v1alpha3/resourceclassparameters.go index f731bfe133..beb0645a9e 100644 --- a/listers/resource/v1alpha2/resourceclassparameters.go +++ b/listers/resource/v1alpha3/resourceclassparameters.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" @@ -30,7 +30,7 @@ import ( type ResourceClassParametersLister interface { // List lists all ResourceClassParameters in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ResourceClassParameters, err error) + List(selector labels.Selector) (ret []*v1alpha3.ResourceClassParameters, err error) // ResourceClassParameters returns an object that can list and get ResourceClassParameters. ResourceClassParameters(namespace string) ResourceClassParametersNamespaceLister ResourceClassParametersListerExpansion @@ -38,17 +38,17 @@ type ResourceClassParametersLister interface { // resourceClassParametersLister implements the ResourceClassParametersLister interface. type resourceClassParametersLister struct { - listers.ResourceIndexer[*v1alpha2.ResourceClassParameters] + listers.ResourceIndexer[*v1alpha3.ResourceClassParameters] } // NewResourceClassParametersLister returns a new ResourceClassParametersLister. func NewResourceClassParametersLister(indexer cache.Indexer) ResourceClassParametersLister { - return &resourceClassParametersLister{listers.New[*v1alpha2.ResourceClassParameters](indexer, v1alpha2.Resource("resourceclassparameters"))} + return &resourceClassParametersLister{listers.New[*v1alpha3.ResourceClassParameters](indexer, v1alpha3.Resource("resourceclassparameters"))} } // ResourceClassParameters returns an object that can list and get ResourceClassParameters. func (s *resourceClassParametersLister) ResourceClassParameters(namespace string) ResourceClassParametersNamespaceLister { - return resourceClassParametersNamespaceLister{listers.NewNamespaced[*v1alpha2.ResourceClassParameters](s.ResourceIndexer, namespace)} + return resourceClassParametersNamespaceLister{listers.NewNamespaced[*v1alpha3.ResourceClassParameters](s.ResourceIndexer, namespace)} } // ResourceClassParametersNamespaceLister helps list and get ResourceClassParameters. @@ -56,15 +56,15 @@ func (s *resourceClassParametersLister) ResourceClassParameters(namespace string type ResourceClassParametersNamespaceLister interface { // List lists all ResourceClassParameters in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ResourceClassParameters, err error) + List(selector labels.Selector) (ret []*v1alpha3.ResourceClassParameters, err error) // Get retrieves the ResourceClassParameters from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.ResourceClassParameters, error) + Get(name string) (*v1alpha3.ResourceClassParameters, error) ResourceClassParametersNamespaceListerExpansion } // resourceClassParametersNamespaceLister implements the ResourceClassParametersNamespaceLister // interface. type resourceClassParametersNamespaceLister struct { - listers.ResourceIndexer[*v1alpha2.ResourceClassParameters] + listers.ResourceIndexer[*v1alpha3.ResourceClassParameters] } diff --git a/listers/resource/v1alpha2/resourceslice.go b/listers/resource/v1alpha3/resourceslice.go similarity index 80% rename from listers/resource/v1alpha2/resourceslice.go rename to listers/resource/v1alpha3/resourceslice.go index c5937df827..ae87b8b66d 100644 --- a/listers/resource/v1alpha2/resourceslice.go +++ b/listers/resource/v1alpha3/resourceslice.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1alpha2 +package v1alpha3 import ( - v1alpha2 "k8s.io/api/resource/v1alpha2" + v1alpha3 "k8s.io/api/resource/v1alpha3" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/listers" "k8s.io/client-go/tools/cache" @@ -30,19 +30,19 @@ import ( type ResourceSliceLister interface { // List lists all ResourceSlices in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha2.ResourceSlice, err error) + List(selector labels.Selector) (ret []*v1alpha3.ResourceSlice, err error) // Get retrieves the ResourceSlice from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha2.ResourceSlice, error) + Get(name string) (*v1alpha3.ResourceSlice, error) ResourceSliceListerExpansion } // resourceSliceLister implements the ResourceSliceLister interface. type resourceSliceLister struct { - listers.ResourceIndexer[*v1alpha2.ResourceSlice] + listers.ResourceIndexer[*v1alpha3.ResourceSlice] } // NewResourceSliceLister returns a new ResourceSliceLister. func NewResourceSliceLister(indexer cache.Indexer) ResourceSliceLister { - return &resourceSliceLister{listers.New[*v1alpha2.ResourceSlice](indexer, v1alpha2.Resource("resourceslice"))} + return &resourceSliceLister{listers.New[*v1alpha3.ResourceSlice](indexer, v1alpha3.Resource("resourceslice"))} } From a7f430b8bb75cf747223b573903838f48c0a3622 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Thu, 13 Jun 2024 17:25:39 +0200 Subject: [PATCH 139/159] DRA: remove immediate allocation As agreed in https://github.com/kubernetes/enhancements/pull/4709, immediate allocation is one of those features which can be removed because it makes no sense for structured parameters and the justification for classic DRA is weak. Kubernetes-commit: de5742ae83c8d77268a7caf5f3b1f418c4a13a84 --- applyconfigurations/internal/internal.go | 3 --- .../resource/v1alpha3/resourceclaimspec.go | 13 ------------- 2 files changed, 16 deletions(-) diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 0a9b23bb23..56536c2bb9 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -12419,9 +12419,6 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.resource.v1alpha3.ResourceClaimSpec map: fields: - - name: allocationMode - type: - scalar: string - name: parametersRef type: namedType: io.k8s.api.resource.v1alpha3.ResourceClaimParametersReference diff --git a/applyconfigurations/resource/v1alpha3/resourceclaimspec.go b/applyconfigurations/resource/v1alpha3/resourceclaimspec.go index ea65036899..38bd0c5578 100644 --- a/applyconfigurations/resource/v1alpha3/resourceclaimspec.go +++ b/applyconfigurations/resource/v1alpha3/resourceclaimspec.go @@ -18,16 +18,11 @@ limitations under the License. package v1alpha3 -import ( - resourcev1alpha3 "k8s.io/api/resource/v1alpha3" -) - // ResourceClaimSpecApplyConfiguration represents a declarative configuration of the ResourceClaimSpec type for use // with apply. type ResourceClaimSpecApplyConfiguration struct { ResourceClassName *string `json:"resourceClassName,omitempty"` ParametersRef *ResourceClaimParametersReferenceApplyConfiguration `json:"parametersRef,omitempty"` - AllocationMode *resourcev1alpha3.AllocationMode `json:"allocationMode,omitempty"` } // ResourceClaimSpecApplyConfiguration constructs a declarative configuration of the ResourceClaimSpec type for use with @@ -51,11 +46,3 @@ func (b *ResourceClaimSpecApplyConfiguration) WithParametersRef(value *ResourceC b.ParametersRef = value return b } - -// WithAllocationMode sets the AllocationMode field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the AllocationMode field is set to the value of the last call. -func (b *ResourceClaimSpecApplyConfiguration) WithAllocationMode(value resourcev1alpha3.AllocationMode) *ResourceClaimSpecApplyConfiguration { - b.AllocationMode = &value - return b -} From e0bc24e153d55d6f019f5241fbff5cc559bbda73 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Thu, 13 Jun 2024 18:43:17 +0200 Subject: [PATCH 140/159] DRA: remove "sharable" from claim allocation result Now all claims are shareable up to the limit imposed by the size of the "reserverFor" array. This is one of the agreed simplifications for 1.31. Kubernetes-commit: 8a629b9f150c1042e2918043e6012a4f22742b19 --- applyconfigurations/internal/internal.go | 6 ------ .../resource/v1alpha3/allocationresult.go | 9 --------- .../resource/v1alpha3/resourceclaimparameters.go | 9 --------- 3 files changed, 24 deletions(-) diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 56536c2bb9..36dd3698d6 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -12166,9 +12166,6 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.resource.v1alpha3.ResourceHandle elementRelationship: atomic - - name: shareable - type: - scalar: boolean - name: io.k8s.api.resource.v1alpha3.DriverAllocationResult map: fields: @@ -12387,9 +12384,6 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - - name: shareable - type: - scalar: boolean - name: io.k8s.api.resource.v1alpha3.ResourceClaimParametersReference map: fields: diff --git a/applyconfigurations/resource/v1alpha3/allocationresult.go b/applyconfigurations/resource/v1alpha3/allocationresult.go index cf3cde948c..e6d1df8635 100644 --- a/applyconfigurations/resource/v1alpha3/allocationresult.go +++ b/applyconfigurations/resource/v1alpha3/allocationresult.go @@ -27,7 +27,6 @@ import ( type AllocationResultApplyConfiguration struct { ResourceHandles []ResourceHandleApplyConfiguration `json:"resourceHandles,omitempty"` AvailableOnNodes *v1.NodeSelectorApplyConfiguration `json:"availableOnNodes,omitempty"` - Shareable *bool `json:"shareable,omitempty"` } // AllocationResultApplyConfiguration constructs a declarative configuration of the AllocationResult type for use with @@ -56,11 +55,3 @@ func (b *AllocationResultApplyConfiguration) WithAvailableOnNodes(value *v1.Node b.AvailableOnNodes = value return b } - -// WithShareable sets the Shareable field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Shareable field is set to the value of the last call. -func (b *AllocationResultApplyConfiguration) WithShareable(value bool) *AllocationResultApplyConfiguration { - b.Shareable = &value - return b -} diff --git a/applyconfigurations/resource/v1alpha3/resourceclaimparameters.go b/applyconfigurations/resource/v1alpha3/resourceclaimparameters.go index ef29f99bfe..fe00f1dad4 100644 --- a/applyconfigurations/resource/v1alpha3/resourceclaimparameters.go +++ b/applyconfigurations/resource/v1alpha3/resourceclaimparameters.go @@ -33,7 +33,6 @@ type ResourceClaimParametersApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` GeneratedFrom *ResourceClaimParametersReferenceApplyConfiguration `json:"generatedFrom,omitempty"` - Shareable *bool `json:"shareable,omitempty"` DriverRequests []DriverRequestsApplyConfiguration `json:"driverRequests,omitempty"` } @@ -250,14 +249,6 @@ func (b *ResourceClaimParametersApplyConfiguration) WithGeneratedFrom(value *Res return b } -// WithShareable sets the Shareable field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Shareable field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithShareable(value bool) *ResourceClaimParametersApplyConfiguration { - b.Shareable = &value - return b -} - // WithDriverRequests adds the given value to the DriverRequests field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the DriverRequests field. From a7db3ade6238d9caf4647a75d3610810f7e355d2 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Tue, 18 Jun 2024 17:47:29 +0200 Subject: [PATCH 141/159] DRA: new API for 1.31 This is a complete revamp of the original API. Some of the key differences: - refocused on structured parameters and allocating devices - support for constraints across devices - support for allocating "all" or a fixed amount of similar devices in a single request - no class for ResourceClaims, instead individual device requests are associated with a mandatory DeviceClass For the sake of simplicity, optional basic types (ints, strings) where the null value is the default are represented as values in the API types. This makes Go code simpler because it doesn't have to check for nil (consumers) and values can be set directly (producers). The effect is that in protobuf, these fields always get encoded because `opt` only has an effect for pointers. The roundtrip test data for v1.29.0 and v1.30.0 changes because of the new "request" field. This is considered acceptable because the entire `claims` field in the pod spec is still alpha. The implementation is complete enough to bring up the apiserver. Adapting other components follows. Kubernetes-commit: 91d7882e867da25ae8014f679db32b20e35e89b4 --- applyconfigurations/core/v1/resourceclaim.go | 11 +- applyconfigurations/internal/internal.go | 423 +++++++++--------- .../resource/v1alpha3/allocationresult.go | 36 +- .../v1alpha3/allocationresultmodel.go | 39 -- .../resource/v1alpha3/basicdevice.go | 65 +++ ...esourcesfilter.go => celdeviceselector.go} | 20 +- ...resourcesallocationresult.go => device.go} | 23 +- .../v1alpha3/deviceallocationconfiguration.go | 63 +++ .../v1alpha3/deviceallocationresult.go | 58 +++ .../resource/v1alpha3/deviceattribute.go | 66 +++ .../resource/v1alpha3/deviceclaim.go | 72 +++ .../v1alpha3/deviceclaimconfiguration.go | 50 +++ ...ourceclaimparameters.go => deviceclass.go} | 102 ++--- .../v1alpha3/deviceclassconfiguration.go | 39 ++ .../resource/v1alpha3/deviceclassspec.go | 71 +++ .../resource/v1alpha3/deviceconfiguration.go | 39 ++ .../resource/v1alpha3/deviceconstraint.go | 54 +++ .../resource/v1alpha3/devicerequest.go | 93 ++++ .../v1alpha3/devicerequestallocationresult.go | 66 +++ .../resource/v1alpha3/deviceselector.go | 39 ++ .../v1alpha3/driverallocationresult.go | 52 --- .../resource/v1alpha3/driverrequests.go | 66 --- .../v1alpha3/namedresourcesattribute.go | 100 ----- .../v1alpha3/namedresourcesattributevalue.go | 97 ---- .../v1alpha3/namedresourcesinstance.go | 53 --- .../v1alpha3/namedresourcesintslice.go | 41 -- .../v1alpha3/namedresourcesrequest.go | 39 -- .../v1alpha3/namedresourcesresources.go | 44 -- .../v1alpha3/namedresourcesstringslice.go | 41 -- ...meters.go => opaquedeviceconfiguration.go} | 22 +- .../resourceclaimparametersreference.go | 57 --- .../resource/v1alpha3/resourceclaimspec.go | 20 +- .../resource/v1alpha3/resourceclaimstatus.go | 9 - .../resource/v1alpha3/resourceclass.go | 281 ------------ .../v1alpha3/resourceclassparameters.go | 283 ------------ .../resourceclassparametersreference.go | 66 --- .../resource/v1alpha3/resourcefilter.go | 48 -- .../resource/v1alpha3/resourcefiltermodel.go | 39 -- .../resource/v1alpha3/resourcehandle.go | 57 --- .../resource/v1alpha3/resourcemodel.go | 39 -- .../resource/v1alpha3/resourcepool.go | 57 +++ .../resource/v1alpha3/resourcerequest.go | 52 --- .../resource/v1alpha3/resourcerequestmodel.go | 39 -- .../resource/v1alpha3/resourceslice.go | 28 +- .../resource/v1alpha3/resourceslicespec.go | 93 ++++ .../v1alpha3/structuredresourcehandle.go | 75 ---- applyconfigurations/utils.go | 88 ++-- informers/generic.go | 8 +- .../{resourceclass.go => deviceclass.go} | 38 +- informers/resource/v1alpha3/interface.go | 28 +- .../v1alpha3/resourceclaimparameters.go | 90 ---- .../v1alpha3/resourceclassparameters.go | 90 ---- .../typed/resource/v1alpha3/deviceclass.go | 69 +++ .../v1alpha3/fake/fake_deviceclass.go | 151 +++++++ .../v1alpha3/fake/fake_resource_client.go | 16 +- .../fake/fake_resourceclaimparameters.go | 160 ------- .../v1alpha3/fake/fake_resourceclass.go | 151 ------- .../fake/fake_resourceclassparameters.go | 160 ------- .../resource/v1alpha3/generated_expansion.go | 8 +- .../resource/v1alpha3/resource_client.go | 20 +- .../v1alpha3/resourceclaimparameters.go | 69 --- .../typed/resource/v1alpha3/resourceclass.go | 69 --- .../v1alpha3/resourceclassparameters.go | 69 --- .../{resourceclass.go => deviceclass.go} | 26 +- .../resource/v1alpha3/expansion_generated.go | 24 +- .../v1alpha3/resourceclaimparameters.go | 70 --- .../v1alpha3/resourceclassparameters.go | 70 --- 67 files changed, 1567 insertions(+), 3134 deletions(-) delete mode 100644 applyconfigurations/resource/v1alpha3/allocationresultmodel.go create mode 100644 applyconfigurations/resource/v1alpha3/basicdevice.go rename applyconfigurations/resource/v1alpha3/{namedresourcesfilter.go => celdeviceselector.go} (50%) rename applyconfigurations/resource/v1alpha3/{namedresourcesallocationresult.go => device.go} (51%) create mode 100644 applyconfigurations/resource/v1alpha3/deviceallocationconfiguration.go create mode 100644 applyconfigurations/resource/v1alpha3/deviceallocationresult.go create mode 100644 applyconfigurations/resource/v1alpha3/deviceattribute.go create mode 100644 applyconfigurations/resource/v1alpha3/deviceclaim.go create mode 100644 applyconfigurations/resource/v1alpha3/deviceclaimconfiguration.go rename applyconfigurations/resource/v1alpha3/{resourceclaimparameters.go => deviceclass.go} (59%) create mode 100644 applyconfigurations/resource/v1alpha3/deviceclassconfiguration.go create mode 100644 applyconfigurations/resource/v1alpha3/deviceclassspec.go create mode 100644 applyconfigurations/resource/v1alpha3/deviceconfiguration.go create mode 100644 applyconfigurations/resource/v1alpha3/deviceconstraint.go create mode 100644 applyconfigurations/resource/v1alpha3/devicerequest.go create mode 100644 applyconfigurations/resource/v1alpha3/devicerequestallocationresult.go create mode 100644 applyconfigurations/resource/v1alpha3/deviceselector.go delete mode 100644 applyconfigurations/resource/v1alpha3/driverallocationresult.go delete mode 100644 applyconfigurations/resource/v1alpha3/driverrequests.go delete mode 100644 applyconfigurations/resource/v1alpha3/namedresourcesattribute.go delete mode 100644 applyconfigurations/resource/v1alpha3/namedresourcesattributevalue.go delete mode 100644 applyconfigurations/resource/v1alpha3/namedresourcesinstance.go delete mode 100644 applyconfigurations/resource/v1alpha3/namedresourcesintslice.go delete mode 100644 applyconfigurations/resource/v1alpha3/namedresourcesrequest.go delete mode 100644 applyconfigurations/resource/v1alpha3/namedresourcesresources.go delete mode 100644 applyconfigurations/resource/v1alpha3/namedresourcesstringslice.go rename applyconfigurations/resource/v1alpha3/{vendorparameters.go => opaquedeviceconfiguration.go} (55%) delete mode 100644 applyconfigurations/resource/v1alpha3/resourceclaimparametersreference.go delete mode 100644 applyconfigurations/resource/v1alpha3/resourceclass.go delete mode 100644 applyconfigurations/resource/v1alpha3/resourceclassparameters.go delete mode 100644 applyconfigurations/resource/v1alpha3/resourceclassparametersreference.go delete mode 100644 applyconfigurations/resource/v1alpha3/resourcefilter.go delete mode 100644 applyconfigurations/resource/v1alpha3/resourcefiltermodel.go delete mode 100644 applyconfigurations/resource/v1alpha3/resourcehandle.go delete mode 100644 applyconfigurations/resource/v1alpha3/resourcemodel.go create mode 100644 applyconfigurations/resource/v1alpha3/resourcepool.go delete mode 100644 applyconfigurations/resource/v1alpha3/resourcerequest.go delete mode 100644 applyconfigurations/resource/v1alpha3/resourcerequestmodel.go create mode 100644 applyconfigurations/resource/v1alpha3/resourceslicespec.go delete mode 100644 applyconfigurations/resource/v1alpha3/structuredresourcehandle.go rename informers/resource/v1alpha3/{resourceclass.go => deviceclass.go} (55%) delete mode 100644 informers/resource/v1alpha3/resourceclaimparameters.go delete mode 100644 informers/resource/v1alpha3/resourceclassparameters.go create mode 100644 kubernetes/typed/resource/v1alpha3/deviceclass.go create mode 100644 kubernetes/typed/resource/v1alpha3/fake/fake_deviceclass.go delete mode 100644 kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaimparameters.go delete mode 100644 kubernetes/typed/resource/v1alpha3/fake/fake_resourceclass.go delete mode 100644 kubernetes/typed/resource/v1alpha3/fake/fake_resourceclassparameters.go delete mode 100644 kubernetes/typed/resource/v1alpha3/resourceclaimparameters.go delete mode 100644 kubernetes/typed/resource/v1alpha3/resourceclass.go delete mode 100644 kubernetes/typed/resource/v1alpha3/resourceclassparameters.go rename listers/resource/v1alpha3/{resourceclass.go => deviceclass.go} (55%) delete mode 100644 listers/resource/v1alpha3/resourceclaimparameters.go delete mode 100644 listers/resource/v1alpha3/resourceclassparameters.go diff --git a/applyconfigurations/core/v1/resourceclaim.go b/applyconfigurations/core/v1/resourceclaim.go index a9d79ae341..b00c692485 100644 --- a/applyconfigurations/core/v1/resourceclaim.go +++ b/applyconfigurations/core/v1/resourceclaim.go @@ -21,7 +21,8 @@ package v1 // ResourceClaimApplyConfiguration represents a declarative configuration of the ResourceClaim type for use // with apply. type ResourceClaimApplyConfiguration struct { - Name *string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` + Request *string `json:"request,omitempty"` } // ResourceClaimApplyConfiguration constructs a declarative configuration of the ResourceClaim type for use with @@ -37,3 +38,11 @@ func (b *ResourceClaimApplyConfiguration) WithName(value string) *ResourceClaimA b.Name = &value return b } + +// WithRequest sets the Request field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Request field is set to the value of the last call. +func (b *ResourceClaimApplyConfiguration) WithRequest(value string) *ResourceClaimApplyConfiguration { + b.Request = &value + return b +} diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 36dd3698d6..018530854c 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -7432,6 +7432,9 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" + - name: request + type: + scalar: string - name: io.k8s.api.core.v1.ResourceFieldSelector map: fields: @@ -12157,47 +12160,78 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.resource.v1alpha3.AllocationResult map: fields: - - name: availableOnNodes + - name: controller + type: + scalar: string + - name: devices + type: + namedType: io.k8s.api.resource.v1alpha3.DeviceAllocationResult + default: {} + - name: nodeSelector type: namedType: io.k8s.api.core.v1.NodeSelector - - name: resourceHandles +- name: io.k8s.api.resource.v1alpha3.BasicDevice + map: + fields: + - name: attributes type: - list: + map: elementType: - namedType: io.k8s.api.resource.v1alpha3.ResourceHandle - elementRelationship: atomic -- name: io.k8s.api.resource.v1alpha3.DriverAllocationResult + namedType: io.k8s.api.resource.v1alpha3.DeviceAttribute + - name: capacity + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.resource.v1alpha3.CELDeviceSelector map: fields: - - name: namedResources - type: - namedType: io.k8s.api.resource.v1alpha3.NamedResourcesAllocationResult - - name: vendorRequestParameters + - name: expression type: - namedType: __untyped_atomic_ -- name: io.k8s.api.resource.v1alpha3.DriverRequests + scalar: string + default: "" +- name: io.k8s.api.resource.v1alpha3.Device map: fields: - - name: driverName + - name: basic + type: + namedType: io.k8s.api.resource.v1alpha3.BasicDevice + - name: name type: scalar: string + default: "" +- name: io.k8s.api.resource.v1alpha3.DeviceAllocationConfiguration + map: + fields: + - name: opaque + type: + namedType: io.k8s.api.resource.v1alpha3.OpaqueDeviceConfiguration - name: requests type: list: elementType: - namedType: io.k8s.api.resource.v1alpha3.ResourceRequest + scalar: string elementRelationship: atomic - - name: vendorParameters + - name: source type: - namedType: __untyped_atomic_ -- name: io.k8s.api.resource.v1alpha3.NamedResourcesAllocationResult + scalar: string + default: "" +- name: io.k8s.api.resource.v1alpha3.DeviceAllocationResult map: fields: - - name: name + - name: config type: - scalar: string - default: "" -- name: io.k8s.api.resource.v1alpha3.NamedResourcesAttribute + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.DeviceAllocationConfiguration + elementRelationship: atomic + - name: results + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.DeviceRequestAllocationResult + elementRelationship: atomic +- name: io.k8s.api.resource.v1alpha3.DeviceAttribute map: fields: - name: bool @@ -12206,79 +12240,160 @@ var schemaYAML = typed.YAMLObject(`types: - name: int type: scalar: numeric - - name: intSlice - type: - namedType: io.k8s.api.resource.v1alpha3.NamedResourcesIntSlice - - name: name - type: - scalar: string - default: "" - - name: quantity - type: - namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: string type: scalar: string - - name: stringSlice - type: - namedType: io.k8s.api.resource.v1alpha3.NamedResourcesStringSlice - name: version type: scalar: string -- name: io.k8s.api.resource.v1alpha3.NamedResourcesFilter +- name: io.k8s.api.resource.v1alpha3.DeviceClaim map: fields: - - name: selector + - name: config type: - scalar: string - default: "" -- name: io.k8s.api.resource.v1alpha3.NamedResourcesInstance - map: - fields: - - name: attributes + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.DeviceClaimConfiguration + elementRelationship: atomic + - name: constraints type: list: elementType: - namedType: io.k8s.api.resource.v1alpha3.NamedResourcesAttribute + namedType: io.k8s.api.resource.v1alpha3.DeviceConstraint elementRelationship: atomic - - name: name + - name: requests type: - scalar: string - default: "" -- name: io.k8s.api.resource.v1alpha3.NamedResourcesIntSlice + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.DeviceRequest + elementRelationship: atomic +- name: io.k8s.api.resource.v1alpha3.DeviceClaimConfiguration map: fields: - - name: ints + - name: opaque + type: + namedType: io.k8s.api.resource.v1alpha3.OpaqueDeviceConfiguration + - name: requests type: list: elementType: - scalar: numeric + scalar: string elementRelationship: atomic -- name: io.k8s.api.resource.v1alpha3.NamedResourcesRequest +- name: io.k8s.api.resource.v1alpha3.DeviceClass map: fields: - - name: selector + - name: apiVersion type: scalar: string - default: "" -- name: io.k8s.api.resource.v1alpha3.NamedResourcesResources + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.resource.v1alpha3.DeviceClassSpec + default: {} +- name: io.k8s.api.resource.v1alpha3.DeviceClassConfiguration map: fields: - - name: instances + - name: opaque + type: + namedType: io.k8s.api.resource.v1alpha3.OpaqueDeviceConfiguration +- name: io.k8s.api.resource.v1alpha3.DeviceClassSpec + map: + fields: + - name: config type: list: elementType: - namedType: io.k8s.api.resource.v1alpha3.NamedResourcesInstance + namedType: io.k8s.api.resource.v1alpha3.DeviceClassConfiguration elementRelationship: atomic -- name: io.k8s.api.resource.v1alpha3.NamedResourcesStringSlice + - name: selectors + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.DeviceSelector + elementRelationship: atomic + - name: suitableNodes + type: + namedType: io.k8s.api.core.v1.NodeSelector +- name: io.k8s.api.resource.v1alpha3.DeviceConstraint map: fields: - - name: strings + - name: matchAttribute + type: + scalar: string + - name: requests type: list: elementType: scalar: string elementRelationship: atomic +- name: io.k8s.api.resource.v1alpha3.DeviceRequest + map: + fields: + - name: adminAccess + type: + scalar: boolean + default: false + - name: allocationMode + type: + scalar: string + - name: count + type: + scalar: numeric + - name: deviceClassName + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: selectors + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.DeviceSelector + elementRelationship: atomic +- name: io.k8s.api.resource.v1alpha3.DeviceRequestAllocationResult + map: + fields: + - name: device + type: + scalar: string + default: "" + - name: driver + type: + scalar: string + default: "" + - name: pool + type: + scalar: string + default: "" + - name: request + type: + scalar: string + default: "" +- name: io.k8s.api.resource.v1alpha3.DeviceSelector + map: + fields: + - name: cel + type: + namedType: io.k8s.api.resource.v1alpha3.CELDeviceSelector +- name: io.k8s.api.resource.v1alpha3.OpaqueDeviceConfiguration + map: + fields: + - name: driver + type: + scalar: string + default: "" + - name: parameters + type: + namedType: __untyped_atomic_ - name: io.k8s.api.resource.v1alpha3.PodSchedulingContext map: fields: @@ -12362,48 +12477,13 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" -- name: io.k8s.api.resource.v1alpha3.ResourceClaimParameters - map: - fields: - - name: apiVersion - type: - scalar: string - - name: driverRequests - type: - list: - elementType: - namedType: io.k8s.api.resource.v1alpha3.DriverRequests - elementRelationship: atomic - - name: generatedFrom - type: - namedType: io.k8s.api.resource.v1alpha3.ResourceClaimParametersReference - - name: kind - type: - scalar: string - - name: metadata - type: - namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta - default: {} -- name: io.k8s.api.resource.v1alpha3.ResourceClaimParametersReference - map: - fields: - - name: apiGroup - type: - scalar: string - - name: kind - type: - scalar: string - default: "" - - name: name - type: - scalar: string - default: "" - name: io.k8s.api.resource.v1alpha3.ResourceClaimSchedulingStatus map: fields: - name: name type: scalar: string + default: "" - name: unsuitableNodes type: list: @@ -12413,13 +12493,13 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.resource.v1alpha3.ResourceClaimSpec map: fields: - - name: parametersRef - type: - namedType: io.k8s.api.resource.v1alpha3.ResourceClaimParametersReference - - name: resourceClassName + - name: controller type: scalar: string - default: "" + - name: devices + type: + namedType: io.k8s.api.resource.v1alpha3.DeviceClaim + default: {} - name: io.k8s.api.resource.v1alpha3.ResourceClaimStatus map: fields: @@ -12429,9 +12509,6 @@ var schemaYAML = typed.YAMLObject(`types: - name: deallocationRequested type: scalar: boolean - - name: driverName - type: - scalar: string - name: reservedFor type: list: @@ -12468,118 +12545,27 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.api.resource.v1alpha3.ResourceClaimSpec default: {} -- name: io.k8s.api.resource.v1alpha3.ResourceClass - map: - fields: - - name: apiVersion - type: - scalar: string - - name: driverName - type: - scalar: string - default: "" - - name: kind - type: - scalar: string - - name: metadata - type: - namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta - default: {} - - name: parametersRef - type: - namedType: io.k8s.api.resource.v1alpha3.ResourceClassParametersReference - - name: structuredParameters - type: - scalar: boolean - - name: suitableNodes - type: - namedType: io.k8s.api.core.v1.NodeSelector -- name: io.k8s.api.resource.v1alpha3.ResourceClassParameters - map: - fields: - - name: apiVersion - type: - scalar: string - - name: filters - type: - list: - elementType: - namedType: io.k8s.api.resource.v1alpha3.ResourceFilter - elementRelationship: atomic - - name: generatedFrom - type: - namedType: io.k8s.api.resource.v1alpha3.ResourceClassParametersReference - - name: kind - type: - scalar: string - - name: metadata - type: - namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta - default: {} - - name: vendorParameters - type: - list: - elementType: - namedType: io.k8s.api.resource.v1alpha3.VendorParameters - elementRelationship: atomic -- name: io.k8s.api.resource.v1alpha3.ResourceClassParametersReference +- name: io.k8s.api.resource.v1alpha3.ResourcePool map: fields: - - name: apiGroup - type: - scalar: string - - name: kind + - name: generation type: - scalar: string - default: "" + scalar: numeric + default: 0 - name: name type: scalar: string default: "" - - name: namespace - type: - scalar: string -- name: io.k8s.api.resource.v1alpha3.ResourceFilter - map: - fields: - - name: driverName - type: - scalar: string - - name: namedResources - type: - namedType: io.k8s.api.resource.v1alpha3.NamedResourcesFilter -- name: io.k8s.api.resource.v1alpha3.ResourceHandle - map: - fields: - - name: data - type: - scalar: string - - name: driverName - type: - scalar: string - default: "" - - name: structuredData + - name: resourceSliceCount type: - namedType: io.k8s.api.resource.v1alpha3.StructuredResourceHandle -- name: io.k8s.api.resource.v1alpha3.ResourceRequest - map: - fields: - - name: namedResources - type: - namedType: io.k8s.api.resource.v1alpha3.NamedResourcesRequest - - name: vendorParameters - type: - namedType: __untyped_atomic_ + scalar: numeric + default: 0 - name: io.k8s.api.resource.v1alpha3.ResourceSlice map: fields: - name: apiVersion type: scalar: string - - name: driverName - type: - scalar: string - default: "" - name: kind type: scalar: string @@ -12587,39 +12573,36 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta default: {} - - name: namedResources - type: - namedType: io.k8s.api.resource.v1alpha3.NamedResourcesResources - - name: nodeName + - name: spec type: - scalar: string -- name: io.k8s.api.resource.v1alpha3.StructuredResourceHandle + namedType: io.k8s.api.resource.v1alpha3.ResourceSliceSpec + default: {} +- name: io.k8s.api.resource.v1alpha3.ResourceSliceSpec map: fields: - - name: nodeName + - name: allNodes type: - scalar: string - - name: results + scalar: boolean + - name: devices type: list: elementType: - namedType: io.k8s.api.resource.v1alpha3.DriverAllocationResult + namedType: io.k8s.api.resource.v1alpha3.Device elementRelationship: atomic - - name: vendorClaimParameters - type: - namedType: __untyped_atomic_ - - name: vendorClassParameters + - name: driver type: - namedType: __untyped_atomic_ -- name: io.k8s.api.resource.v1alpha3.VendorParameters - map: - fields: - - name: driverName + scalar: string + default: "" + - name: nodeName type: scalar: string - - name: parameters + - name: nodeSelector type: - namedType: __untyped_atomic_ + namedType: io.k8s.api.core.v1.NodeSelector + - name: pool + type: + namedType: io.k8s.api.resource.v1alpha3.ResourcePool + default: {} - name: io.k8s.api.scheduling.v1.PriorityClass map: fields: diff --git a/applyconfigurations/resource/v1alpha3/allocationresult.go b/applyconfigurations/resource/v1alpha3/allocationresult.go index e6d1df8635..3090b2f9d3 100644 --- a/applyconfigurations/resource/v1alpha3/allocationresult.go +++ b/applyconfigurations/resource/v1alpha3/allocationresult.go @@ -25,8 +25,9 @@ import ( // AllocationResultApplyConfiguration represents a declarative configuration of the AllocationResult type for use // with apply. type AllocationResultApplyConfiguration struct { - ResourceHandles []ResourceHandleApplyConfiguration `json:"resourceHandles,omitempty"` - AvailableOnNodes *v1.NodeSelectorApplyConfiguration `json:"availableOnNodes,omitempty"` + Devices *DeviceAllocationResultApplyConfiguration `json:"devices,omitempty"` + NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"` + Controller *string `json:"controller,omitempty"` } // AllocationResultApplyConfiguration constructs a declarative configuration of the AllocationResult type for use with @@ -35,23 +36,26 @@ func AllocationResult() *AllocationResultApplyConfiguration { return &AllocationResultApplyConfiguration{} } -// WithResourceHandles adds the given value to the ResourceHandles field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the ResourceHandles field. -func (b *AllocationResultApplyConfiguration) WithResourceHandles(values ...*ResourceHandleApplyConfiguration) *AllocationResultApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithResourceHandles") - } - b.ResourceHandles = append(b.ResourceHandles, *values[i]) - } +// WithDevices sets the Devices field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Devices field is set to the value of the last call. +func (b *AllocationResultApplyConfiguration) WithDevices(value *DeviceAllocationResultApplyConfiguration) *AllocationResultApplyConfiguration { + b.Devices = value + return b +} + +// WithNodeSelector sets the NodeSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeSelector field is set to the value of the last call. +func (b *AllocationResultApplyConfiguration) WithNodeSelector(value *v1.NodeSelectorApplyConfiguration) *AllocationResultApplyConfiguration { + b.NodeSelector = value return b } -// WithAvailableOnNodes sets the AvailableOnNodes field in the declarative configuration to the given value +// WithController sets the Controller field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the AvailableOnNodes field is set to the value of the last call. -func (b *AllocationResultApplyConfiguration) WithAvailableOnNodes(value *v1.NodeSelectorApplyConfiguration) *AllocationResultApplyConfiguration { - b.AvailableOnNodes = value +// If called multiple times, the Controller field is set to the value of the last call. +func (b *AllocationResultApplyConfiguration) WithController(value string) *AllocationResultApplyConfiguration { + b.Controller = &value return b } diff --git a/applyconfigurations/resource/v1alpha3/allocationresultmodel.go b/applyconfigurations/resource/v1alpha3/allocationresultmodel.go deleted file mode 100644 index 197f882883..0000000000 --- a/applyconfigurations/resource/v1alpha3/allocationresultmodel.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha3 - -// AllocationResultModelApplyConfiguration represents a declarative configuration of the AllocationResultModel type for use -// with apply. -type AllocationResultModelApplyConfiguration struct { - NamedResources *NamedResourcesAllocationResultApplyConfiguration `json:"namedResources,omitempty"` -} - -// AllocationResultModelApplyConfiguration constructs a declarative configuration of the AllocationResultModel type for use with -// apply. -func AllocationResultModel() *AllocationResultModelApplyConfiguration { - return &AllocationResultModelApplyConfiguration{} -} - -// WithNamedResources sets the NamedResources field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the NamedResources field is set to the value of the last call. -func (b *AllocationResultModelApplyConfiguration) WithNamedResources(value *NamedResourcesAllocationResultApplyConfiguration) *AllocationResultModelApplyConfiguration { - b.NamedResources = value - return b -} diff --git a/applyconfigurations/resource/v1alpha3/basicdevice.go b/applyconfigurations/resource/v1alpha3/basicdevice.go new file mode 100644 index 0000000000..e6b7745082 --- /dev/null +++ b/applyconfigurations/resource/v1alpha3/basicdevice.go @@ -0,0 +1,65 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + v1alpha3 "k8s.io/api/resource/v1alpha3" + resource "k8s.io/apimachinery/pkg/api/resource" +) + +// BasicDeviceApplyConfiguration represents a declarative configuration of the BasicDevice type for use +// with apply. +type BasicDeviceApplyConfiguration struct { + Attributes map[v1alpha3.QualifiedName]DeviceAttributeApplyConfiguration `json:"attributes,omitempty"` + Capacity map[v1alpha3.QualifiedName]resource.Quantity `json:"capacity,omitempty"` +} + +// BasicDeviceApplyConfiguration constructs a declarative configuration of the BasicDevice type for use with +// apply. +func BasicDevice() *BasicDeviceApplyConfiguration { + return &BasicDeviceApplyConfiguration{} +} + +// WithAttributes puts the entries into the Attributes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Attributes field, +// overwriting an existing map entries in Attributes field with the same key. +func (b *BasicDeviceApplyConfiguration) WithAttributes(entries map[v1alpha3.QualifiedName]DeviceAttributeApplyConfiguration) *BasicDeviceApplyConfiguration { + if b.Attributes == nil && len(entries) > 0 { + b.Attributes = make(map[v1alpha3.QualifiedName]DeviceAttributeApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Attributes[k] = v + } + return b +} + +// WithCapacity puts the entries into the Capacity field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Capacity field, +// overwriting an existing map entries in Capacity field with the same key. +func (b *BasicDeviceApplyConfiguration) WithCapacity(entries map[v1alpha3.QualifiedName]resource.Quantity) *BasicDeviceApplyConfiguration { + if b.Capacity == nil && len(entries) > 0 { + b.Capacity = make(map[v1alpha3.QualifiedName]resource.Quantity, len(entries)) + } + for k, v := range entries { + b.Capacity[k] = v + } + return b +} diff --git a/applyconfigurations/resource/v1alpha3/namedresourcesfilter.go b/applyconfigurations/resource/v1alpha3/celdeviceselector.go similarity index 50% rename from applyconfigurations/resource/v1alpha3/namedresourcesfilter.go rename to applyconfigurations/resource/v1alpha3/celdeviceselector.go index 3a47beada4..c59b6a2e37 100644 --- a/applyconfigurations/resource/v1alpha3/namedresourcesfilter.go +++ b/applyconfigurations/resource/v1alpha3/celdeviceselector.go @@ -18,22 +18,22 @@ limitations under the License. package v1alpha3 -// NamedResourcesFilterApplyConfiguration represents a declarative configuration of the NamedResourcesFilter type for use +// CELDeviceSelectorApplyConfiguration represents a declarative configuration of the CELDeviceSelector type for use // with apply. -type NamedResourcesFilterApplyConfiguration struct { - Selector *string `json:"selector,omitempty"` +type CELDeviceSelectorApplyConfiguration struct { + Expression *string `json:"expression,omitempty"` } -// NamedResourcesFilterApplyConfiguration constructs a declarative configuration of the NamedResourcesFilter type for use with +// CELDeviceSelectorApplyConfiguration constructs a declarative configuration of the CELDeviceSelector type for use with // apply. -func NamedResourcesFilter() *NamedResourcesFilterApplyConfiguration { - return &NamedResourcesFilterApplyConfiguration{} +func CELDeviceSelector() *CELDeviceSelectorApplyConfiguration { + return &CELDeviceSelectorApplyConfiguration{} } -// WithSelector sets the Selector field in the declarative configuration to the given value +// WithExpression sets the Expression field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Selector field is set to the value of the last call. -func (b *NamedResourcesFilterApplyConfiguration) WithSelector(value string) *NamedResourcesFilterApplyConfiguration { - b.Selector = &value +// If called multiple times, the Expression field is set to the value of the last call. +func (b *CELDeviceSelectorApplyConfiguration) WithExpression(value string) *CELDeviceSelectorApplyConfiguration { + b.Expression = &value return b } diff --git a/applyconfigurations/resource/v1alpha3/namedresourcesallocationresult.go b/applyconfigurations/resource/v1alpha3/device.go similarity index 51% rename from applyconfigurations/resource/v1alpha3/namedresourcesallocationresult.go rename to applyconfigurations/resource/v1alpha3/device.go index 89509eecb0..efdb5f37a9 100644 --- a/applyconfigurations/resource/v1alpha3/namedresourcesallocationresult.go +++ b/applyconfigurations/resource/v1alpha3/device.go @@ -18,22 +18,31 @@ limitations under the License. package v1alpha3 -// NamedResourcesAllocationResultApplyConfiguration represents a declarative configuration of the NamedResourcesAllocationResult type for use +// DeviceApplyConfiguration represents a declarative configuration of the Device type for use // with apply. -type NamedResourcesAllocationResultApplyConfiguration struct { - Name *string `json:"name,omitempty"` +type DeviceApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Basic *BasicDeviceApplyConfiguration `json:"basic,omitempty"` } -// NamedResourcesAllocationResultApplyConfiguration constructs a declarative configuration of the NamedResourcesAllocationResult type for use with +// DeviceApplyConfiguration constructs a declarative configuration of the Device type for use with // apply. -func NamedResourcesAllocationResult() *NamedResourcesAllocationResultApplyConfiguration { - return &NamedResourcesAllocationResultApplyConfiguration{} +func Device() *DeviceApplyConfiguration { + return &DeviceApplyConfiguration{} } // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. -func (b *NamedResourcesAllocationResultApplyConfiguration) WithName(value string) *NamedResourcesAllocationResultApplyConfiguration { +func (b *DeviceApplyConfiguration) WithName(value string) *DeviceApplyConfiguration { b.Name = &value return b } + +// WithBasic sets the Basic field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Basic field is set to the value of the last call. +func (b *DeviceApplyConfiguration) WithBasic(value *BasicDeviceApplyConfiguration) *DeviceApplyConfiguration { + b.Basic = value + return b +} diff --git a/applyconfigurations/resource/v1alpha3/deviceallocationconfiguration.go b/applyconfigurations/resource/v1alpha3/deviceallocationconfiguration.go new file mode 100644 index 0000000000..342e724ef0 --- /dev/null +++ b/applyconfigurations/resource/v1alpha3/deviceallocationconfiguration.go @@ -0,0 +1,63 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + v1alpha3 "k8s.io/api/resource/v1alpha3" +) + +// DeviceAllocationConfigurationApplyConfiguration represents a declarative configuration of the DeviceAllocationConfiguration type for use +// with apply. +type DeviceAllocationConfigurationApplyConfiguration struct { + Source *v1alpha3.AllocationConfigSource `json:"source,omitempty"` + Requests []string `json:"requests,omitempty"` + DeviceConfigurationApplyConfiguration `json:",inline"` +} + +// DeviceAllocationConfigurationApplyConfiguration constructs a declarative configuration of the DeviceAllocationConfiguration type for use with +// apply. +func DeviceAllocationConfiguration() *DeviceAllocationConfigurationApplyConfiguration { + return &DeviceAllocationConfigurationApplyConfiguration{} +} + +// WithSource sets the Source field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Source field is set to the value of the last call. +func (b *DeviceAllocationConfigurationApplyConfiguration) WithSource(value v1alpha3.AllocationConfigSource) *DeviceAllocationConfigurationApplyConfiguration { + b.Source = &value + return b +} + +// WithRequests adds the given value to the Requests field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Requests field. +func (b *DeviceAllocationConfigurationApplyConfiguration) WithRequests(values ...string) *DeviceAllocationConfigurationApplyConfiguration { + for i := range values { + b.Requests = append(b.Requests, values[i]) + } + return b +} + +// WithOpaque sets the Opaque field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Opaque field is set to the value of the last call. +func (b *DeviceAllocationConfigurationApplyConfiguration) WithOpaque(value *OpaqueDeviceConfigurationApplyConfiguration) *DeviceAllocationConfigurationApplyConfiguration { + b.Opaque = value + return b +} diff --git a/applyconfigurations/resource/v1alpha3/deviceallocationresult.go b/applyconfigurations/resource/v1alpha3/deviceallocationresult.go new file mode 100644 index 0000000000..0cfb264b4e --- /dev/null +++ b/applyconfigurations/resource/v1alpha3/deviceallocationresult.go @@ -0,0 +1,58 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// DeviceAllocationResultApplyConfiguration represents a declarative configuration of the DeviceAllocationResult type for use +// with apply. +type DeviceAllocationResultApplyConfiguration struct { + Results []DeviceRequestAllocationResultApplyConfiguration `json:"results,omitempty"` + Config []DeviceAllocationConfigurationApplyConfiguration `json:"config,omitempty"` +} + +// DeviceAllocationResultApplyConfiguration constructs a declarative configuration of the DeviceAllocationResult type for use with +// apply. +func DeviceAllocationResult() *DeviceAllocationResultApplyConfiguration { + return &DeviceAllocationResultApplyConfiguration{} +} + +// WithResults adds the given value to the Results field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Results field. +func (b *DeviceAllocationResultApplyConfiguration) WithResults(values ...*DeviceRequestAllocationResultApplyConfiguration) *DeviceAllocationResultApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResults") + } + b.Results = append(b.Results, *values[i]) + } + return b +} + +// WithConfig adds the given value to the Config field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Config field. +func (b *DeviceAllocationResultApplyConfiguration) WithConfig(values ...*DeviceAllocationConfigurationApplyConfiguration) *DeviceAllocationResultApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConfig") + } + b.Config = append(b.Config, *values[i]) + } + return b +} diff --git a/applyconfigurations/resource/v1alpha3/deviceattribute.go b/applyconfigurations/resource/v1alpha3/deviceattribute.go new file mode 100644 index 0000000000..6b0b7a40ac --- /dev/null +++ b/applyconfigurations/resource/v1alpha3/deviceattribute.go @@ -0,0 +1,66 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// DeviceAttributeApplyConfiguration represents a declarative configuration of the DeviceAttribute type for use +// with apply. +type DeviceAttributeApplyConfiguration struct { + IntValue *int64 `json:"int,omitempty"` + BoolValue *bool `json:"bool,omitempty"` + StringValue *string `json:"string,omitempty"` + VersionValue *string `json:"version,omitempty"` +} + +// DeviceAttributeApplyConfiguration constructs a declarative configuration of the DeviceAttribute type for use with +// apply. +func DeviceAttribute() *DeviceAttributeApplyConfiguration { + return &DeviceAttributeApplyConfiguration{} +} + +// WithIntValue sets the IntValue field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IntValue field is set to the value of the last call. +func (b *DeviceAttributeApplyConfiguration) WithIntValue(value int64) *DeviceAttributeApplyConfiguration { + b.IntValue = &value + return b +} + +// WithBoolValue sets the BoolValue field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BoolValue field is set to the value of the last call. +func (b *DeviceAttributeApplyConfiguration) WithBoolValue(value bool) *DeviceAttributeApplyConfiguration { + b.BoolValue = &value + return b +} + +// WithStringValue sets the StringValue field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StringValue field is set to the value of the last call. +func (b *DeviceAttributeApplyConfiguration) WithStringValue(value string) *DeviceAttributeApplyConfiguration { + b.StringValue = &value + return b +} + +// WithVersionValue sets the VersionValue field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VersionValue field is set to the value of the last call. +func (b *DeviceAttributeApplyConfiguration) WithVersionValue(value string) *DeviceAttributeApplyConfiguration { + b.VersionValue = &value + return b +} diff --git a/applyconfigurations/resource/v1alpha3/deviceclaim.go b/applyconfigurations/resource/v1alpha3/deviceclaim.go new file mode 100644 index 0000000000..ce3ab56d8b --- /dev/null +++ b/applyconfigurations/resource/v1alpha3/deviceclaim.go @@ -0,0 +1,72 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// DeviceClaimApplyConfiguration represents a declarative configuration of the DeviceClaim type for use +// with apply. +type DeviceClaimApplyConfiguration struct { + Requests []DeviceRequestApplyConfiguration `json:"requests,omitempty"` + Constraints []DeviceConstraintApplyConfiguration `json:"constraints,omitempty"` + Config []DeviceClaimConfigurationApplyConfiguration `json:"config,omitempty"` +} + +// DeviceClaimApplyConfiguration constructs a declarative configuration of the DeviceClaim type for use with +// apply. +func DeviceClaim() *DeviceClaimApplyConfiguration { + return &DeviceClaimApplyConfiguration{} +} + +// WithRequests adds the given value to the Requests field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Requests field. +func (b *DeviceClaimApplyConfiguration) WithRequests(values ...*DeviceRequestApplyConfiguration) *DeviceClaimApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRequests") + } + b.Requests = append(b.Requests, *values[i]) + } + return b +} + +// WithConstraints adds the given value to the Constraints field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Constraints field. +func (b *DeviceClaimApplyConfiguration) WithConstraints(values ...*DeviceConstraintApplyConfiguration) *DeviceClaimApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConstraints") + } + b.Constraints = append(b.Constraints, *values[i]) + } + return b +} + +// WithConfig adds the given value to the Config field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Config field. +func (b *DeviceClaimApplyConfiguration) WithConfig(values ...*DeviceClaimConfigurationApplyConfiguration) *DeviceClaimApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConfig") + } + b.Config = append(b.Config, *values[i]) + } + return b +} diff --git a/applyconfigurations/resource/v1alpha3/deviceclaimconfiguration.go b/applyconfigurations/resource/v1alpha3/deviceclaimconfiguration.go new file mode 100644 index 0000000000..4cabe98599 --- /dev/null +++ b/applyconfigurations/resource/v1alpha3/deviceclaimconfiguration.go @@ -0,0 +1,50 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// DeviceClaimConfigurationApplyConfiguration represents a declarative configuration of the DeviceClaimConfiguration type for use +// with apply. +type DeviceClaimConfigurationApplyConfiguration struct { + Requests []string `json:"requests,omitempty"` + DeviceConfigurationApplyConfiguration `json:",inline"` +} + +// DeviceClaimConfigurationApplyConfiguration constructs a declarative configuration of the DeviceClaimConfiguration type for use with +// apply. +func DeviceClaimConfiguration() *DeviceClaimConfigurationApplyConfiguration { + return &DeviceClaimConfigurationApplyConfiguration{} +} + +// WithRequests adds the given value to the Requests field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Requests field. +func (b *DeviceClaimConfigurationApplyConfiguration) WithRequests(values ...string) *DeviceClaimConfigurationApplyConfiguration { + for i := range values { + b.Requests = append(b.Requests, values[i]) + } + return b +} + +// WithOpaque sets the Opaque field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Opaque field is set to the value of the last call. +func (b *DeviceClaimConfigurationApplyConfiguration) WithOpaque(value *OpaqueDeviceConfigurationApplyConfiguration) *DeviceClaimConfigurationApplyConfiguration { + b.Opaque = value + return b +} diff --git a/applyconfigurations/resource/v1alpha3/resourceclaimparameters.go b/applyconfigurations/resource/v1alpha3/deviceclass.go similarity index 59% rename from applyconfigurations/resource/v1alpha3/resourceclaimparameters.go rename to applyconfigurations/resource/v1alpha3/deviceclass.go index fe00f1dad4..abaadbb366 100644 --- a/applyconfigurations/resource/v1alpha3/resourceclaimparameters.go +++ b/applyconfigurations/resource/v1alpha3/deviceclass.go @@ -27,58 +27,55 @@ import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) -// ResourceClaimParametersApplyConfiguration represents a declarative configuration of the ResourceClaimParameters type for use +// DeviceClassApplyConfiguration represents a declarative configuration of the DeviceClass type for use // with apply. -type ResourceClaimParametersApplyConfiguration struct { +type DeviceClassApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - GeneratedFrom *ResourceClaimParametersReferenceApplyConfiguration `json:"generatedFrom,omitempty"` - DriverRequests []DriverRequestsApplyConfiguration `json:"driverRequests,omitempty"` + Spec *DeviceClassSpecApplyConfiguration `json:"spec,omitempty"` } -// ResourceClaimParameters constructs a declarative configuration of the ResourceClaimParameters type for use with +// DeviceClass constructs a declarative configuration of the DeviceClass type for use with // apply. -func ResourceClaimParameters(name, namespace string) *ResourceClaimParametersApplyConfiguration { - b := &ResourceClaimParametersApplyConfiguration{} +func DeviceClass(name string) *DeviceClassApplyConfiguration { + b := &DeviceClassApplyConfiguration{} b.WithName(name) - b.WithNamespace(namespace) - b.WithKind("ResourceClaimParameters") + b.WithKind("DeviceClass") b.WithAPIVersion("resource.k8s.io/v1alpha3") return b } -// ExtractResourceClaimParameters extracts the applied configuration owned by fieldManager from -// resourceClaimParameters. If no managedFields are found in resourceClaimParameters for fieldManager, a -// ResourceClaimParametersApplyConfiguration is returned with only the Name, Namespace (if applicable), +// ExtractDeviceClass extracts the applied configuration owned by fieldManager from +// deviceClass. If no managedFields are found in deviceClass for fieldManager, a +// DeviceClassApplyConfiguration is returned with only the Name, Namespace (if applicable), // APIVersion and Kind populated. It is possible that no managed fields were found for because other // field managers have taken ownership of all the fields previously owned by fieldManager, or because // the fieldManager never owned fields any fields. -// resourceClaimParameters must be a unmodified ResourceClaimParameters API object that was retrieved from the Kubernetes API. -// ExtractResourceClaimParameters provides a way to perform a extract/modify-in-place/apply workflow. +// deviceClass must be a unmodified DeviceClass API object that was retrieved from the Kubernetes API. +// ExtractDeviceClass provides a way to perform a extract/modify-in-place/apply workflow. // Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously // applied if another fieldManager has updated or force applied any of the previously applied fields. // Experimental! -func ExtractResourceClaimParameters(resourceClaimParameters *resourcev1alpha3.ResourceClaimParameters, fieldManager string) (*ResourceClaimParametersApplyConfiguration, error) { - return extractResourceClaimParameters(resourceClaimParameters, fieldManager, "") +func ExtractDeviceClass(deviceClass *resourcev1alpha3.DeviceClass, fieldManager string) (*DeviceClassApplyConfiguration, error) { + return extractDeviceClass(deviceClass, fieldManager, "") } -// ExtractResourceClaimParametersStatus is the same as ExtractResourceClaimParameters except +// ExtractDeviceClassStatus is the same as ExtractDeviceClass except // that it extracts the status subresource applied configuration. // Experimental! -func ExtractResourceClaimParametersStatus(resourceClaimParameters *resourcev1alpha3.ResourceClaimParameters, fieldManager string) (*ResourceClaimParametersApplyConfiguration, error) { - return extractResourceClaimParameters(resourceClaimParameters, fieldManager, "status") +func ExtractDeviceClassStatus(deviceClass *resourcev1alpha3.DeviceClass, fieldManager string) (*DeviceClassApplyConfiguration, error) { + return extractDeviceClass(deviceClass, fieldManager, "status") } -func extractResourceClaimParameters(resourceClaimParameters *resourcev1alpha3.ResourceClaimParameters, fieldManager string, subresource string) (*ResourceClaimParametersApplyConfiguration, error) { - b := &ResourceClaimParametersApplyConfiguration{} - err := managedfields.ExtractInto(resourceClaimParameters, internal.Parser().Type("io.k8s.api.resource.v1alpha3.ResourceClaimParameters"), fieldManager, b, subresource) +func extractDeviceClass(deviceClass *resourcev1alpha3.DeviceClass, fieldManager string, subresource string) (*DeviceClassApplyConfiguration, error) { + b := &DeviceClassApplyConfiguration{} + err := managedfields.ExtractInto(deviceClass, internal.Parser().Type("io.k8s.api.resource.v1alpha3.DeviceClass"), fieldManager, b, subresource) if err != nil { return nil, err } - b.WithName(resourceClaimParameters.Name) - b.WithNamespace(resourceClaimParameters.Namespace) + b.WithName(deviceClass.Name) - b.WithKind("ResourceClaimParameters") + b.WithKind("DeviceClass") b.WithAPIVersion("resource.k8s.io/v1alpha3") return b, nil } @@ -86,7 +83,7 @@ func extractResourceClaimParameters(resourceClaimParameters *resourcev1alpha3.Re // WithKind sets the Kind field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Kind field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithKind(value string) *ResourceClaimParametersApplyConfiguration { +func (b *DeviceClassApplyConfiguration) WithKind(value string) *DeviceClassApplyConfiguration { b.Kind = &value return b } @@ -94,7 +91,7 @@ func (b *ResourceClaimParametersApplyConfiguration) WithKind(value string) *Reso // WithAPIVersion sets the APIVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the APIVersion field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithAPIVersion(value string) *ResourceClaimParametersApplyConfiguration { +func (b *DeviceClassApplyConfiguration) WithAPIVersion(value string) *DeviceClassApplyConfiguration { b.APIVersion = &value return b } @@ -102,7 +99,7 @@ func (b *ResourceClaimParametersApplyConfiguration) WithAPIVersion(value string) // WithName sets the Name field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Name field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithName(value string) *ResourceClaimParametersApplyConfiguration { +func (b *DeviceClassApplyConfiguration) WithName(value string) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Name = &value return b @@ -111,7 +108,7 @@ func (b *ResourceClaimParametersApplyConfiguration) WithName(value string) *Reso // WithGenerateName sets the GenerateName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the GenerateName field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithGenerateName(value string) *ResourceClaimParametersApplyConfiguration { +func (b *DeviceClassApplyConfiguration) WithGenerateName(value string) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.GenerateName = &value return b @@ -120,7 +117,7 @@ func (b *ResourceClaimParametersApplyConfiguration) WithGenerateName(value strin // WithNamespace sets the Namespace field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Namespace field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithNamespace(value string) *ResourceClaimParametersApplyConfiguration { +func (b *DeviceClassApplyConfiguration) WithNamespace(value string) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Namespace = &value return b @@ -129,7 +126,7 @@ func (b *ResourceClaimParametersApplyConfiguration) WithNamespace(value string) // WithUID sets the UID field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the UID field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithUID(value types.UID) *ResourceClaimParametersApplyConfiguration { +func (b *DeviceClassApplyConfiguration) WithUID(value types.UID) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.UID = &value return b @@ -138,7 +135,7 @@ func (b *ResourceClaimParametersApplyConfiguration) WithUID(value types.UID) *Re // WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithResourceVersion(value string) *ResourceClaimParametersApplyConfiguration { +func (b *DeviceClassApplyConfiguration) WithResourceVersion(value string) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.ResourceVersion = &value return b @@ -147,7 +144,7 @@ func (b *ResourceClaimParametersApplyConfiguration) WithResourceVersion(value st // WithGeneration sets the Generation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Generation field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithGeneration(value int64) *ResourceClaimParametersApplyConfiguration { +func (b *DeviceClassApplyConfiguration) WithGeneration(value int64) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.Generation = &value return b @@ -156,7 +153,7 @@ func (b *ResourceClaimParametersApplyConfiguration) WithGeneration(value int64) // WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceClaimParametersApplyConfiguration { +func (b *DeviceClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.CreationTimestamp = &value return b @@ -165,7 +162,7 @@ func (b *ResourceClaimParametersApplyConfiguration) WithCreationTimestamp(value // WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceClaimParametersApplyConfiguration { +func (b *DeviceClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionTimestamp = &value return b @@ -174,7 +171,7 @@ func (b *ResourceClaimParametersApplyConfiguration) WithDeletionTimestamp(value // WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceClaimParametersApplyConfiguration { +func (b *DeviceClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() b.DeletionGracePeriodSeconds = &value return b @@ -184,7 +181,7 @@ func (b *ResourceClaimParametersApplyConfiguration) WithDeletionGracePeriodSecon // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Labels field, // overwriting an existing map entries in Labels field with the same key. -func (b *ResourceClaimParametersApplyConfiguration) WithLabels(entries map[string]string) *ResourceClaimParametersApplyConfiguration { +func (b *DeviceClassApplyConfiguration) WithLabels(entries map[string]string) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Labels == nil && len(entries) > 0 { b.Labels = make(map[string]string, len(entries)) @@ -199,7 +196,7 @@ func (b *ResourceClaimParametersApplyConfiguration) WithLabels(entries map[strin // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Annotations field, // overwriting an existing map entries in Annotations field with the same key. -func (b *ResourceClaimParametersApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceClaimParametersApplyConfiguration { +func (b *DeviceClassApplyConfiguration) WithAnnotations(entries map[string]string) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() if b.Annotations == nil && len(entries) > 0 { b.Annotations = make(map[string]string, len(entries)) @@ -213,7 +210,7 @@ func (b *ResourceClaimParametersApplyConfiguration) WithAnnotations(entries map[ // WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *ResourceClaimParametersApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceClaimParametersApplyConfiguration { +func (b *DeviceClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { if values[i] == nil { @@ -227,7 +224,7 @@ func (b *ResourceClaimParametersApplyConfiguration) WithOwnerReferences(values . // WithFinalizers adds the given value to the Finalizers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *ResourceClaimParametersApplyConfiguration) WithFinalizers(values ...string) *ResourceClaimParametersApplyConfiguration { +func (b *DeviceClassApplyConfiguration) WithFinalizers(values ...string) *DeviceClassApplyConfiguration { b.ensureObjectMetaApplyConfigurationExists() for i := range values { b.Finalizers = append(b.Finalizers, values[i]) @@ -235,35 +232,22 @@ func (b *ResourceClaimParametersApplyConfiguration) WithFinalizers(values ...str return b } -func (b *ResourceClaimParametersApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { +func (b *DeviceClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { if b.ObjectMetaApplyConfiguration == nil { b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} } } -// WithGeneratedFrom sets the GeneratedFrom field in the declarative configuration to the given value +// WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GeneratedFrom field is set to the value of the last call. -func (b *ResourceClaimParametersApplyConfiguration) WithGeneratedFrom(value *ResourceClaimParametersReferenceApplyConfiguration) *ResourceClaimParametersApplyConfiguration { - b.GeneratedFrom = value - return b -} - -// WithDriverRequests adds the given value to the DriverRequests field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the DriverRequests field. -func (b *ResourceClaimParametersApplyConfiguration) WithDriverRequests(values ...*DriverRequestsApplyConfiguration) *ResourceClaimParametersApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithDriverRequests") - } - b.DriverRequests = append(b.DriverRequests, *values[i]) - } +// If called multiple times, the Spec field is set to the value of the last call. +func (b *DeviceClassApplyConfiguration) WithSpec(value *DeviceClassSpecApplyConfiguration) *DeviceClassApplyConfiguration { + b.Spec = value return b } // GetName retrieves the value of the Name field in the declarative configuration. -func (b *ResourceClaimParametersApplyConfiguration) GetName() *string { +func (b *DeviceClassApplyConfiguration) GetName() *string { b.ensureObjectMetaApplyConfigurationExists() return b.Name } diff --git a/applyconfigurations/resource/v1alpha3/deviceclassconfiguration.go b/applyconfigurations/resource/v1alpha3/deviceclassconfiguration.go new file mode 100644 index 0000000000..cb3758a3e3 --- /dev/null +++ b/applyconfigurations/resource/v1alpha3/deviceclassconfiguration.go @@ -0,0 +1,39 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// DeviceClassConfigurationApplyConfiguration represents a declarative configuration of the DeviceClassConfiguration type for use +// with apply. +type DeviceClassConfigurationApplyConfiguration struct { + DeviceConfigurationApplyConfiguration `json:",inline"` +} + +// DeviceClassConfigurationApplyConfiguration constructs a declarative configuration of the DeviceClassConfiguration type for use with +// apply. +func DeviceClassConfiguration() *DeviceClassConfigurationApplyConfiguration { + return &DeviceClassConfigurationApplyConfiguration{} +} + +// WithOpaque sets the Opaque field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Opaque field is set to the value of the last call. +func (b *DeviceClassConfigurationApplyConfiguration) WithOpaque(value *OpaqueDeviceConfigurationApplyConfiguration) *DeviceClassConfigurationApplyConfiguration { + b.Opaque = value + return b +} diff --git a/applyconfigurations/resource/v1alpha3/deviceclassspec.go b/applyconfigurations/resource/v1alpha3/deviceclassspec.go new file mode 100644 index 0000000000..d40a43de66 --- /dev/null +++ b/applyconfigurations/resource/v1alpha3/deviceclassspec.go @@ -0,0 +1,71 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + v1 "k8s.io/client-go/applyconfigurations/core/v1" +) + +// DeviceClassSpecApplyConfiguration represents a declarative configuration of the DeviceClassSpec type for use +// with apply. +type DeviceClassSpecApplyConfiguration struct { + Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"` + Config []DeviceClassConfigurationApplyConfiguration `json:"config,omitempty"` + SuitableNodes *v1.NodeSelectorApplyConfiguration `json:"suitableNodes,omitempty"` +} + +// DeviceClassSpecApplyConfiguration constructs a declarative configuration of the DeviceClassSpec type for use with +// apply. +func DeviceClassSpec() *DeviceClassSpecApplyConfiguration { + return &DeviceClassSpecApplyConfiguration{} +} + +// WithSelectors adds the given value to the Selectors field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Selectors field. +func (b *DeviceClassSpecApplyConfiguration) WithSelectors(values ...*DeviceSelectorApplyConfiguration) *DeviceClassSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSelectors") + } + b.Selectors = append(b.Selectors, *values[i]) + } + return b +} + +// WithConfig adds the given value to the Config field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Config field. +func (b *DeviceClassSpecApplyConfiguration) WithConfig(values ...*DeviceClassConfigurationApplyConfiguration) *DeviceClassSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConfig") + } + b.Config = append(b.Config, *values[i]) + } + return b +} + +// WithSuitableNodes sets the SuitableNodes field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SuitableNodes field is set to the value of the last call. +func (b *DeviceClassSpecApplyConfiguration) WithSuitableNodes(value *v1.NodeSelectorApplyConfiguration) *DeviceClassSpecApplyConfiguration { + b.SuitableNodes = value + return b +} diff --git a/applyconfigurations/resource/v1alpha3/deviceconfiguration.go b/applyconfigurations/resource/v1alpha3/deviceconfiguration.go new file mode 100644 index 0000000000..62c0d997de --- /dev/null +++ b/applyconfigurations/resource/v1alpha3/deviceconfiguration.go @@ -0,0 +1,39 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// DeviceConfigurationApplyConfiguration represents a declarative configuration of the DeviceConfiguration type for use +// with apply. +type DeviceConfigurationApplyConfiguration struct { + Opaque *OpaqueDeviceConfigurationApplyConfiguration `json:"opaque,omitempty"` +} + +// DeviceConfigurationApplyConfiguration constructs a declarative configuration of the DeviceConfiguration type for use with +// apply. +func DeviceConfiguration() *DeviceConfigurationApplyConfiguration { + return &DeviceConfigurationApplyConfiguration{} +} + +// WithOpaque sets the Opaque field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Opaque field is set to the value of the last call. +func (b *DeviceConfigurationApplyConfiguration) WithOpaque(value *OpaqueDeviceConfigurationApplyConfiguration) *DeviceConfigurationApplyConfiguration { + b.Opaque = value + return b +} diff --git a/applyconfigurations/resource/v1alpha3/deviceconstraint.go b/applyconfigurations/resource/v1alpha3/deviceconstraint.go new file mode 100644 index 0000000000..479acd57c2 --- /dev/null +++ b/applyconfigurations/resource/v1alpha3/deviceconstraint.go @@ -0,0 +1,54 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + v1alpha3 "k8s.io/api/resource/v1alpha3" +) + +// DeviceConstraintApplyConfiguration represents a declarative configuration of the DeviceConstraint type for use +// with apply. +type DeviceConstraintApplyConfiguration struct { + Requests []string `json:"requests,omitempty"` + MatchAttribute *v1alpha3.FullyQualifiedName `json:"matchAttribute,omitempty"` +} + +// DeviceConstraintApplyConfiguration constructs a declarative configuration of the DeviceConstraint type for use with +// apply. +func DeviceConstraint() *DeviceConstraintApplyConfiguration { + return &DeviceConstraintApplyConfiguration{} +} + +// WithRequests adds the given value to the Requests field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Requests field. +func (b *DeviceConstraintApplyConfiguration) WithRequests(values ...string) *DeviceConstraintApplyConfiguration { + for i := range values { + b.Requests = append(b.Requests, values[i]) + } + return b +} + +// WithMatchAttribute sets the MatchAttribute field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MatchAttribute field is set to the value of the last call. +func (b *DeviceConstraintApplyConfiguration) WithMatchAttribute(value v1alpha3.FullyQualifiedName) *DeviceConstraintApplyConfiguration { + b.MatchAttribute = &value + return b +} diff --git a/applyconfigurations/resource/v1alpha3/devicerequest.go b/applyconfigurations/resource/v1alpha3/devicerequest.go new file mode 100644 index 0000000000..e5c87efe47 --- /dev/null +++ b/applyconfigurations/resource/v1alpha3/devicerequest.go @@ -0,0 +1,93 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + resourcev1alpha3 "k8s.io/api/resource/v1alpha3" +) + +// DeviceRequestApplyConfiguration represents a declarative configuration of the DeviceRequest type for use +// with apply. +type DeviceRequestApplyConfiguration struct { + Name *string `json:"name,omitempty"` + DeviceClassName *string `json:"deviceClassName,omitempty"` + Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"` + AllocationMode *resourcev1alpha3.DeviceAllocationMode `json:"allocationMode,omitempty"` + Count *int64 `json:"count,omitempty"` + AdminAccess *bool `json:"adminAccess,omitempty"` +} + +// DeviceRequestApplyConfiguration constructs a declarative configuration of the DeviceRequest type for use with +// apply. +func DeviceRequest() *DeviceRequestApplyConfiguration { + return &DeviceRequestApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *DeviceRequestApplyConfiguration) WithName(value string) *DeviceRequestApplyConfiguration { + b.Name = &value + return b +} + +// WithDeviceClassName sets the DeviceClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeviceClassName field is set to the value of the last call. +func (b *DeviceRequestApplyConfiguration) WithDeviceClassName(value string) *DeviceRequestApplyConfiguration { + b.DeviceClassName = &value + return b +} + +// WithSelectors adds the given value to the Selectors field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Selectors field. +func (b *DeviceRequestApplyConfiguration) WithSelectors(values ...*DeviceSelectorApplyConfiguration) *DeviceRequestApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSelectors") + } + b.Selectors = append(b.Selectors, *values[i]) + } + return b +} + +// WithAllocationMode sets the AllocationMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllocationMode field is set to the value of the last call. +func (b *DeviceRequestApplyConfiguration) WithAllocationMode(value resourcev1alpha3.DeviceAllocationMode) *DeviceRequestApplyConfiguration { + b.AllocationMode = &value + return b +} + +// WithCount sets the Count field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Count field is set to the value of the last call. +func (b *DeviceRequestApplyConfiguration) WithCount(value int64) *DeviceRequestApplyConfiguration { + b.Count = &value + return b +} + +// WithAdminAccess sets the AdminAccess field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AdminAccess field is set to the value of the last call. +func (b *DeviceRequestApplyConfiguration) WithAdminAccess(value bool) *DeviceRequestApplyConfiguration { + b.AdminAccess = &value + return b +} diff --git a/applyconfigurations/resource/v1alpha3/devicerequestallocationresult.go b/applyconfigurations/resource/v1alpha3/devicerequestallocationresult.go new file mode 100644 index 0000000000..712b9bf9b1 --- /dev/null +++ b/applyconfigurations/resource/v1alpha3/devicerequestallocationresult.go @@ -0,0 +1,66 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// DeviceRequestAllocationResultApplyConfiguration represents a declarative configuration of the DeviceRequestAllocationResult type for use +// with apply. +type DeviceRequestAllocationResultApplyConfiguration struct { + Request *string `json:"request,omitempty"` + Driver *string `json:"driver,omitempty"` + Pool *string `json:"pool,omitempty"` + Device *string `json:"device,omitempty"` +} + +// DeviceRequestAllocationResultApplyConfiguration constructs a declarative configuration of the DeviceRequestAllocationResult type for use with +// apply. +func DeviceRequestAllocationResult() *DeviceRequestAllocationResultApplyConfiguration { + return &DeviceRequestAllocationResultApplyConfiguration{} +} + +// WithRequest sets the Request field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Request field is set to the value of the last call. +func (b *DeviceRequestAllocationResultApplyConfiguration) WithRequest(value string) *DeviceRequestAllocationResultApplyConfiguration { + b.Request = &value + return b +} + +// WithDriver sets the Driver field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Driver field is set to the value of the last call. +func (b *DeviceRequestAllocationResultApplyConfiguration) WithDriver(value string) *DeviceRequestAllocationResultApplyConfiguration { + b.Driver = &value + return b +} + +// WithPool sets the Pool field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Pool field is set to the value of the last call. +func (b *DeviceRequestAllocationResultApplyConfiguration) WithPool(value string) *DeviceRequestAllocationResultApplyConfiguration { + b.Pool = &value + return b +} + +// WithDevice sets the Device field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Device field is set to the value of the last call. +func (b *DeviceRequestAllocationResultApplyConfiguration) WithDevice(value string) *DeviceRequestAllocationResultApplyConfiguration { + b.Device = &value + return b +} diff --git a/applyconfigurations/resource/v1alpha3/deviceselector.go b/applyconfigurations/resource/v1alpha3/deviceselector.go new file mode 100644 index 0000000000..574299d15e --- /dev/null +++ b/applyconfigurations/resource/v1alpha3/deviceselector.go @@ -0,0 +1,39 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// DeviceSelectorApplyConfiguration represents a declarative configuration of the DeviceSelector type for use +// with apply. +type DeviceSelectorApplyConfiguration struct { + CEL *CELDeviceSelectorApplyConfiguration `json:"cel,omitempty"` +} + +// DeviceSelectorApplyConfiguration constructs a declarative configuration of the DeviceSelector type for use with +// apply. +func DeviceSelector() *DeviceSelectorApplyConfiguration { + return &DeviceSelectorApplyConfiguration{} +} + +// WithCEL sets the CEL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CEL field is set to the value of the last call. +func (b *DeviceSelectorApplyConfiguration) WithCEL(value *CELDeviceSelectorApplyConfiguration) *DeviceSelectorApplyConfiguration { + b.CEL = value + return b +} diff --git a/applyconfigurations/resource/v1alpha3/driverallocationresult.go b/applyconfigurations/resource/v1alpha3/driverallocationresult.go deleted file mode 100644 index 787c02660c..0000000000 --- a/applyconfigurations/resource/v1alpha3/driverallocationresult.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha3 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DriverAllocationResultApplyConfiguration represents a declarative configuration of the DriverAllocationResult type for use -// with apply. -type DriverAllocationResultApplyConfiguration struct { - VendorRequestParameters *runtime.RawExtension `json:"vendorRequestParameters,omitempty"` - AllocationResultModelApplyConfiguration `json:",inline"` -} - -// DriverAllocationResultApplyConfiguration constructs a declarative configuration of the DriverAllocationResult type for use with -// apply. -func DriverAllocationResult() *DriverAllocationResultApplyConfiguration { - return &DriverAllocationResultApplyConfiguration{} -} - -// WithVendorRequestParameters sets the VendorRequestParameters field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the VendorRequestParameters field is set to the value of the last call. -func (b *DriverAllocationResultApplyConfiguration) WithVendorRequestParameters(value runtime.RawExtension) *DriverAllocationResultApplyConfiguration { - b.VendorRequestParameters = &value - return b -} - -// WithNamedResources sets the NamedResources field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the NamedResources field is set to the value of the last call. -func (b *DriverAllocationResultApplyConfiguration) WithNamedResources(value *NamedResourcesAllocationResultApplyConfiguration) *DriverAllocationResultApplyConfiguration { - b.NamedResources = value - return b -} diff --git a/applyconfigurations/resource/v1alpha3/driverrequests.go b/applyconfigurations/resource/v1alpha3/driverrequests.go deleted file mode 100644 index f322e7930a..0000000000 --- a/applyconfigurations/resource/v1alpha3/driverrequests.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha3 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// DriverRequestsApplyConfiguration represents a declarative configuration of the DriverRequests type for use -// with apply. -type DriverRequestsApplyConfiguration struct { - DriverName *string `json:"driverName,omitempty"` - VendorParameters *runtime.RawExtension `json:"vendorParameters,omitempty"` - Requests []ResourceRequestApplyConfiguration `json:"requests,omitempty"` -} - -// DriverRequestsApplyConfiguration constructs a declarative configuration of the DriverRequests type for use with -// apply. -func DriverRequests() *DriverRequestsApplyConfiguration { - return &DriverRequestsApplyConfiguration{} -} - -// WithDriverName sets the DriverName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DriverName field is set to the value of the last call. -func (b *DriverRequestsApplyConfiguration) WithDriverName(value string) *DriverRequestsApplyConfiguration { - b.DriverName = &value - return b -} - -// WithVendorParameters sets the VendorParameters field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the VendorParameters field is set to the value of the last call. -func (b *DriverRequestsApplyConfiguration) WithVendorParameters(value runtime.RawExtension) *DriverRequestsApplyConfiguration { - b.VendorParameters = &value - return b -} - -// WithRequests adds the given value to the Requests field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Requests field. -func (b *DriverRequestsApplyConfiguration) WithRequests(values ...*ResourceRequestApplyConfiguration) *DriverRequestsApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithRequests") - } - b.Requests = append(b.Requests, *values[i]) - } - return b -} diff --git a/applyconfigurations/resource/v1alpha3/namedresourcesattribute.go b/applyconfigurations/resource/v1alpha3/namedresourcesattribute.go deleted file mode 100644 index 5028597812..0000000000 --- a/applyconfigurations/resource/v1alpha3/namedresourcesattribute.go +++ /dev/null @@ -1,100 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha3 - -import ( - resource "k8s.io/apimachinery/pkg/api/resource" -) - -// NamedResourcesAttributeApplyConfiguration represents a declarative configuration of the NamedResourcesAttribute type for use -// with apply. -type NamedResourcesAttributeApplyConfiguration struct { - Name *string `json:"name,omitempty"` - NamedResourcesAttributeValueApplyConfiguration `json:",inline"` -} - -// NamedResourcesAttributeApplyConfiguration constructs a declarative configuration of the NamedResourcesAttribute type for use with -// apply. -func NamedResourcesAttribute() *NamedResourcesAttributeApplyConfiguration { - return &NamedResourcesAttributeApplyConfiguration{} -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *NamedResourcesAttributeApplyConfiguration) WithName(value string) *NamedResourcesAttributeApplyConfiguration { - b.Name = &value - return b -} - -// WithQuantityValue sets the QuantityValue field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the QuantityValue field is set to the value of the last call. -func (b *NamedResourcesAttributeApplyConfiguration) WithQuantityValue(value resource.Quantity) *NamedResourcesAttributeApplyConfiguration { - b.QuantityValue = &value - return b -} - -// WithBoolValue sets the BoolValue field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the BoolValue field is set to the value of the last call. -func (b *NamedResourcesAttributeApplyConfiguration) WithBoolValue(value bool) *NamedResourcesAttributeApplyConfiguration { - b.BoolValue = &value - return b -} - -// WithIntValue sets the IntValue field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the IntValue field is set to the value of the last call. -func (b *NamedResourcesAttributeApplyConfiguration) WithIntValue(value int64) *NamedResourcesAttributeApplyConfiguration { - b.IntValue = &value - return b -} - -// WithIntSliceValue sets the IntSliceValue field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the IntSliceValue field is set to the value of the last call. -func (b *NamedResourcesAttributeApplyConfiguration) WithIntSliceValue(value *NamedResourcesIntSliceApplyConfiguration) *NamedResourcesAttributeApplyConfiguration { - b.IntSliceValue = value - return b -} - -// WithStringValue sets the StringValue field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the StringValue field is set to the value of the last call. -func (b *NamedResourcesAttributeApplyConfiguration) WithStringValue(value string) *NamedResourcesAttributeApplyConfiguration { - b.StringValue = &value - return b -} - -// WithStringSliceValue sets the StringSliceValue field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the StringSliceValue field is set to the value of the last call. -func (b *NamedResourcesAttributeApplyConfiguration) WithStringSliceValue(value *NamedResourcesStringSliceApplyConfiguration) *NamedResourcesAttributeApplyConfiguration { - b.StringSliceValue = value - return b -} - -// WithVersionValue sets the VersionValue field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the VersionValue field is set to the value of the last call. -func (b *NamedResourcesAttributeApplyConfiguration) WithVersionValue(value string) *NamedResourcesAttributeApplyConfiguration { - b.VersionValue = &value - return b -} diff --git a/applyconfigurations/resource/v1alpha3/namedresourcesattributevalue.go b/applyconfigurations/resource/v1alpha3/namedresourcesattributevalue.go deleted file mode 100644 index 8b6d90d50c..0000000000 --- a/applyconfigurations/resource/v1alpha3/namedresourcesattributevalue.go +++ /dev/null @@ -1,97 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha3 - -import ( - resource "k8s.io/apimachinery/pkg/api/resource" -) - -// NamedResourcesAttributeValueApplyConfiguration represents a declarative configuration of the NamedResourcesAttributeValue type for use -// with apply. -type NamedResourcesAttributeValueApplyConfiguration struct { - QuantityValue *resource.Quantity `json:"quantity,omitempty"` - BoolValue *bool `json:"bool,omitempty"` - IntValue *int64 `json:"int,omitempty"` - IntSliceValue *NamedResourcesIntSliceApplyConfiguration `json:"intSlice,omitempty"` - StringValue *string `json:"string,omitempty"` - StringSliceValue *NamedResourcesStringSliceApplyConfiguration `json:"stringSlice,omitempty"` - VersionValue *string `json:"version,omitempty"` -} - -// NamedResourcesAttributeValueApplyConfiguration constructs a declarative configuration of the NamedResourcesAttributeValue type for use with -// apply. -func NamedResourcesAttributeValue() *NamedResourcesAttributeValueApplyConfiguration { - return &NamedResourcesAttributeValueApplyConfiguration{} -} - -// WithQuantityValue sets the QuantityValue field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the QuantityValue field is set to the value of the last call. -func (b *NamedResourcesAttributeValueApplyConfiguration) WithQuantityValue(value resource.Quantity) *NamedResourcesAttributeValueApplyConfiguration { - b.QuantityValue = &value - return b -} - -// WithBoolValue sets the BoolValue field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the BoolValue field is set to the value of the last call. -func (b *NamedResourcesAttributeValueApplyConfiguration) WithBoolValue(value bool) *NamedResourcesAttributeValueApplyConfiguration { - b.BoolValue = &value - return b -} - -// WithIntValue sets the IntValue field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the IntValue field is set to the value of the last call. -func (b *NamedResourcesAttributeValueApplyConfiguration) WithIntValue(value int64) *NamedResourcesAttributeValueApplyConfiguration { - b.IntValue = &value - return b -} - -// WithIntSliceValue sets the IntSliceValue field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the IntSliceValue field is set to the value of the last call. -func (b *NamedResourcesAttributeValueApplyConfiguration) WithIntSliceValue(value *NamedResourcesIntSliceApplyConfiguration) *NamedResourcesAttributeValueApplyConfiguration { - b.IntSliceValue = value - return b -} - -// WithStringValue sets the StringValue field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the StringValue field is set to the value of the last call. -func (b *NamedResourcesAttributeValueApplyConfiguration) WithStringValue(value string) *NamedResourcesAttributeValueApplyConfiguration { - b.StringValue = &value - return b -} - -// WithStringSliceValue sets the StringSliceValue field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the StringSliceValue field is set to the value of the last call. -func (b *NamedResourcesAttributeValueApplyConfiguration) WithStringSliceValue(value *NamedResourcesStringSliceApplyConfiguration) *NamedResourcesAttributeValueApplyConfiguration { - b.StringSliceValue = value - return b -} - -// WithVersionValue sets the VersionValue field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the VersionValue field is set to the value of the last call. -func (b *NamedResourcesAttributeValueApplyConfiguration) WithVersionValue(value string) *NamedResourcesAttributeValueApplyConfiguration { - b.VersionValue = &value - return b -} diff --git a/applyconfigurations/resource/v1alpha3/namedresourcesinstance.go b/applyconfigurations/resource/v1alpha3/namedresourcesinstance.go deleted file mode 100644 index ff028814db..0000000000 --- a/applyconfigurations/resource/v1alpha3/namedresourcesinstance.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha3 - -// NamedResourcesInstanceApplyConfiguration represents a declarative configuration of the NamedResourcesInstance type for use -// with apply. -type NamedResourcesInstanceApplyConfiguration struct { - Name *string `json:"name,omitempty"` - Attributes []NamedResourcesAttributeApplyConfiguration `json:"attributes,omitempty"` -} - -// NamedResourcesInstanceApplyConfiguration constructs a declarative configuration of the NamedResourcesInstance type for use with -// apply. -func NamedResourcesInstance() *NamedResourcesInstanceApplyConfiguration { - return &NamedResourcesInstanceApplyConfiguration{} -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *NamedResourcesInstanceApplyConfiguration) WithName(value string) *NamedResourcesInstanceApplyConfiguration { - b.Name = &value - return b -} - -// WithAttributes adds the given value to the Attributes field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Attributes field. -func (b *NamedResourcesInstanceApplyConfiguration) WithAttributes(values ...*NamedResourcesAttributeApplyConfiguration) *NamedResourcesInstanceApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithAttributes") - } - b.Attributes = append(b.Attributes, *values[i]) - } - return b -} diff --git a/applyconfigurations/resource/v1alpha3/namedresourcesintslice.go b/applyconfigurations/resource/v1alpha3/namedresourcesintslice.go deleted file mode 100644 index fa336b4ae9..0000000000 --- a/applyconfigurations/resource/v1alpha3/namedresourcesintslice.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha3 - -// NamedResourcesIntSliceApplyConfiguration represents a declarative configuration of the NamedResourcesIntSlice type for use -// with apply. -type NamedResourcesIntSliceApplyConfiguration struct { - Ints []int64 `json:"ints,omitempty"` -} - -// NamedResourcesIntSliceApplyConfiguration constructs a declarative configuration of the NamedResourcesIntSlice type for use with -// apply. -func NamedResourcesIntSlice() *NamedResourcesIntSliceApplyConfiguration { - return &NamedResourcesIntSliceApplyConfiguration{} -} - -// WithInts adds the given value to the Ints field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Ints field. -func (b *NamedResourcesIntSliceApplyConfiguration) WithInts(values ...int64) *NamedResourcesIntSliceApplyConfiguration { - for i := range values { - b.Ints = append(b.Ints, values[i]) - } - return b -} diff --git a/applyconfigurations/resource/v1alpha3/namedresourcesrequest.go b/applyconfigurations/resource/v1alpha3/namedresourcesrequest.go deleted file mode 100644 index da6ac3efcf..0000000000 --- a/applyconfigurations/resource/v1alpha3/namedresourcesrequest.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha3 - -// NamedResourcesRequestApplyConfiguration represents a declarative configuration of the NamedResourcesRequest type for use -// with apply. -type NamedResourcesRequestApplyConfiguration struct { - Selector *string `json:"selector,omitempty"` -} - -// NamedResourcesRequestApplyConfiguration constructs a declarative configuration of the NamedResourcesRequest type for use with -// apply. -func NamedResourcesRequest() *NamedResourcesRequestApplyConfiguration { - return &NamedResourcesRequestApplyConfiguration{} -} - -// WithSelector sets the Selector field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Selector field is set to the value of the last call. -func (b *NamedResourcesRequestApplyConfiguration) WithSelector(value string) *NamedResourcesRequestApplyConfiguration { - b.Selector = &value - return b -} diff --git a/applyconfigurations/resource/v1alpha3/namedresourcesresources.go b/applyconfigurations/resource/v1alpha3/namedresourcesresources.go deleted file mode 100644 index 3e467922a4..0000000000 --- a/applyconfigurations/resource/v1alpha3/namedresourcesresources.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha3 - -// NamedResourcesResourcesApplyConfiguration represents a declarative configuration of the NamedResourcesResources type for use -// with apply. -type NamedResourcesResourcesApplyConfiguration struct { - Instances []NamedResourcesInstanceApplyConfiguration `json:"instances,omitempty"` -} - -// NamedResourcesResourcesApplyConfiguration constructs a declarative configuration of the NamedResourcesResources type for use with -// apply. -func NamedResourcesResources() *NamedResourcesResourcesApplyConfiguration { - return &NamedResourcesResourcesApplyConfiguration{} -} - -// WithInstances adds the given value to the Instances field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Instances field. -func (b *NamedResourcesResourcesApplyConfiguration) WithInstances(values ...*NamedResourcesInstanceApplyConfiguration) *NamedResourcesResourcesApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithInstances") - } - b.Instances = append(b.Instances, *values[i]) - } - return b -} diff --git a/applyconfigurations/resource/v1alpha3/namedresourcesstringslice.go b/applyconfigurations/resource/v1alpha3/namedresourcesstringslice.go deleted file mode 100644 index 8f21f81905..0000000000 --- a/applyconfigurations/resource/v1alpha3/namedresourcesstringslice.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha3 - -// NamedResourcesStringSliceApplyConfiguration represents a declarative configuration of the NamedResourcesStringSlice type for use -// with apply. -type NamedResourcesStringSliceApplyConfiguration struct { - Strings []string `json:"strings,omitempty"` -} - -// NamedResourcesStringSliceApplyConfiguration constructs a declarative configuration of the NamedResourcesStringSlice type for use with -// apply. -func NamedResourcesStringSlice() *NamedResourcesStringSliceApplyConfiguration { - return &NamedResourcesStringSliceApplyConfiguration{} -} - -// WithStrings adds the given value to the Strings field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Strings field. -func (b *NamedResourcesStringSliceApplyConfiguration) WithStrings(values ...string) *NamedResourcesStringSliceApplyConfiguration { - for i := range values { - b.Strings = append(b.Strings, values[i]) - } - return b -} diff --git a/applyconfigurations/resource/v1alpha3/vendorparameters.go b/applyconfigurations/resource/v1alpha3/opaquedeviceconfiguration.go similarity index 55% rename from applyconfigurations/resource/v1alpha3/vendorparameters.go rename to applyconfigurations/resource/v1alpha3/opaquedeviceconfiguration.go index 71f86a159c..caf9d059c3 100644 --- a/applyconfigurations/resource/v1alpha3/vendorparameters.go +++ b/applyconfigurations/resource/v1alpha3/opaquedeviceconfiguration.go @@ -22,31 +22,31 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" ) -// VendorParametersApplyConfiguration represents a declarative configuration of the VendorParameters type for use +// OpaqueDeviceConfigurationApplyConfiguration represents a declarative configuration of the OpaqueDeviceConfiguration type for use // with apply. -type VendorParametersApplyConfiguration struct { - DriverName *string `json:"driverName,omitempty"` +type OpaqueDeviceConfigurationApplyConfiguration struct { + Driver *string `json:"driver,omitempty"` Parameters *runtime.RawExtension `json:"parameters,omitempty"` } -// VendorParametersApplyConfiguration constructs a declarative configuration of the VendorParameters type for use with +// OpaqueDeviceConfigurationApplyConfiguration constructs a declarative configuration of the OpaqueDeviceConfiguration type for use with // apply. -func VendorParameters() *VendorParametersApplyConfiguration { - return &VendorParametersApplyConfiguration{} +func OpaqueDeviceConfiguration() *OpaqueDeviceConfigurationApplyConfiguration { + return &OpaqueDeviceConfigurationApplyConfiguration{} } -// WithDriverName sets the DriverName field in the declarative configuration to the given value +// WithDriver sets the Driver field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DriverName field is set to the value of the last call. -func (b *VendorParametersApplyConfiguration) WithDriverName(value string) *VendorParametersApplyConfiguration { - b.DriverName = &value +// If called multiple times, the Driver field is set to the value of the last call. +func (b *OpaqueDeviceConfigurationApplyConfiguration) WithDriver(value string) *OpaqueDeviceConfigurationApplyConfiguration { + b.Driver = &value return b } // WithParameters sets the Parameters field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Parameters field is set to the value of the last call. -func (b *VendorParametersApplyConfiguration) WithParameters(value runtime.RawExtension) *VendorParametersApplyConfiguration { +func (b *OpaqueDeviceConfigurationApplyConfiguration) WithParameters(value runtime.RawExtension) *OpaqueDeviceConfigurationApplyConfiguration { b.Parameters = &value return b } diff --git a/applyconfigurations/resource/v1alpha3/resourceclaimparametersreference.go b/applyconfigurations/resource/v1alpha3/resourceclaimparametersreference.go deleted file mode 100644 index 1d677011c1..0000000000 --- a/applyconfigurations/resource/v1alpha3/resourceclaimparametersreference.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha3 - -// ResourceClaimParametersReferenceApplyConfiguration represents a declarative configuration of the ResourceClaimParametersReference type for use -// with apply. -type ResourceClaimParametersReferenceApplyConfiguration struct { - APIGroup *string `json:"apiGroup,omitempty"` - Kind *string `json:"kind,omitempty"` - Name *string `json:"name,omitempty"` -} - -// ResourceClaimParametersReferenceApplyConfiguration constructs a declarative configuration of the ResourceClaimParametersReference type for use with -// apply. -func ResourceClaimParametersReference() *ResourceClaimParametersReferenceApplyConfiguration { - return &ResourceClaimParametersReferenceApplyConfiguration{} -} - -// WithAPIGroup sets the APIGroup field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIGroup field is set to the value of the last call. -func (b *ResourceClaimParametersReferenceApplyConfiguration) WithAPIGroup(value string) *ResourceClaimParametersReferenceApplyConfiguration { - b.APIGroup = &value - return b -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *ResourceClaimParametersReferenceApplyConfiguration) WithKind(value string) *ResourceClaimParametersReferenceApplyConfiguration { - b.Kind = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *ResourceClaimParametersReferenceApplyConfiguration) WithName(value string) *ResourceClaimParametersReferenceApplyConfiguration { - b.Name = &value - return b -} diff --git a/applyconfigurations/resource/v1alpha3/resourceclaimspec.go b/applyconfigurations/resource/v1alpha3/resourceclaimspec.go index 38bd0c5578..7c5b65681d 100644 --- a/applyconfigurations/resource/v1alpha3/resourceclaimspec.go +++ b/applyconfigurations/resource/v1alpha3/resourceclaimspec.go @@ -21,8 +21,8 @@ package v1alpha3 // ResourceClaimSpecApplyConfiguration represents a declarative configuration of the ResourceClaimSpec type for use // with apply. type ResourceClaimSpecApplyConfiguration struct { - ResourceClassName *string `json:"resourceClassName,omitempty"` - ParametersRef *ResourceClaimParametersReferenceApplyConfiguration `json:"parametersRef,omitempty"` + Devices *DeviceClaimApplyConfiguration `json:"devices,omitempty"` + Controller *string `json:"controller,omitempty"` } // ResourceClaimSpecApplyConfiguration constructs a declarative configuration of the ResourceClaimSpec type for use with @@ -31,18 +31,18 @@ func ResourceClaimSpec() *ResourceClaimSpecApplyConfiguration { return &ResourceClaimSpecApplyConfiguration{} } -// WithResourceClassName sets the ResourceClassName field in the declarative configuration to the given value +// WithDevices sets the Devices field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceClassName field is set to the value of the last call. -func (b *ResourceClaimSpecApplyConfiguration) WithResourceClassName(value string) *ResourceClaimSpecApplyConfiguration { - b.ResourceClassName = &value +// If called multiple times, the Devices field is set to the value of the last call. +func (b *ResourceClaimSpecApplyConfiguration) WithDevices(value *DeviceClaimApplyConfiguration) *ResourceClaimSpecApplyConfiguration { + b.Devices = value return b } -// WithParametersRef sets the ParametersRef field in the declarative configuration to the given value +// WithController sets the Controller field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ParametersRef field is set to the value of the last call. -func (b *ResourceClaimSpecApplyConfiguration) WithParametersRef(value *ResourceClaimParametersReferenceApplyConfiguration) *ResourceClaimSpecApplyConfiguration { - b.ParametersRef = value +// If called multiple times, the Controller field is set to the value of the last call. +func (b *ResourceClaimSpecApplyConfiguration) WithController(value string) *ResourceClaimSpecApplyConfiguration { + b.Controller = &value return b } diff --git a/applyconfigurations/resource/v1alpha3/resourceclaimstatus.go b/applyconfigurations/resource/v1alpha3/resourceclaimstatus.go index fa1545e52a..a52af3ec36 100644 --- a/applyconfigurations/resource/v1alpha3/resourceclaimstatus.go +++ b/applyconfigurations/resource/v1alpha3/resourceclaimstatus.go @@ -21,7 +21,6 @@ package v1alpha3 // ResourceClaimStatusApplyConfiguration represents a declarative configuration of the ResourceClaimStatus type for use // with apply. type ResourceClaimStatusApplyConfiguration struct { - DriverName *string `json:"driverName,omitempty"` Allocation *AllocationResultApplyConfiguration `json:"allocation,omitempty"` ReservedFor []ResourceClaimConsumerReferenceApplyConfiguration `json:"reservedFor,omitempty"` DeallocationRequested *bool `json:"deallocationRequested,omitempty"` @@ -33,14 +32,6 @@ func ResourceClaimStatus() *ResourceClaimStatusApplyConfiguration { return &ResourceClaimStatusApplyConfiguration{} } -// WithDriverName sets the DriverName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DriverName field is set to the value of the last call. -func (b *ResourceClaimStatusApplyConfiguration) WithDriverName(value string) *ResourceClaimStatusApplyConfiguration { - b.DriverName = &value - return b -} - // WithAllocation sets the Allocation field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Allocation field is set to the value of the last call. diff --git a/applyconfigurations/resource/v1alpha3/resourceclass.go b/applyconfigurations/resource/v1alpha3/resourceclass.go deleted file mode 100644 index a42ea74224..0000000000 --- a/applyconfigurations/resource/v1alpha3/resourceclass.go +++ /dev/null @@ -1,281 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha3 - -import ( - resourcev1alpha3 "k8s.io/api/resource/v1alpha3" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - managedfields "k8s.io/apimachinery/pkg/util/managedfields" - corev1 "k8s.io/client-go/applyconfigurations/core/v1" - internal "k8s.io/client-go/applyconfigurations/internal" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// ResourceClassApplyConfiguration represents a declarative configuration of the ResourceClass type for use -// with apply. -type ResourceClassApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - DriverName *string `json:"driverName,omitempty"` - ParametersRef *ResourceClassParametersReferenceApplyConfiguration `json:"parametersRef,omitempty"` - SuitableNodes *corev1.NodeSelectorApplyConfiguration `json:"suitableNodes,omitempty"` - StructuredParameters *bool `json:"structuredParameters,omitempty"` -} - -// ResourceClass constructs a declarative configuration of the ResourceClass type for use with -// apply. -func ResourceClass(name string) *ResourceClassApplyConfiguration { - b := &ResourceClassApplyConfiguration{} - b.WithName(name) - b.WithKind("ResourceClass") - b.WithAPIVersion("resource.k8s.io/v1alpha3") - return b -} - -// ExtractResourceClass extracts the applied configuration owned by fieldManager from -// resourceClass. If no managedFields are found in resourceClass for fieldManager, a -// ResourceClassApplyConfiguration is returned with only the Name, Namespace (if applicable), -// APIVersion and Kind populated. It is possible that no managed fields were found for because other -// field managers have taken ownership of all the fields previously owned by fieldManager, or because -// the fieldManager never owned fields any fields. -// resourceClass must be a unmodified ResourceClass API object that was retrieved from the Kubernetes API. -// ExtractResourceClass provides a way to perform a extract/modify-in-place/apply workflow. -// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously -// applied if another fieldManager has updated or force applied any of the previously applied fields. -// Experimental! -func ExtractResourceClass(resourceClass *resourcev1alpha3.ResourceClass, fieldManager string) (*ResourceClassApplyConfiguration, error) { - return extractResourceClass(resourceClass, fieldManager, "") -} - -// ExtractResourceClassStatus is the same as ExtractResourceClass except -// that it extracts the status subresource applied configuration. -// Experimental! -func ExtractResourceClassStatus(resourceClass *resourcev1alpha3.ResourceClass, fieldManager string) (*ResourceClassApplyConfiguration, error) { - return extractResourceClass(resourceClass, fieldManager, "status") -} - -func extractResourceClass(resourceClass *resourcev1alpha3.ResourceClass, fieldManager string, subresource string) (*ResourceClassApplyConfiguration, error) { - b := &ResourceClassApplyConfiguration{} - err := managedfields.ExtractInto(resourceClass, internal.Parser().Type("io.k8s.api.resource.v1alpha3.ResourceClass"), fieldManager, b, subresource) - if err != nil { - return nil, err - } - b.WithName(resourceClass.Name) - - b.WithKind("ResourceClass") - b.WithAPIVersion("resource.k8s.io/v1alpha3") - return b, nil -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithKind(value string) *ResourceClassApplyConfiguration { - b.Kind = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithAPIVersion(value string) *ResourceClassApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithName(value string) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value - return b -} - -// WithGenerateName sets the GenerateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GenerateName field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithGenerateName(value string) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithNamespace(value string) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value - return b -} - -// WithUID sets the UID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UID field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithUID(value types.UID) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value - return b -} - -// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithResourceVersion(value string) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value - return b -} - -// WithGeneration sets the Generation field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Generation field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithGeneration(value int64) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value - return b -} - -// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value - return b -} - -// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value - return b -} - -// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value - return b -} - -// WithLabels puts the entries into the Labels field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Labels field, -// overwriting an existing map entries in Labels field with the same key. -func (b *ResourceClassApplyConfiguration) WithLabels(entries map[string]string) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Labels[k] = v - } - return b -} - -// WithAnnotations puts the entries into the Annotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Annotations field, -// overwriting an existing map entries in Annotations field with the same key. -func (b *ResourceClassApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - return b -} - -// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *ResourceClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) - } - return b -} - -// WithFinalizers adds the given value to the Finalizers field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *ResourceClassApplyConfiguration) WithFinalizers(values ...string) *ResourceClassApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *ResourceClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { - if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} - } -} - -// WithDriverName sets the DriverName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DriverName field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithDriverName(value string) *ResourceClassApplyConfiguration { - b.DriverName = &value - return b -} - -// WithParametersRef sets the ParametersRef field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ParametersRef field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithParametersRef(value *ResourceClassParametersReferenceApplyConfiguration) *ResourceClassApplyConfiguration { - b.ParametersRef = value - return b -} - -// WithSuitableNodes sets the SuitableNodes field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the SuitableNodes field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithSuitableNodes(value *corev1.NodeSelectorApplyConfiguration) *ResourceClassApplyConfiguration { - b.SuitableNodes = value - return b -} - -// WithStructuredParameters sets the StructuredParameters field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the StructuredParameters field is set to the value of the last call. -func (b *ResourceClassApplyConfiguration) WithStructuredParameters(value bool) *ResourceClassApplyConfiguration { - b.StructuredParameters = &value - return b -} - -// GetName retrieves the value of the Name field in the declarative configuration. -func (b *ResourceClassApplyConfiguration) GetName() *string { - b.ensureObjectMetaApplyConfigurationExists() - return b.Name -} diff --git a/applyconfigurations/resource/v1alpha3/resourceclassparameters.go b/applyconfigurations/resource/v1alpha3/resourceclassparameters.go deleted file mode 100644 index 7413fbfe7c..0000000000 --- a/applyconfigurations/resource/v1alpha3/resourceclassparameters.go +++ /dev/null @@ -1,283 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha3 - -import ( - resourcev1alpha3 "k8s.io/api/resource/v1alpha3" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - managedfields "k8s.io/apimachinery/pkg/util/managedfields" - internal "k8s.io/client-go/applyconfigurations/internal" - v1 "k8s.io/client-go/applyconfigurations/meta/v1" -) - -// ResourceClassParametersApplyConfiguration represents a declarative configuration of the ResourceClassParameters type for use -// with apply. -type ResourceClassParametersApplyConfiguration struct { - v1.TypeMetaApplyConfiguration `json:",inline"` - *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - GeneratedFrom *ResourceClassParametersReferenceApplyConfiguration `json:"generatedFrom,omitempty"` - VendorParameters []VendorParametersApplyConfiguration `json:"vendorParameters,omitempty"` - Filters []ResourceFilterApplyConfiguration `json:"filters,omitempty"` -} - -// ResourceClassParameters constructs a declarative configuration of the ResourceClassParameters type for use with -// apply. -func ResourceClassParameters(name, namespace string) *ResourceClassParametersApplyConfiguration { - b := &ResourceClassParametersApplyConfiguration{} - b.WithName(name) - b.WithNamespace(namespace) - b.WithKind("ResourceClassParameters") - b.WithAPIVersion("resource.k8s.io/v1alpha3") - return b -} - -// ExtractResourceClassParameters extracts the applied configuration owned by fieldManager from -// resourceClassParameters. If no managedFields are found in resourceClassParameters for fieldManager, a -// ResourceClassParametersApplyConfiguration is returned with only the Name, Namespace (if applicable), -// APIVersion and Kind populated. It is possible that no managed fields were found for because other -// field managers have taken ownership of all the fields previously owned by fieldManager, or because -// the fieldManager never owned fields any fields. -// resourceClassParameters must be a unmodified ResourceClassParameters API object that was retrieved from the Kubernetes API. -// ExtractResourceClassParameters provides a way to perform a extract/modify-in-place/apply workflow. -// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously -// applied if another fieldManager has updated or force applied any of the previously applied fields. -// Experimental! -func ExtractResourceClassParameters(resourceClassParameters *resourcev1alpha3.ResourceClassParameters, fieldManager string) (*ResourceClassParametersApplyConfiguration, error) { - return extractResourceClassParameters(resourceClassParameters, fieldManager, "") -} - -// ExtractResourceClassParametersStatus is the same as ExtractResourceClassParameters except -// that it extracts the status subresource applied configuration. -// Experimental! -func ExtractResourceClassParametersStatus(resourceClassParameters *resourcev1alpha3.ResourceClassParameters, fieldManager string) (*ResourceClassParametersApplyConfiguration, error) { - return extractResourceClassParameters(resourceClassParameters, fieldManager, "status") -} - -func extractResourceClassParameters(resourceClassParameters *resourcev1alpha3.ResourceClassParameters, fieldManager string, subresource string) (*ResourceClassParametersApplyConfiguration, error) { - b := &ResourceClassParametersApplyConfiguration{} - err := managedfields.ExtractInto(resourceClassParameters, internal.Parser().Type("io.k8s.api.resource.v1alpha3.ResourceClassParameters"), fieldManager, b, subresource) - if err != nil { - return nil, err - } - b.WithName(resourceClassParameters.Name) - b.WithNamespace(resourceClassParameters.Namespace) - - b.WithKind("ResourceClassParameters") - b.WithAPIVersion("resource.k8s.io/v1alpha3") - return b, nil -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithKind(value string) *ResourceClassParametersApplyConfiguration { - b.Kind = &value - return b -} - -// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIVersion field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithAPIVersion(value string) *ResourceClassParametersApplyConfiguration { - b.APIVersion = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithName(value string) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Name = &value - return b -} - -// WithGenerateName sets the GenerateName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GenerateName field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithGenerateName(value string) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.GenerateName = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithNamespace(value string) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Namespace = &value - return b -} - -// WithUID sets the UID field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the UID field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithUID(value types.UID) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.UID = &value - return b -} - -// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the ResourceVersion field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithResourceVersion(value string) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.ResourceVersion = &value - return b -} - -// WithGeneration sets the Generation field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Generation field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithGeneration(value int64) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.Generation = &value - return b -} - -// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the CreationTimestamp field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.CreationTimestamp = &value - return b -} - -// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionTimestamp field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionTimestamp = &value - return b -} - -// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - b.DeletionGracePeriodSeconds = &value - return b -} - -// WithLabels puts the entries into the Labels field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Labels field, -// overwriting an existing map entries in Labels field with the same key. -func (b *ResourceClassParametersApplyConfiguration) WithLabels(entries map[string]string) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Labels == nil && len(entries) > 0 { - b.Labels = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Labels[k] = v - } - return b -} - -// WithAnnotations puts the entries into the Annotations field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, the entries provided by each call will be put on the Annotations field, -// overwriting an existing map entries in Annotations field with the same key. -func (b *ResourceClassParametersApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - if b.Annotations == nil && len(entries) > 0 { - b.Annotations = make(map[string]string, len(entries)) - } - for k, v := range entries { - b.Annotations[k] = v - } - return b -} - -// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the OwnerReferences field. -func (b *ResourceClassParametersApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - if values[i] == nil { - panic("nil value passed to WithOwnerReferences") - } - b.OwnerReferences = append(b.OwnerReferences, *values[i]) - } - return b -} - -// WithFinalizers adds the given value to the Finalizers field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Finalizers field. -func (b *ResourceClassParametersApplyConfiguration) WithFinalizers(values ...string) *ResourceClassParametersApplyConfiguration { - b.ensureObjectMetaApplyConfigurationExists() - for i := range values { - b.Finalizers = append(b.Finalizers, values[i]) - } - return b -} - -func (b *ResourceClassParametersApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { - if b.ObjectMetaApplyConfiguration == nil { - b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} - } -} - -// WithGeneratedFrom sets the GeneratedFrom field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the GeneratedFrom field is set to the value of the last call. -func (b *ResourceClassParametersApplyConfiguration) WithGeneratedFrom(value *ResourceClassParametersReferenceApplyConfiguration) *ResourceClassParametersApplyConfiguration { - b.GeneratedFrom = value - return b -} - -// WithVendorParameters adds the given value to the VendorParameters field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the VendorParameters field. -func (b *ResourceClassParametersApplyConfiguration) WithVendorParameters(values ...*VendorParametersApplyConfiguration) *ResourceClassParametersApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithVendorParameters") - } - b.VendorParameters = append(b.VendorParameters, *values[i]) - } - return b -} - -// WithFilters adds the given value to the Filters field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Filters field. -func (b *ResourceClassParametersApplyConfiguration) WithFilters(values ...*ResourceFilterApplyConfiguration) *ResourceClassParametersApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithFilters") - } - b.Filters = append(b.Filters, *values[i]) - } - return b -} - -// GetName retrieves the value of the Name field in the declarative configuration. -func (b *ResourceClassParametersApplyConfiguration) GetName() *string { - b.ensureObjectMetaApplyConfigurationExists() - return b.Name -} diff --git a/applyconfigurations/resource/v1alpha3/resourceclassparametersreference.go b/applyconfigurations/resource/v1alpha3/resourceclassparametersreference.go deleted file mode 100644 index db469e5eec..0000000000 --- a/applyconfigurations/resource/v1alpha3/resourceclassparametersreference.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha3 - -// ResourceClassParametersReferenceApplyConfiguration represents a declarative configuration of the ResourceClassParametersReference type for use -// with apply. -type ResourceClassParametersReferenceApplyConfiguration struct { - APIGroup *string `json:"apiGroup,omitempty"` - Kind *string `json:"kind,omitempty"` - Name *string `json:"name,omitempty"` - Namespace *string `json:"namespace,omitempty"` -} - -// ResourceClassParametersReferenceApplyConfiguration constructs a declarative configuration of the ResourceClassParametersReference type for use with -// apply. -func ResourceClassParametersReference() *ResourceClassParametersReferenceApplyConfiguration { - return &ResourceClassParametersReferenceApplyConfiguration{} -} - -// WithAPIGroup sets the APIGroup field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the APIGroup field is set to the value of the last call. -func (b *ResourceClassParametersReferenceApplyConfiguration) WithAPIGroup(value string) *ResourceClassParametersReferenceApplyConfiguration { - b.APIGroup = &value - return b -} - -// WithKind sets the Kind field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Kind field is set to the value of the last call. -func (b *ResourceClassParametersReferenceApplyConfiguration) WithKind(value string) *ResourceClassParametersReferenceApplyConfiguration { - b.Kind = &value - return b -} - -// WithName sets the Name field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Name field is set to the value of the last call. -func (b *ResourceClassParametersReferenceApplyConfiguration) WithName(value string) *ResourceClassParametersReferenceApplyConfiguration { - b.Name = &value - return b -} - -// WithNamespace sets the Namespace field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Namespace field is set to the value of the last call. -func (b *ResourceClassParametersReferenceApplyConfiguration) WithNamespace(value string) *ResourceClassParametersReferenceApplyConfiguration { - b.Namespace = &value - return b -} diff --git a/applyconfigurations/resource/v1alpha3/resourcefilter.go b/applyconfigurations/resource/v1alpha3/resourcefilter.go deleted file mode 100644 index 4c5542692c..0000000000 --- a/applyconfigurations/resource/v1alpha3/resourcefilter.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha3 - -// ResourceFilterApplyConfiguration represents a declarative configuration of the ResourceFilter type for use -// with apply. -type ResourceFilterApplyConfiguration struct { - DriverName *string `json:"driverName,omitempty"` - ResourceFilterModelApplyConfiguration `json:",inline"` -} - -// ResourceFilterApplyConfiguration constructs a declarative configuration of the ResourceFilter type for use with -// apply. -func ResourceFilter() *ResourceFilterApplyConfiguration { - return &ResourceFilterApplyConfiguration{} -} - -// WithDriverName sets the DriverName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DriverName field is set to the value of the last call. -func (b *ResourceFilterApplyConfiguration) WithDriverName(value string) *ResourceFilterApplyConfiguration { - b.DriverName = &value - return b -} - -// WithNamedResources sets the NamedResources field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the NamedResources field is set to the value of the last call. -func (b *ResourceFilterApplyConfiguration) WithNamedResources(value *NamedResourcesFilterApplyConfiguration) *ResourceFilterApplyConfiguration { - b.NamedResources = value - return b -} diff --git a/applyconfigurations/resource/v1alpha3/resourcefiltermodel.go b/applyconfigurations/resource/v1alpha3/resourcefiltermodel.go deleted file mode 100644 index 0de3f12f67..0000000000 --- a/applyconfigurations/resource/v1alpha3/resourcefiltermodel.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha3 - -// ResourceFilterModelApplyConfiguration represents a declarative configuration of the ResourceFilterModel type for use -// with apply. -type ResourceFilterModelApplyConfiguration struct { - NamedResources *NamedResourcesFilterApplyConfiguration `json:"namedResources,omitempty"` -} - -// ResourceFilterModelApplyConfiguration constructs a declarative configuration of the ResourceFilterModel type for use with -// apply. -func ResourceFilterModel() *ResourceFilterModelApplyConfiguration { - return &ResourceFilterModelApplyConfiguration{} -} - -// WithNamedResources sets the NamedResources field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the NamedResources field is set to the value of the last call. -func (b *ResourceFilterModelApplyConfiguration) WithNamedResources(value *NamedResourcesFilterApplyConfiguration) *ResourceFilterModelApplyConfiguration { - b.NamedResources = value - return b -} diff --git a/applyconfigurations/resource/v1alpha3/resourcehandle.go b/applyconfigurations/resource/v1alpha3/resourcehandle.go deleted file mode 100644 index 6c8a697fa1..0000000000 --- a/applyconfigurations/resource/v1alpha3/resourcehandle.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha3 - -// ResourceHandleApplyConfiguration represents a declarative configuration of the ResourceHandle type for use -// with apply. -type ResourceHandleApplyConfiguration struct { - DriverName *string `json:"driverName,omitempty"` - Data *string `json:"data,omitempty"` - StructuredData *StructuredResourceHandleApplyConfiguration `json:"structuredData,omitempty"` -} - -// ResourceHandleApplyConfiguration constructs a declarative configuration of the ResourceHandle type for use with -// apply. -func ResourceHandle() *ResourceHandleApplyConfiguration { - return &ResourceHandleApplyConfiguration{} -} - -// WithDriverName sets the DriverName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DriverName field is set to the value of the last call. -func (b *ResourceHandleApplyConfiguration) WithDriverName(value string) *ResourceHandleApplyConfiguration { - b.DriverName = &value - return b -} - -// WithData sets the Data field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the Data field is set to the value of the last call. -func (b *ResourceHandleApplyConfiguration) WithData(value string) *ResourceHandleApplyConfiguration { - b.Data = &value - return b -} - -// WithStructuredData sets the StructuredData field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the StructuredData field is set to the value of the last call. -func (b *ResourceHandleApplyConfiguration) WithStructuredData(value *StructuredResourceHandleApplyConfiguration) *ResourceHandleApplyConfiguration { - b.StructuredData = value - return b -} diff --git a/applyconfigurations/resource/v1alpha3/resourcemodel.go b/applyconfigurations/resource/v1alpha3/resourcemodel.go deleted file mode 100644 index 2999d447df..0000000000 --- a/applyconfigurations/resource/v1alpha3/resourcemodel.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha3 - -// ResourceModelApplyConfiguration represents a declarative configuration of the ResourceModel type for use -// with apply. -type ResourceModelApplyConfiguration struct { - NamedResources *NamedResourcesResourcesApplyConfiguration `json:"namedResources,omitempty"` -} - -// ResourceModelApplyConfiguration constructs a declarative configuration of the ResourceModel type for use with -// apply. -func ResourceModel() *ResourceModelApplyConfiguration { - return &ResourceModelApplyConfiguration{} -} - -// WithNamedResources sets the NamedResources field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the NamedResources field is set to the value of the last call. -func (b *ResourceModelApplyConfiguration) WithNamedResources(value *NamedResourcesResourcesApplyConfiguration) *ResourceModelApplyConfiguration { - b.NamedResources = value - return b -} diff --git a/applyconfigurations/resource/v1alpha3/resourcepool.go b/applyconfigurations/resource/v1alpha3/resourcepool.go new file mode 100644 index 0000000000..23825d137f --- /dev/null +++ b/applyconfigurations/resource/v1alpha3/resourcepool.go @@ -0,0 +1,57 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +// ResourcePoolApplyConfiguration represents a declarative configuration of the ResourcePool type for use +// with apply. +type ResourcePoolApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Generation *int64 `json:"generation,omitempty"` + ResourceSliceCount *int64 `json:"resourceSliceCount,omitempty"` +} + +// ResourcePoolApplyConfiguration constructs a declarative configuration of the ResourcePool type for use with +// apply. +func ResourcePool() *ResourcePoolApplyConfiguration { + return &ResourcePoolApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ResourcePoolApplyConfiguration) WithName(value string) *ResourcePoolApplyConfiguration { + b.Name = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ResourcePoolApplyConfiguration) WithGeneration(value int64) *ResourcePoolApplyConfiguration { + b.Generation = &value + return b +} + +// WithResourceSliceCount sets the ResourceSliceCount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceSliceCount field is set to the value of the last call. +func (b *ResourcePoolApplyConfiguration) WithResourceSliceCount(value int64) *ResourcePoolApplyConfiguration { + b.ResourceSliceCount = &value + return b +} diff --git a/applyconfigurations/resource/v1alpha3/resourcerequest.go b/applyconfigurations/resource/v1alpha3/resourcerequest.go deleted file mode 100644 index d0d047e752..0000000000 --- a/applyconfigurations/resource/v1alpha3/resourcerequest.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha3 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// ResourceRequestApplyConfiguration represents a declarative configuration of the ResourceRequest type for use -// with apply. -type ResourceRequestApplyConfiguration struct { - VendorParameters *runtime.RawExtension `json:"vendorParameters,omitempty"` - ResourceRequestModelApplyConfiguration `json:",inline"` -} - -// ResourceRequestApplyConfiguration constructs a declarative configuration of the ResourceRequest type for use with -// apply. -func ResourceRequest() *ResourceRequestApplyConfiguration { - return &ResourceRequestApplyConfiguration{} -} - -// WithVendorParameters sets the VendorParameters field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the VendorParameters field is set to the value of the last call. -func (b *ResourceRequestApplyConfiguration) WithVendorParameters(value runtime.RawExtension) *ResourceRequestApplyConfiguration { - b.VendorParameters = &value - return b -} - -// WithNamedResources sets the NamedResources field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the NamedResources field is set to the value of the last call. -func (b *ResourceRequestApplyConfiguration) WithNamedResources(value *NamedResourcesRequestApplyConfiguration) *ResourceRequestApplyConfiguration { - b.NamedResources = value - return b -} diff --git a/applyconfigurations/resource/v1alpha3/resourcerequestmodel.go b/applyconfigurations/resource/v1alpha3/resourcerequestmodel.go deleted file mode 100644 index 35d1825319..0000000000 --- a/applyconfigurations/resource/v1alpha3/resourcerequestmodel.go +++ /dev/null @@ -1,39 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha3 - -// ResourceRequestModelApplyConfiguration represents a declarative configuration of the ResourceRequestModel type for use -// with apply. -type ResourceRequestModelApplyConfiguration struct { - NamedResources *NamedResourcesRequestApplyConfiguration `json:"namedResources,omitempty"` -} - -// ResourceRequestModelApplyConfiguration constructs a declarative configuration of the ResourceRequestModel type for use with -// apply. -func ResourceRequestModel() *ResourceRequestModelApplyConfiguration { - return &ResourceRequestModelApplyConfiguration{} -} - -// WithNamedResources sets the NamedResources field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the NamedResources field is set to the value of the last call. -func (b *ResourceRequestModelApplyConfiguration) WithNamedResources(value *NamedResourcesRequestApplyConfiguration) *ResourceRequestModelApplyConfiguration { - b.NamedResources = value - return b -} diff --git a/applyconfigurations/resource/v1alpha3/resourceslice.go b/applyconfigurations/resource/v1alpha3/resourceslice.go index 7486e75c82..aaad68612e 100644 --- a/applyconfigurations/resource/v1alpha3/resourceslice.go +++ b/applyconfigurations/resource/v1alpha3/resourceslice.go @@ -32,9 +32,7 @@ import ( type ResourceSliceApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` - NodeName *string `json:"nodeName,omitempty"` - DriverName *string `json:"driverName,omitempty"` - ResourceModelApplyConfiguration `json:",inline"` + Spec *ResourceSliceSpecApplyConfiguration `json:"spec,omitempty"` } // ResourceSlice constructs a declarative configuration of the ResourceSlice type for use with @@ -240,27 +238,11 @@ func (b *ResourceSliceApplyConfiguration) ensureObjectMetaApplyConfigurationExis } } -// WithNodeName sets the NodeName field in the declarative configuration to the given value +// WithSpec sets the Spec field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the NodeName field is set to the value of the last call. -func (b *ResourceSliceApplyConfiguration) WithNodeName(value string) *ResourceSliceApplyConfiguration { - b.NodeName = &value - return b -} - -// WithDriverName sets the DriverName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the DriverName field is set to the value of the last call. -func (b *ResourceSliceApplyConfiguration) WithDriverName(value string) *ResourceSliceApplyConfiguration { - b.DriverName = &value - return b -} - -// WithNamedResources sets the NamedResources field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the NamedResources field is set to the value of the last call. -func (b *ResourceSliceApplyConfiguration) WithNamedResources(value *NamedResourcesResourcesApplyConfiguration) *ResourceSliceApplyConfiguration { - b.NamedResources = value +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ResourceSliceApplyConfiguration) WithSpec(value *ResourceSliceSpecApplyConfiguration) *ResourceSliceApplyConfiguration { + b.Spec = value return b } diff --git a/applyconfigurations/resource/v1alpha3/resourceslicespec.go b/applyconfigurations/resource/v1alpha3/resourceslicespec.go new file mode 100644 index 0000000000..2ded759073 --- /dev/null +++ b/applyconfigurations/resource/v1alpha3/resourceslicespec.go @@ -0,0 +1,93 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + v1 "k8s.io/client-go/applyconfigurations/core/v1" +) + +// ResourceSliceSpecApplyConfiguration represents a declarative configuration of the ResourceSliceSpec type for use +// with apply. +type ResourceSliceSpecApplyConfiguration struct { + Driver *string `json:"driver,omitempty"` + Pool *ResourcePoolApplyConfiguration `json:"pool,omitempty"` + NodeName *string `json:"nodeName,omitempty"` + NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"` + AllNodes *bool `json:"allNodes,omitempty"` + Devices []DeviceApplyConfiguration `json:"devices,omitempty"` +} + +// ResourceSliceSpecApplyConfiguration constructs a declarative configuration of the ResourceSliceSpec type for use with +// apply. +func ResourceSliceSpec() *ResourceSliceSpecApplyConfiguration { + return &ResourceSliceSpecApplyConfiguration{} +} + +// WithDriver sets the Driver field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Driver field is set to the value of the last call. +func (b *ResourceSliceSpecApplyConfiguration) WithDriver(value string) *ResourceSliceSpecApplyConfiguration { + b.Driver = &value + return b +} + +// WithPool sets the Pool field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Pool field is set to the value of the last call. +func (b *ResourceSliceSpecApplyConfiguration) WithPool(value *ResourcePoolApplyConfiguration) *ResourceSliceSpecApplyConfiguration { + b.Pool = value + return b +} + +// WithNodeName sets the NodeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeName field is set to the value of the last call. +func (b *ResourceSliceSpecApplyConfiguration) WithNodeName(value string) *ResourceSliceSpecApplyConfiguration { + b.NodeName = &value + return b +} + +// WithNodeSelector sets the NodeSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeSelector field is set to the value of the last call. +func (b *ResourceSliceSpecApplyConfiguration) WithNodeSelector(value *v1.NodeSelectorApplyConfiguration) *ResourceSliceSpecApplyConfiguration { + b.NodeSelector = value + return b +} + +// WithAllNodes sets the AllNodes field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllNodes field is set to the value of the last call. +func (b *ResourceSliceSpecApplyConfiguration) WithAllNodes(value bool) *ResourceSliceSpecApplyConfiguration { + b.AllNodes = &value + return b +} + +// WithDevices adds the given value to the Devices field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Devices field. +func (b *ResourceSliceSpecApplyConfiguration) WithDevices(values ...*DeviceApplyConfiguration) *ResourceSliceSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithDevices") + } + b.Devices = append(b.Devices, *values[i]) + } + return b +} diff --git a/applyconfigurations/resource/v1alpha3/structuredresourcehandle.go b/applyconfigurations/resource/v1alpha3/structuredresourcehandle.go deleted file mode 100644 index 0d58994c94..0000000000 --- a/applyconfigurations/resource/v1alpha3/structuredresourcehandle.go +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by applyconfiguration-gen. DO NOT EDIT. - -package v1alpha3 - -import ( - runtime "k8s.io/apimachinery/pkg/runtime" -) - -// StructuredResourceHandleApplyConfiguration represents a declarative configuration of the StructuredResourceHandle type for use -// with apply. -type StructuredResourceHandleApplyConfiguration struct { - VendorClassParameters *runtime.RawExtension `json:"vendorClassParameters,omitempty"` - VendorClaimParameters *runtime.RawExtension `json:"vendorClaimParameters,omitempty"` - NodeName *string `json:"nodeName,omitempty"` - Results []DriverAllocationResultApplyConfiguration `json:"results,omitempty"` -} - -// StructuredResourceHandleApplyConfiguration constructs a declarative configuration of the StructuredResourceHandle type for use with -// apply. -func StructuredResourceHandle() *StructuredResourceHandleApplyConfiguration { - return &StructuredResourceHandleApplyConfiguration{} -} - -// WithVendorClassParameters sets the VendorClassParameters field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the VendorClassParameters field is set to the value of the last call. -func (b *StructuredResourceHandleApplyConfiguration) WithVendorClassParameters(value runtime.RawExtension) *StructuredResourceHandleApplyConfiguration { - b.VendorClassParameters = &value - return b -} - -// WithVendorClaimParameters sets the VendorClaimParameters field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the VendorClaimParameters field is set to the value of the last call. -func (b *StructuredResourceHandleApplyConfiguration) WithVendorClaimParameters(value runtime.RawExtension) *StructuredResourceHandleApplyConfiguration { - b.VendorClaimParameters = &value - return b -} - -// WithNodeName sets the NodeName field in the declarative configuration to the given value -// and returns the receiver, so that objects can be built by chaining "With" function invocations. -// If called multiple times, the NodeName field is set to the value of the last call. -func (b *StructuredResourceHandleApplyConfiguration) WithNodeName(value string) *StructuredResourceHandleApplyConfiguration { - b.NodeName = &value - return b -} - -// WithResults adds the given value to the Results field in the declarative configuration -// and returns the receiver, so that objects can be build by chaining "With" function invocations. -// If called multiple times, values provided by each call will be appended to the Results field. -func (b *StructuredResourceHandleApplyConfiguration) WithResults(values ...*DriverAllocationResultApplyConfiguration) *StructuredResourceHandleApplyConfiguration { - for i := range values { - if values[i] == nil { - panic("nil value passed to WithResults") - } - b.Results = append(b.Results, *values[i]) - } - return b -} diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index 0bc1607a42..64ffaa9f47 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -1556,30 +1556,40 @@ func ForKind(kind schema.GroupVersionKind) interface{} { // Group=resource.k8s.io, Version=v1alpha3 case v1alpha3.SchemeGroupVersion.WithKind("AllocationResult"): return &resourcev1alpha3.AllocationResultApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("AllocationResultModel"): - return &resourcev1alpha3.AllocationResultModelApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("DriverAllocationResult"): - return &resourcev1alpha3.DriverAllocationResultApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("DriverRequests"): - return &resourcev1alpha3.DriverRequestsApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("NamedResourcesAllocationResult"): - return &resourcev1alpha3.NamedResourcesAllocationResultApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("NamedResourcesAttribute"): - return &resourcev1alpha3.NamedResourcesAttributeApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("NamedResourcesAttributeValue"): - return &resourcev1alpha3.NamedResourcesAttributeValueApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("NamedResourcesFilter"): - return &resourcev1alpha3.NamedResourcesFilterApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("NamedResourcesInstance"): - return &resourcev1alpha3.NamedResourcesInstanceApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("NamedResourcesIntSlice"): - return &resourcev1alpha3.NamedResourcesIntSliceApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("NamedResourcesRequest"): - return &resourcev1alpha3.NamedResourcesRequestApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("NamedResourcesResources"): - return &resourcev1alpha3.NamedResourcesResourcesApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("NamedResourcesStringSlice"): - return &resourcev1alpha3.NamedResourcesStringSliceApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("BasicDevice"): + return &resourcev1alpha3.BasicDeviceApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("CELDeviceSelector"): + return &resourcev1alpha3.CELDeviceSelectorApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("Device"): + return &resourcev1alpha3.DeviceApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceAllocationConfiguration"): + return &resourcev1alpha3.DeviceAllocationConfigurationApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceAllocationResult"): + return &resourcev1alpha3.DeviceAllocationResultApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceAttribute"): + return &resourcev1alpha3.DeviceAttributeApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceClaim"): + return &resourcev1alpha3.DeviceClaimApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceClaimConfiguration"): + return &resourcev1alpha3.DeviceClaimConfigurationApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceClass"): + return &resourcev1alpha3.DeviceClassApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceClassConfiguration"): + return &resourcev1alpha3.DeviceClassConfigurationApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceClassSpec"): + return &resourcev1alpha3.DeviceClassSpecApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceConfiguration"): + return &resourcev1alpha3.DeviceConfigurationApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceConstraint"): + return &resourcev1alpha3.DeviceConstraintApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceRequest"): + return &resourcev1alpha3.DeviceRequestApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceRequestAllocationResult"): + return &resourcev1alpha3.DeviceRequestAllocationResultApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("DeviceSelector"): + return &resourcev1alpha3.DeviceSelectorApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("OpaqueDeviceConfiguration"): + return &resourcev1alpha3.OpaqueDeviceConfigurationApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("PodSchedulingContext"): return &resourcev1alpha3.PodSchedulingContextApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("PodSchedulingContextSpec"): @@ -1590,10 +1600,6 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &resourcev1alpha3.ResourceClaimApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimConsumerReference"): return &resourcev1alpha3.ResourceClaimConsumerReferenceApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimParameters"): - return &resourcev1alpha3.ResourceClaimParametersApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimParametersReference"): - return &resourcev1alpha3.ResourceClaimParametersReferenceApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimSchedulingStatus"): return &resourcev1alpha3.ResourceClaimSchedulingStatusApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimSpec"): @@ -1604,30 +1610,12 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &resourcev1alpha3.ResourceClaimTemplateApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimTemplateSpec"): return &resourcev1alpha3.ResourceClaimTemplateSpecApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("ResourceClass"): - return &resourcev1alpha3.ResourceClassApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("ResourceClassParameters"): - return &resourcev1alpha3.ResourceClassParametersApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("ResourceClassParametersReference"): - return &resourcev1alpha3.ResourceClassParametersReferenceApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("ResourceFilter"): - return &resourcev1alpha3.ResourceFilterApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("ResourceFilterModel"): - return &resourcev1alpha3.ResourceFilterModelApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("ResourceHandle"): - return &resourcev1alpha3.ResourceHandleApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("ResourceModel"): - return &resourcev1alpha3.ResourceModelApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("ResourceRequest"): - return &resourcev1alpha3.ResourceRequestApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("ResourceRequestModel"): - return &resourcev1alpha3.ResourceRequestModelApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourcePool"): + return &resourcev1alpha3.ResourcePoolApplyConfiguration{} case v1alpha3.SchemeGroupVersion.WithKind("ResourceSlice"): return &resourcev1alpha3.ResourceSliceApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("StructuredResourceHandle"): - return &resourcev1alpha3.StructuredResourceHandleApplyConfiguration{} - case v1alpha3.SchemeGroupVersion.WithKind("VendorParameters"): - return &resourcev1alpha3.VendorParametersApplyConfiguration{} + case v1alpha3.SchemeGroupVersion.WithKind("ResourceSliceSpec"): + return &resourcev1alpha3.ResourceSliceSpecApplyConfiguration{} // Group=scheduling.k8s.io, Version=v1 case schedulingv1.SchemeGroupVersion.WithKind("PriorityClass"): diff --git a/informers/generic.go b/informers/generic.go index 42c8f22aab..c7df13f252 100644 --- a/informers/generic.go +++ b/informers/generic.go @@ -367,18 +367,14 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1beta1().RoleBindings().Informer()}, nil // Group=resource.k8s.io, Version=v1alpha3 + case v1alpha3.SchemeGroupVersion.WithResource("deviceclasses"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().DeviceClasses().Informer()}, nil case v1alpha3.SchemeGroupVersion.WithResource("podschedulingcontexts"): return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().PodSchedulingContexts().Informer()}, nil case v1alpha3.SchemeGroupVersion.WithResource("resourceclaims"): return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourceClaims().Informer()}, nil - case v1alpha3.SchemeGroupVersion.WithResource("resourceclaimparameters"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourceClaimParameters().Informer()}, nil case v1alpha3.SchemeGroupVersion.WithResource("resourceclaimtemplates"): return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourceClaimTemplates().Informer()}, nil - case v1alpha3.SchemeGroupVersion.WithResource("resourceclasses"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourceClasses().Informer()}, nil - case v1alpha3.SchemeGroupVersion.WithResource("resourceclassparameters"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourceClassParameters().Informer()}, nil case v1alpha3.SchemeGroupVersion.WithResource("resourceslices"): return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourceSlices().Informer()}, nil diff --git a/informers/resource/v1alpha3/resourceclass.go b/informers/resource/v1alpha3/deviceclass.go similarity index 55% rename from informers/resource/v1alpha3/resourceclass.go rename to informers/resource/v1alpha3/deviceclass.go index f63141a70e..c0bcbd1905 100644 --- a/informers/resource/v1alpha3/resourceclass.go +++ b/informers/resource/v1alpha3/deviceclass.go @@ -32,58 +32,58 @@ import ( cache "k8s.io/client-go/tools/cache" ) -// ResourceClassInformer provides access to a shared informer and lister for -// ResourceClasses. -type ResourceClassInformer interface { +// DeviceClassInformer provides access to a shared informer and lister for +// DeviceClasses. +type DeviceClassInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha3.ResourceClassLister + Lister() v1alpha3.DeviceClassLister } -type resourceClassInformer struct { +type deviceClassInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc } -// NewResourceClassInformer constructs a new informer for ResourceClass type. +// NewDeviceClassInformer constructs a new informer for DeviceClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewResourceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredResourceClassInformer(client, resyncPeriod, indexers, nil) +func NewDeviceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDeviceClassInformer(client, resyncPeriod, indexers, nil) } -// NewFilteredResourceClassInformer constructs a new informer for ResourceClass type. +// NewFilteredDeviceClassInformer constructs a new informer for DeviceClass type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. -func NewFilteredResourceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredDeviceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha3().ResourceClasses().List(context.TODO(), options) + return client.ResourceV1alpha3().DeviceClasses().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ResourceV1alpha3().ResourceClasses().Watch(context.TODO(), options) + return client.ResourceV1alpha3().DeviceClasses().Watch(context.TODO(), options) }, }, - &resourcev1alpha3.ResourceClass{}, + &resourcev1alpha3.DeviceClass{}, resyncPeriod, indexers, ) } -func (f *resourceClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredResourceClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +func (f *deviceClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDeviceClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } -func (f *resourceClassInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&resourcev1alpha3.ResourceClass{}, f.defaultInformer) +func (f *deviceClassInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&resourcev1alpha3.DeviceClass{}, f.defaultInformer) } -func (f *resourceClassInformer) Lister() v1alpha3.ResourceClassLister { - return v1alpha3.NewResourceClassLister(f.Informer().GetIndexer()) +func (f *deviceClassInformer) Lister() v1alpha3.DeviceClassLister { + return v1alpha3.NewDeviceClassLister(f.Informer().GetIndexer()) } diff --git a/informers/resource/v1alpha3/interface.go b/informers/resource/v1alpha3/interface.go index 36b9f1c782..481a7de451 100644 --- a/informers/resource/v1alpha3/interface.go +++ b/informers/resource/v1alpha3/interface.go @@ -24,18 +24,14 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { + // DeviceClasses returns a DeviceClassInformer. + DeviceClasses() DeviceClassInformer // PodSchedulingContexts returns a PodSchedulingContextInformer. PodSchedulingContexts() PodSchedulingContextInformer // ResourceClaims returns a ResourceClaimInformer. ResourceClaims() ResourceClaimInformer - // ResourceClaimParameters returns a ResourceClaimParametersInformer. - ResourceClaimParameters() ResourceClaimParametersInformer // ResourceClaimTemplates returns a ResourceClaimTemplateInformer. ResourceClaimTemplates() ResourceClaimTemplateInformer - // ResourceClasses returns a ResourceClassInformer. - ResourceClasses() ResourceClassInformer - // ResourceClassParameters returns a ResourceClassParametersInformer. - ResourceClassParameters() ResourceClassParametersInformer // ResourceSlices returns a ResourceSliceInformer. ResourceSlices() ResourceSliceInformer } @@ -51,6 +47,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } +// DeviceClasses returns a DeviceClassInformer. +func (v *version) DeviceClasses() DeviceClassInformer { + return &deviceClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + // PodSchedulingContexts returns a PodSchedulingContextInformer. func (v *version) PodSchedulingContexts() PodSchedulingContextInformer { return &podSchedulingContextInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} @@ -61,26 +62,11 @@ func (v *version) ResourceClaims() ResourceClaimInformer { return &resourceClaimInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// ResourceClaimParameters returns a ResourceClaimParametersInformer. -func (v *version) ResourceClaimParameters() ResourceClaimParametersInformer { - return &resourceClaimParametersInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - // ResourceClaimTemplates returns a ResourceClaimTemplateInformer. func (v *version) ResourceClaimTemplates() ResourceClaimTemplateInformer { return &resourceClaimTemplateInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// ResourceClasses returns a ResourceClassInformer. -func (v *version) ResourceClasses() ResourceClassInformer { - return &resourceClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - -// ResourceClassParameters returns a ResourceClassParametersInformer. -func (v *version) ResourceClassParameters() ResourceClassParametersInformer { - return &resourceClassParametersInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - // ResourceSlices returns a ResourceSliceInformer. func (v *version) ResourceSlices() ResourceSliceInformer { return &resourceSliceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} diff --git a/informers/resource/v1alpha3/resourceclaimparameters.go b/informers/resource/v1alpha3/resourceclaimparameters.go deleted file mode 100644 index 86df716241..0000000000 --- a/informers/resource/v1alpha3/resourceclaimparameters.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha3 - -import ( - "context" - time "time" - - resourcev1alpha3 "k8s.io/api/resource/v1alpha3" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - internalinterfaces "k8s.io/client-go/informers/internalinterfaces" - kubernetes "k8s.io/client-go/kubernetes" - v1alpha3 "k8s.io/client-go/listers/resource/v1alpha3" - cache "k8s.io/client-go/tools/cache" -) - -// ResourceClaimParametersInformer provides access to a shared informer and lister for -// ResourceClaimParameters. -type ResourceClaimParametersInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha3.ResourceClaimParametersLister -} - -type resourceClaimParametersInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewResourceClaimParametersInformer constructs a new informer for ResourceClaimParameters type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewResourceClaimParametersInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredResourceClaimParametersInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredResourceClaimParametersInformer constructs a new informer for ResourceClaimParameters type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredResourceClaimParametersInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ResourceV1alpha3().ResourceClaimParameters(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ResourceV1alpha3().ResourceClaimParameters(namespace).Watch(context.TODO(), options) - }, - }, - &resourcev1alpha3.ResourceClaimParameters{}, - resyncPeriod, - indexers, - ) -} - -func (f *resourceClaimParametersInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredResourceClaimParametersInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *resourceClaimParametersInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&resourcev1alpha3.ResourceClaimParameters{}, f.defaultInformer) -} - -func (f *resourceClaimParametersInformer) Lister() v1alpha3.ResourceClaimParametersLister { - return v1alpha3.NewResourceClaimParametersLister(f.Informer().GetIndexer()) -} diff --git a/informers/resource/v1alpha3/resourceclassparameters.go b/informers/resource/v1alpha3/resourceclassparameters.go deleted file mode 100644 index cb2172f5c0..0000000000 --- a/informers/resource/v1alpha3/resourceclassparameters.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by informer-gen. DO NOT EDIT. - -package v1alpha3 - -import ( - "context" - time "time" - - resourcev1alpha3 "k8s.io/api/resource/v1alpha3" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - internalinterfaces "k8s.io/client-go/informers/internalinterfaces" - kubernetes "k8s.io/client-go/kubernetes" - v1alpha3 "k8s.io/client-go/listers/resource/v1alpha3" - cache "k8s.io/client-go/tools/cache" -) - -// ResourceClassParametersInformer provides access to a shared informer and lister for -// ResourceClassParameters. -type ResourceClassParametersInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha3.ResourceClassParametersLister -} - -type resourceClassParametersInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewResourceClassParametersInformer constructs a new informer for ResourceClassParameters type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewResourceClassParametersInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredResourceClassParametersInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredResourceClassParametersInformer constructs a new informer for ResourceClassParameters type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredResourceClassParametersInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ResourceV1alpha3().ResourceClassParameters(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.ResourceV1alpha3().ResourceClassParameters(namespace).Watch(context.TODO(), options) - }, - }, - &resourcev1alpha3.ResourceClassParameters{}, - resyncPeriod, - indexers, - ) -} - -func (f *resourceClassParametersInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredResourceClassParametersInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *resourceClassParametersInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&resourcev1alpha3.ResourceClassParameters{}, f.defaultInformer) -} - -func (f *resourceClassParametersInformer) Lister() v1alpha3.ResourceClassParametersLister { - return v1alpha3.NewResourceClassParametersLister(f.Informer().GetIndexer()) -} diff --git a/kubernetes/typed/resource/v1alpha3/deviceclass.go b/kubernetes/typed/resource/v1alpha3/deviceclass.go new file mode 100644 index 0000000000..35455dfa35 --- /dev/null +++ b/kubernetes/typed/resource/v1alpha3/deviceclass.go @@ -0,0 +1,69 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + "context" + + v1alpha3 "k8s.io/api/resource/v1alpha3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// DeviceClassesGetter has a method to return a DeviceClassInterface. +// A group's client should implement this interface. +type DeviceClassesGetter interface { + DeviceClasses() DeviceClassInterface +} + +// DeviceClassInterface has methods to work with DeviceClass resources. +type DeviceClassInterface interface { + Create(ctx context.Context, deviceClass *v1alpha3.DeviceClass, opts v1.CreateOptions) (*v1alpha3.DeviceClass, error) + Update(ctx context.Context, deviceClass *v1alpha3.DeviceClass, opts v1.UpdateOptions) (*v1alpha3.DeviceClass, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha3.DeviceClass, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.DeviceClassList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.DeviceClass, err error) + Apply(ctx context.Context, deviceClass *resourcev1alpha3.DeviceClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.DeviceClass, err error) + DeviceClassExpansion +} + +// deviceClasses implements DeviceClassInterface +type deviceClasses struct { + *gentype.ClientWithListAndApply[*v1alpha3.DeviceClass, *v1alpha3.DeviceClassList, *resourcev1alpha3.DeviceClassApplyConfiguration] +} + +// newDeviceClasses returns a DeviceClasses +func newDeviceClasses(c *ResourceV1alpha3Client) *deviceClasses { + return &deviceClasses{ + gentype.NewClientWithListAndApply[*v1alpha3.DeviceClass, *v1alpha3.DeviceClassList, *resourcev1alpha3.DeviceClassApplyConfiguration]( + "deviceclasses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1alpha3.DeviceClass { return &v1alpha3.DeviceClass{} }, + func() *v1alpha3.DeviceClassList { return &v1alpha3.DeviceClassList{} }), + } +} diff --git a/kubernetes/typed/resource/v1alpha3/fake/fake_deviceclass.go b/kubernetes/typed/resource/v1alpha3/fake/fake_deviceclass.go new file mode 100644 index 0000000000..d96cbd2219 --- /dev/null +++ b/kubernetes/typed/resource/v1alpha3/fake/fake_deviceclass.go @@ -0,0 +1,151 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1alpha3 "k8s.io/api/resource/v1alpha3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" + testing "k8s.io/client-go/testing" +) + +// FakeDeviceClasses implements DeviceClassInterface +type FakeDeviceClasses struct { + Fake *FakeResourceV1alpha3 +} + +var deviceclassesResource = v1alpha3.SchemeGroupVersion.WithResource("deviceclasses") + +var deviceclassesKind = v1alpha3.SchemeGroupVersion.WithKind("DeviceClass") + +// Get takes name of the deviceClass, and returns the corresponding deviceClass object, and an error if there is any. +func (c *FakeDeviceClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.DeviceClass, err error) { + emptyResult := &v1alpha3.DeviceClass{} + obj, err := c.Fake. + Invokes(testing.NewRootGetActionWithOptions(deviceclassesResource, name, options), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha3.DeviceClass), err +} + +// List takes label and field selectors, and returns the list of DeviceClasses that match those selectors. +func (c *FakeDeviceClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.DeviceClassList, err error) { + emptyResult := &v1alpha3.DeviceClassList{} + obj, err := c.Fake. + Invokes(testing.NewRootListActionWithOptions(deviceclassesResource, deviceclassesKind, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha3.DeviceClassList{ListMeta: obj.(*v1alpha3.DeviceClassList).ListMeta} + for _, item := range obj.(*v1alpha3.DeviceClassList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested deviceClasses. +func (c *FakeDeviceClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchActionWithOptions(deviceclassesResource, opts)) +} + +// Create takes the representation of a deviceClass and creates it. Returns the server's representation of the deviceClass, and an error, if there is any. +func (c *FakeDeviceClasses) Create(ctx context.Context, deviceClass *v1alpha3.DeviceClass, opts v1.CreateOptions) (result *v1alpha3.DeviceClass, err error) { + emptyResult := &v1alpha3.DeviceClass{} + obj, err := c.Fake. + Invokes(testing.NewRootCreateActionWithOptions(deviceclassesResource, deviceClass, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha3.DeviceClass), err +} + +// Update takes the representation of a deviceClass and updates it. Returns the server's representation of the deviceClass, and an error, if there is any. +func (c *FakeDeviceClasses) Update(ctx context.Context, deviceClass *v1alpha3.DeviceClass, opts v1.UpdateOptions) (result *v1alpha3.DeviceClass, err error) { + emptyResult := &v1alpha3.DeviceClass{} + obj, err := c.Fake. + Invokes(testing.NewRootUpdateActionWithOptions(deviceclassesResource, deviceClass, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha3.DeviceClass), err +} + +// Delete takes name of the deviceClass and deletes it. Returns an error if one occurs. +func (c *FakeDeviceClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(deviceclassesResource, name, opts), &v1alpha3.DeviceClass{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDeviceClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionActionWithOptions(deviceclassesResource, opts, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha3.DeviceClassList{}) + return err +} + +// Patch applies the patch and returns the patched deviceClass. +func (c *FakeDeviceClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.DeviceClass, err error) { + emptyResult := &v1alpha3.DeviceClass{} + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceActionWithOptions(deviceclassesResource, name, pt, data, opts, subresources...), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha3.DeviceClass), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied deviceClass. +func (c *FakeDeviceClasses) Apply(ctx context.Context, deviceClass *resourcev1alpha3.DeviceClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.DeviceClass, err error) { + if deviceClass == nil { + return nil, fmt.Errorf("deviceClass provided to Apply must not be nil") + } + data, err := json.Marshal(deviceClass) + if err != nil { + return nil, err + } + name := deviceClass.Name + if name == nil { + return nil, fmt.Errorf("deviceClass.Name must be provided to Apply") + } + emptyResult := &v1alpha3.DeviceClass{} + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceActionWithOptions(deviceclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha3.DeviceClass), err +} diff --git a/kubernetes/typed/resource/v1alpha3/fake/fake_resource_client.go b/kubernetes/typed/resource/v1alpha3/fake/fake_resource_client.go index d01b28c66a..4523d9f09c 100644 --- a/kubernetes/typed/resource/v1alpha3/fake/fake_resource_client.go +++ b/kubernetes/typed/resource/v1alpha3/fake/fake_resource_client.go @@ -28,6 +28,10 @@ type FakeResourceV1alpha3 struct { *testing.Fake } +func (c *FakeResourceV1alpha3) DeviceClasses() v1alpha3.DeviceClassInterface { + return &FakeDeviceClasses{c} +} + func (c *FakeResourceV1alpha3) PodSchedulingContexts(namespace string) v1alpha3.PodSchedulingContextInterface { return &FakePodSchedulingContexts{c, namespace} } @@ -36,22 +40,10 @@ func (c *FakeResourceV1alpha3) ResourceClaims(namespace string) v1alpha3.Resourc return &FakeResourceClaims{c, namespace} } -func (c *FakeResourceV1alpha3) ResourceClaimParameters(namespace string) v1alpha3.ResourceClaimParametersInterface { - return &FakeResourceClaimParameters{c, namespace} -} - func (c *FakeResourceV1alpha3) ResourceClaimTemplates(namespace string) v1alpha3.ResourceClaimTemplateInterface { return &FakeResourceClaimTemplates{c, namespace} } -func (c *FakeResourceV1alpha3) ResourceClasses() v1alpha3.ResourceClassInterface { - return &FakeResourceClasses{c} -} - -func (c *FakeResourceV1alpha3) ResourceClassParameters(namespace string) v1alpha3.ResourceClassParametersInterface { - return &FakeResourceClassParameters{c, namespace} -} - func (c *FakeResourceV1alpha3) ResourceSlices() v1alpha3.ResourceSliceInterface { return &FakeResourceSlices{c} } diff --git a/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaimparameters.go b/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaimparameters.go deleted file mode 100644 index 1f646101e5..0000000000 --- a/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclaimparameters.go +++ /dev/null @@ -1,160 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha3 "k8s.io/api/resource/v1alpha3" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" - testing "k8s.io/client-go/testing" -) - -// FakeResourceClaimParameters implements ResourceClaimParametersInterface -type FakeResourceClaimParameters struct { - Fake *FakeResourceV1alpha3 - ns string -} - -var resourceclaimparametersResource = v1alpha3.SchemeGroupVersion.WithResource("resourceclaimparameters") - -var resourceclaimparametersKind = v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimParameters") - -// Get takes name of the resourceClaimParameters, and returns the corresponding resourceClaimParameters object, and an error if there is any. -func (c *FakeResourceClaimParameters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.ResourceClaimParameters, err error) { - emptyResult := &v1alpha3.ResourceClaimParameters{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(resourceclaimparametersResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClaimParameters), err -} - -// List takes label and field selectors, and returns the list of ResourceClaimParameters that match those selectors. -func (c *FakeResourceClaimParameters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.ResourceClaimParametersList, err error) { - emptyResult := &v1alpha3.ResourceClaimParametersList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(resourceclaimparametersResource, resourceclaimparametersKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha3.ResourceClaimParametersList{ListMeta: obj.(*v1alpha3.ResourceClaimParametersList).ListMeta} - for _, item := range obj.(*v1alpha3.ResourceClaimParametersList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested resourceClaimParameters. -func (c *FakeResourceClaimParameters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(resourceclaimparametersResource, c.ns, opts)) - -} - -// Create takes the representation of a resourceClaimParameters and creates it. Returns the server's representation of the resourceClaimParameters, and an error, if there is any. -func (c *FakeResourceClaimParameters) Create(ctx context.Context, resourceClaimParameters *v1alpha3.ResourceClaimParameters, opts v1.CreateOptions) (result *v1alpha3.ResourceClaimParameters, err error) { - emptyResult := &v1alpha3.ResourceClaimParameters{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(resourceclaimparametersResource, c.ns, resourceClaimParameters, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClaimParameters), err -} - -// Update takes the representation of a resourceClaimParameters and updates it. Returns the server's representation of the resourceClaimParameters, and an error, if there is any. -func (c *FakeResourceClaimParameters) Update(ctx context.Context, resourceClaimParameters *v1alpha3.ResourceClaimParameters, opts v1.UpdateOptions) (result *v1alpha3.ResourceClaimParameters, err error) { - emptyResult := &v1alpha3.ResourceClaimParameters{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(resourceclaimparametersResource, c.ns, resourceClaimParameters, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClaimParameters), err -} - -// Delete takes name of the resourceClaimParameters and deletes it. Returns an error if one occurs. -func (c *FakeResourceClaimParameters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(resourceclaimparametersResource, c.ns, name, opts), &v1alpha3.ResourceClaimParameters{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeResourceClaimParameters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(resourceclaimparametersResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha3.ResourceClaimParametersList{}) - return err -} - -// Patch applies the patch and returns the patched resourceClaimParameters. -func (c *FakeResourceClaimParameters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClaimParameters, err error) { - emptyResult := &v1alpha3.ResourceClaimParameters{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimparametersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClaimParameters), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied resourceClaimParameters. -func (c *FakeResourceClaimParameters) Apply(ctx context.Context, resourceClaimParameters *resourcev1alpha3.ResourceClaimParametersApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaimParameters, err error) { - if resourceClaimParameters == nil { - return nil, fmt.Errorf("resourceClaimParameters provided to Apply must not be nil") - } - data, err := json.Marshal(resourceClaimParameters) - if err != nil { - return nil, err - } - name := resourceClaimParameters.Name - if name == nil { - return nil, fmt.Errorf("resourceClaimParameters.Name must be provided to Apply") - } - emptyResult := &v1alpha3.ResourceClaimParameters{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclaimparametersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClaimParameters), err -} diff --git a/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclass.go b/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclass.go deleted file mode 100644 index 7de1908865..0000000000 --- a/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclass.go +++ /dev/null @@ -1,151 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha3 "k8s.io/api/resource/v1alpha3" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" - testing "k8s.io/client-go/testing" -) - -// FakeResourceClasses implements ResourceClassInterface -type FakeResourceClasses struct { - Fake *FakeResourceV1alpha3 -} - -var resourceclassesResource = v1alpha3.SchemeGroupVersion.WithResource("resourceclasses") - -var resourceclassesKind = v1alpha3.SchemeGroupVersion.WithKind("ResourceClass") - -// Get takes name of the resourceClass, and returns the corresponding resourceClass object, and an error if there is any. -func (c *FakeResourceClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.ResourceClass, err error) { - emptyResult := &v1alpha3.ResourceClass{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(resourceclassesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClass), err -} - -// List takes label and field selectors, and returns the list of ResourceClasses that match those selectors. -func (c *FakeResourceClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.ResourceClassList, err error) { - emptyResult := &v1alpha3.ResourceClassList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(resourceclassesResource, resourceclassesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha3.ResourceClassList{ListMeta: obj.(*v1alpha3.ResourceClassList).ListMeta} - for _, item := range obj.(*v1alpha3.ResourceClassList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested resourceClasses. -func (c *FakeResourceClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(resourceclassesResource, opts)) -} - -// Create takes the representation of a resourceClass and creates it. Returns the server's representation of the resourceClass, and an error, if there is any. -func (c *FakeResourceClasses) Create(ctx context.Context, resourceClass *v1alpha3.ResourceClass, opts v1.CreateOptions) (result *v1alpha3.ResourceClass, err error) { - emptyResult := &v1alpha3.ResourceClass{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(resourceclassesResource, resourceClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClass), err -} - -// Update takes the representation of a resourceClass and updates it. Returns the server's representation of the resourceClass, and an error, if there is any. -func (c *FakeResourceClasses) Update(ctx context.Context, resourceClass *v1alpha3.ResourceClass, opts v1.UpdateOptions) (result *v1alpha3.ResourceClass, err error) { - emptyResult := &v1alpha3.ResourceClass{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(resourceclassesResource, resourceClass, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClass), err -} - -// Delete takes name of the resourceClass and deletes it. Returns an error if one occurs. -func (c *FakeResourceClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(resourceclassesResource, name, opts), &v1alpha3.ResourceClass{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeResourceClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(resourceclassesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha3.ResourceClassList{}) - return err -} - -// Patch applies the patch and returns the patched resourceClass. -func (c *FakeResourceClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClass, err error) { - emptyResult := &v1alpha3.ResourceClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(resourceclassesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClass), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied resourceClass. -func (c *FakeResourceClasses) Apply(ctx context.Context, resourceClass *resourcev1alpha3.ResourceClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClass, err error) { - if resourceClass == nil { - return nil, fmt.Errorf("resourceClass provided to Apply must not be nil") - } - data, err := json.Marshal(resourceClass) - if err != nil { - return nil, err - } - name := resourceClass.Name - if name == nil { - return nil, fmt.Errorf("resourceClass.Name must be provided to Apply") - } - emptyResult := &v1alpha3.ResourceClass{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(resourceclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClass), err -} diff --git a/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclassparameters.go b/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclassparameters.go deleted file mode 100644 index c61412de53..0000000000 --- a/kubernetes/typed/resource/v1alpha3/fake/fake_resourceclassparameters.go +++ /dev/null @@ -1,160 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - json "encoding/json" - "fmt" - - v1alpha3 "k8s.io/api/resource/v1alpha3" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" - testing "k8s.io/client-go/testing" -) - -// FakeResourceClassParameters implements ResourceClassParametersInterface -type FakeResourceClassParameters struct { - Fake *FakeResourceV1alpha3 - ns string -} - -var resourceclassparametersResource = v1alpha3.SchemeGroupVersion.WithResource("resourceclassparameters") - -var resourceclassparametersKind = v1alpha3.SchemeGroupVersion.WithKind("ResourceClassParameters") - -// Get takes name of the resourceClassParameters, and returns the corresponding resourceClassParameters object, and an error if there is any. -func (c *FakeResourceClassParameters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha3.ResourceClassParameters, err error) { - emptyResult := &v1alpha3.ResourceClassParameters{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(resourceclassparametersResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClassParameters), err -} - -// List takes label and field selectors, and returns the list of ResourceClassParameters that match those selectors. -func (c *FakeResourceClassParameters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha3.ResourceClassParametersList, err error) { - emptyResult := &v1alpha3.ResourceClassParametersList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(resourceclassparametersResource, resourceclassparametersKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha3.ResourceClassParametersList{ListMeta: obj.(*v1alpha3.ResourceClassParametersList).ListMeta} - for _, item := range obj.(*v1alpha3.ResourceClassParametersList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested resourceClassParameters. -func (c *FakeResourceClassParameters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(resourceclassparametersResource, c.ns, opts)) - -} - -// Create takes the representation of a resourceClassParameters and creates it. Returns the server's representation of the resourceClassParameters, and an error, if there is any. -func (c *FakeResourceClassParameters) Create(ctx context.Context, resourceClassParameters *v1alpha3.ResourceClassParameters, opts v1.CreateOptions) (result *v1alpha3.ResourceClassParameters, err error) { - emptyResult := &v1alpha3.ResourceClassParameters{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(resourceclassparametersResource, c.ns, resourceClassParameters, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClassParameters), err -} - -// Update takes the representation of a resourceClassParameters and updates it. Returns the server's representation of the resourceClassParameters, and an error, if there is any. -func (c *FakeResourceClassParameters) Update(ctx context.Context, resourceClassParameters *v1alpha3.ResourceClassParameters, opts v1.UpdateOptions) (result *v1alpha3.ResourceClassParameters, err error) { - emptyResult := &v1alpha3.ResourceClassParameters{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(resourceclassparametersResource, c.ns, resourceClassParameters, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClassParameters), err -} - -// Delete takes name of the resourceClassParameters and deletes it. Returns an error if one occurs. -func (c *FakeResourceClassParameters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(resourceclassparametersResource, c.ns, name, opts), &v1alpha3.ResourceClassParameters{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeResourceClassParameters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(resourceclassparametersResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha3.ResourceClassParametersList{}) - return err -} - -// Patch applies the patch and returns the patched resourceClassParameters. -func (c *FakeResourceClassParameters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClassParameters, err error) { - emptyResult := &v1alpha3.ResourceClassParameters{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclassparametersResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClassParameters), err -} - -// Apply takes the given apply declarative configuration, applies it and returns the applied resourceClassParameters. -func (c *FakeResourceClassParameters) Apply(ctx context.Context, resourceClassParameters *resourcev1alpha3.ResourceClassParametersApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClassParameters, err error) { - if resourceClassParameters == nil { - return nil, fmt.Errorf("resourceClassParameters provided to Apply must not be nil") - } - data, err := json.Marshal(resourceClassParameters) - if err != nil { - return nil, err - } - name := resourceClassParameters.Name - if name == nil { - return nil, fmt.Errorf("resourceClassParameters.Name must be provided to Apply") - } - emptyResult := &v1alpha3.ResourceClassParameters{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(resourceclassparametersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha3.ResourceClassParameters), err -} diff --git a/kubernetes/typed/resource/v1alpha3/generated_expansion.go b/kubernetes/typed/resource/v1alpha3/generated_expansion.go index 2f5289dabf..747e564b76 100644 --- a/kubernetes/typed/resource/v1alpha3/generated_expansion.go +++ b/kubernetes/typed/resource/v1alpha3/generated_expansion.go @@ -18,16 +18,12 @@ limitations under the License. package v1alpha3 +type DeviceClassExpansion interface{} + type PodSchedulingContextExpansion interface{} type ResourceClaimExpansion interface{} -type ResourceClaimParametersExpansion interface{} - type ResourceClaimTemplateExpansion interface{} -type ResourceClassExpansion interface{} - -type ResourceClassParametersExpansion interface{} - type ResourceSliceExpansion interface{} diff --git a/kubernetes/typed/resource/v1alpha3/resource_client.go b/kubernetes/typed/resource/v1alpha3/resource_client.go index 4cc6238b16..879f0990d7 100644 --- a/kubernetes/typed/resource/v1alpha3/resource_client.go +++ b/kubernetes/typed/resource/v1alpha3/resource_client.go @@ -28,12 +28,10 @@ import ( type ResourceV1alpha3Interface interface { RESTClient() rest.Interface + DeviceClassesGetter PodSchedulingContextsGetter ResourceClaimsGetter - ResourceClaimParametersGetter ResourceClaimTemplatesGetter - ResourceClassesGetter - ResourceClassParametersGetter ResourceSlicesGetter } @@ -42,6 +40,10 @@ type ResourceV1alpha3Client struct { restClient rest.Interface } +func (c *ResourceV1alpha3Client) DeviceClasses() DeviceClassInterface { + return newDeviceClasses(c) +} + func (c *ResourceV1alpha3Client) PodSchedulingContexts(namespace string) PodSchedulingContextInterface { return newPodSchedulingContexts(c, namespace) } @@ -50,22 +52,10 @@ func (c *ResourceV1alpha3Client) ResourceClaims(namespace string) ResourceClaimI return newResourceClaims(c, namespace) } -func (c *ResourceV1alpha3Client) ResourceClaimParameters(namespace string) ResourceClaimParametersInterface { - return newResourceClaimParameters(c, namespace) -} - func (c *ResourceV1alpha3Client) ResourceClaimTemplates(namespace string) ResourceClaimTemplateInterface { return newResourceClaimTemplates(c, namespace) } -func (c *ResourceV1alpha3Client) ResourceClasses() ResourceClassInterface { - return newResourceClasses(c) -} - -func (c *ResourceV1alpha3Client) ResourceClassParameters(namespace string) ResourceClassParametersInterface { - return newResourceClassParameters(c, namespace) -} - func (c *ResourceV1alpha3Client) ResourceSlices() ResourceSliceInterface { return newResourceSlices(c) } diff --git a/kubernetes/typed/resource/v1alpha3/resourceclaimparameters.go b/kubernetes/typed/resource/v1alpha3/resourceclaimparameters.go deleted file mode 100644 index 8ae3476f61..0000000000 --- a/kubernetes/typed/resource/v1alpha3/resourceclaimparameters.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha3 - -import ( - "context" - - v1alpha3 "k8s.io/api/resource/v1alpha3" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" - gentype "k8s.io/client-go/gentype" - scheme "k8s.io/client-go/kubernetes/scheme" -) - -// ResourceClaimParametersGetter has a method to return a ResourceClaimParametersInterface. -// A group's client should implement this interface. -type ResourceClaimParametersGetter interface { - ResourceClaimParameters(namespace string) ResourceClaimParametersInterface -} - -// ResourceClaimParametersInterface has methods to work with ResourceClaimParameters resources. -type ResourceClaimParametersInterface interface { - Create(ctx context.Context, resourceClaimParameters *v1alpha3.ResourceClaimParameters, opts v1.CreateOptions) (*v1alpha3.ResourceClaimParameters, error) - Update(ctx context.Context, resourceClaimParameters *v1alpha3.ResourceClaimParameters, opts v1.UpdateOptions) (*v1alpha3.ResourceClaimParameters, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha3.ResourceClaimParameters, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.ResourceClaimParametersList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClaimParameters, err error) - Apply(ctx context.Context, resourceClaimParameters *resourcev1alpha3.ResourceClaimParametersApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClaimParameters, err error) - ResourceClaimParametersExpansion -} - -// resourceClaimParameters implements ResourceClaimParametersInterface -type resourceClaimParameters struct { - *gentype.ClientWithListAndApply[*v1alpha3.ResourceClaimParameters, *v1alpha3.ResourceClaimParametersList, *resourcev1alpha3.ResourceClaimParametersApplyConfiguration] -} - -// newResourceClaimParameters returns a ResourceClaimParameters -func newResourceClaimParameters(c *ResourceV1alpha3Client, namespace string) *resourceClaimParameters { - return &resourceClaimParameters{ - gentype.NewClientWithListAndApply[*v1alpha3.ResourceClaimParameters, *v1alpha3.ResourceClaimParametersList, *resourcev1alpha3.ResourceClaimParametersApplyConfiguration]( - "resourceclaimparameters", - c.RESTClient(), - scheme.ParameterCodec, - namespace, - func() *v1alpha3.ResourceClaimParameters { return &v1alpha3.ResourceClaimParameters{} }, - func() *v1alpha3.ResourceClaimParametersList { return &v1alpha3.ResourceClaimParametersList{} }), - } -} diff --git a/kubernetes/typed/resource/v1alpha3/resourceclass.go b/kubernetes/typed/resource/v1alpha3/resourceclass.go deleted file mode 100644 index 0d88e96edf..0000000000 --- a/kubernetes/typed/resource/v1alpha3/resourceclass.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha3 - -import ( - "context" - - v1alpha3 "k8s.io/api/resource/v1alpha3" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" - gentype "k8s.io/client-go/gentype" - scheme "k8s.io/client-go/kubernetes/scheme" -) - -// ResourceClassesGetter has a method to return a ResourceClassInterface. -// A group's client should implement this interface. -type ResourceClassesGetter interface { - ResourceClasses() ResourceClassInterface -} - -// ResourceClassInterface has methods to work with ResourceClass resources. -type ResourceClassInterface interface { - Create(ctx context.Context, resourceClass *v1alpha3.ResourceClass, opts v1.CreateOptions) (*v1alpha3.ResourceClass, error) - Update(ctx context.Context, resourceClass *v1alpha3.ResourceClass, opts v1.UpdateOptions) (*v1alpha3.ResourceClass, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha3.ResourceClass, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.ResourceClassList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClass, err error) - Apply(ctx context.Context, resourceClass *resourcev1alpha3.ResourceClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClass, err error) - ResourceClassExpansion -} - -// resourceClasses implements ResourceClassInterface -type resourceClasses struct { - *gentype.ClientWithListAndApply[*v1alpha3.ResourceClass, *v1alpha3.ResourceClassList, *resourcev1alpha3.ResourceClassApplyConfiguration] -} - -// newResourceClasses returns a ResourceClasses -func newResourceClasses(c *ResourceV1alpha3Client) *resourceClasses { - return &resourceClasses{ - gentype.NewClientWithListAndApply[*v1alpha3.ResourceClass, *v1alpha3.ResourceClassList, *resourcev1alpha3.ResourceClassApplyConfiguration]( - "resourceclasses", - c.RESTClient(), - scheme.ParameterCodec, - "", - func() *v1alpha3.ResourceClass { return &v1alpha3.ResourceClass{} }, - func() *v1alpha3.ResourceClassList { return &v1alpha3.ResourceClassList{} }), - } -} diff --git a/kubernetes/typed/resource/v1alpha3/resourceclassparameters.go b/kubernetes/typed/resource/v1alpha3/resourceclassparameters.go deleted file mode 100644 index 42db8f7059..0000000000 --- a/kubernetes/typed/resource/v1alpha3/resourceclassparameters.go +++ /dev/null @@ -1,69 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha3 - -import ( - "context" - - v1alpha3 "k8s.io/api/resource/v1alpha3" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3" - gentype "k8s.io/client-go/gentype" - scheme "k8s.io/client-go/kubernetes/scheme" -) - -// ResourceClassParametersGetter has a method to return a ResourceClassParametersInterface. -// A group's client should implement this interface. -type ResourceClassParametersGetter interface { - ResourceClassParameters(namespace string) ResourceClassParametersInterface -} - -// ResourceClassParametersInterface has methods to work with ResourceClassParameters resources. -type ResourceClassParametersInterface interface { - Create(ctx context.Context, resourceClassParameters *v1alpha3.ResourceClassParameters, opts v1.CreateOptions) (*v1alpha3.ResourceClassParameters, error) - Update(ctx context.Context, resourceClassParameters *v1alpha3.ResourceClassParameters, opts v1.UpdateOptions) (*v1alpha3.ResourceClassParameters, error) - Delete(ctx context.Context, name string, opts v1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha3.ResourceClassParameters, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha3.ResourceClassParametersList, error) - Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha3.ResourceClassParameters, err error) - Apply(ctx context.Context, resourceClassParameters *resourcev1alpha3.ResourceClassParametersApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha3.ResourceClassParameters, err error) - ResourceClassParametersExpansion -} - -// resourceClassParameters implements ResourceClassParametersInterface -type resourceClassParameters struct { - *gentype.ClientWithListAndApply[*v1alpha3.ResourceClassParameters, *v1alpha3.ResourceClassParametersList, *resourcev1alpha3.ResourceClassParametersApplyConfiguration] -} - -// newResourceClassParameters returns a ResourceClassParameters -func newResourceClassParameters(c *ResourceV1alpha3Client, namespace string) *resourceClassParameters { - return &resourceClassParameters{ - gentype.NewClientWithListAndApply[*v1alpha3.ResourceClassParameters, *v1alpha3.ResourceClassParametersList, *resourcev1alpha3.ResourceClassParametersApplyConfiguration]( - "resourceclassparameters", - c.RESTClient(), - scheme.ParameterCodec, - namespace, - func() *v1alpha3.ResourceClassParameters { return &v1alpha3.ResourceClassParameters{} }, - func() *v1alpha3.ResourceClassParametersList { return &v1alpha3.ResourceClassParametersList{} }), - } -} diff --git a/listers/resource/v1alpha3/resourceclass.go b/listers/resource/v1alpha3/deviceclass.go similarity index 55% rename from listers/resource/v1alpha3/resourceclass.go rename to listers/resource/v1alpha3/deviceclass.go index 0c911003b0..0950691e2b 100644 --- a/listers/resource/v1alpha3/resourceclass.go +++ b/listers/resource/v1alpha3/deviceclass.go @@ -25,24 +25,24 @@ import ( "k8s.io/client-go/tools/cache" ) -// ResourceClassLister helps list ResourceClasses. +// DeviceClassLister helps list DeviceClasses. // All objects returned here must be treated as read-only. -type ResourceClassLister interface { - // List lists all ResourceClasses in the indexer. +type DeviceClassLister interface { + // List lists all DeviceClasses in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha3.ResourceClass, err error) - // Get retrieves the ResourceClass from the index for a given name. + List(selector labels.Selector) (ret []*v1alpha3.DeviceClass, err error) + // Get retrieves the DeviceClass from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha3.ResourceClass, error) - ResourceClassListerExpansion + Get(name string) (*v1alpha3.DeviceClass, error) + DeviceClassListerExpansion } -// resourceClassLister implements the ResourceClassLister interface. -type resourceClassLister struct { - listers.ResourceIndexer[*v1alpha3.ResourceClass] +// deviceClassLister implements the DeviceClassLister interface. +type deviceClassLister struct { + listers.ResourceIndexer[*v1alpha3.DeviceClass] } -// NewResourceClassLister returns a new ResourceClassLister. -func NewResourceClassLister(indexer cache.Indexer) ResourceClassLister { - return &resourceClassLister{listers.New[*v1alpha3.ResourceClass](indexer, v1alpha3.Resource("resourceclass"))} +// NewDeviceClassLister returns a new DeviceClassLister. +func NewDeviceClassLister(indexer cache.Indexer) DeviceClassLister { + return &deviceClassLister{listers.New[*v1alpha3.DeviceClass](indexer, v1alpha3.Resource("deviceclass"))} } diff --git a/listers/resource/v1alpha3/expansion_generated.go b/listers/resource/v1alpha3/expansion_generated.go index bc580e3d23..b6642f635f 100644 --- a/listers/resource/v1alpha3/expansion_generated.go +++ b/listers/resource/v1alpha3/expansion_generated.go @@ -18,6 +18,10 @@ limitations under the License. package v1alpha3 +// DeviceClassListerExpansion allows custom methods to be added to +// DeviceClassLister. +type DeviceClassListerExpansion interface{} + // PodSchedulingContextListerExpansion allows custom methods to be added to // PodSchedulingContextLister. type PodSchedulingContextListerExpansion interface{} @@ -34,14 +38,6 @@ type ResourceClaimListerExpansion interface{} // ResourceClaimNamespaceLister. type ResourceClaimNamespaceListerExpansion interface{} -// ResourceClaimParametersListerExpansion allows custom methods to be added to -// ResourceClaimParametersLister. -type ResourceClaimParametersListerExpansion interface{} - -// ResourceClaimParametersNamespaceListerExpansion allows custom methods to be added to -// ResourceClaimParametersNamespaceLister. -type ResourceClaimParametersNamespaceListerExpansion interface{} - // ResourceClaimTemplateListerExpansion allows custom methods to be added to // ResourceClaimTemplateLister. type ResourceClaimTemplateListerExpansion interface{} @@ -50,18 +46,6 @@ type ResourceClaimTemplateListerExpansion interface{} // ResourceClaimTemplateNamespaceLister. type ResourceClaimTemplateNamespaceListerExpansion interface{} -// ResourceClassListerExpansion allows custom methods to be added to -// ResourceClassLister. -type ResourceClassListerExpansion interface{} - -// ResourceClassParametersListerExpansion allows custom methods to be added to -// ResourceClassParametersLister. -type ResourceClassParametersListerExpansion interface{} - -// ResourceClassParametersNamespaceListerExpansion allows custom methods to be added to -// ResourceClassParametersNamespaceLister. -type ResourceClassParametersNamespaceListerExpansion interface{} - // ResourceSliceListerExpansion allows custom methods to be added to // ResourceSliceLister. type ResourceSliceListerExpansion interface{} diff --git a/listers/resource/v1alpha3/resourceclaimparameters.go b/listers/resource/v1alpha3/resourceclaimparameters.go deleted file mode 100644 index aa5636b33d..0000000000 --- a/listers/resource/v1alpha3/resourceclaimparameters.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha3 - -import ( - v1alpha3 "k8s.io/api/resource/v1alpha3" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" -) - -// ResourceClaimParametersLister helps list ResourceClaimParameters. -// All objects returned here must be treated as read-only. -type ResourceClaimParametersLister interface { - // List lists all ResourceClaimParameters in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha3.ResourceClaimParameters, err error) - // ResourceClaimParameters returns an object that can list and get ResourceClaimParameters. - ResourceClaimParameters(namespace string) ResourceClaimParametersNamespaceLister - ResourceClaimParametersListerExpansion -} - -// resourceClaimParametersLister implements the ResourceClaimParametersLister interface. -type resourceClaimParametersLister struct { - listers.ResourceIndexer[*v1alpha3.ResourceClaimParameters] -} - -// NewResourceClaimParametersLister returns a new ResourceClaimParametersLister. -func NewResourceClaimParametersLister(indexer cache.Indexer) ResourceClaimParametersLister { - return &resourceClaimParametersLister{listers.New[*v1alpha3.ResourceClaimParameters](indexer, v1alpha3.Resource("resourceclaimparameters"))} -} - -// ResourceClaimParameters returns an object that can list and get ResourceClaimParameters. -func (s *resourceClaimParametersLister) ResourceClaimParameters(namespace string) ResourceClaimParametersNamespaceLister { - return resourceClaimParametersNamespaceLister{listers.NewNamespaced[*v1alpha3.ResourceClaimParameters](s.ResourceIndexer, namespace)} -} - -// ResourceClaimParametersNamespaceLister helps list and get ResourceClaimParameters. -// All objects returned here must be treated as read-only. -type ResourceClaimParametersNamespaceLister interface { - // List lists all ResourceClaimParameters in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha3.ResourceClaimParameters, err error) - // Get retrieves the ResourceClaimParameters from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha3.ResourceClaimParameters, error) - ResourceClaimParametersNamespaceListerExpansion -} - -// resourceClaimParametersNamespaceLister implements the ResourceClaimParametersNamespaceLister -// interface. -type resourceClaimParametersNamespaceLister struct { - listers.ResourceIndexer[*v1alpha3.ResourceClaimParameters] -} diff --git a/listers/resource/v1alpha3/resourceclassparameters.go b/listers/resource/v1alpha3/resourceclassparameters.go deleted file mode 100644 index beb0645a9e..0000000000 --- a/listers/resource/v1alpha3/resourceclassparameters.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by lister-gen. DO NOT EDIT. - -package v1alpha3 - -import ( - v1alpha3 "k8s.io/api/resource/v1alpha3" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" -) - -// ResourceClassParametersLister helps list ResourceClassParameters. -// All objects returned here must be treated as read-only. -type ResourceClassParametersLister interface { - // List lists all ResourceClassParameters in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha3.ResourceClassParameters, err error) - // ResourceClassParameters returns an object that can list and get ResourceClassParameters. - ResourceClassParameters(namespace string) ResourceClassParametersNamespaceLister - ResourceClassParametersListerExpansion -} - -// resourceClassParametersLister implements the ResourceClassParametersLister interface. -type resourceClassParametersLister struct { - listers.ResourceIndexer[*v1alpha3.ResourceClassParameters] -} - -// NewResourceClassParametersLister returns a new ResourceClassParametersLister. -func NewResourceClassParametersLister(indexer cache.Indexer) ResourceClassParametersLister { - return &resourceClassParametersLister{listers.New[*v1alpha3.ResourceClassParameters](indexer, v1alpha3.Resource("resourceclassparameters"))} -} - -// ResourceClassParameters returns an object that can list and get ResourceClassParameters. -func (s *resourceClassParametersLister) ResourceClassParameters(namespace string) ResourceClassParametersNamespaceLister { - return resourceClassParametersNamespaceLister{listers.NewNamespaced[*v1alpha3.ResourceClassParameters](s.ResourceIndexer, namespace)} -} - -// ResourceClassParametersNamespaceLister helps list and get ResourceClassParameters. -// All objects returned here must be treated as read-only. -type ResourceClassParametersNamespaceLister interface { - // List lists all ResourceClassParameters in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha3.ResourceClassParameters, err error) - // Get retrieves the ResourceClassParameters from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha3.ResourceClassParameters, error) - ResourceClassParametersNamespaceListerExpansion -} - -// resourceClassParametersNamespaceLister implements the ResourceClassParametersNamespaceLister -// interface. -type resourceClassParametersNamespaceLister struct { - listers.ResourceIndexer[*v1alpha3.ResourceClassParameters] -} From a9affb4c9c01deb044f1ff838dba4533f5e04cb9 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Mon, 22 Jul 2024 11:45:55 -0700 Subject: [PATCH 142/159] Merge pull request #125488 from pohly/dra-1.31 DRA for 1.31 Kubernetes-commit: d21b17264e5a554724aa3ad032536630bcfd5b3f --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5597df4a51..2bbf765923 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.34.2 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240720022854-7d5e5eaf3aef + k8s.io/api v0.0.0-20240722223048-9516298b292e k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 diff --git a/go.sum b/go.sum index f6d4fed3a4..829154cc31 100644 --- a/go.sum +++ b/go.sum @@ -156,8 +156,8 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240720022854-7d5e5eaf3aef h1:srEy4lds3ddDhT+cxFy68Uvt3GVRTo3fwnw+Us/Nqqs= -k8s.io/api v0.0.0-20240720022854-7d5e5eaf3aef/go.mod h1:SvpyE6bmVBf1ly5BaD4y6yym4ZpHrV2pa8tTRjcglaA= +k8s.io/api v0.0.0-20240722223048-9516298b292e h1:n9SmHfxWHZKHj0n5U+45hjVVWLEWoL5wbCo2zChYpdo= +k8s.io/api v0.0.0-20240722223048-9516298b292e/go.mod h1:ytlEzqC2wOTwYET71W7+J+k7O2V7vrDuzmNLBSpgT+k= k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe h1:V9MwpYUwbKlfLKVrhpVuKWiat/LBIhm1pGB9/xdHm5Q= k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= From 3aff10e3cd830c2d640f6886328da7027cde8513 Mon Sep 17 00:00:00 2001 From: Sean Sullivan Date: Sun, 14 Jul 2024 19:46:16 -0700 Subject: [PATCH 143/159] Adds extra error information from response to bad handshake error when possible Kubernetes-commit: f387f0b69acb34143f76275aacb955fabb555bd7 --- transport/websocket/roundtripper.go | 4 ++++ transport/websocket/roundtripper_test.go | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/transport/websocket/roundtripper.go b/transport/websocket/roundtripper.go index 624dd5473a..8286a8eb52 100644 --- a/transport/websocket/roundtripper.go +++ b/transport/websocket/roundtripper.go @@ -111,6 +111,10 @@ func (rt *RoundTripper) RoundTrip(request *http.Request) (retResp *http.Response wsConn, resp, err := dialer.DialContext(request.Context(), request.URL.String(), request.Header) if err != nil { if errors.Is(err, gwebsocket.ErrBadHandshake) { + // Enhance the error message with the response status if possible. + if resp != nil && len(resp.Status) > 0 { + err = fmt.Errorf("%w (%s)", err, resp.Status) + } return nil, &httpstream.UpgradeFailureError{Cause: err} } return nil, err diff --git a/transport/websocket/roundtripper_test.go b/transport/websocket/roundtripper_test.go index 39baba4b3e..c03565d1a4 100644 --- a/transport/websocket/roundtripper_test.go +++ b/transport/websocket/roundtripper_test.go @@ -87,7 +87,8 @@ func TestWebSocketRoundTripper_RoundTripperFails(t *testing.T) { _, err = rt.RoundTrip(req) // Ensure a "bad handshake" error is returned, since requested protocol is not supported. require.Error(t, err) - assert.True(t, strings.Contains(err.Error(), "bad handshake")) + assert.True(t, strings.Contains(err.Error(), "websocket: bad handshake")) + assert.True(t, strings.Contains(err.Error(), "403 Forbidden")) assert.True(t, httpstream.IsUpgradeFailure(err)) } From 001900e4e98a496a3d336e5cf456b9df4dd26807 Mon Sep 17 00:00:00 2001 From: mprahl Date: Tue, 16 Jul 2024 10:55:26 -0400 Subject: [PATCH 144/159] Allow calling Stop multiple times on RetryWatcher This makes the Stop method idempotent so that if Stop is called multiple times, it does not cause a panic due to closing a closed channel. Signed-off-by: mprahl Kubernetes-commit: a54ba917be42c941edf1a0359dced04e1a5e1d6f --- tools/watch/retrywatcher.go | 12 +++++++++++- tools/watch/retrywatcher_test.go | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/watch/retrywatcher.go b/tools/watch/retrywatcher.go index d81dc43570..8431d02fcb 100644 --- a/tools/watch/retrywatcher.go +++ b/tools/watch/retrywatcher.go @@ -22,6 +22,7 @@ import ( "fmt" "io" "net/http" + "sync" "time" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -53,6 +54,7 @@ type RetryWatcher struct { stopChan chan struct{} doneChan chan struct{} minRestartDelay time.Duration + stopChanLock sync.Mutex } // NewRetryWatcher creates a new RetryWatcher. @@ -286,7 +288,15 @@ func (rw *RetryWatcher) ResultChan() <-chan watch.Event { // Stop implements Interface. func (rw *RetryWatcher) Stop() { - close(rw.stopChan) + rw.stopChanLock.Lock() + defer rw.stopChanLock.Unlock() + + // Prevent closing an already closed channel to prevent a panic + select { + case <-rw.stopChan: + default: + close(rw.stopChan) + } } // Done allows the caller to be notified when Retry watcher stops. diff --git a/tools/watch/retrywatcher_test.go b/tools/watch/retrywatcher_test.go index fff3a46c48..297661aae6 100644 --- a/tools/watch/retrywatcher_test.go +++ b/tools/watch/retrywatcher_test.go @@ -585,6 +585,8 @@ func TestRetryWatcherToFinishWithUnreadEvents(t *testing.T) { // Give the watcher a chance to get to sending events (blocking) time.Sleep(10 * time.Millisecond) + watcher.Stop() + // Verify a second stop does not cause a panic watcher.Stop() maxTime := time.Second From 9dea255e1203b0e64faf1a0e7a6c05fc3d1646cd Mon Sep 17 00:00:00 2001 From: carlory Date: Wed, 17 Jul 2024 15:55:06 +0800 Subject: [PATCH 145/159] Promote VolumeAttributesClass to beta Kubernetes-commit: 0260c7d023551f85621049ca604a4fd5110ba0a9 --- applyconfigurations/internal/internal.go | 22 ++ .../storage/v1beta1/volumeattributesclass.go | 268 ++++++++++++++++++ applyconfigurations/utils.go | 2 + informers/generic.go | 2 + informers/storage/v1beta1/interface.go | 7 + .../storage/v1beta1/volumeattributesclass.go | 89 ++++++ .../v1beta1/fake/fake_storage_client.go | 4 + .../fake/fake_volumeattributesclass.go | 151 ++++++++++ .../storage/v1beta1/generated_expansion.go | 2 + .../typed/storage/v1beta1/storage_client.go | 5 + .../storage/v1beta1/volumeattributesclass.go | 69 +++++ .../storage/v1beta1/expansion_generated.go | 4 + .../storage/v1beta1/volumeattributesclass.go | 48 ++++ 13 files changed, 673 insertions(+) create mode 100644 applyconfigurations/storage/v1beta1/volumeattributesclass.go create mode 100644 informers/storage/v1beta1/volumeattributesclass.go create mode 100644 kubernetes/typed/storage/v1beta1/fake/fake_volumeattributesclass.go create mode 100644 kubernetes/typed/storage/v1beta1/volumeattributesclass.go create mode 100644 listers/storage/v1beta1/volumeattributesclass.go diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 018530854c..d0400ba109 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -13296,6 +13296,28 @@ var schemaYAML = typed.YAMLObject(`types: - name: detachError type: namedType: io.k8s.api.storage.v1beta1.VolumeError +- name: io.k8s.api.storage.v1beta1.VolumeAttributesClass + map: + fields: + - name: apiVersion + type: + scalar: string + - name: driverName + type: + scalar: string + default: "" + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: parameters + type: + map: + elementType: + scalar: string - name: io.k8s.api.storage.v1beta1.VolumeError map: fields: diff --git a/applyconfigurations/storage/v1beta1/volumeattributesclass.go b/applyconfigurations/storage/v1beta1/volumeattributesclass.go new file mode 100644 index 0000000000..7b221d2775 --- /dev/null +++ b/applyconfigurations/storage/v1beta1/volumeattributesclass.go @@ -0,0 +1,268 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "k8s.io/api/storage/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// VolumeAttributesClassApplyConfiguration represents a declarative configuration of the VolumeAttributesClass type for use +// with apply. +type VolumeAttributesClassApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + DriverName *string `json:"driverName,omitempty"` + Parameters map[string]string `json:"parameters,omitempty"` +} + +// VolumeAttributesClass constructs a declarative configuration of the VolumeAttributesClass type for use with +// apply. +func VolumeAttributesClass(name string) *VolumeAttributesClassApplyConfiguration { + b := &VolumeAttributesClassApplyConfiguration{} + b.WithName(name) + b.WithKind("VolumeAttributesClass") + b.WithAPIVersion("storage.k8s.io/v1beta1") + return b +} + +// ExtractVolumeAttributesClass extracts the applied configuration owned by fieldManager from +// volumeAttributesClass. If no managedFields are found in volumeAttributesClass for fieldManager, a +// VolumeAttributesClassApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// volumeAttributesClass must be a unmodified VolumeAttributesClass API object that was retrieved from the Kubernetes API. +// ExtractVolumeAttributesClass provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractVolumeAttributesClass(volumeAttributesClass *v1beta1.VolumeAttributesClass, fieldManager string) (*VolumeAttributesClassApplyConfiguration, error) { + return extractVolumeAttributesClass(volumeAttributesClass, fieldManager, "") +} + +// ExtractVolumeAttributesClassStatus is the same as ExtractVolumeAttributesClass except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractVolumeAttributesClassStatus(volumeAttributesClass *v1beta1.VolumeAttributesClass, fieldManager string) (*VolumeAttributesClassApplyConfiguration, error) { + return extractVolumeAttributesClass(volumeAttributesClass, fieldManager, "status") +} + +func extractVolumeAttributesClass(volumeAttributesClass *v1beta1.VolumeAttributesClass, fieldManager string, subresource string) (*VolumeAttributesClassApplyConfiguration, error) { + b := &VolumeAttributesClassApplyConfiguration{} + err := managedfields.ExtractInto(volumeAttributesClass, internal.Parser().Type("io.k8s.api.storage.v1beta1.VolumeAttributesClass"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(volumeAttributesClass.Name) + + b.WithKind("VolumeAttributesClass") + b.WithAPIVersion("storage.k8s.io/v1beta1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *VolumeAttributesClassApplyConfiguration) WithKind(value string) *VolumeAttributesClassApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *VolumeAttributesClassApplyConfiguration) WithAPIVersion(value string) *VolumeAttributesClassApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *VolumeAttributesClassApplyConfiguration) WithName(value string) *VolumeAttributesClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *VolumeAttributesClassApplyConfiguration) WithGenerateName(value string) *VolumeAttributesClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *VolumeAttributesClassApplyConfiguration) WithNamespace(value string) *VolumeAttributesClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *VolumeAttributesClassApplyConfiguration) WithUID(value types.UID) *VolumeAttributesClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *VolumeAttributesClassApplyConfiguration) WithResourceVersion(value string) *VolumeAttributesClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *VolumeAttributesClassApplyConfiguration) WithGeneration(value int64) *VolumeAttributesClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *VolumeAttributesClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *VolumeAttributesClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *VolumeAttributesClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *VolumeAttributesClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *VolumeAttributesClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *VolumeAttributesClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *VolumeAttributesClassApplyConfiguration) WithLabels(entries map[string]string) *VolumeAttributesClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *VolumeAttributesClassApplyConfiguration) WithAnnotations(entries map[string]string) *VolumeAttributesClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *VolumeAttributesClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *VolumeAttributesClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *VolumeAttributesClassApplyConfiguration) WithFinalizers(values ...string) *VolumeAttributesClassApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *VolumeAttributesClassApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithDriverName sets the DriverName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DriverName field is set to the value of the last call. +func (b *VolumeAttributesClassApplyConfiguration) WithDriverName(value string) *VolumeAttributesClassApplyConfiguration { + b.DriverName = &value + return b +} + +// WithParameters puts the entries into the Parameters field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Parameters field, +// overwriting an existing map entries in Parameters field with the same key. +func (b *VolumeAttributesClassApplyConfiguration) WithParameters(entries map[string]string) *VolumeAttributesClassApplyConfiguration { + if b.Parameters == nil && len(entries) > 0 { + b.Parameters = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Parameters[k] = v + } + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *VolumeAttributesClassApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index 64ffaa9f47..98079c23a9 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -1700,6 +1700,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationsstoragev1beta1.VolumeAttachmentSpecApplyConfiguration{} case storagev1beta1.SchemeGroupVersion.WithKind("VolumeAttachmentStatus"): return &applyconfigurationsstoragev1beta1.VolumeAttachmentStatusApplyConfiguration{} + case storagev1beta1.SchemeGroupVersion.WithKind("VolumeAttributesClass"): + return &applyconfigurationsstoragev1beta1.VolumeAttributesClassApplyConfiguration{} case storagev1beta1.SchemeGroupVersion.WithKind("VolumeError"): return &applyconfigurationsstoragev1beta1.VolumeErrorApplyConfiguration{} case storagev1beta1.SchemeGroupVersion.WithKind("VolumeNodeResources"): diff --git a/informers/generic.go b/informers/generic.go index c7df13f252..7cca8a154c 100644 --- a/informers/generic.go +++ b/informers/generic.go @@ -421,6 +421,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().StorageClasses().Informer()}, nil case storagev1beta1.SchemeGroupVersion.WithResource("volumeattachments"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().VolumeAttachments().Informer()}, nil + case storagev1beta1.SchemeGroupVersion.WithResource("volumeattributesclasses"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().VolumeAttributesClasses().Informer()}, nil // Group=storagemigration.k8s.io, Version=v1alpha1 case storagemigrationv1alpha1.SchemeGroupVersion.WithResource("storageversionmigrations"): diff --git a/informers/storage/v1beta1/interface.go b/informers/storage/v1beta1/interface.go index 77b77c08ee..7433951855 100644 --- a/informers/storage/v1beta1/interface.go +++ b/informers/storage/v1beta1/interface.go @@ -34,6 +34,8 @@ type Interface interface { StorageClasses() StorageClassInformer // VolumeAttachments returns a VolumeAttachmentInformer. VolumeAttachments() VolumeAttachmentInformer + // VolumeAttributesClasses returns a VolumeAttributesClassInformer. + VolumeAttributesClasses() VolumeAttributesClassInformer } type version struct { @@ -71,3 +73,8 @@ func (v *version) StorageClasses() StorageClassInformer { func (v *version) VolumeAttachments() VolumeAttachmentInformer { return &volumeAttachmentInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } + +// VolumeAttributesClasses returns a VolumeAttributesClassInformer. +func (v *version) VolumeAttributesClasses() VolumeAttributesClassInformer { + return &volumeAttributesClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/informers/storage/v1beta1/volumeattributesclass.go b/informers/storage/v1beta1/volumeattributesclass.go new file mode 100644 index 0000000000..ede90ce43c --- /dev/null +++ b/informers/storage/v1beta1/volumeattributesclass.go @@ -0,0 +1,89 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + storagev1beta1 "k8s.io/api/storage/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + v1beta1 "k8s.io/client-go/listers/storage/v1beta1" + cache "k8s.io/client-go/tools/cache" +) + +// VolumeAttributesClassInformer provides access to a shared informer and lister for +// VolumeAttributesClasses. +type VolumeAttributesClassInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.VolumeAttributesClassLister +} + +type volumeAttributesClassInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredVolumeAttributesClassInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredVolumeAttributesClassInformer constructs a new informer for VolumeAttributesClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredVolumeAttributesClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1beta1().VolumeAttributesClasses().List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1beta1().VolumeAttributesClasses().Watch(context.TODO(), options) + }, + }, + &storagev1beta1.VolumeAttributesClass{}, + resyncPeriod, + indexers, + ) +} + +func (f *volumeAttributesClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredVolumeAttributesClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *volumeAttributesClassInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&storagev1beta1.VolumeAttributesClass{}, f.defaultInformer) +} + +func (f *volumeAttributesClassInformer) Lister() v1beta1.VolumeAttributesClassLister { + return v1beta1.NewVolumeAttributesClassLister(f.Informer().GetIndexer()) +} diff --git a/kubernetes/typed/storage/v1beta1/fake/fake_storage_client.go b/kubernetes/typed/storage/v1beta1/fake/fake_storage_client.go index 6b5bb02fda..470281607f 100644 --- a/kubernetes/typed/storage/v1beta1/fake/fake_storage_client.go +++ b/kubernetes/typed/storage/v1beta1/fake/fake_storage_client.go @@ -48,6 +48,10 @@ func (c *FakeStorageV1beta1) VolumeAttachments() v1beta1.VolumeAttachmentInterfa return &FakeVolumeAttachments{c} } +func (c *FakeStorageV1beta1) VolumeAttributesClasses() v1beta1.VolumeAttributesClassInterface { + return &FakeVolumeAttributesClasses{c} +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeStorageV1beta1) RESTClient() rest.Interface { diff --git a/kubernetes/typed/storage/v1beta1/fake/fake_volumeattributesclass.go b/kubernetes/typed/storage/v1beta1/fake/fake_volumeattributesclass.go new file mode 100644 index 0000000000..3cef7291ab --- /dev/null +++ b/kubernetes/typed/storage/v1beta1/fake/fake_volumeattributesclass.go @@ -0,0 +1,151 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1beta1 "k8s.io/api/storage/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" + testing "k8s.io/client-go/testing" +) + +// FakeVolumeAttributesClasses implements VolumeAttributesClassInterface +type FakeVolumeAttributesClasses struct { + Fake *FakeStorageV1beta1 +} + +var volumeattributesclassesResource = v1beta1.SchemeGroupVersion.WithResource("volumeattributesclasses") + +var volumeattributesclassesKind = v1beta1.SchemeGroupVersion.WithKind("VolumeAttributesClass") + +// Get takes name of the volumeAttributesClass, and returns the corresponding volumeAttributesClass object, and an error if there is any. +func (c *FakeVolumeAttributesClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeAttributesClass, err error) { + emptyResult := &v1beta1.VolumeAttributesClass{} + obj, err := c.Fake. + Invokes(testing.NewRootGetActionWithOptions(volumeattributesclassesResource, name, options), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1beta1.VolumeAttributesClass), err +} + +// List takes label and field selectors, and returns the list of VolumeAttributesClasses that match those selectors. +func (c *FakeVolumeAttributesClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeAttributesClassList, err error) { + emptyResult := &v1beta1.VolumeAttributesClassList{} + obj, err := c.Fake. + Invokes(testing.NewRootListActionWithOptions(volumeattributesclassesResource, volumeattributesclassesKind, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.VolumeAttributesClassList{ListMeta: obj.(*v1beta1.VolumeAttributesClassList).ListMeta} + for _, item := range obj.(*v1beta1.VolumeAttributesClassList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested volumeAttributesClasses. +func (c *FakeVolumeAttributesClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchActionWithOptions(volumeattributesclassesResource, opts)) +} + +// Create takes the representation of a volumeAttributesClass and creates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. +func (c *FakeVolumeAttributesClasses) Create(ctx context.Context, volumeAttributesClass *v1beta1.VolumeAttributesClass, opts v1.CreateOptions) (result *v1beta1.VolumeAttributesClass, err error) { + emptyResult := &v1beta1.VolumeAttributesClass{} + obj, err := c.Fake. + Invokes(testing.NewRootCreateActionWithOptions(volumeattributesclassesResource, volumeAttributesClass, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1beta1.VolumeAttributesClass), err +} + +// Update takes the representation of a volumeAttributesClass and updates it. Returns the server's representation of the volumeAttributesClass, and an error, if there is any. +func (c *FakeVolumeAttributesClasses) Update(ctx context.Context, volumeAttributesClass *v1beta1.VolumeAttributesClass, opts v1.UpdateOptions) (result *v1beta1.VolumeAttributesClass, err error) { + emptyResult := &v1beta1.VolumeAttributesClass{} + obj, err := c.Fake. + Invokes(testing.NewRootUpdateActionWithOptions(volumeattributesclassesResource, volumeAttributesClass, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1beta1.VolumeAttributesClass), err +} + +// Delete takes name of the volumeAttributesClass and deletes it. Returns an error if one occurs. +func (c *FakeVolumeAttributesClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(volumeattributesclassesResource, name, opts), &v1beta1.VolumeAttributesClass{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVolumeAttributesClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionActionWithOptions(volumeattributesclassesResource, opts, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.VolumeAttributesClassList{}) + return err +} + +// Patch applies the patch and returns the patched volumeAttributesClass. +func (c *FakeVolumeAttributesClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeAttributesClass, err error) { + emptyResult := &v1beta1.VolumeAttributesClass{} + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattributesclassesResource, name, pt, data, opts, subresources...), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1beta1.VolumeAttributesClass), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied volumeAttributesClass. +func (c *FakeVolumeAttributesClasses) Apply(ctx context.Context, volumeAttributesClass *storagev1beta1.VolumeAttributesClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.VolumeAttributesClass, err error) { + if volumeAttributesClass == nil { + return nil, fmt.Errorf("volumeAttributesClass provided to Apply must not be nil") + } + data, err := json.Marshal(volumeAttributesClass) + if err != nil { + return nil, err + } + name := volumeAttributesClass.Name + if name == nil { + return nil, fmt.Errorf("volumeAttributesClass.Name must be provided to Apply") + } + emptyResult := &v1beta1.VolumeAttributesClass{} + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceActionWithOptions(volumeattributesclassesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(*v1beta1.VolumeAttributesClass), err +} diff --git a/kubernetes/typed/storage/v1beta1/generated_expansion.go b/kubernetes/typed/storage/v1beta1/generated_expansion.go index 1a202a928e..ebf78e10bc 100644 --- a/kubernetes/typed/storage/v1beta1/generated_expansion.go +++ b/kubernetes/typed/storage/v1beta1/generated_expansion.go @@ -27,3 +27,5 @@ type CSIStorageCapacityExpansion interface{} type StorageClassExpansion interface{} type VolumeAttachmentExpansion interface{} + +type VolumeAttributesClassExpansion interface{} diff --git a/kubernetes/typed/storage/v1beta1/storage_client.go b/kubernetes/typed/storage/v1beta1/storage_client.go index 4c7604bd29..3d1b59e36c 100644 --- a/kubernetes/typed/storage/v1beta1/storage_client.go +++ b/kubernetes/typed/storage/v1beta1/storage_client.go @@ -33,6 +33,7 @@ type StorageV1beta1Interface interface { CSIStorageCapacitiesGetter StorageClassesGetter VolumeAttachmentsGetter + VolumeAttributesClassesGetter } // StorageV1beta1Client is used to interact with features provided by the storage.k8s.io group. @@ -60,6 +61,10 @@ func (c *StorageV1beta1Client) VolumeAttachments() VolumeAttachmentInterface { return newVolumeAttachments(c) } +func (c *StorageV1beta1Client) VolumeAttributesClasses() VolumeAttributesClassInterface { + return newVolumeAttributesClasses(c) +} + // NewForConfig creates a new StorageV1beta1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). diff --git a/kubernetes/typed/storage/v1beta1/volumeattributesclass.go b/kubernetes/typed/storage/v1beta1/volumeattributesclass.go new file mode 100644 index 0000000000..47eadcac63 --- /dev/null +++ b/kubernetes/typed/storage/v1beta1/volumeattributesclass.go @@ -0,0 +1,69 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + + v1beta1 "k8s.io/api/storage/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// VolumeAttributesClassesGetter has a method to return a VolumeAttributesClassInterface. +// A group's client should implement this interface. +type VolumeAttributesClassesGetter interface { + VolumeAttributesClasses() VolumeAttributesClassInterface +} + +// VolumeAttributesClassInterface has methods to work with VolumeAttributesClass resources. +type VolumeAttributesClassInterface interface { + Create(ctx context.Context, volumeAttributesClass *v1beta1.VolumeAttributesClass, opts v1.CreateOptions) (*v1beta1.VolumeAttributesClass, error) + Update(ctx context.Context, volumeAttributesClass *v1beta1.VolumeAttributesClass, opts v1.UpdateOptions) (*v1beta1.VolumeAttributesClass, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.VolumeAttributesClass, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VolumeAttributesClassList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeAttributesClass, err error) + Apply(ctx context.Context, volumeAttributesClass *storagev1beta1.VolumeAttributesClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.VolumeAttributesClass, err error) + VolumeAttributesClassExpansion +} + +// volumeAttributesClasses implements VolumeAttributesClassInterface +type volumeAttributesClasses struct { + *gentype.ClientWithListAndApply[*v1beta1.VolumeAttributesClass, *v1beta1.VolumeAttributesClassList, *storagev1beta1.VolumeAttributesClassApplyConfiguration] +} + +// newVolumeAttributesClasses returns a VolumeAttributesClasses +func newVolumeAttributesClasses(c *StorageV1beta1Client) *volumeAttributesClasses { + return &volumeAttributesClasses{ + gentype.NewClientWithListAndApply[*v1beta1.VolumeAttributesClass, *v1beta1.VolumeAttributesClassList, *storagev1beta1.VolumeAttributesClassApplyConfiguration]( + "volumeattributesclasses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *v1beta1.VolumeAttributesClass { return &v1beta1.VolumeAttributesClass{} }, + func() *v1beta1.VolumeAttributesClassList { return &v1beta1.VolumeAttributesClassList{} }), + } +} diff --git a/listers/storage/v1beta1/expansion_generated.go b/listers/storage/v1beta1/expansion_generated.go index c2b0d5b17d..4f56776be1 100644 --- a/listers/storage/v1beta1/expansion_generated.go +++ b/listers/storage/v1beta1/expansion_generated.go @@ -41,3 +41,7 @@ type StorageClassListerExpansion interface{} // VolumeAttachmentListerExpansion allows custom methods to be added to // VolumeAttachmentLister. type VolumeAttachmentListerExpansion interface{} + +// VolumeAttributesClassListerExpansion allows custom methods to be added to +// VolumeAttributesClassLister. +type VolumeAttributesClassListerExpansion interface{} diff --git a/listers/storage/v1beta1/volumeattributesclass.go b/listers/storage/v1beta1/volumeattributesclass.go new file mode 100644 index 0000000000..2ff71e3d7f --- /dev/null +++ b/listers/storage/v1beta1/volumeattributesclass.go @@ -0,0 +1,48 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "k8s.io/api/storage/v1beta1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" + "k8s.io/client-go/tools/cache" +) + +// VolumeAttributesClassLister helps list VolumeAttributesClasses. +// All objects returned here must be treated as read-only. +type VolumeAttributesClassLister interface { + // List lists all VolumeAttributesClasses in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1beta1.VolumeAttributesClass, err error) + // Get retrieves the VolumeAttributesClass from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1beta1.VolumeAttributesClass, error) + VolumeAttributesClassListerExpansion +} + +// volumeAttributesClassLister implements the VolumeAttributesClassLister interface. +type volumeAttributesClassLister struct { + listers.ResourceIndexer[*v1beta1.VolumeAttributesClass] +} + +// NewVolumeAttributesClassLister returns a new VolumeAttributesClassLister. +func NewVolumeAttributesClassLister(indexer cache.Indexer) VolumeAttributesClassLister { + return &volumeAttributesClassLister{listers.New[*v1beta1.VolumeAttributesClass](indexer, v1beta1.Resource("volumeattributesclass"))} +} From 8a2bbd0393162ca3465101f63c931e6fb3b44bb8 Mon Sep 17 00:00:00 2001 From: Jefftree Date: Sun, 21 Jul 2024 20:02:00 +0000 Subject: [PATCH 146/159] Coordinated Leader Election Alpha API Kubernetes-commit: 3999b98c8840e41acaa19d94e88f46d1fbb0c1b3 --- .../coordination/v1/leasespec.go | 29 +- .../coordination/v1alpha1/leasecandidate.go | 255 ++++++++++++++++++ .../v1alpha1/leasecandidatespec.go | 91 +++++++ .../coordination/v1beta1/leasespec.go | 29 +- applyconfigurations/internal/internal.go | 54 ++++ applyconfigurations/utils.go | 8 + informers/coordination/interface.go | 8 + informers/coordination/v1alpha1/interface.go | 45 ++++ .../coordination/v1alpha1/leasecandidate.go | 90 +++++++ informers/generic.go | 5 + kubernetes/clientset.go | 13 + kubernetes/fake/clientset_generated.go | 7 + kubernetes/fake/register.go | 2 + kubernetes/scheme/register.go | 2 + .../v1alpha1/coordination_client.go | 107 ++++++++ kubernetes/typed/coordination/v1alpha1/doc.go | 20 ++ .../typed/coordination/v1alpha1/fake/doc.go | 20 ++ .../v1alpha1/fake/fake_coordination_client.go | 40 +++ .../v1alpha1/fake/fake_leasecandidate.go | 160 +++++++++++ .../v1alpha1/generated_expansion.go | 21 ++ .../coordination/v1alpha1/leasecandidate.go | 69 +++++ .../v1alpha1/expansion_generated.go | 27 ++ .../coordination/v1alpha1/leasecandidate.go | 70 +++++ 23 files changed, 1162 insertions(+), 10 deletions(-) create mode 100644 applyconfigurations/coordination/v1alpha1/leasecandidate.go create mode 100644 applyconfigurations/coordination/v1alpha1/leasecandidatespec.go create mode 100644 informers/coordination/v1alpha1/interface.go create mode 100644 informers/coordination/v1alpha1/leasecandidate.go create mode 100644 kubernetes/typed/coordination/v1alpha1/coordination_client.go create mode 100644 kubernetes/typed/coordination/v1alpha1/doc.go create mode 100644 kubernetes/typed/coordination/v1alpha1/fake/doc.go create mode 100644 kubernetes/typed/coordination/v1alpha1/fake/fake_coordination_client.go create mode 100644 kubernetes/typed/coordination/v1alpha1/fake/fake_leasecandidate.go create mode 100644 kubernetes/typed/coordination/v1alpha1/generated_expansion.go create mode 100644 kubernetes/typed/coordination/v1alpha1/leasecandidate.go create mode 100644 listers/coordination/v1alpha1/expansion_generated.go create mode 100644 listers/coordination/v1alpha1/leasecandidate.go diff --git a/applyconfigurations/coordination/v1/leasespec.go b/applyconfigurations/coordination/v1/leasespec.go index 3eea890b28..01d0df1380 100644 --- a/applyconfigurations/coordination/v1/leasespec.go +++ b/applyconfigurations/coordination/v1/leasespec.go @@ -19,17 +19,20 @@ limitations under the License. package v1 import ( + coordinationv1 "k8s.io/api/coordination/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // LeaseSpecApplyConfiguration represents a declarative configuration of the LeaseSpec type for use // with apply. type LeaseSpecApplyConfiguration struct { - HolderIdentity *string `json:"holderIdentity,omitempty"` - LeaseDurationSeconds *int32 `json:"leaseDurationSeconds,omitempty"` - AcquireTime *v1.MicroTime `json:"acquireTime,omitempty"` - RenewTime *v1.MicroTime `json:"renewTime,omitempty"` - LeaseTransitions *int32 `json:"leaseTransitions,omitempty"` + HolderIdentity *string `json:"holderIdentity,omitempty"` + LeaseDurationSeconds *int32 `json:"leaseDurationSeconds,omitempty"` + AcquireTime *v1.MicroTime `json:"acquireTime,omitempty"` + RenewTime *v1.MicroTime `json:"renewTime,omitempty"` + LeaseTransitions *int32 `json:"leaseTransitions,omitempty"` + Strategy *coordinationv1.CoordinatedLeaseStrategy `json:"strategy,omitempty"` + PreferredHolder *string `json:"preferredHolder,omitempty"` } // LeaseSpecApplyConfiguration constructs a declarative configuration of the LeaseSpec type for use with @@ -77,3 +80,19 @@ func (b *LeaseSpecApplyConfiguration) WithLeaseTransitions(value int32) *LeaseSp b.LeaseTransitions = &value return b } + +// WithStrategy sets the Strategy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Strategy field is set to the value of the last call. +func (b *LeaseSpecApplyConfiguration) WithStrategy(value coordinationv1.CoordinatedLeaseStrategy) *LeaseSpecApplyConfiguration { + b.Strategy = &value + return b +} + +// WithPreferredHolder sets the PreferredHolder field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PreferredHolder field is set to the value of the last call. +func (b *LeaseSpecApplyConfiguration) WithPreferredHolder(value string) *LeaseSpecApplyConfiguration { + b.PreferredHolder = &value + return b +} diff --git a/applyconfigurations/coordination/v1alpha1/leasecandidate.go b/applyconfigurations/coordination/v1alpha1/leasecandidate.go new file mode 100644 index 0000000000..ef76847791 --- /dev/null +++ b/applyconfigurations/coordination/v1alpha1/leasecandidate.go @@ -0,0 +1,255 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + coordinationv1alpha1 "k8s.io/api/coordination/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" + internal "k8s.io/client-go/applyconfigurations/internal" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// LeaseCandidateApplyConfiguration represents a declarative configuration of the LeaseCandidate type for use +// with apply. +type LeaseCandidateApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *LeaseCandidateSpecApplyConfiguration `json:"spec,omitempty"` +} + +// LeaseCandidate constructs a declarative configuration of the LeaseCandidate type for use with +// apply. +func LeaseCandidate(name, namespace string) *LeaseCandidateApplyConfiguration { + b := &LeaseCandidateApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("LeaseCandidate") + b.WithAPIVersion("coordination.k8s.io/v1alpha1") + return b +} + +// ExtractLeaseCandidate extracts the applied configuration owned by fieldManager from +// leaseCandidate. If no managedFields are found in leaseCandidate for fieldManager, a +// LeaseCandidateApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// leaseCandidate must be a unmodified LeaseCandidate API object that was retrieved from the Kubernetes API. +// ExtractLeaseCandidate provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractLeaseCandidate(leaseCandidate *coordinationv1alpha1.LeaseCandidate, fieldManager string) (*LeaseCandidateApplyConfiguration, error) { + return extractLeaseCandidate(leaseCandidate, fieldManager, "") +} + +// ExtractLeaseCandidateStatus is the same as ExtractLeaseCandidate except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractLeaseCandidateStatus(leaseCandidate *coordinationv1alpha1.LeaseCandidate, fieldManager string) (*LeaseCandidateApplyConfiguration, error) { + return extractLeaseCandidate(leaseCandidate, fieldManager, "status") +} + +func extractLeaseCandidate(leaseCandidate *coordinationv1alpha1.LeaseCandidate, fieldManager string, subresource string) (*LeaseCandidateApplyConfiguration, error) { + b := &LeaseCandidateApplyConfiguration{} + err := managedfields.ExtractInto(leaseCandidate, internal.Parser().Type("io.k8s.api.coordination.v1alpha1.LeaseCandidate"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(leaseCandidate.Name) + b.WithNamespace(leaseCandidate.Namespace) + + b.WithKind("LeaseCandidate") + b.WithAPIVersion("coordination.k8s.io/v1alpha1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithKind(value string) *LeaseCandidateApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithAPIVersion(value string) *LeaseCandidateApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithName(value string) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithGenerateName(value string) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithNamespace(value string) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithUID(value types.UID) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithResourceVersion(value string) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithGeneration(value int64) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithCreationTimestamp(value metav1.Time) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *LeaseCandidateApplyConfiguration) WithLabels(entries map[string]string) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *LeaseCandidateApplyConfiguration) WithAnnotations(entries map[string]string) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *LeaseCandidateApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *LeaseCandidateApplyConfiguration) WithFinalizers(values ...string) *LeaseCandidateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *LeaseCandidateApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *LeaseCandidateApplyConfiguration) WithSpec(value *LeaseCandidateSpecApplyConfiguration) *LeaseCandidateApplyConfiguration { + b.Spec = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *LeaseCandidateApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.Name +} diff --git a/applyconfigurations/coordination/v1alpha1/leasecandidatespec.go b/applyconfigurations/coordination/v1alpha1/leasecandidatespec.go new file mode 100644 index 0000000000..61d3dca10b --- /dev/null +++ b/applyconfigurations/coordination/v1alpha1/leasecandidatespec.go @@ -0,0 +1,91 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + coordinationv1 "k8s.io/api/coordination/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// LeaseCandidateSpecApplyConfiguration represents a declarative configuration of the LeaseCandidateSpec type for use +// with apply. +type LeaseCandidateSpecApplyConfiguration struct { + LeaseName *string `json:"leaseName,omitempty"` + PingTime *v1.MicroTime `json:"pingTime,omitempty"` + RenewTime *v1.MicroTime `json:"renewTime,omitempty"` + BinaryVersion *string `json:"binaryVersion,omitempty"` + EmulationVersion *string `json:"emulationVersion,omitempty"` + PreferredStrategies []coordinationv1.CoordinatedLeaseStrategy `json:"preferredStrategies,omitempty"` +} + +// LeaseCandidateSpecApplyConfiguration constructs a declarative configuration of the LeaseCandidateSpec type for use with +// apply. +func LeaseCandidateSpec() *LeaseCandidateSpecApplyConfiguration { + return &LeaseCandidateSpecApplyConfiguration{} +} + +// WithLeaseName sets the LeaseName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LeaseName field is set to the value of the last call. +func (b *LeaseCandidateSpecApplyConfiguration) WithLeaseName(value string) *LeaseCandidateSpecApplyConfiguration { + b.LeaseName = &value + return b +} + +// WithPingTime sets the PingTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PingTime field is set to the value of the last call. +func (b *LeaseCandidateSpecApplyConfiguration) WithPingTime(value v1.MicroTime) *LeaseCandidateSpecApplyConfiguration { + b.PingTime = &value + return b +} + +// WithRenewTime sets the RenewTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RenewTime field is set to the value of the last call. +func (b *LeaseCandidateSpecApplyConfiguration) WithRenewTime(value v1.MicroTime) *LeaseCandidateSpecApplyConfiguration { + b.RenewTime = &value + return b +} + +// WithBinaryVersion sets the BinaryVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BinaryVersion field is set to the value of the last call. +func (b *LeaseCandidateSpecApplyConfiguration) WithBinaryVersion(value string) *LeaseCandidateSpecApplyConfiguration { + b.BinaryVersion = &value + return b +} + +// WithEmulationVersion sets the EmulationVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EmulationVersion field is set to the value of the last call. +func (b *LeaseCandidateSpecApplyConfiguration) WithEmulationVersion(value string) *LeaseCandidateSpecApplyConfiguration { + b.EmulationVersion = &value + return b +} + +// WithPreferredStrategies adds the given value to the PreferredStrategies field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PreferredStrategies field. +func (b *LeaseCandidateSpecApplyConfiguration) WithPreferredStrategies(values ...coordinationv1.CoordinatedLeaseStrategy) *LeaseCandidateSpecApplyConfiguration { + for i := range values { + b.PreferredStrategies = append(b.PreferredStrategies, values[i]) + } + return b +} diff --git a/applyconfigurations/coordination/v1beta1/leasespec.go b/applyconfigurations/coordination/v1beta1/leasespec.go index 9a0a9ab2f9..8c7fddfc61 100644 --- a/applyconfigurations/coordination/v1beta1/leasespec.go +++ b/applyconfigurations/coordination/v1beta1/leasespec.go @@ -19,17 +19,20 @@ limitations under the License. package v1beta1 import ( + coordinationv1 "k8s.io/api/coordination/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // LeaseSpecApplyConfiguration represents a declarative configuration of the LeaseSpec type for use // with apply. type LeaseSpecApplyConfiguration struct { - HolderIdentity *string `json:"holderIdentity,omitempty"` - LeaseDurationSeconds *int32 `json:"leaseDurationSeconds,omitempty"` - AcquireTime *v1.MicroTime `json:"acquireTime,omitempty"` - RenewTime *v1.MicroTime `json:"renewTime,omitempty"` - LeaseTransitions *int32 `json:"leaseTransitions,omitempty"` + HolderIdentity *string `json:"holderIdentity,omitempty"` + LeaseDurationSeconds *int32 `json:"leaseDurationSeconds,omitempty"` + AcquireTime *v1.MicroTime `json:"acquireTime,omitempty"` + RenewTime *v1.MicroTime `json:"renewTime,omitempty"` + LeaseTransitions *int32 `json:"leaseTransitions,omitempty"` + Strategy *coordinationv1.CoordinatedLeaseStrategy `json:"strategy,omitempty"` + PreferredHolder *string `json:"preferredHolder,omitempty"` } // LeaseSpecApplyConfiguration constructs a declarative configuration of the LeaseSpec type for use with @@ -77,3 +80,19 @@ func (b *LeaseSpecApplyConfiguration) WithLeaseTransitions(value int32) *LeaseSp b.LeaseTransitions = &value return b } + +// WithStrategy sets the Strategy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Strategy field is set to the value of the last call. +func (b *LeaseSpecApplyConfiguration) WithStrategy(value coordinationv1.CoordinatedLeaseStrategy) *LeaseSpecApplyConfiguration { + b.Strategy = &value + return b +} + +// WithPreferredHolder sets the PreferredHolder field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PreferredHolder field is set to the value of the last call. +func (b *LeaseSpecApplyConfiguration) WithPreferredHolder(value string) *LeaseSpecApplyConfiguration { + b.PreferredHolder = &value + return b +} diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index 157e132dfd..43c9ae05a1 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -4356,6 +4356,54 @@ var schemaYAML = typed.YAMLObject(`types: - name: leaseTransitions type: scalar: numeric + - name: preferredHolder + type: + scalar: string + - name: renewTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + - name: strategy + type: + scalar: string +- name: io.k8s.api.coordination.v1alpha1.LeaseCandidate + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.coordination.v1alpha1.LeaseCandidateSpec + default: {} +- name: io.k8s.api.coordination.v1alpha1.LeaseCandidateSpec + map: + fields: + - name: binaryVersion + type: + scalar: string + - name: emulationVersion + type: + scalar: string + - name: leaseName + type: + scalar: string + default: "" + - name: pingTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + - name: preferredStrategies + type: + list: + elementType: + scalar: string + elementRelationship: atomic - name: renewTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime @@ -4391,9 +4439,15 @@ var schemaYAML = typed.YAMLObject(`types: - name: leaseTransitions type: scalar: numeric + - name: preferredHolder + type: + scalar: string - name: renewTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + - name: strategy + type: + scalar: string - name: io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource map: fields: diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index eb88e1c4de..0955b8f44f 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -36,6 +36,7 @@ import ( certificatesv1alpha1 "k8s.io/api/certificates/v1alpha1" certificatesv1beta1 "k8s.io/api/certificates/v1beta1" coordinationv1 "k8s.io/api/coordination/v1" + coordinationv1alpha1 "k8s.io/api/coordination/v1alpha1" coordinationv1beta1 "k8s.io/api/coordination/v1beta1" corev1 "k8s.io/api/core/v1" discoveryv1 "k8s.io/api/discovery/v1" @@ -87,6 +88,7 @@ import ( applyconfigurationscertificatesv1alpha1 "k8s.io/client-go/applyconfigurations/certificates/v1alpha1" applyconfigurationscertificatesv1beta1 "k8s.io/client-go/applyconfigurations/certificates/v1beta1" applyconfigurationscoordinationv1 "k8s.io/client-go/applyconfigurations/coordination/v1" + applyconfigurationscoordinationv1alpha1 "k8s.io/client-go/applyconfigurations/coordination/v1alpha1" applyconfigurationscoordinationv1beta1 "k8s.io/client-go/applyconfigurations/coordination/v1beta1" applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1" applyconfigurationsdiscoveryv1 "k8s.io/client-go/applyconfigurations/discovery/v1" @@ -613,6 +615,12 @@ func ForKind(kind schema.GroupVersionKind) interface{} { case coordinationv1.SchemeGroupVersion.WithKind("LeaseSpec"): return &applyconfigurationscoordinationv1.LeaseSpecApplyConfiguration{} + // Group=coordination.k8s.io, Version=v1alpha1 + case coordinationv1alpha1.SchemeGroupVersion.WithKind("LeaseCandidate"): + return &applyconfigurationscoordinationv1alpha1.LeaseCandidateApplyConfiguration{} + case coordinationv1alpha1.SchemeGroupVersion.WithKind("LeaseCandidateSpec"): + return &applyconfigurationscoordinationv1alpha1.LeaseCandidateSpecApplyConfiguration{} + // Group=coordination.k8s.io, Version=v1beta1 case coordinationv1beta1.SchemeGroupVersion.WithKind("Lease"): return &applyconfigurationscoordinationv1beta1.LeaseApplyConfiguration{} diff --git a/informers/coordination/interface.go b/informers/coordination/interface.go index 54cfd7b9f2..026b4d9476 100644 --- a/informers/coordination/interface.go +++ b/informers/coordination/interface.go @@ -20,6 +20,7 @@ package coordination import ( v1 "k8s.io/client-go/informers/coordination/v1" + v1alpha1 "k8s.io/client-go/informers/coordination/v1alpha1" v1beta1 "k8s.io/client-go/informers/coordination/v1beta1" internalinterfaces "k8s.io/client-go/informers/internalinterfaces" ) @@ -28,6 +29,8 @@ import ( type Interface interface { // V1 provides access to shared informers for resources in V1. V1() v1.Interface + // V1alpha1 provides access to shared informers for resources in V1alpha1. + V1alpha1() v1alpha1.Interface // V1beta1 provides access to shared informers for resources in V1beta1. V1beta1() v1beta1.Interface } @@ -48,6 +51,11 @@ func (g *group) V1() v1.Interface { return v1.New(g.factory, g.namespace, g.tweakListOptions) } +// V1alpha1 returns a new v1alpha1.Interface. +func (g *group) V1alpha1() v1alpha1.Interface { + return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) +} + // V1beta1 returns a new v1beta1.Interface. func (g *group) V1beta1() v1beta1.Interface { return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) diff --git a/informers/coordination/v1alpha1/interface.go b/informers/coordination/v1alpha1/interface.go new file mode 100644 index 0000000000..4058af2806 --- /dev/null +++ b/informers/coordination/v1alpha1/interface.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // LeaseCandidates returns a LeaseCandidateInformer. + LeaseCandidates() LeaseCandidateInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// LeaseCandidates returns a LeaseCandidateInformer. +func (v *version) LeaseCandidates() LeaseCandidateInformer { + return &leaseCandidateInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/informers/coordination/v1alpha1/leasecandidate.go b/informers/coordination/v1alpha1/leasecandidate.go new file mode 100644 index 0000000000..21bc47a8e6 --- /dev/null +++ b/informers/coordination/v1alpha1/leasecandidate.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + time "time" + + coordinationv1alpha1 "k8s.io/api/coordination/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + v1alpha1 "k8s.io/client-go/listers/coordination/v1alpha1" + cache "k8s.io/client-go/tools/cache" +) + +// LeaseCandidateInformer provides access to a shared informer and lister for +// LeaseCandidates. +type LeaseCandidateInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.LeaseCandidateLister +} + +type leaseCandidateInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewLeaseCandidateInformer constructs a new informer for LeaseCandidate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewLeaseCandidateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredLeaseCandidateInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredLeaseCandidateInformer constructs a new informer for LeaseCandidate type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredLeaseCandidateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoordinationV1alpha1().LeaseCandidates(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.CoordinationV1alpha1().LeaseCandidates(namespace).Watch(context.TODO(), options) + }, + }, + &coordinationv1alpha1.LeaseCandidate{}, + resyncPeriod, + indexers, + ) +} + +func (f *leaseCandidateInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredLeaseCandidateInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *leaseCandidateInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&coordinationv1alpha1.LeaseCandidate{}, f.defaultInformer) +} + +func (f *leaseCandidateInformer) Lister() v1alpha1.LeaseCandidateLister { + return v1alpha1.NewLeaseCandidateLister(f.Informer().GetIndexer()) +} diff --git a/informers/generic.go b/informers/generic.go index 7cca8a154c..39a9d3bf4f 100644 --- a/informers/generic.go +++ b/informers/generic.go @@ -38,6 +38,7 @@ import ( certificatesv1alpha1 "k8s.io/api/certificates/v1alpha1" certificatesv1beta1 "k8s.io/api/certificates/v1beta1" coordinationv1 "k8s.io/api/coordination/v1" + coordinationv1alpha1 "k8s.io/api/coordination/v1alpha1" coordinationv1beta1 "k8s.io/api/coordination/v1beta1" corev1 "k8s.io/api/core/v1" discoveryv1 "k8s.io/api/discovery/v1" @@ -198,6 +199,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case coordinationv1.SchemeGroupVersion.WithResource("leases"): return &genericInformer{resource: resource.GroupResource(), informer: f.Coordination().V1().Leases().Informer()}, nil + // Group=coordination.k8s.io, Version=v1alpha1 + case coordinationv1alpha1.SchemeGroupVersion.WithResource("leasecandidates"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Coordination().V1alpha1().LeaseCandidates().Informer()}, nil + // Group=coordination.k8s.io, Version=v1beta1 case coordinationv1beta1.SchemeGroupVersion.WithResource("leases"): return &genericInformer{resource: resource.GroupResource(), informer: f.Coordination().V1beta1().Leases().Informer()}, nil diff --git a/kubernetes/clientset.go b/kubernetes/clientset.go index ce17f8ed8e..9cddb0bbed 100644 --- a/kubernetes/clientset.go +++ b/kubernetes/clientset.go @@ -45,6 +45,7 @@ import ( certificatesv1alpha1 "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1" certificatesv1beta1 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1" coordinationv1 "k8s.io/client-go/kubernetes/typed/coordination/v1" + coordinationv1alpha1 "k8s.io/client-go/kubernetes/typed/coordination/v1alpha1" coordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1" corev1 "k8s.io/client-go/kubernetes/typed/core/v1" discoveryv1 "k8s.io/client-go/kubernetes/typed/discovery/v1" @@ -102,6 +103,7 @@ type Interface interface { CertificatesV1() certificatesv1.CertificatesV1Interface CertificatesV1beta1() certificatesv1beta1.CertificatesV1beta1Interface CertificatesV1alpha1() certificatesv1alpha1.CertificatesV1alpha1Interface + CoordinationV1alpha1() coordinationv1alpha1.CoordinationV1alpha1Interface CoordinationV1beta1() coordinationv1beta1.CoordinationV1beta1Interface CoordinationV1() coordinationv1.CoordinationV1Interface CoreV1() corev1.CoreV1Interface @@ -159,6 +161,7 @@ type Clientset struct { certificatesV1 *certificatesv1.CertificatesV1Client certificatesV1beta1 *certificatesv1beta1.CertificatesV1beta1Client certificatesV1alpha1 *certificatesv1alpha1.CertificatesV1alpha1Client + coordinationV1alpha1 *coordinationv1alpha1.CoordinationV1alpha1Client coordinationV1beta1 *coordinationv1beta1.CoordinationV1beta1Client coordinationV1 *coordinationv1.CoordinationV1Client coreV1 *corev1.CoreV1Client @@ -297,6 +300,11 @@ func (c *Clientset) CertificatesV1alpha1() certificatesv1alpha1.CertificatesV1al return c.certificatesV1alpha1 } +// CoordinationV1alpha1 retrieves the CoordinationV1alpha1Client +func (c *Clientset) CoordinationV1alpha1() coordinationv1alpha1.CoordinationV1alpha1Interface { + return c.coordinationV1alpha1 +} + // CoordinationV1beta1 retrieves the CoordinationV1beta1Client func (c *Clientset) CoordinationV1beta1() coordinationv1beta1.CoordinationV1beta1Interface { return c.coordinationV1beta1 @@ -580,6 +588,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } + cs.coordinationV1alpha1, err = coordinationv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.coordinationV1beta1, err = coordinationv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err @@ -746,6 +758,7 @@ func New(c rest.Interface) *Clientset { cs.certificatesV1 = certificatesv1.New(c) cs.certificatesV1beta1 = certificatesv1beta1.New(c) cs.certificatesV1alpha1 = certificatesv1alpha1.New(c) + cs.coordinationV1alpha1 = coordinationv1alpha1.New(c) cs.coordinationV1beta1 = coordinationv1beta1.New(c) cs.coordinationV1 = coordinationv1.New(c) cs.coreV1 = corev1.New(c) diff --git a/kubernetes/fake/clientset_generated.go b/kubernetes/fake/clientset_generated.go index 63f384b139..132f917abe 100644 --- a/kubernetes/fake/clientset_generated.go +++ b/kubernetes/fake/clientset_generated.go @@ -69,6 +69,8 @@ import ( fakecertificatesv1beta1 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake" coordinationv1 "k8s.io/client-go/kubernetes/typed/coordination/v1" fakecoordinationv1 "k8s.io/client-go/kubernetes/typed/coordination/v1/fake" + coordinationv1alpha1 "k8s.io/client-go/kubernetes/typed/coordination/v1alpha1" + fakecoordinationv1alpha1 "k8s.io/client-go/kubernetes/typed/coordination/v1alpha1/fake" coordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1" fakecoordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake" corev1 "k8s.io/client-go/kubernetes/typed/core/v1" @@ -323,6 +325,11 @@ func (c *Clientset) CertificatesV1alpha1() certificatesv1alpha1.CertificatesV1al return &fakecertificatesv1alpha1.FakeCertificatesV1alpha1{Fake: &c.Fake} } +// CoordinationV1alpha1 retrieves the CoordinationV1alpha1Client +func (c *Clientset) CoordinationV1alpha1() coordinationv1alpha1.CoordinationV1alpha1Interface { + return &fakecoordinationv1alpha1.FakeCoordinationV1alpha1{Fake: &c.Fake} +} + // CoordinationV1beta1 retrieves the CoordinationV1beta1Client func (c *Clientset) CoordinationV1beta1() coordinationv1beta1.CoordinationV1beta1Interface { return &fakecoordinationv1beta1.FakeCoordinationV1beta1{Fake: &c.Fake} diff --git a/kubernetes/fake/register.go b/kubernetes/fake/register.go index 2cd83ecb57..157abae5ff 100644 --- a/kubernetes/fake/register.go +++ b/kubernetes/fake/register.go @@ -41,6 +41,7 @@ import ( certificatesv1alpha1 "k8s.io/api/certificates/v1alpha1" certificatesv1beta1 "k8s.io/api/certificates/v1beta1" coordinationv1 "k8s.io/api/coordination/v1" + coordinationv1alpha1 "k8s.io/api/coordination/v1alpha1" coordinationv1beta1 "k8s.io/api/coordination/v1beta1" corev1 "k8s.io/api/core/v1" discoveryv1 "k8s.io/api/discovery/v1" @@ -103,6 +104,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ certificatesv1.AddToScheme, certificatesv1beta1.AddToScheme, certificatesv1alpha1.AddToScheme, + coordinationv1alpha1.AddToScheme, coordinationv1beta1.AddToScheme, coordinationv1.AddToScheme, corev1.AddToScheme, diff --git a/kubernetes/scheme/register.go b/kubernetes/scheme/register.go index 1b15a4f247..5262b0f046 100644 --- a/kubernetes/scheme/register.go +++ b/kubernetes/scheme/register.go @@ -41,6 +41,7 @@ import ( certificatesv1alpha1 "k8s.io/api/certificates/v1alpha1" certificatesv1beta1 "k8s.io/api/certificates/v1beta1" coordinationv1 "k8s.io/api/coordination/v1" + coordinationv1alpha1 "k8s.io/api/coordination/v1alpha1" coordinationv1beta1 "k8s.io/api/coordination/v1beta1" corev1 "k8s.io/api/core/v1" discoveryv1 "k8s.io/api/discovery/v1" @@ -103,6 +104,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ certificatesv1.AddToScheme, certificatesv1beta1.AddToScheme, certificatesv1alpha1.AddToScheme, + coordinationv1alpha1.AddToScheme, coordinationv1beta1.AddToScheme, coordinationv1.AddToScheme, corev1.AddToScheme, diff --git a/kubernetes/typed/coordination/v1alpha1/coordination_client.go b/kubernetes/typed/coordination/v1alpha1/coordination_client.go new file mode 100644 index 0000000000..dd75e5d014 --- /dev/null +++ b/kubernetes/typed/coordination/v1alpha1/coordination_client.go @@ -0,0 +1,107 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "net/http" + + v1alpha1 "k8s.io/api/coordination/v1alpha1" + "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +type CoordinationV1alpha1Interface interface { + RESTClient() rest.Interface + LeaseCandidatesGetter +} + +// CoordinationV1alpha1Client is used to interact with features provided by the coordination.k8s.io group. +type CoordinationV1alpha1Client struct { + restClient rest.Interface +} + +func (c *CoordinationV1alpha1Client) LeaseCandidates(namespace string) LeaseCandidateInterface { + return newLeaseCandidates(c, namespace) +} + +// NewForConfig creates a new CoordinationV1alpha1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*CoordinationV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new CoordinationV1alpha1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CoordinationV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &CoordinationV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new CoordinationV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *CoordinationV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new CoordinationV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *CoordinationV1alpha1Client { + return &CoordinationV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *CoordinationV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/kubernetes/typed/coordination/v1alpha1/doc.go b/kubernetes/typed/coordination/v1alpha1/doc.go new file mode 100644 index 0000000000..df51baa4d4 --- /dev/null +++ b/kubernetes/typed/coordination/v1alpha1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/kubernetes/typed/coordination/v1alpha1/fake/doc.go b/kubernetes/typed/coordination/v1alpha1/fake/doc.go new file mode 100644 index 0000000000..16f4439906 --- /dev/null +++ b/kubernetes/typed/coordination/v1alpha1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/kubernetes/typed/coordination/v1alpha1/fake/fake_coordination_client.go b/kubernetes/typed/coordination/v1alpha1/fake/fake_coordination_client.go new file mode 100644 index 0000000000..2e7d4be268 --- /dev/null +++ b/kubernetes/typed/coordination/v1alpha1/fake/fake_coordination_client.go @@ -0,0 +1,40 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "k8s.io/client-go/kubernetes/typed/coordination/v1alpha1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeCoordinationV1alpha1 struct { + *testing.Fake +} + +func (c *FakeCoordinationV1alpha1) LeaseCandidates(namespace string) v1alpha1.LeaseCandidateInterface { + return &FakeLeaseCandidates{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeCoordinationV1alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/kubernetes/typed/coordination/v1alpha1/fake/fake_leasecandidate.go b/kubernetes/typed/coordination/v1alpha1/fake/fake_leasecandidate.go new file mode 100644 index 0000000000..c3de2303ca --- /dev/null +++ b/kubernetes/typed/coordination/v1alpha1/fake/fake_leasecandidate.go @@ -0,0 +1,160 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + v1alpha1 "k8s.io/api/coordination/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + coordinationv1alpha1 "k8s.io/client-go/applyconfigurations/coordination/v1alpha1" + testing "k8s.io/client-go/testing" +) + +// FakeLeaseCandidates implements LeaseCandidateInterface +type FakeLeaseCandidates struct { + Fake *FakeCoordinationV1alpha1 + ns string +} + +var leasecandidatesResource = v1alpha1.SchemeGroupVersion.WithResource("leasecandidates") + +var leasecandidatesKind = v1alpha1.SchemeGroupVersion.WithKind("LeaseCandidate") + +// Get takes name of the leaseCandidate, and returns the corresponding leaseCandidate object, and an error if there is any. +func (c *FakeLeaseCandidates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.LeaseCandidate, err error) { + emptyResult := &v1alpha1.LeaseCandidate{} + obj, err := c.Fake. + Invokes(testing.NewGetActionWithOptions(leasecandidatesResource, c.ns, name, options), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha1.LeaseCandidate), err +} + +// List takes label and field selectors, and returns the list of LeaseCandidates that match those selectors. +func (c *FakeLeaseCandidates) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.LeaseCandidateList, err error) { + emptyResult := &v1alpha1.LeaseCandidateList{} + obj, err := c.Fake. + Invokes(testing.NewListActionWithOptions(leasecandidatesResource, leasecandidatesKind, c.ns, opts), emptyResult) + + if obj == nil { + return emptyResult, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.LeaseCandidateList{ListMeta: obj.(*v1alpha1.LeaseCandidateList).ListMeta} + for _, item := range obj.(*v1alpha1.LeaseCandidateList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested leaseCandidates. +func (c *FakeLeaseCandidates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchActionWithOptions(leasecandidatesResource, c.ns, opts)) + +} + +// Create takes the representation of a leaseCandidate and creates it. Returns the server's representation of the leaseCandidate, and an error, if there is any. +func (c *FakeLeaseCandidates) Create(ctx context.Context, leaseCandidate *v1alpha1.LeaseCandidate, opts v1.CreateOptions) (result *v1alpha1.LeaseCandidate, err error) { + emptyResult := &v1alpha1.LeaseCandidate{} + obj, err := c.Fake. + Invokes(testing.NewCreateActionWithOptions(leasecandidatesResource, c.ns, leaseCandidate, opts), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha1.LeaseCandidate), err +} + +// Update takes the representation of a leaseCandidate and updates it. Returns the server's representation of the leaseCandidate, and an error, if there is any. +func (c *FakeLeaseCandidates) Update(ctx context.Context, leaseCandidate *v1alpha1.LeaseCandidate, opts v1.UpdateOptions) (result *v1alpha1.LeaseCandidate, err error) { + emptyResult := &v1alpha1.LeaseCandidate{} + obj, err := c.Fake. + Invokes(testing.NewUpdateActionWithOptions(leasecandidatesResource, c.ns, leaseCandidate, opts), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha1.LeaseCandidate), err +} + +// Delete takes name of the leaseCandidate and deletes it. Returns an error if one occurs. +func (c *FakeLeaseCandidates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(leasecandidatesResource, c.ns, name, opts), &v1alpha1.LeaseCandidate{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeLeaseCandidates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionActionWithOptions(leasecandidatesResource, c.ns, opts, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.LeaseCandidateList{}) + return err +} + +// Patch applies the patch and returns the patched leaseCandidate. +func (c *FakeLeaseCandidates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LeaseCandidate, err error) { + emptyResult := &v1alpha1.LeaseCandidate{} + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceActionWithOptions(leasecandidatesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha1.LeaseCandidate), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied leaseCandidate. +func (c *FakeLeaseCandidates) Apply(ctx context.Context, leaseCandidate *coordinationv1alpha1.LeaseCandidateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.LeaseCandidate, err error) { + if leaseCandidate == nil { + return nil, fmt.Errorf("leaseCandidate provided to Apply must not be nil") + } + data, err := json.Marshal(leaseCandidate) + if err != nil { + return nil, err + } + name := leaseCandidate.Name + if name == nil { + return nil, fmt.Errorf("leaseCandidate.Name must be provided to Apply") + } + emptyResult := &v1alpha1.LeaseCandidate{} + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceActionWithOptions(leasecandidatesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult) + + if obj == nil { + return emptyResult, err + } + return obj.(*v1alpha1.LeaseCandidate), err +} diff --git a/kubernetes/typed/coordination/v1alpha1/generated_expansion.go b/kubernetes/typed/coordination/v1alpha1/generated_expansion.go new file mode 100644 index 0000000000..2dc2f30cfc --- /dev/null +++ b/kubernetes/typed/coordination/v1alpha1/generated_expansion.go @@ -0,0 +1,21 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +type LeaseCandidateExpansion interface{} diff --git a/kubernetes/typed/coordination/v1alpha1/leasecandidate.go b/kubernetes/typed/coordination/v1alpha1/leasecandidate.go new file mode 100644 index 0000000000..868185135b --- /dev/null +++ b/kubernetes/typed/coordination/v1alpha1/leasecandidate.go @@ -0,0 +1,69 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + + v1alpha1 "k8s.io/api/coordination/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + coordinationv1alpha1 "k8s.io/client-go/applyconfigurations/coordination/v1alpha1" + gentype "k8s.io/client-go/gentype" + scheme "k8s.io/client-go/kubernetes/scheme" +) + +// LeaseCandidatesGetter has a method to return a LeaseCandidateInterface. +// A group's client should implement this interface. +type LeaseCandidatesGetter interface { + LeaseCandidates(namespace string) LeaseCandidateInterface +} + +// LeaseCandidateInterface has methods to work with LeaseCandidate resources. +type LeaseCandidateInterface interface { + Create(ctx context.Context, leaseCandidate *v1alpha1.LeaseCandidate, opts v1.CreateOptions) (*v1alpha1.LeaseCandidate, error) + Update(ctx context.Context, leaseCandidate *v1alpha1.LeaseCandidate, opts v1.UpdateOptions) (*v1alpha1.LeaseCandidate, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.LeaseCandidate, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.LeaseCandidateList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LeaseCandidate, err error) + Apply(ctx context.Context, leaseCandidate *coordinationv1alpha1.LeaseCandidateApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.LeaseCandidate, err error) + LeaseCandidateExpansion +} + +// leaseCandidates implements LeaseCandidateInterface +type leaseCandidates struct { + *gentype.ClientWithListAndApply[*v1alpha1.LeaseCandidate, *v1alpha1.LeaseCandidateList, *coordinationv1alpha1.LeaseCandidateApplyConfiguration] +} + +// newLeaseCandidates returns a LeaseCandidates +func newLeaseCandidates(c *CoordinationV1alpha1Client, namespace string) *leaseCandidates { + return &leaseCandidates{ + gentype.NewClientWithListAndApply[*v1alpha1.LeaseCandidate, *v1alpha1.LeaseCandidateList, *coordinationv1alpha1.LeaseCandidateApplyConfiguration]( + "leasecandidates", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *v1alpha1.LeaseCandidate { return &v1alpha1.LeaseCandidate{} }, + func() *v1alpha1.LeaseCandidateList { return &v1alpha1.LeaseCandidateList{} }), + } +} diff --git a/listers/coordination/v1alpha1/expansion_generated.go b/listers/coordination/v1alpha1/expansion_generated.go new file mode 100644 index 0000000000..233bda975b --- /dev/null +++ b/listers/coordination/v1alpha1/expansion_generated.go @@ -0,0 +1,27 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +// LeaseCandidateListerExpansion allows custom methods to be added to +// LeaseCandidateLister. +type LeaseCandidateListerExpansion interface{} + +// LeaseCandidateNamespaceListerExpansion allows custom methods to be added to +// LeaseCandidateNamespaceLister. +type LeaseCandidateNamespaceListerExpansion interface{} diff --git a/listers/coordination/v1alpha1/leasecandidate.go b/listers/coordination/v1alpha1/leasecandidate.go new file mode 100644 index 0000000000..b5e5fac9e4 --- /dev/null +++ b/listers/coordination/v1alpha1/leasecandidate.go @@ -0,0 +1,70 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "k8s.io/api/coordination/v1alpha1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/listers" + "k8s.io/client-go/tools/cache" +) + +// LeaseCandidateLister helps list LeaseCandidates. +// All objects returned here must be treated as read-only. +type LeaseCandidateLister interface { + // List lists all LeaseCandidates in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.LeaseCandidate, err error) + // LeaseCandidates returns an object that can list and get LeaseCandidates. + LeaseCandidates(namespace string) LeaseCandidateNamespaceLister + LeaseCandidateListerExpansion +} + +// leaseCandidateLister implements the LeaseCandidateLister interface. +type leaseCandidateLister struct { + listers.ResourceIndexer[*v1alpha1.LeaseCandidate] +} + +// NewLeaseCandidateLister returns a new LeaseCandidateLister. +func NewLeaseCandidateLister(indexer cache.Indexer) LeaseCandidateLister { + return &leaseCandidateLister{listers.New[*v1alpha1.LeaseCandidate](indexer, v1alpha1.Resource("leasecandidate"))} +} + +// LeaseCandidates returns an object that can list and get LeaseCandidates. +func (s *leaseCandidateLister) LeaseCandidates(namespace string) LeaseCandidateNamespaceLister { + return leaseCandidateNamespaceLister{listers.NewNamespaced[*v1alpha1.LeaseCandidate](s.ResourceIndexer, namespace)} +} + +// LeaseCandidateNamespaceLister helps list and get LeaseCandidates. +// All objects returned here must be treated as read-only. +type LeaseCandidateNamespaceLister interface { + // List lists all LeaseCandidates in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.LeaseCandidate, err error) + // Get retrieves the LeaseCandidate from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.LeaseCandidate, error) + LeaseCandidateNamespaceListerExpansion +} + +// leaseCandidateNamespaceLister implements the LeaseCandidateNamespaceLister +// interface. +type leaseCandidateNamespaceLister struct { + listers.ResourceIndexer[*v1alpha1.LeaseCandidate] +} From 20993758b7d8485d755e0c170da90579b2384356 Mon Sep 17 00:00:00 2001 From: Jefftree Date: Sun, 21 Jul 2024 20:06:03 +0000 Subject: [PATCH 147/159] CLE controller and client changes Kubernetes-commit: c47ff1e1a9aec44f262674eb6cdbabf80512d981 --- tools/leaderelection/leaderelection.go | 91 +++++++- tools/leaderelection/leaderelection_test.go | 144 ++++++++++++- tools/leaderelection/leasecandidate.go | 196 ++++++++++++++++++ tools/leaderelection/leasecandidate_test.go | 146 +++++++++++++ .../leaderelection/resourcelock/interface.go | 17 +- .../leaderelection/resourcelock/leaselock.go | 15 +- 6 files changed, 596 insertions(+), 13 deletions(-) create mode 100644 tools/leaderelection/leasecandidate.go create mode 100644 tools/leaderelection/leasecandidate_test.go diff --git a/tools/leaderelection/leaderelection.go b/tools/leaderelection/leaderelection.go index 5a1194b4ab..c61c600a7f 100644 --- a/tools/leaderelection/leaderelection.go +++ b/tools/leaderelection/leaderelection.go @@ -159,6 +159,9 @@ type LeaderElectionConfig struct { // Name is the name of the resource lock for debugging Name string + + // Coordinated will use the Coordinated Leader Election feature + Coordinated bool } // LeaderCallbacks are callbacks that are triggered during certain @@ -249,7 +252,11 @@ func (le *LeaderElector) acquire(ctx context.Context) bool { desc := le.config.Lock.Describe() klog.Infof("attempting to acquire leader lease %v...", desc) wait.JitterUntil(func() { - succeeded = le.tryAcquireOrRenew(ctx) + if !le.config.Coordinated { + succeeded = le.tryAcquireOrRenew(ctx) + } else { + succeeded = le.tryCoordinatedRenew(ctx) + } le.maybeReportTransition() if !succeeded { klog.V(4).Infof("failed to acquire lease %v", desc) @@ -272,7 +279,11 @@ func (le *LeaderElector) renew(ctx context.Context) { timeoutCtx, timeoutCancel := context.WithTimeout(ctx, le.config.RenewDeadline) defer timeoutCancel() err := wait.PollImmediateUntil(le.config.RetryPeriod, func() (bool, error) { - return le.tryAcquireOrRenew(timeoutCtx), nil + if !le.config.Coordinated { + return le.tryAcquireOrRenew(timeoutCtx), nil + } else { + return le.tryCoordinatedRenew(timeoutCtx), nil + } }, timeoutCtx.Done()) le.maybeReportTransition() @@ -282,7 +293,6 @@ func (le *LeaderElector) renew(ctx context.Context) { return } le.metrics.leaderOff(le.config.Name) - klog.Infof("failed to renew lease %v: %v", desc, err) cancel() }, le.config.RetryPeriod, ctx.Done()) @@ -315,6 +325,81 @@ func (le *LeaderElector) release() bool { return true } +// tryCoordinatedRenew checks if it acquired a lease and tries to renew the +// lease if it has already been acquired. Returns true on success else returns +// false. +func (le *LeaderElector) tryCoordinatedRenew(ctx context.Context) bool { + now := metav1.NewTime(le.clock.Now()) + leaderElectionRecord := rl.LeaderElectionRecord{ + HolderIdentity: le.config.Lock.Identity(), + LeaseDurationSeconds: int(le.config.LeaseDuration / time.Second), + RenewTime: now, + AcquireTime: now, + } + + // 1. obtain the electionRecord + oldLeaderElectionRecord, oldLeaderElectionRawRecord, err := le.config.Lock.Get(ctx) + if err != nil { + if !errors.IsNotFound(err) { + klog.Errorf("error retrieving resource lock %v: %v", le.config.Lock.Describe(), err) + return false + } + klog.Infof("lease lock not found: %v", le.config.Lock.Describe()) + return false + } + + // 2. Record obtained, check the Identity & Time + if !bytes.Equal(le.observedRawRecord, oldLeaderElectionRawRecord) { + le.setObservedRecord(oldLeaderElectionRecord) + + le.observedRawRecord = oldLeaderElectionRawRecord + } + hasExpired := le.observedTime.Add(time.Second * time.Duration(oldLeaderElectionRecord.LeaseDurationSeconds)).Before(now.Time) + + if hasExpired { + klog.Infof("lock has expired: %v", le.config.Lock.Describe()) + return false + } + + if !le.IsLeader() { + klog.V(4).Infof("lock is held by %v and has not yet expired: %v", oldLeaderElectionRecord.HolderIdentity, le.config.Lock.Describe()) + return false + } + + // 2b. If the lease has been marked as "end of term", don't renew it + if le.IsLeader() && oldLeaderElectionRecord.PreferredHolder != "" { + klog.V(4).Infof("lock is marked as 'end of term': %v", le.config.Lock.Describe()) + // TODO: Instead of letting lease expire, the holder may deleted it directly + // This will not be compatible with all controllers, so it needs to be opt-in behavior.. + // We must ensure all code guarded by this lease has successfully completed + // prior to releasing or there may be two processes + // simultaneously acting on the critical path. + // Usually once this returns false, the process is terminated.. + // xref: OnStoppedLeading + return false + } + + // 3. We're going to try to update. The leaderElectionRecord is set to it's default + // here. Let's correct it before updating. + if le.IsLeader() { + leaderElectionRecord.AcquireTime = oldLeaderElectionRecord.AcquireTime + leaderElectionRecord.LeaderTransitions = oldLeaderElectionRecord.LeaderTransitions + leaderElectionRecord.Strategy = oldLeaderElectionRecord.Strategy + le.metrics.slowpathExercised(le.config.Name) + } else { + leaderElectionRecord.LeaderTransitions = oldLeaderElectionRecord.LeaderTransitions + 1 + } + + // update the lock itself + if err = le.config.Lock.Update(ctx, leaderElectionRecord); err != nil { + klog.Errorf("Failed to update lock: %v", err) + return false + } + + le.setObservedRecord(&leaderElectionRecord) + return true +} + // tryAcquireOrRenew tries to acquire a leader lease if it is not already acquired, // else it tries to renew the lease if it has already been acquired. Returns true // on success else returns false. diff --git a/tools/leaderelection/leaderelection_test.go b/tools/leaderelection/leaderelection_test.go index de481e0adf..91959ae386 100644 --- a/tools/leaderelection/leaderelection_test.go +++ b/tools/leaderelection/leaderelection_test.go @@ -25,6 +25,7 @@ import ( "time" "github.com/google/go-cmp/cmp" + "github.com/stretchr/testify/assert" coordinationv1 "k8s.io/api/coordination/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/equality" @@ -37,8 +38,6 @@ import ( rl "k8s.io/client-go/tools/leaderelection/resourcelock" "k8s.io/client-go/tools/record" "k8s.io/utils/clock" - - "github.com/stretchr/testify/assert" ) func createLockObject(t *testing.T, objectType, namespace, name string, record *rl.LeaderElectionRecord) (obj runtime.Object) { @@ -353,6 +352,147 @@ func testTryAcquireOrRenew(t *testing.T, objectType string) { } } +func TestTryCoordinatedRenew(t *testing.T) { + objectType := "leases" + clock := clock.RealClock{} + future := clock.Now().Add(1000 * time.Hour) + + tests := []struct { + name string + observedRecord rl.LeaderElectionRecord + observedTime time.Time + retryAfter time.Duration + reactors []Reactor + expectedEvents []string + + expectSuccess bool + transitionLeader bool + outHolder string + }{ + { + name: "don't acquire from led, acked object", + reactors: []Reactor{ + { + verb: "get", + reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { + return true, createLockObject(t, objectType, action.GetNamespace(), action.(fakeclient.GetAction).GetName(), &rl.LeaderElectionRecord{HolderIdentity: "bing"}), nil + }, + }, + }, + observedTime: future, + + expectSuccess: false, + outHolder: "bing", + }, + { + name: "renew already acquired object", + reactors: []Reactor{ + { + verb: "get", + reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { + return true, createLockObject(t, objectType, action.GetNamespace(), action.(fakeclient.GetAction).GetName(), &rl.LeaderElectionRecord{HolderIdentity: "baz"}), nil + }, + }, + { + verb: "update", + reaction: func(action fakeclient.Action) (handled bool, ret runtime.Object, err error) { + return true, action.(fakeclient.CreateAction).GetObject(), nil + }, + }, + }, + observedTime: future, + observedRecord: rl.LeaderElectionRecord{HolderIdentity: "baz"}, + + expectSuccess: true, + outHolder: "baz", + }, + } + + for i := range tests { + test := &tests[i] + t.Run(test.name, func(t *testing.T) { + // OnNewLeader is called async so we have to wait for it. + var wg sync.WaitGroup + wg.Add(1) + var reportedLeader string + var lock rl.Interface + + objectMeta := metav1.ObjectMeta{Namespace: "foo", Name: "bar"} + recorder := record.NewFakeRecorder(100) + resourceLockConfig := rl.ResourceLockConfig{ + Identity: "baz", + EventRecorder: recorder, + } + c := &fake.Clientset{} + for _, reactor := range test.reactors { + c.AddReactor(reactor.verb, objectType, reactor.reaction) + } + c.AddReactor("*", "*", func(action fakeclient.Action) (bool, runtime.Object, error) { + t.Errorf("unreachable action. testclient called too many times: %+v", action) + return true, nil, fmt.Errorf("unreachable action") + }) + + lock = &rl.LeaseLock{ + LeaseMeta: objectMeta, + LockConfig: resourceLockConfig, + Client: c.CoordinationV1(), + } + lec := LeaderElectionConfig{ + Lock: lock, + LeaseDuration: 10 * time.Second, + Callbacks: LeaderCallbacks{ + OnNewLeader: func(l string) { + defer wg.Done() + reportedLeader = l + }, + }, + Coordinated: true, + } + observedRawRecord := GetRawRecordOrDie(t, objectType, test.observedRecord) + le := &LeaderElector{ + config: lec, + observedRecord: test.observedRecord, + observedRawRecord: observedRawRecord, + observedTime: test.observedTime, + clock: clock, + metrics: globalMetricsFactory.newLeaderMetrics(), + } + if test.expectSuccess != le.tryCoordinatedRenew(context.Background()) { + if test.retryAfter != 0 { + time.Sleep(test.retryAfter) + if test.expectSuccess != le.tryCoordinatedRenew(context.Background()) { + t.Errorf("unexpected result of tryCoordinatedRenew: [succeeded=%v]", !test.expectSuccess) + } + } else { + t.Errorf("unexpected result of gryCoordinatedRenew: [succeeded=%v]", !test.expectSuccess) + } + } + + le.observedRecord.AcquireTime = metav1.Time{} + le.observedRecord.RenewTime = metav1.Time{} + if le.observedRecord.HolderIdentity != test.outHolder { + t.Errorf("expected holder:\n\t%+v\ngot:\n\t%+v", test.outHolder, le.observedRecord.HolderIdentity) + } + if len(test.reactors) != len(c.Actions()) { + t.Errorf("wrong number of api interactions") + } + if test.transitionLeader && le.observedRecord.LeaderTransitions != 1 { + t.Errorf("leader should have transitioned but did not") + } + if !test.transitionLeader && le.observedRecord.LeaderTransitions != 0 { + t.Errorf("leader should not have transitioned but did") + } + + le.maybeReportTransition() + wg.Wait() + if reportedLeader != test.outHolder { + t.Errorf("reported leader was not the new leader. expected %q, got %q", test.outHolder, reportedLeader) + } + assertEqualEvents(t, test.expectedEvents, recorder.Events) + }) + } +} + // Will test leader election using lease as the resource func TestTryAcquireOrRenewLeases(t *testing.T) { testTryAcquireOrRenew(t, "leases") diff --git a/tools/leaderelection/leasecandidate.go b/tools/leaderelection/leasecandidate.go new file mode 100644 index 0000000000..f071dd33ac --- /dev/null +++ b/tools/leaderelection/leasecandidate.go @@ -0,0 +1,196 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package leaderelection + +import ( + "context" + "time" + + v1 "k8s.io/api/coordination/v1" + v1alpha1 "k8s.io/api/coordination/v1alpha1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/client-go/informers" + "k8s.io/client-go/kubernetes" + coordinationv1alpha1client "k8s.io/client-go/kubernetes/typed/coordination/v1alpha1" + "k8s.io/client-go/tools/cache" + "k8s.io/client-go/util/workqueue" + "k8s.io/klog/v2" + "k8s.io/utils/clock" +) + +const requeueInterval = 5 * time.Minute + +type LeaseCandidate struct { + LeaseClient coordinationv1alpha1client.LeaseCandidateInterface + LeaseCandidateInformer cache.SharedIndexInformer + InformerFactory informers.SharedInformerFactory + HasSynced cache.InformerSynced + + // At most there will be one item in this Queue (since we only watch one item) + queue workqueue.TypedRateLimitingInterface[int] + + name string + namespace string + + // controller lease + leaseName string + + Clock clock.Clock + + binaryVersion, emulationVersion string + preferredStrategies []v1.CoordinatedLeaseStrategy +} + +func NewCandidate(clientset kubernetes.Interface, + candidateName string, + candidateNamespace string, + targetLease string, + clock clock.Clock, + binaryVersion, emulationVersion string, + preferredStrategies []v1.CoordinatedLeaseStrategy, +) (*LeaseCandidate, error) { + fieldSelector := fields.OneTermEqualSelector("metadata.name", candidateName).String() + // A separate informer factory is required because this must start before informerFactories + // are started for leader elected components + informerFactory := informers.NewSharedInformerFactoryWithOptions( + clientset, 5*time.Minute, + informers.WithTweakListOptions(func(options *metav1.ListOptions) { + options.FieldSelector = fieldSelector + }), + ) + leaseCandidateInformer := informerFactory.Coordination().V1alpha1().LeaseCandidates().Informer() + + lc := &LeaseCandidate{ + LeaseClient: clientset.CoordinationV1alpha1().LeaseCandidates(candidateNamespace), + LeaseCandidateInformer: leaseCandidateInformer, + InformerFactory: informerFactory, + name: candidateName, + namespace: candidateNamespace, + leaseName: targetLease, + Clock: clock, + binaryVersion: binaryVersion, + emulationVersion: emulationVersion, + preferredStrategies: preferredStrategies, + } + lc.queue = workqueue.NewTypedRateLimitingQueueWithConfig(workqueue.DefaultTypedControllerRateLimiter[int](), workqueue.TypedRateLimitingQueueConfig[int]{Name: "leasecandidate"}) + + synced, err := leaseCandidateInformer.AddEventHandler(cache.ResourceEventHandlerFuncs{ + UpdateFunc: func(oldObj, newObj interface{}) { + if leasecandidate, ok := newObj.(*v1alpha1.LeaseCandidate); ok { + if leasecandidate.Spec.PingTime != nil { + lc.enqueueLease() + } + } + }, + }) + if err != nil { + return nil, err + } + lc.HasSynced = synced.HasSynced + + return lc, nil +} + +func (c *LeaseCandidate) Run(ctx context.Context) { + defer c.queue.ShutDown() + + go c.InformerFactory.Start(ctx.Done()) + if !cache.WaitForNamedCacheSync("leasecandidateclient", ctx.Done(), c.HasSynced) { + return + } + + c.enqueueLease() + go c.runWorker(ctx) + <-ctx.Done() +} + +func (c *LeaseCandidate) runWorker(ctx context.Context) { + for c.processNextWorkItem(ctx) { + } +} + +func (c *LeaseCandidate) processNextWorkItem(ctx context.Context) bool { + key, shutdown := c.queue.Get() + if shutdown { + return false + } + defer c.queue.Done(key) + + err := c.ensureLease(ctx) + if err == nil { + c.queue.AddAfter(key, requeueInterval) + return true + } + + utilruntime.HandleError(err) + klog.Infof("processNextWorkItem.AddRateLimited: %v", key) + c.queue.AddRateLimited(key) + + return true +} + +func (c *LeaseCandidate) enqueueLease() { + c.queue.Add(0) +} + +// ensureLease creates the lease if it does not exist and renew it if it exists. Returns the lease and +// a bool (true if this call created the lease), or any error that occurs. +func (c *LeaseCandidate) ensureLease(ctx context.Context) error { + lease, err := c.LeaseClient.Get(ctx, c.name, metav1.GetOptions{}) + if apierrors.IsNotFound(err) { + klog.V(2).Infof("Creating lease candidate") + // lease does not exist, create it. + leaseToCreate := c.newLease() + _, err := c.LeaseClient.Create(ctx, leaseToCreate, metav1.CreateOptions{}) + if err != nil { + return err + } + klog.V(2).Infof("Created lease candidate") + return nil + } else if err != nil { + return err + } + klog.V(2).Infof("lease candidate exists.. renewing") + clone := lease.DeepCopy() + clone.Spec.RenewTime = &metav1.MicroTime{Time: c.Clock.Now()} + clone.Spec.PingTime = nil + _, err = c.LeaseClient.Update(ctx, clone, metav1.UpdateOptions{}) + if err != nil { + return err + } + return nil +} + +func (c *LeaseCandidate) newLease() *v1alpha1.LeaseCandidate { + lease := &v1alpha1.LeaseCandidate{ + ObjectMeta: metav1.ObjectMeta{ + Name: c.name, + Namespace: c.namespace, + }, + Spec: v1alpha1.LeaseCandidateSpec{ + LeaseName: c.leaseName, + BinaryVersion: c.binaryVersion, + EmulationVersion: c.emulationVersion, + PreferredStrategies: c.preferredStrategies, + }, + } + lease.Spec.RenewTime = &metav1.MicroTime{Time: c.Clock.Now()} + return lease +} diff --git a/tools/leaderelection/leasecandidate_test.go b/tools/leaderelection/leasecandidate_test.go new file mode 100644 index 0000000000..5265abfc38 --- /dev/null +++ b/tools/leaderelection/leasecandidate_test.go @@ -0,0 +1,146 @@ +/* +Copyright 2024 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package leaderelection + +import ( + "context" + "testing" + "time" + + v1 "k8s.io/api/coordination/v1" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/wait" + "k8s.io/client-go/kubernetes/fake" + "k8s.io/utils/clock" +) + +type testcase struct { + candidateName, candidateNamespace, leaseName string + binaryVersion, emulationVersion string +} + +func TestLeaseCandidateCreation(t *testing.T) { + tc := testcase{ + candidateName: "foo", + candidateNamespace: "default", + leaseName: "lease", + binaryVersion: "1.30.0", + emulationVersion: "1.30.0", + } + + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + client := fake.NewSimpleClientset() + candidate, err := NewCandidate( + client, + tc.candidateName, + tc.candidateNamespace, + tc.leaseName, + clock.RealClock{}, + tc.binaryVersion, + tc.emulationVersion, + []v1.CoordinatedLeaseStrategy{v1.OldestEmulationVersion}, + ) + if err != nil { + t.Fatal(err) + } + + go candidate.Run(ctx) + err = pollForLease(ctx, tc, client, nil) + if err != nil { + t.Fatal(err) + } +} + +func TestLeaseCandidateAck(t *testing.T) { + tc := testcase{ + candidateName: "foo", + candidateNamespace: "default", + leaseName: "lease", + binaryVersion: "1.30.0", + emulationVersion: "1.30.0", + } + + ctx, cancel := context.WithTimeout(context.Background(), time.Minute) + defer cancel() + + client := fake.NewSimpleClientset() + + candidate, err := NewCandidate( + client, + tc.candidateName, + tc.candidateNamespace, + tc.leaseName, + clock.RealClock{}, + tc.binaryVersion, + tc.emulationVersion, + []v1.CoordinatedLeaseStrategy{v1.OldestEmulationVersion}, + ) + if err != nil { + t.Fatal(err) + } + + go candidate.Run(ctx) + err = pollForLease(ctx, tc, client, nil) + if err != nil { + t.Fatal(err) + } + + // Update PingTime and verify that the client renews + ensureAfter := &metav1.MicroTime{Time: time.Now()} + lc, err := client.CoordinationV1alpha1().LeaseCandidates(tc.candidateNamespace).Get(ctx, tc.candidateName, metav1.GetOptions{}) + if err == nil { + if lc.Spec.PingTime == nil { + c := lc.DeepCopy() + c.Spec.PingTime = &metav1.MicroTime{Time: time.Now()} + _, err = client.CoordinationV1alpha1().LeaseCandidates(tc.candidateNamespace).Update(ctx, c, metav1.UpdateOptions{}) + if err != nil { + t.Error(err) + } + } + } + err = pollForLease(ctx, tc, client, ensureAfter) + if err != nil { + t.Fatal(err) + } +} + +func pollForLease(ctx context.Context, tc testcase, client *fake.Clientset, t *metav1.MicroTime) error { + return wait.PollUntilContextTimeout(ctx, 100*time.Millisecond, 10*time.Second, true, func(ctx context.Context) (done bool, err error) { + lc, err := client.CoordinationV1alpha1().LeaseCandidates(tc.candidateNamespace).Get(ctx, tc.candidateName, metav1.GetOptions{}) + if err != nil { + if errors.IsNotFound(err) { + return false, nil + } + return true, err + } + if lc.Spec.BinaryVersion == tc.binaryVersion && + lc.Spec.EmulationVersion == tc.emulationVersion && + lc.Spec.LeaseName == tc.leaseName && + lc.Spec.PingTime == nil && + lc.Spec.RenewTime != nil { + // Ensure that if a time is provided, the renewTime occurred after the provided time. + if t != nil && t.After(lc.Spec.RenewTime.Time) { + return false, nil + } + return true, nil + } + return false, nil + }) +} diff --git a/tools/leaderelection/resourcelock/interface.go b/tools/leaderelection/resourcelock/interface.go index 483753d632..053a7570d7 100644 --- a/tools/leaderelection/resourcelock/interface.go +++ b/tools/leaderelection/resourcelock/interface.go @@ -19,14 +19,15 @@ package resourcelock import ( "context" "fmt" - clientset "k8s.io/client-go/kubernetes" - restclient "k8s.io/client-go/rest" "time" + v1 "k8s.io/api/coordination/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + clientset "k8s.io/client-go/kubernetes" coordinationv1 "k8s.io/client-go/kubernetes/typed/coordination/v1" corev1 "k8s.io/client-go/kubernetes/typed/core/v1" + restclient "k8s.io/client-go/rest" ) const ( @@ -114,11 +115,13 @@ type LeaderElectionRecord struct { // attempt to acquire leases with empty identities and will wait for the full lease // interval to expire before attempting to reacquire. This value is set to empty when // a client voluntarily steps down. - HolderIdentity string `json:"holderIdentity"` - LeaseDurationSeconds int `json:"leaseDurationSeconds"` - AcquireTime metav1.Time `json:"acquireTime"` - RenewTime metav1.Time `json:"renewTime"` - LeaderTransitions int `json:"leaderTransitions"` + HolderIdentity string `json:"holderIdentity"` + LeaseDurationSeconds int `json:"leaseDurationSeconds"` + AcquireTime metav1.Time `json:"acquireTime"` + RenewTime metav1.Time `json:"renewTime"` + LeaderTransitions int `json:"leaderTransitions"` + Strategy v1.CoordinatedLeaseStrategy `json:"strategy"` + PreferredHolder string `json:"preferredHolder"` } // EventRecorder records a change in the ResourceLock. diff --git a/tools/leaderelection/resourcelock/leaselock.go b/tools/leaderelection/resourcelock/leaselock.go index 8a9d7d60f2..7cd2a8b9ca 100644 --- a/tools/leaderelection/resourcelock/leaselock.go +++ b/tools/leaderelection/resourcelock/leaselock.go @@ -122,6 +122,12 @@ func LeaseSpecToLeaderElectionRecord(spec *coordinationv1.LeaseSpec) *LeaderElec if spec.RenewTime != nil { r.RenewTime = metav1.Time{Time: spec.RenewTime.Time} } + if spec.PreferredHolder != nil { + r.PreferredHolder = *spec.PreferredHolder + } + if spec.Strategy != nil { + r.Strategy = *spec.Strategy + } return &r } @@ -129,11 +135,18 @@ func LeaseSpecToLeaderElectionRecord(spec *coordinationv1.LeaseSpec) *LeaderElec func LeaderElectionRecordToLeaseSpec(ler *LeaderElectionRecord) coordinationv1.LeaseSpec { leaseDurationSeconds := int32(ler.LeaseDurationSeconds) leaseTransitions := int32(ler.LeaderTransitions) - return coordinationv1.LeaseSpec{ + spec := coordinationv1.LeaseSpec{ HolderIdentity: &ler.HolderIdentity, LeaseDurationSeconds: &leaseDurationSeconds, AcquireTime: &metav1.MicroTime{Time: ler.AcquireTime.Time}, RenewTime: &metav1.MicroTime{Time: ler.RenewTime.Time}, LeaseTransitions: &leaseTransitions, } + if ler.PreferredHolder != "" { + spec.PreferredHolder = &ler.PreferredHolder + } + if ler.Strategy != "" { + spec.Strategy = &ler.Strategy + } + return spec } From bad8f77ca6ef7e6dec47f10837959f26444aa8ba Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Mon, 22 Jul 2024 16:53:16 -0700 Subject: [PATCH 148/159] Merge pull request #126091 from seans3/ws-err-extra-info Adds extra error information from response to bad handshake error when possible Kubernetes-commit: f753a444a5e0b245d2cf8433f7d8bb915c12363e --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2bbf765923..41c70690e2 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.34.2 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240722223048-9516298b292e + k8s.io/api v0.0.0-20240722223049-b689d905290f k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 diff --git a/go.sum b/go.sum index 829154cc31..c6d4890228 100644 --- a/go.sum +++ b/go.sum @@ -156,8 +156,8 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240722223048-9516298b292e h1:n9SmHfxWHZKHj0n5U+45hjVVWLEWoL5wbCo2zChYpdo= -k8s.io/api v0.0.0-20240722223048-9516298b292e/go.mod h1:ytlEzqC2wOTwYET71W7+J+k7O2V7vrDuzmNLBSpgT+k= +k8s.io/api v0.0.0-20240722223049-b689d905290f h1:wtqzslJEcheiQ7hXjw1yGfqUyMCb7G4j72aL64Bzpbo= +k8s.io/api v0.0.0-20240722223049-b689d905290f/go.mod h1:ytlEzqC2wOTwYET71W7+J+k7O2V7vrDuzmNLBSpgT+k= k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe h1:V9MwpYUwbKlfLKVrhpVuKWiat/LBIhm1pGB9/xdHm5Q= k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= From 79fd7abf82ec5d93cfdbca22f09eace58f7a4161 Mon Sep 17 00:00:00 2001 From: Sergey Kanzhelev Date: Mon, 22 Jul 2024 05:20:58 +0000 Subject: [PATCH 149/159] generated files Kubernetes-commit: 2253b53b585e3405c5ce2dda2921db3a0afa02c9 --- .../core/v1/containerstatus.go | 40 ++++++++----- applyconfigurations/core/v1/resourcehealth.go | 52 +++++++++++++++++ applyconfigurations/core/v1/resourcestatus.go | 57 +++++++++++++++++++ applyconfigurations/internal/internal.go | 33 +++++++++++ applyconfigurations/utils.go | 4 ++ 5 files changed, 173 insertions(+), 13 deletions(-) create mode 100644 applyconfigurations/core/v1/resourcehealth.go create mode 100644 applyconfigurations/core/v1/resourcestatus.go diff --git a/applyconfigurations/core/v1/containerstatus.go b/applyconfigurations/core/v1/containerstatus.go index bdf696aaa7..6a28939c2f 100644 --- a/applyconfigurations/core/v1/containerstatus.go +++ b/applyconfigurations/core/v1/containerstatus.go @@ -25,19 +25,20 @@ import ( // ContainerStatusApplyConfiguration represents a declarative configuration of the ContainerStatus type for use // with apply. type ContainerStatusApplyConfiguration struct { - Name *string `json:"name,omitempty"` - State *ContainerStateApplyConfiguration `json:"state,omitempty"` - LastTerminationState *ContainerStateApplyConfiguration `json:"lastState,omitempty"` - Ready *bool `json:"ready,omitempty"` - RestartCount *int32 `json:"restartCount,omitempty"` - Image *string `json:"image,omitempty"` - ImageID *string `json:"imageID,omitempty"` - ContainerID *string `json:"containerID,omitempty"` - Started *bool `json:"started,omitempty"` - AllocatedResources *corev1.ResourceList `json:"allocatedResources,omitempty"` - Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"` - VolumeMounts []VolumeMountStatusApplyConfiguration `json:"volumeMounts,omitempty"` - User *ContainerUserApplyConfiguration `json:"user,omitempty"` + Name *string `json:"name,omitempty"` + State *ContainerStateApplyConfiguration `json:"state,omitempty"` + LastTerminationState *ContainerStateApplyConfiguration `json:"lastState,omitempty"` + Ready *bool `json:"ready,omitempty"` + RestartCount *int32 `json:"restartCount,omitempty"` + Image *string `json:"image,omitempty"` + ImageID *string `json:"imageID,omitempty"` + ContainerID *string `json:"containerID,omitempty"` + Started *bool `json:"started,omitempty"` + AllocatedResources *corev1.ResourceList `json:"allocatedResources,omitempty"` + Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"` + VolumeMounts []VolumeMountStatusApplyConfiguration `json:"volumeMounts,omitempty"` + User *ContainerUserApplyConfiguration `json:"user,omitempty"` + AllocatedResourcesStatus []ResourceStatusApplyConfiguration `json:"allocatedResourcesStatus,omitempty"` } // ContainerStatusApplyConfiguration constructs a declarative configuration of the ContainerStatus type for use with @@ -154,3 +155,16 @@ func (b *ContainerStatusApplyConfiguration) WithUser(value *ContainerUserApplyCo b.User = value return b } + +// WithAllocatedResourcesStatus adds the given value to the AllocatedResourcesStatus field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the AllocatedResourcesStatus field. +func (b *ContainerStatusApplyConfiguration) WithAllocatedResourcesStatus(values ...*ResourceStatusApplyConfiguration) *ContainerStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAllocatedResourcesStatus") + } + b.AllocatedResourcesStatus = append(b.AllocatedResourcesStatus, *values[i]) + } + return b +} diff --git a/applyconfigurations/core/v1/resourcehealth.go b/applyconfigurations/core/v1/resourcehealth.go new file mode 100644 index 0000000000..5169cb4bc3 --- /dev/null +++ b/applyconfigurations/core/v1/resourcehealth.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// ResourceHealthApplyConfiguration represents a declarative configuration of the ResourceHealth type for use +// with apply. +type ResourceHealthApplyConfiguration struct { + ResourceID *v1.ResourceID `json:"resourceID,omitempty"` + Health *v1.ResourceHealthStatus `json:"health,omitempty"` +} + +// ResourceHealthApplyConfiguration constructs a declarative configuration of the ResourceHealth type for use with +// apply. +func ResourceHealth() *ResourceHealthApplyConfiguration { + return &ResourceHealthApplyConfiguration{} +} + +// WithResourceID sets the ResourceID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceID field is set to the value of the last call. +func (b *ResourceHealthApplyConfiguration) WithResourceID(value v1.ResourceID) *ResourceHealthApplyConfiguration { + b.ResourceID = &value + return b +} + +// WithHealth sets the Health field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Health field is set to the value of the last call. +func (b *ResourceHealthApplyConfiguration) WithHealth(value v1.ResourceHealthStatus) *ResourceHealthApplyConfiguration { + b.Health = &value + return b +} diff --git a/applyconfigurations/core/v1/resourcestatus.go b/applyconfigurations/core/v1/resourcestatus.go new file mode 100644 index 0000000000..1e63c87f8c --- /dev/null +++ b/applyconfigurations/core/v1/resourcestatus.go @@ -0,0 +1,57 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// ResourceStatusApplyConfiguration represents a declarative configuration of the ResourceStatus type for use +// with apply. +type ResourceStatusApplyConfiguration struct { + Name *v1.ResourceName `json:"name,omitempty"` + Resources []ResourceHealthApplyConfiguration `json:"resources,omitempty"` +} + +// ResourceStatusApplyConfiguration constructs a declarative configuration of the ResourceStatus type for use with +// apply. +func ResourceStatus() *ResourceStatusApplyConfiguration { + return &ResourceStatusApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ResourceStatusApplyConfiguration) WithName(value v1.ResourceName) *ResourceStatusApplyConfiguration { + b.Name = &value + return b +} + +// WithResources adds the given value to the Resources field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Resources field. +func (b *ResourceStatusApplyConfiguration) WithResources(values ...*ResourceHealthApplyConfiguration) *ResourceStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResources") + } + b.Resources = append(b.Resources, *values[i]) + } + return b +} diff --git a/applyconfigurations/internal/internal.go b/applyconfigurations/internal/internal.go index d0400ba109..157e132dfd 100644 --- a/applyconfigurations/internal/internal.go +++ b/applyconfigurations/internal/internal.go @@ -5042,6 +5042,14 @@ var schemaYAML = typed.YAMLObject(`types: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: allocatedResourcesStatus + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ResourceStatus + elementRelationship: associative + keys: + - name - name: containerID type: scalar: string @@ -7449,6 +7457,16 @@ var schemaYAML = typed.YAMLObject(`types: scalar: string default: "" elementRelationship: atomic +- name: io.k8s.api.core.v1.ResourceHealth + map: + fields: + - name: health + type: + scalar: string + - name: resourceID + type: + scalar: string + default: "" - name: io.k8s.api.core.v1.ResourceQuota map: fields: @@ -7521,6 +7539,21 @@ var schemaYAML = typed.YAMLObject(`types: map: elementType: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.core.v1.ResourceStatus + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: resources + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ResourceHealth + elementRelationship: associative + keys: + - resourceID - name: io.k8s.api.core.v1.SELinuxOptions map: fields: diff --git a/applyconfigurations/utils.go b/applyconfigurations/utils.go index 98079c23a9..eb88e1c4de 100644 --- a/applyconfigurations/utils.go +++ b/applyconfigurations/utils.go @@ -918,6 +918,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationscorev1.ResourceClaimApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ResourceFieldSelector"): return &applyconfigurationscorev1.ResourceFieldSelectorApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ResourceHealth"): + return &applyconfigurationscorev1.ResourceHealthApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ResourceQuota"): return &applyconfigurationscorev1.ResourceQuotaApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ResourceQuotaSpec"): @@ -926,6 +928,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &applyconfigurationscorev1.ResourceQuotaStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ResourceRequirements"): return &applyconfigurationscorev1.ResourceRequirementsApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ResourceStatus"): + return &applyconfigurationscorev1.ResourceStatusApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ScaleIOPersistentVolumeSource"): return &applyconfigurationscorev1.ScaleIOPersistentVolumeSourceApplyConfiguration{} case corev1.SchemeGroupVersion.WithKind("ScaleIOVolumeSource"): From 1f27757b2f976cc5f75b9a0950482d6cd85428d0 Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Tue, 23 Jul 2024 14:52:25 +0200 Subject: [PATCH 150/159] Review feedback Signed-off-by: Dr. Stefan Schimanski Kubernetes-commit: 68226b0501996fc86c9c2bddb7d61e6a64c91304 --- tools/leaderelection/leasecandidate.go | 48 +++++++++++---------- tools/leaderelection/leasecandidate_test.go | 7 +-- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/tools/leaderelection/leasecandidate.go b/tools/leaderelection/leasecandidate.go index f071dd33ac..98871213c9 100644 --- a/tools/leaderelection/leasecandidate.go +++ b/tools/leaderelection/leasecandidate.go @@ -18,6 +18,7 @@ package leaderelection import ( "context" + "reflect" "time" v1 "k8s.io/api/coordination/v1" @@ -37,11 +38,15 @@ import ( const requeueInterval = 5 * time.Minute +type CacheSyncWaiter interface { + WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool +} + type LeaseCandidate struct { - LeaseClient coordinationv1alpha1client.LeaseCandidateInterface - LeaseCandidateInformer cache.SharedIndexInformer - InformerFactory informers.SharedInformerFactory - HasSynced cache.InformerSynced + leaseClient coordinationv1alpha1client.LeaseCandidateInterface + leaseCandidateInformer cache.SharedIndexInformer + informerFactory informers.SharedInformerFactory + hasSynced cache.InformerSynced // At most there will be one item in this Queue (since we only watch one item) queue workqueue.TypedRateLimitingInterface[int] @@ -52,7 +57,7 @@ type LeaseCandidate struct { // controller lease leaseName string - Clock clock.Clock + clock clock.Clock binaryVersion, emulationVersion string preferredStrategies []v1.CoordinatedLeaseStrategy @@ -62,10 +67,9 @@ func NewCandidate(clientset kubernetes.Interface, candidateName string, candidateNamespace string, targetLease string, - clock clock.Clock, binaryVersion, emulationVersion string, preferredStrategies []v1.CoordinatedLeaseStrategy, -) (*LeaseCandidate, error) { +) (*LeaseCandidate, CacheSyncWaiter, error) { fieldSelector := fields.OneTermEqualSelector("metadata.name", candidateName).String() // A separate informer factory is required because this must start before informerFactories // are started for leader elected components @@ -78,20 +82,20 @@ func NewCandidate(clientset kubernetes.Interface, leaseCandidateInformer := informerFactory.Coordination().V1alpha1().LeaseCandidates().Informer() lc := &LeaseCandidate{ - LeaseClient: clientset.CoordinationV1alpha1().LeaseCandidates(candidateNamespace), - LeaseCandidateInformer: leaseCandidateInformer, - InformerFactory: informerFactory, + leaseClient: clientset.CoordinationV1alpha1().LeaseCandidates(candidateNamespace), + leaseCandidateInformer: leaseCandidateInformer, + informerFactory: informerFactory, name: candidateName, namespace: candidateNamespace, leaseName: targetLease, - Clock: clock, + clock: clock.RealClock{}, binaryVersion: binaryVersion, emulationVersion: emulationVersion, preferredStrategies: preferredStrategies, } lc.queue = workqueue.NewTypedRateLimitingQueueWithConfig(workqueue.DefaultTypedControllerRateLimiter[int](), workqueue.TypedRateLimitingQueueConfig[int]{Name: "leasecandidate"}) - synced, err := leaseCandidateInformer.AddEventHandler(cache.ResourceEventHandlerFuncs{ + h, err := leaseCandidateInformer.AddEventHandler(cache.ResourceEventHandlerFuncs{ UpdateFunc: func(oldObj, newObj interface{}) { if leasecandidate, ok := newObj.(*v1alpha1.LeaseCandidate); ok { if leasecandidate.Spec.PingTime != nil { @@ -101,18 +105,18 @@ func NewCandidate(clientset kubernetes.Interface, }, }) if err != nil { - return nil, err + return nil, nil, err } - lc.HasSynced = synced.HasSynced + lc.hasSynced = h.HasSynced - return lc, nil + return lc, informerFactory, nil } func (c *LeaseCandidate) Run(ctx context.Context) { defer c.queue.ShutDown() - go c.InformerFactory.Start(ctx.Done()) - if !cache.WaitForNamedCacheSync("leasecandidateclient", ctx.Done(), c.HasSynced) { + go c.informerFactory.Start(ctx.Done()) + if !cache.WaitForNamedCacheSync("leasecandidateclient", ctx.Done(), c.hasSynced) { return } @@ -153,12 +157,12 @@ func (c *LeaseCandidate) enqueueLease() { // ensureLease creates the lease if it does not exist and renew it if it exists. Returns the lease and // a bool (true if this call created the lease), or any error that occurs. func (c *LeaseCandidate) ensureLease(ctx context.Context) error { - lease, err := c.LeaseClient.Get(ctx, c.name, metav1.GetOptions{}) + lease, err := c.leaseClient.Get(ctx, c.name, metav1.GetOptions{}) if apierrors.IsNotFound(err) { klog.V(2).Infof("Creating lease candidate") // lease does not exist, create it. leaseToCreate := c.newLease() - _, err := c.LeaseClient.Create(ctx, leaseToCreate, metav1.CreateOptions{}) + _, err := c.leaseClient.Create(ctx, leaseToCreate, metav1.CreateOptions{}) if err != nil { return err } @@ -169,9 +173,9 @@ func (c *LeaseCandidate) ensureLease(ctx context.Context) error { } klog.V(2).Infof("lease candidate exists.. renewing") clone := lease.DeepCopy() - clone.Spec.RenewTime = &metav1.MicroTime{Time: c.Clock.Now()} + clone.Spec.RenewTime = &metav1.MicroTime{Time: c.clock.Now()} clone.Spec.PingTime = nil - _, err = c.LeaseClient.Update(ctx, clone, metav1.UpdateOptions{}) + _, err = c.leaseClient.Update(ctx, clone, metav1.UpdateOptions{}) if err != nil { return err } @@ -191,6 +195,6 @@ func (c *LeaseCandidate) newLease() *v1alpha1.LeaseCandidate { PreferredStrategies: c.preferredStrategies, }, } - lease.Spec.RenewTime = &metav1.MicroTime{Time: c.Clock.Now()} + lease.Spec.RenewTime = &metav1.MicroTime{Time: c.clock.Now()} return lease } diff --git a/tools/leaderelection/leasecandidate_test.go b/tools/leaderelection/leasecandidate_test.go index 5265abfc38..43e0d2d11a 100644 --- a/tools/leaderelection/leasecandidate_test.go +++ b/tools/leaderelection/leasecandidate_test.go @@ -26,7 +26,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes/fake" - "k8s.io/utils/clock" ) type testcase struct { @@ -47,12 +46,11 @@ func TestLeaseCandidateCreation(t *testing.T) { defer cancel() client := fake.NewSimpleClientset() - candidate, err := NewCandidate( + candidate, _, err := NewCandidate( client, tc.candidateName, tc.candidateNamespace, tc.leaseName, - clock.RealClock{}, tc.binaryVersion, tc.emulationVersion, []v1.CoordinatedLeaseStrategy{v1.OldestEmulationVersion}, @@ -82,12 +80,11 @@ func TestLeaseCandidateAck(t *testing.T) { client := fake.NewSimpleClientset() - candidate, err := NewCandidate( + candidate, _, err := NewCandidate( client, tc.candidateName, tc.candidateNamespace, tc.leaseName, - clock.RealClock{}, tc.binaryVersion, tc.emulationVersion, []v1.CoordinatedLeaseStrategy{v1.OldestEmulationVersion}, From 18dd587a4b6e309efba4cea32ff298dddbe8ba34 Mon Sep 17 00:00:00 2001 From: Jefftree Date: Tue, 23 Jul 2024 14:28:08 +0000 Subject: [PATCH 151/159] feedback: leasecandidate clients Kubernetes-commit: fac758164029e278e9bda924090ed078bb6514c8 --- tools/leaderelection/leaderelection.go | 8 ++++--- tools/leaderelection/leasecandidate.go | 23 ++++++++++++--------- tools/leaderelection/leasecandidate_test.go | 2 +- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/tools/leaderelection/leaderelection.go b/tools/leaderelection/leaderelection.go index c61c600a7f..d9d87d55f2 100644 --- a/tools/leaderelection/leaderelection.go +++ b/tools/leaderelection/leaderelection.go @@ -161,6 +161,7 @@ type LeaderElectionConfig struct { Name string // Coordinated will use the Coordinated Leader Election feature + // WARNING: Coordinated leader election is ALPHA. Coordinated bool } @@ -293,6 +294,7 @@ func (le *LeaderElector) renew(ctx context.Context) { return } le.metrics.leaderOff(le.config.Name) + klog.Infof("failed to renew lease %v: %v", desc, err) cancel() }, le.config.RetryPeriod, ctx.Done()) @@ -354,15 +356,15 @@ func (le *LeaderElector) tryCoordinatedRenew(ctx context.Context) bool { le.observedRawRecord = oldLeaderElectionRawRecord } - hasExpired := le.observedTime.Add(time.Second * time.Duration(oldLeaderElectionRecord.LeaseDurationSeconds)).Before(now.Time) + hasExpired := le.observedTime.Add(time.Second * time.Duration(oldLeaderElectionRecord.LeaseDurationSeconds)).Before(now.Time) if hasExpired { klog.Infof("lock has expired: %v", le.config.Lock.Describe()) return false } if !le.IsLeader() { - klog.V(4).Infof("lock is held by %v and has not yet expired: %v", oldLeaderElectionRecord.HolderIdentity, le.config.Lock.Describe()) + klog.V(6).Infof("lock is held by %v and has not yet expired: %v", oldLeaderElectionRecord.HolderIdentity, le.config.Lock.Describe()) return false } @@ -370,7 +372,7 @@ func (le *LeaderElector) tryCoordinatedRenew(ctx context.Context) bool { if le.IsLeader() && oldLeaderElectionRecord.PreferredHolder != "" { klog.V(4).Infof("lock is marked as 'end of term': %v", le.config.Lock.Describe()) // TODO: Instead of letting lease expire, the holder may deleted it directly - // This will not be compatible with all controllers, so it needs to be opt-in behavior.. + // This will not be compatible with all controllers, so it needs to be opt-in behavior. // We must ensure all code guarded by this lease has successfully completed // prior to releasing or there may be two processes // simultaneously acting on the critical path. diff --git a/tools/leaderelection/leasecandidate.go b/tools/leaderelection/leasecandidate.go index 98871213c9..fa07066f03 100644 --- a/tools/leaderelection/leasecandidate.go +++ b/tools/leaderelection/leasecandidate.go @@ -63,9 +63,14 @@ type LeaseCandidate struct { preferredStrategies []v1.CoordinatedLeaseStrategy } +// NewCandidate creates new LeaseCandidate controller that creates a +// LeaseCandidate object if it does not exist and watches changes +// to the corresponding object and renews if PingTime is set. +// WARNING: This is an ALPHA feature. Ensure that the CoordinatedLeaderElection +// feature gate is on. func NewCandidate(clientset kubernetes.Interface, - candidateName string, candidateNamespace string, + candidateName string, targetLease string, binaryVersion, emulationVersion string, preferredStrategies []v1.CoordinatedLeaseStrategy, @@ -144,7 +149,6 @@ func (c *LeaseCandidate) processNextWorkItem(ctx context.Context) bool { } utilruntime.HandleError(err) - klog.Infof("processNextWorkItem.AddRateLimited: %v", key) c.queue.AddRateLimited(key) return true @@ -161,9 +165,8 @@ func (c *LeaseCandidate) ensureLease(ctx context.Context) error { if apierrors.IsNotFound(err) { klog.V(2).Infof("Creating lease candidate") // lease does not exist, create it. - leaseToCreate := c.newLease() - _, err := c.leaseClient.Create(ctx, leaseToCreate, metav1.CreateOptions{}) - if err != nil { + leaseToCreate := c.newLeaseCandidate() + if _, err := c.leaseClient.Create(ctx, leaseToCreate, metav1.CreateOptions{}); err != nil { return err } klog.V(2).Infof("Created lease candidate") @@ -171,7 +174,7 @@ func (c *LeaseCandidate) ensureLease(ctx context.Context) error { } else if err != nil { return err } - klog.V(2).Infof("lease candidate exists.. renewing") + klog.V(2).Infof("lease candidate exists. Renewing.") clone := lease.DeepCopy() clone.Spec.RenewTime = &metav1.MicroTime{Time: c.clock.Now()} clone.Spec.PingTime = nil @@ -182,8 +185,8 @@ func (c *LeaseCandidate) ensureLease(ctx context.Context) error { return nil } -func (c *LeaseCandidate) newLease() *v1alpha1.LeaseCandidate { - lease := &v1alpha1.LeaseCandidate{ +func (c *LeaseCandidate) newLeaseCandidate() *v1alpha1.LeaseCandidate { + lc := &v1alpha1.LeaseCandidate{ ObjectMeta: metav1.ObjectMeta{ Name: c.name, Namespace: c.namespace, @@ -195,6 +198,6 @@ func (c *LeaseCandidate) newLease() *v1alpha1.LeaseCandidate { PreferredStrategies: c.preferredStrategies, }, } - lease.Spec.RenewTime = &metav1.MicroTime{Time: c.clock.Now()} - return lease + lc.Spec.RenewTime = &metav1.MicroTime{Time: c.clock.Now()} + return lc } diff --git a/tools/leaderelection/leasecandidate_test.go b/tools/leaderelection/leasecandidate_test.go index 43e0d2d11a..d1378228bf 100644 --- a/tools/leaderelection/leasecandidate_test.go +++ b/tools/leaderelection/leasecandidate_test.go @@ -48,8 +48,8 @@ func TestLeaseCandidateCreation(t *testing.T) { client := fake.NewSimpleClientset() candidate, _, err := NewCandidate( client, - tc.candidateName, tc.candidateNamespace, + tc.candidateName, tc.leaseName, tc.binaryVersion, tc.emulationVersion, From f45c45195a21bffbb655a6b7d4375c75b6c6470b Mon Sep 17 00:00:00 2001 From: Jefftree Date: Tue, 23 Jul 2024 17:09:37 +0000 Subject: [PATCH 152/159] fix ordering issue in candidates Kubernetes-commit: e1ea24a171ca6ba2d0f184abbd019ab3cf4a93c4 --- tools/leaderelection/leasecandidate_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/leaderelection/leasecandidate_test.go b/tools/leaderelection/leasecandidate_test.go index d1378228bf..92dc199f02 100644 --- a/tools/leaderelection/leasecandidate_test.go +++ b/tools/leaderelection/leasecandidate_test.go @@ -82,8 +82,8 @@ func TestLeaseCandidateAck(t *testing.T) { candidate, _, err := NewCandidate( client, - tc.candidateName, tc.candidateNamespace, + tc.candidateName, tc.leaseName, tc.binaryVersion, tc.emulationVersion, From 825f52e194ecd5972250ee8038c42d4b1517c9cd Mon Sep 17 00:00:00 2001 From: Jefftree Date: Tue, 23 Jul 2024 19:19:12 +0000 Subject: [PATCH 153/159] Change PingTime to be persistent Kubernetes-commit: 0c774d0b1f79b0b0a6d73102a78c84853220f036 --- tools/leaderelection/leasecandidate.go | 3 +-- tools/leaderelection/leasecandidate_test.go | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/leaderelection/leasecandidate.go b/tools/leaderelection/leasecandidate.go index fa07066f03..c75fc3bdf7 100644 --- a/tools/leaderelection/leasecandidate.go +++ b/tools/leaderelection/leasecandidate.go @@ -103,7 +103,7 @@ func NewCandidate(clientset kubernetes.Interface, h, err := leaseCandidateInformer.AddEventHandler(cache.ResourceEventHandlerFuncs{ UpdateFunc: func(oldObj, newObj interface{}) { if leasecandidate, ok := newObj.(*v1alpha1.LeaseCandidate); ok { - if leasecandidate.Spec.PingTime != nil { + if leasecandidate.Spec.PingTime != nil && leasecandidate.Spec.PingTime.After(leasecandidate.Spec.RenewTime.Time) { lc.enqueueLease() } } @@ -177,7 +177,6 @@ func (c *LeaseCandidate) ensureLease(ctx context.Context) error { klog.V(2).Infof("lease candidate exists. Renewing.") clone := lease.DeepCopy() clone.Spec.RenewTime = &metav1.MicroTime{Time: c.clock.Now()} - clone.Spec.PingTime = nil _, err = c.leaseClient.Update(ctx, clone, metav1.UpdateOptions{}) if err != nil { return err diff --git a/tools/leaderelection/leasecandidate_test.go b/tools/leaderelection/leasecandidate_test.go index 92dc199f02..c50059180e 100644 --- a/tools/leaderelection/leasecandidate_test.go +++ b/tools/leaderelection/leasecandidate_test.go @@ -130,7 +130,6 @@ func pollForLease(ctx context.Context, tc testcase, client *fake.Clientset, t *m if lc.Spec.BinaryVersion == tc.binaryVersion && lc.Spec.EmulationVersion == tc.emulationVersion && lc.Spec.LeaseName == tc.leaseName && - lc.Spec.PingTime == nil && lc.Spec.RenewTime != nil { // Ensure that if a time is provided, the renewTime occurred after the provided time. if t != nil && t.After(lc.Spec.RenewTime.Time) { From fe54892e0cc44385de5b5300985bd27218dd2c23 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Tue, 23 Jul 2024 20:12:24 -0700 Subject: [PATCH 154/159] Merge pull request #126243 from SergeyKanzhelev/devicePluginFailures Implement resource health in pod status (KEP 4680) Kubernetes-commit: 5af1710d90d2396f6305c73fdf7df3a1be0c2fd0 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b2ad1105a0..114a995fb0 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.34.2 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240724010313-f04ea0bc861d + k8s.io/api v0.0.0-20240724031224-63e21d3bdab9 k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 diff --git a/go.sum b/go.sum index 34e813b01e..4cc32bc71d 100644 --- a/go.sum +++ b/go.sum @@ -156,8 +156,8 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240724010313-f04ea0bc861d h1:phdCFnuErJqqxJwiX9uNdygnJ1i3RiTQepKHtf354qA= -k8s.io/api v0.0.0-20240724010313-f04ea0bc861d/go.mod h1:ytlEzqC2wOTwYET71W7+J+k7O2V7vrDuzmNLBSpgT+k= +k8s.io/api v0.0.0-20240724031224-63e21d3bdab9 h1:DsdxdppkdprdzZ/IwMZY+uNpvEcKtpJpKQRgll5PXto= +k8s.io/api v0.0.0-20240724031224-63e21d3bdab9/go.mod h1:ytlEzqC2wOTwYET71W7+J+k7O2V7vrDuzmNLBSpgT+k= k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe h1:V9MwpYUwbKlfLKVrhpVuKWiat/LBIhm1pGB9/xdHm5Q= k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= From 6a9911a398f15280b2be744bec76eec7c8f0acf3 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 25 Jul 2024 08:52:23 +0200 Subject: [PATCH 155/159] revendor dependencies I was workinng on updating a dependency, and noticed that running hack/update-vendor.sh resulted in a diff. Comitting the result as a PR. Signed-off-by: Sebastiaan van Stijn Kubernetes-commit: aeb607443dd9b8ee378ee10209e9b446256f3ee2 --- go.mod | 10 ++++++++-- go.sum | 17 +++++++++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 114a995fb0..9922e71b10 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.34.2 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240724031224-63e21d3bdab9 - k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe + k8s.io/api v0.0.0 + k8s.io/apimachinery v0.0.0 k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 @@ -65,3 +65,9 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace ( + k8s.io/api => ../api + k8s.io/apimachinery => ../apimachinery + k8s.io/client-go => ../client-go +) diff --git a/go.sum b/go.sum index 4cc32bc71d..2899cbfc97 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,9 @@ +cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -44,6 +48,7 @@ github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWm github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/ianlancetaylor/demangle v0.0.0-20240312041847-bd984b5ce465/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw= github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -90,6 +95,7 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= @@ -100,13 +106,16 @@ 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/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -118,11 +127,13 @@ golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbht 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= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -141,6 +152,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -156,10 +168,7 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240724031224-63e21d3bdab9 h1:DsdxdppkdprdzZ/IwMZY+uNpvEcKtpJpKQRgll5PXto= -k8s.io/api v0.0.0-20240724031224-63e21d3bdab9/go.mod h1:ytlEzqC2wOTwYET71W7+J+k7O2V7vrDuzmNLBSpgT+k= -k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe h1:V9MwpYUwbKlfLKVrhpVuKWiat/LBIhm1pGB9/xdHm5Q= -k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From 93c6a5bf507f28f7d004b26a6f9f65fa2dc9f69c Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Thu, 25 Jul 2024 08:45:25 -0700 Subject: [PATCH 156/159] Merge pull request #126353 from liggitt/fix-vendor Fix verify-vendor script to check all go.mod and go.sum files Kubernetes-commit: 9edabd617945cd23111fd46cfc9a09fe37ed194a --- go.mod | 10 ++-------- go.sum | 17 ++++------------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index 9922e71b10..114a995fb0 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.34.2 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0 - k8s.io/apimachinery v0.0.0 + k8s.io/api v0.0.0-20240724031224-63e21d3bdab9 + k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 @@ -65,9 +65,3 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace ( - k8s.io/api => ../api - k8s.io/apimachinery => ../apimachinery - k8s.io/client-go => ../client-go -) diff --git a/go.sum b/go.sum index 2899cbfc97..4cc32bc71d 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,5 @@ -cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -48,7 +44,6 @@ github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWm github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/ianlancetaylor/demangle v0.0.0-20240312041847-bd984b5ce465/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw= github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= @@ -95,7 +90,6 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= @@ -106,16 +100,13 @@ 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/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -127,13 +118,11 @@ golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbht 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= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.21.0 h1:WVXCp+/EBEHOj53Rvu+7KiT/iElMrO8ACK16SMZ3jaA= golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -152,7 +141,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -168,7 +156,10 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= +k8s.io/api v0.0.0-20240724031224-63e21d3bdab9 h1:DsdxdppkdprdzZ/IwMZY+uNpvEcKtpJpKQRgll5PXto= +k8s.io/api v0.0.0-20240724031224-63e21d3bdab9/go.mod h1:ytlEzqC2wOTwYET71W7+J+k7O2V7vrDuzmNLBSpgT+k= +k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe h1:V9MwpYUwbKlfLKVrhpVuKWiat/LBIhm1pGB9/xdHm5Q= +k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= From f71a5cc5d3520ba293e5a571c107cd56ccefb5fe Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Sat, 27 Jul 2024 16:13:16 +0200 Subject: [PATCH 157/159] Call non-blocking informerFactory.Start synchronously to avoid races Signed-off-by: Dr. Stefan Schimanski Kubernetes-commit: c7a1fa432a87579895eac4b3873162d5f1dba7f5 --- tools/leaderelection/leasecandidate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/leaderelection/leasecandidate.go b/tools/leaderelection/leasecandidate.go index c75fc3bdf7..74cf5bb5c2 100644 --- a/tools/leaderelection/leasecandidate.go +++ b/tools/leaderelection/leasecandidate.go @@ -120,7 +120,7 @@ func NewCandidate(clientset kubernetes.Interface, func (c *LeaseCandidate) Run(ctx context.Context) { defer c.queue.ShutDown() - go c.informerFactory.Start(ctx.Done()) + c.informerFactory.Start(ctx.Done()) if !cache.WaitForNamedCacheSync("leasecandidateclient", ctx.Done(), c.hasSynced) { return } From 5e3e8ea98fe99479404107bcd7d8c221edc91a0c Mon Sep 17 00:00:00 2001 From: Jefftree Date: Sat, 27 Jul 2024 15:47:24 +0000 Subject: [PATCH 158/159] informers: add comment that Start does not block Signed-off-by: Dr. Stefan Schimanski Kubernetes-commit: cd69335542fd961b69b4e83b6433d1b40d2f4439 --- go.mod | 4 ++-- go.sum | 8 ++++---- informers/factory.go | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 3487280a28..7a39903a86 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.34.2 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240725200553-fb1fc3084c0e - k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe + k8s.io/api v0.0.0-20240801003428-382a0912e579 + k8s.io/apimachinery v0.0.0-20240719190441-a8f449e276fe k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 diff --git a/go.sum b/go.sum index 866a1b525a..2af64b2711 100644 --- a/go.sum +++ b/go.sum @@ -156,10 +156,10 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240725200553-fb1fc3084c0e h1:zSGnlOF57ubuWLnmPjHd1c9XRaXJeXdcVsszq+wm17o= -k8s.io/api v0.0.0-20240725200553-fb1fc3084c0e/go.mod h1:ytlEzqC2wOTwYET71W7+J+k7O2V7vrDuzmNLBSpgT+k= -k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe h1:V9MwpYUwbKlfLKVrhpVuKWiat/LBIhm1pGB9/xdHm5Q= -k8s.io/apimachinery v0.0.0-20240720202316-95b78024e3fe/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/api v0.0.0-20240801003428-382a0912e579 h1:pElFtnw6/eJb1SLes+tbAqfL/7IezesSZ1bLTO+b2UE= +k8s.io/api v0.0.0-20240801003428-382a0912e579/go.mod h1:sSxNOmsgxkyv9k7Nu9ysVYNCkTkTemOgz4HxbATSKDQ= +k8s.io/apimachinery v0.0.0-20240719190441-a8f449e276fe h1:lt6b7CTEYMgUTCGIZrATyWMZTQThE+qIQq5YTCbpMVQ= +k8s.io/apimachinery v0.0.0-20240719190441-a8f449e276fe/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= diff --git a/informers/factory.go b/informers/factory.go index f2fef0e0b2..86c24551ef 100644 --- a/informers/factory.go +++ b/informers/factory.go @@ -247,6 +247,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 From 02a19c375c491042890be396d94a26a69da89563 Mon Sep 17 00:00:00 2001 From: Kubernetes Publisher Date: Tue, 13 Aug 2024 14:19:25 +0000 Subject: [PATCH 159/159] Update dependencies to v0.31.0 tag --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 7a39903a86..220abfee6d 100644 --- a/go.mod +++ b/go.mod @@ -25,8 +25,8 @@ require ( golang.org/x/time v0.3.0 google.golang.org/protobuf v1.34.2 gopkg.in/evanphx/json-patch.v4 v4.12.0 - k8s.io/api v0.0.0-20240801003428-382a0912e579 - k8s.io/apimachinery v0.0.0-20240719190441-a8f449e276fe + k8s.io/api v0.31.0 + k8s.io/apimachinery 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-20240711033017-18e509b52bc8 diff --git a/go.sum b/go.sum index 2af64b2711..3abd0254c0 100644 --- a/go.sum +++ b/go.sum @@ -156,10 +156,10 @@ 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.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/api v0.0.0-20240801003428-382a0912e579 h1:pElFtnw6/eJb1SLes+tbAqfL/7IezesSZ1bLTO+b2UE= -k8s.io/api v0.0.0-20240801003428-382a0912e579/go.mod h1:sSxNOmsgxkyv9k7Nu9ysVYNCkTkTemOgz4HxbATSKDQ= -k8s.io/apimachinery v0.0.0-20240719190441-a8f449e276fe h1:lt6b7CTEYMgUTCGIZrATyWMZTQThE+qIQq5YTCbpMVQ= -k8s.io/apimachinery v0.0.0-20240719190441-a8f449e276fe/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +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/apimachinery v0.31.0 h1:m9jOiSr3FoSSL5WO9bjm1n6B9KROYYgNZOb4tyZ1lBc= +k8s.io/apimachinery v0.31.0/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=